#define pr_fmt(fmt) …
#include <linux/debugfs.h>
#include <linux/kthread.h>
#include <linux/seq_file.h>
#include <drm/drm_atomic.h>
#include <drm/drm_crtc.h>
#include <drm/drm_file.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_framebuffer.h>
#include "msm_drv.h"
#include "dpu_kms.h"
#include "dpu_hwio.h"
#include "dpu_hw_catalog.h"
#include "dpu_hw_intf.h"
#include "dpu_hw_ctl.h"
#include "dpu_hw_dspp.h"
#include "dpu_hw_dsc.h"
#include "dpu_hw_merge3d.h"
#include "dpu_hw_cdm.h"
#include "dpu_formats.h"
#include "dpu_encoder_phys.h"
#include "dpu_crtc.h"
#include "dpu_trace.h"
#include "dpu_core_irq.h"
#include "disp/msm_disp_snapshot.h"
#define DPU_DEBUG_ENC(e, fmt, ...) …
#define DPU_ERROR_ENC(e, fmt, ...) …
#define DPU_ERROR_ENC_RATELIMITED(e, fmt, ...) …
#define NUM_PHYS_ENCODER_TYPES …
#define MAX_PHYS_ENCODERS_PER_VIRTUAL …
#define MAX_CHANNELS_PER_ENC …
#define IDLE_SHORT_TIMEOUT …
#define MAX_HDISPLAY_SPLIT …
#define DPU_ENCODER_FRAME_DONE_TIMEOUT_FRAMES …
enum dpu_enc_rc_events { … };
enum dpu_enc_rc_states { … };
struct dpu_encoder_virt { … };
#define to_dpu_encoder_virt(x) …
static u32 dither_matrix[DITHER_MATRIX_SZ] = …;
u32 dpu_encoder_get_drm_fmt(struct dpu_encoder_phys *phys_enc)
{ … }
bool dpu_encoder_needs_periph_flush(struct dpu_encoder_phys *phys_enc)
{ … }
bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)
{ … }
bool dpu_encoder_is_dsc_enabled(const struct drm_encoder *drm_enc)
{ … }
int dpu_encoder_get_crc_values_cnt(const struct drm_encoder *drm_enc)
{ … }
void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc)
{ … }
int dpu_encoder_get_crc(const struct drm_encoder *drm_enc, u32 *crcs, int pos)
{ … }
static void _dpu_encoder_setup_dither(struct dpu_hw_pingpong *hw_pp, unsigned bpc)
{ … }
static char *dpu_encoder_helper_get_intf_type(enum dpu_intf_mode intf_mode)
{ … }
void dpu_encoder_helper_report_irq_timeout(struct dpu_encoder_phys *phys_enc,
enum dpu_intr_idx intr_idx)
{ … }
static int dpu_encoder_helper_wait_event_timeout(int32_t drm_id,
u32 irq_idx, struct dpu_encoder_wait_info *info);
int dpu_encoder_helper_wait_for_irq(struct dpu_encoder_phys *phys_enc,
unsigned int irq_idx,
void (*func)(void *arg),
struct dpu_encoder_wait_info *wait_info)
{ … }
int dpu_encoder_get_vsync_count(struct drm_encoder *drm_enc)
{ … }
int dpu_encoder_get_linecount(struct drm_encoder *drm_enc)
{ … }
void dpu_encoder_helper_split_config(
struct dpu_encoder_phys *phys_enc,
enum dpu_intf interface)
{ … }
bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
{ … }
struct drm_dsc_config *dpu_encoder_get_dsc_config(struct drm_encoder *drm_enc)
{ … }
static struct msm_display_topology dpu_encoder_get_topology(
struct dpu_encoder_virt *dpu_enc,
struct dpu_kms *dpu_kms,
struct drm_display_mode *mode,
struct drm_crtc_state *crtc_state,
struct drm_dsc_config *dsc)
{ … }
static int dpu_encoder_virt_atomic_check(
struct drm_encoder *drm_enc,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{ … }
static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc,
struct msm_display_info *disp_info)
{ … }
static void _dpu_encoder_irq_enable(struct drm_encoder *drm_enc)
{ … }
static void _dpu_encoder_irq_disable(struct drm_encoder *drm_enc)
{ … }
static void _dpu_encoder_resource_enable(struct drm_encoder *drm_enc)
{ … }
static void _dpu_encoder_resource_disable(struct drm_encoder *drm_enc)
{ … }
static int dpu_encoder_resource_control(struct drm_encoder *drm_enc,
u32 sw_event)
{ … }
void dpu_encoder_prepare_wb_job(struct drm_encoder *drm_enc,
struct drm_writeback_job *job)
{ … }
void dpu_encoder_cleanup_wb_job(struct drm_encoder *drm_enc,
struct drm_writeback_job *job)
{ … }
static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{ … }
static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc)
{ … }
void dpu_encoder_virt_runtime_resume(struct drm_encoder *drm_enc)
{ … }
static void dpu_encoder_virt_atomic_enable(struct drm_encoder *drm_enc,
struct drm_atomic_state *state)
{ … }
static void dpu_encoder_virt_atomic_disable(struct drm_encoder *drm_enc,
struct drm_atomic_state *state)
{ … }
static struct dpu_hw_intf *dpu_encoder_get_intf(const struct dpu_mdss_cfg *catalog,
struct dpu_rm *dpu_rm,
enum dpu_intf_type type, u32 controller_id)
{ … }
void dpu_encoder_vblank_callback(struct drm_encoder *drm_enc,
struct dpu_encoder_phys *phy_enc)
{ … }
void dpu_encoder_underrun_callback(struct drm_encoder *drm_enc,
struct dpu_encoder_phys *phy_enc)
{ … }
void dpu_encoder_assign_crtc(struct drm_encoder *drm_enc, struct drm_crtc *crtc)
{ … }
void dpu_encoder_toggle_vblank_for_crtc(struct drm_encoder *drm_enc,
struct drm_crtc *crtc, bool enable)
{ … }
void dpu_encoder_frame_done_callback(
struct drm_encoder *drm_enc,
struct dpu_encoder_phys *ready_phys, u32 event)
{ … }
static void dpu_encoder_off_work(struct work_struct *work)
{ … }
static void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc,
struct dpu_encoder_phys *phys, uint32_t extra_flush_bits)
{ … }
static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys)
{ … }
void dpu_encoder_helper_trigger_start(struct dpu_encoder_phys *phys_enc)
{ … }
static int dpu_encoder_helper_wait_event_timeout(
int32_t drm_id,
unsigned int irq_idx,
struct dpu_encoder_wait_info *info)
{ … }
static void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc)
{ … }
static void _dpu_encoder_kickoff_phys(struct dpu_encoder_virt *dpu_enc)
{ … }
void dpu_encoder_trigger_kickoff_pending(struct drm_encoder *drm_enc)
{ … }
static u32 _dpu_encoder_calculate_linetime(struct dpu_encoder_virt *dpu_enc,
struct drm_display_mode *mode)
{ … }
int dpu_encoder_vsync_time(struct drm_encoder *drm_enc, ktime_t *wakeup_time)
{ … }
static u32
dpu_encoder_dsc_initial_line_calc(struct drm_dsc_config *dsc,
u32 enc_ip_width)
{ … }
static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_ctl *ctl,
struct dpu_hw_dsc *hw_dsc,
struct dpu_hw_pingpong *hw_pp,
struct drm_dsc_config *dsc,
u32 common_mode,
u32 initial_lines)
{ … }
static void dpu_encoder_prep_dsc(struct dpu_encoder_virt *dpu_enc,
struct drm_dsc_config *dsc)
{ … }
void dpu_encoder_prepare_for_kickoff(struct drm_encoder *drm_enc)
{ … }
bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc)
{ … }
void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
{ … }
static void dpu_encoder_helper_reset_mixers(struct dpu_encoder_phys *phys_enc)
{ … }
static void dpu_encoder_dsc_pipe_clr(struct dpu_hw_ctl *ctl,
struct dpu_hw_dsc *hw_dsc,
struct dpu_hw_pingpong *hw_pp)
{ … }
static void dpu_encoder_unprep_dsc(struct dpu_encoder_virt *dpu_enc)
{ … }
void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
{ … }
void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
const struct msm_format *dpu_fmt,
u32 output_type)
{ … }
#ifdef CONFIG_DEBUG_FS
static int _dpu_encoder_status_show(struct seq_file *s, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static void dpu_encoder_debugfs_init(struct drm_encoder *drm_enc, struct dentry *root)
{ … }
#else
#define dpu_encoder_debugfs_init …
#endif
static int dpu_encoder_virt_add_phys_encs(
struct drm_device *dev,
struct msm_display_info *disp_info,
struct dpu_encoder_virt *dpu_enc,
struct dpu_enc_phys_init_params *params)
{ … }
static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
struct dpu_kms *dpu_kms,
struct msm_display_info *disp_info)
{ … }
static void dpu_encoder_frame_done_timeout(struct timer_list *t)
{ … }
static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = …;
static const struct drm_encoder_funcs dpu_encoder_funcs = …;
struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
int drm_enc_mode,
struct msm_display_info *disp_info)
{ … }
int dpu_encoder_wait_for_commit_done(struct drm_encoder *drm_enc)
{ … }
int dpu_encoder_wait_for_tx_complete(struct drm_encoder *drm_enc)
{ … }
enum dpu_intf_mode dpu_encoder_get_intf_mode(struct drm_encoder *encoder)
{ … }
unsigned int dpu_encoder_helper_get_dsc(struct dpu_encoder_phys *phys_enc)
{ … }
void dpu_encoder_phys_init(struct dpu_encoder_phys *phys_enc,
struct dpu_enc_phys_init_params *p)
{ … }