#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"
#define LEFT_MIXER …
#define RIGHT_MIXER …
#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)
{ … }
static void _dpu_crtc_blend_setup(struct drm_crtc *crtc)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
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
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 = …;
struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
struct drm_plane *cursor)
{ … }