linux/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <[email protected]>
 */

#define pr_fmt(fmt)
#include <linux/sort.h>
#include <linux/debugfs.h>
#include <linux/ktime.h>
#include <linux/bits.h>

#include <drm/drm_atomic.h>
#include <drm/drm_blend.h>
#include <drm/drm_crtc.h>
#include <drm/drm_flip_work.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_mode.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_rect.h>
#include <drm/drm_vblank.h>
#include <drm/drm_self_refresh_helper.h>

#include "dpu_kms.h"
#include "dpu_hw_lm.h"
#include "dpu_hw_ctl.h"
#include "dpu_hw_dspp.h"
#include "dpu_crtc.h"
#include "dpu_plane.h"
#include "dpu_encoder.h"
#include "dpu_vbif.h"
#include "dpu_core_perf.h"
#include "dpu_trace.h"

/* layer mixer index on dpu_crtc */
#define LEFT_MIXER
#define RIGHT_MIXER

/* timeout in ms waiting for frame done */
#define DPU_CRTC_FRAME_DONE_TIMEOUT_MS

#define CONVERT_S3_15(val)

static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
{}

static struct drm_encoder *get_encoder_from_crtc(struct drm_crtc *crtc)
{}

static enum dpu_crtc_crc_source dpu_crtc_parse_crc_source(const char *src_name)
{}

static int dpu_crtc_verify_crc_source(struct drm_crtc *crtc,
		const char *src_name, size_t *values_cnt)
{}

static void dpu_crtc_setup_lm_misr(struct dpu_crtc_state *crtc_state)
{}

static void dpu_crtc_setup_encoder_misr(struct drm_crtc *crtc)
{}

static int dpu_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
{}

static u32 dpu_crtc_get_vblank_counter(struct drm_crtc *crtc)
{}

static int dpu_crtc_get_lm_crc(struct drm_crtc *crtc,
		struct dpu_crtc_state *crtc_state)
{}

static int dpu_crtc_get_encoder_crc(struct drm_crtc *crtc)
{}

static int dpu_crtc_get_crc(struct drm_crtc *crtc)
{}

static bool dpu_crtc_get_scanout_position(struct drm_crtc *crtc,
					   bool in_vblank_irq,
					   int *vpos, int *hpos,
					   ktime_t *stime, ktime_t *etime,
					   const struct drm_display_mode *mode)
{}

static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
		struct dpu_plane_state *pstate, const struct msm_format *format)
{}

static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc)
{}

static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc,
				       struct drm_plane *plane,
				       struct dpu_crtc_mixer *mixer,
				       u32 num_mixers,
				       enum dpu_stage stage,
				       const struct msm_format *format,
				       uint64_t modifier,
				       struct dpu_sw_pipe *pipe,
				       unsigned int stage_idx,
				       struct dpu_hw_stage_cfg *stage_cfg
				      )
{}

static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
	struct dpu_crtc *dpu_crtc, struct dpu_crtc_mixer *mixer,
	struct dpu_hw_stage_cfg *stage_cfg)
{}

/**
 * _dpu_crtc_blend_setup - configure crtc mixers
 * @crtc: Pointer to drm crtc structure
 */
static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
{}

/**
 *  _dpu_crtc_complete_flip - signal pending page_flip events
 * Any pending vblank events are added to the vblank_event_list
 * so that the next vblank interrupt shall signal them.
 * However PAGE_FLIP events are not handled through the vblank_event_list.
 * This API signals any pending PAGE_FLIP events requested through
 * DRM_IOCTL_MODE_PAGE_FLIP and are cached in the dpu_crtc->event.
 * @crtc: Pointer to drm crtc structure
 */
static void _dpu_crtc_complete_flip(struct drm_crtc *crtc)
{}

enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc *crtc)
{}

void dpu_crtc_vblank_callback(struct drm_crtc *crtc)
{}

static void dpu_crtc_frame_event_work(struct kthread_work *work)
{}

/**
 * dpu_crtc_frame_event_cb - crtc frame event callback API
 * @crtc: Pointer to crtc
 * @event: Event to process
 *
 * Encoder may call this for different events from different context - IRQ,
 * user thread, commit_thread, etc. Each event should be carefully reviewed and
 * should be processed in proper task context to avoid schedulin delay or
 * properly manage the irq context's bottom half processing.
 */
void dpu_crtc_frame_event_cb(struct drm_crtc *crtc, u32 event)
{}

void dpu_crtc_complete_commit(struct drm_crtc *crtc)
{}

static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,
		struct drm_crtc_state *state)
{}

static void _dpu_crtc_get_pcc_coeff(struct drm_crtc_state *state,
		struct dpu_hw_pcc_cfg *cfg)
{}

static void _dpu_crtc_setup_cp_blocks(struct drm_crtc *crtc)
{}

static void dpu_crtc_atomic_begin(struct drm_crtc *crtc,
		struct drm_atomic_state *state)
{}

static void dpu_crtc_atomic_flush(struct drm_crtc *crtc,
		struct drm_atomic_state *state)
{}

/**
 * dpu_crtc_destroy_state - state destroy hook
 * @crtc: drm CRTC
 * @state: CRTC state object to release
 */
static void dpu_crtc_destroy_state(struct drm_crtc *crtc,
		struct drm_crtc_state *state)
{}

static int _dpu_crtc_wait_for_frame_done(struct drm_crtc *crtc)
{}

void dpu_crtc_commit_kickoff(struct drm_crtc *crtc)
{}

static void dpu_crtc_reset(struct drm_crtc *crtc)
{}

/**
 * dpu_crtc_duplicate_state - state duplicate hook
 * @crtc: Pointer to drm crtc structure
 */
static struct drm_crtc_state *dpu_crtc_duplicate_state(struct drm_crtc *crtc)
{}

static void dpu_crtc_atomic_print_state(struct drm_printer *p,
					const struct drm_crtc_state *state)
{}

static void dpu_crtc_disable(struct drm_crtc *crtc,
			     struct drm_atomic_state *state)
{}

static void dpu_crtc_enable(struct drm_crtc *crtc,
		struct drm_atomic_state *state)
{}

static bool dpu_crtc_needs_dirtyfb(struct drm_crtc_state *cstate)
{}

static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
		struct drm_atomic_state *state)
{}

int dpu_crtc_vblank(struct drm_crtc *crtc, bool en)
{}

#ifdef CONFIG_DEBUG_FS
static int _dpu_debugfs_status_show(struct seq_file *s, void *data)
{}

DEFINE_SHOW_ATTRIBUTE();

static int dpu_crtc_debugfs_state_show(struct seq_file *s, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

static int _dpu_crtc_init_debugfs(struct drm_crtc *crtc)
{}
#else
static int _dpu_crtc_init_debugfs(struct drm_crtc *crtc)
{
	return 0;
}
#endif /* CONFIG_DEBUG_FS */

static int dpu_crtc_late_register(struct drm_crtc *crtc)
{}

static const struct drm_crtc_funcs dpu_crtc_funcs =;

static const struct drm_crtc_helper_funcs dpu_crtc_helper_funcs =;

/* initialize crtc */
struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
				struct drm_plane *cursor)
{}