Lines Matching refs:drm_enc

221 bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)  in dpu_encoder_is_widebus_enabled()  argument
223 const struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_is_widebus_enabled()
228 int dpu_encoder_get_crc_values_cnt(const struct drm_encoder *drm_enc) in dpu_encoder_get_crc_values_cnt() argument
233 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_get_crc_values_cnt()
246 void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc) in dpu_encoder_setup_misr() argument
252 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_setup_misr()
264 int dpu_encoder_get_crc(const struct drm_encoder *drm_enc, u32 *crcs, int pos) in dpu_encoder_get_crc() argument
270 if (!drm_enc->crtc) { in dpu_encoder_get_crc()
271 DRM_ERROR("no crtc found for encoder %d\n", drm_enc->index); in dpu_encoder_get_crc()
275 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_get_crc()
423 int dpu_encoder_get_vsync_count(struct drm_encoder *drm_enc) in dpu_encoder_get_vsync_count() argument
425 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_get_vsync_count()
430 int dpu_encoder_get_linecount(struct drm_encoder *drm_enc) in dpu_encoder_get_linecount() argument
436 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_get_linecount()
445 static void dpu_encoder_destroy(struct drm_encoder *drm_enc) in dpu_encoder_destroy() argument
450 if (!drm_enc) { in dpu_encoder_destroy()
455 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_destroy()
476 drm_encoder_cleanup(drm_enc); in dpu_encoder_destroy()
529 bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc) in dpu_encoder_use_dsc_merge() argument
531 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_use_dsc_merge()
601 struct drm_encoder *drm_enc, in dpu_encoder_virt_atomic_check() argument
614 if (!drm_enc || !crtc_state || !conn_state) { in dpu_encoder_virt_atomic_check()
616 drm_enc != NULL, crtc_state != NULL, conn_state != NULL); in dpu_encoder_virt_atomic_check()
620 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_virt_atomic_check()
623 priv = drm_enc->dev->dev_private; in dpu_encoder_virt_atomic_check()
630 trace_dpu_enc_atomic_check(DRMID(drm_enc)); in dpu_encoder_virt_atomic_check()
655 dpu_rm_release(global_state, drm_enc); in dpu_encoder_virt_atomic_check()
659 drm_enc, crtc_state, topology); in dpu_encoder_virt_atomic_check()
663 trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); in dpu_encoder_virt_atomic_check()
675 struct drm_encoder *drm_enc; in _dpu_encoder_update_vsync_source() local
689 drm_enc = &dpu_enc->base; in _dpu_encoder_update_vsync_source()
691 priv = drm_enc->dev->dev_private; in _dpu_encoder_update_vsync_source()
715 static void _dpu_encoder_irq_control(struct drm_encoder *drm_enc, bool enable) in _dpu_encoder_irq_control() argument
720 if (!drm_enc) { in _dpu_encoder_irq_control()
725 dpu_enc = to_dpu_encoder_virt(drm_enc); in _dpu_encoder_irq_control()
737 static void _dpu_encoder_resource_control_helper(struct drm_encoder *drm_enc, in _dpu_encoder_resource_control_helper() argument
744 dpu_enc = to_dpu_encoder_virt(drm_enc); in _dpu_encoder_resource_control_helper()
745 priv = drm_enc->dev->dev_private; in _dpu_encoder_resource_control_helper()
748 trace_dpu_enc_rc_helper(DRMID(drm_enc), enable); in _dpu_encoder_resource_control_helper()
760 _dpu_encoder_irq_control(drm_enc, true); in _dpu_encoder_resource_control_helper()
764 _dpu_encoder_irq_control(drm_enc, false); in _dpu_encoder_resource_control_helper()
772 static int dpu_encoder_resource_control(struct drm_encoder *drm_enc, in dpu_encoder_resource_control() argument
779 if (!drm_enc || !drm_enc->dev || !drm_enc->crtc) { in dpu_encoder_resource_control()
783 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_resource_control()
784 priv = drm_enc->dev->dev_private; in dpu_encoder_resource_control()
797 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, dpu_enc->idle_pc_supported, in dpu_encoder_resource_control()
812 DRMID(drm_enc), sw_event); in dpu_encoder_resource_control()
818 DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
825 _dpu_encoder_irq_control(drm_enc, true); in dpu_encoder_resource_control()
827 _dpu_encoder_resource_control_helper(drm_enc, true); in dpu_encoder_resource_control()
831 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
847 DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
856 if (dpu_crtc_frame_pending(drm_enc->crtc) > 1) { in dpu_encoder_resource_control()
858 DRMID(drm_enc)); in dpu_encoder_resource_control()
865 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
880 _dpu_encoder_irq_control(drm_enc, true); in dpu_encoder_resource_control()
886 DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
894 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
907 DRMID(drm_enc), sw_event); in dpu_encoder_resource_control()
912 DRMID(drm_enc), sw_event, dpu_enc->rc_state); in dpu_encoder_resource_control()
922 _dpu_encoder_resource_control_helper(drm_enc, false); in dpu_encoder_resource_control()
926 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
938 DRMID(drm_enc), sw_event, dpu_enc->rc_state); in dpu_encoder_resource_control()
949 DRMID(drm_enc), sw_event, dpu_enc->rc_state); in dpu_encoder_resource_control()
955 _dpu_encoder_irq_control(drm_enc, false); in dpu_encoder_resource_control()
957 _dpu_encoder_resource_control_helper(drm_enc, false); in dpu_encoder_resource_control()
961 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
969 DRM_ERROR("id:%u, unexpected sw_event: %d\n", DRMID(drm_enc), in dpu_encoder_resource_control()
971 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
977 trace_dpu_enc_rc(DRMID(drm_enc), sw_event, in dpu_encoder_resource_control()
983 void dpu_encoder_prepare_wb_job(struct drm_encoder *drm_enc, in dpu_encoder_prepare_wb_job() argument
989 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_prepare_wb_job()
1000 void dpu_encoder_cleanup_wb_job(struct drm_encoder *drm_enc, in dpu_encoder_cleanup_wb_job() argument
1006 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_cleanup_wb_job()
1017 static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, in dpu_encoder_virt_atomic_mode_set() argument
1035 if (!drm_enc) { in dpu_encoder_virt_atomic_mode_set()
1040 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_virt_atomic_mode_set()
1043 priv = drm_enc->dev->dev_private; in dpu_encoder_virt_atomic_mode_set()
1052 trace_dpu_enc_mode_set(DRMID(drm_enc)); in dpu_encoder_virt_atomic_mode_set()
1056 drm_enc->base.id, DPU_HW_BLK_PINGPONG, hw_pp, in dpu_encoder_virt_atomic_mode_set()
1059 drm_enc->base.id, DPU_HW_BLK_CTL, hw_ctl, ARRAY_SIZE(hw_ctl)); in dpu_encoder_virt_atomic_mode_set()
1061 drm_enc->base.id, DPU_HW_BLK_LM, hw_lm, ARRAY_SIZE(hw_lm)); in dpu_encoder_virt_atomic_mode_set()
1063 drm_enc->base.id, DPU_HW_BLK_DSPP, hw_dspp, in dpu_encoder_virt_atomic_mode_set()
1072 drm_enc->base.id, DPU_HW_BLK_DSC, in dpu_encoder_virt_atomic_mode_set()
1120 static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc) in _dpu_encoder_virt_enable_helper() argument
1125 if (!drm_enc || !drm_enc->dev) { in _dpu_encoder_virt_enable_helper()
1130 dpu_enc = to_dpu_encoder_virt(drm_enc); in _dpu_encoder_virt_enable_helper()
1156 void dpu_encoder_virt_runtime_resume(struct drm_encoder *drm_enc) in dpu_encoder_virt_runtime_resume() argument
1158 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_virt_runtime_resume()
1170 _dpu_encoder_virt_enable_helper(drm_enc); in dpu_encoder_virt_runtime_resume()
1176 static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc) in dpu_encoder_virt_enable() argument
1182 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_virt_enable()
1187 trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay, in dpu_encoder_virt_enable()
1197 ret = dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_KICKOFF); in dpu_encoder_virt_enable()
1204 _dpu_encoder_virt_enable_helper(drm_enc); in dpu_encoder_virt_enable()
1212 static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) in dpu_encoder_virt_disable() argument
1217 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_virt_disable()
1223 trace_dpu_enc_disable(DRMID(drm_enc)); in dpu_encoder_virt_disable()
1226 dpu_encoder_wait_for_event(drm_enc, MSM_ENC_TX_COMPLETE); in dpu_encoder_virt_disable()
1228 dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_PRE_STOP); in dpu_encoder_virt_disable()
1240 DPU_ERROR("enc%d timeout pending\n", drm_enc->base.id); in dpu_encoder_virt_disable()
1244 dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_STOP); in dpu_encoder_virt_disable()
1287 static void dpu_encoder_vblank_callback(struct drm_encoder *drm_enc, in dpu_encoder_vblank_callback() argument
1293 if (!drm_enc || !phy_enc) in dpu_encoder_vblank_callback()
1297 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_vblank_callback()
1309 static void dpu_encoder_underrun_callback(struct drm_encoder *drm_enc, in dpu_encoder_underrun_callback() argument
1320 msm_disp_snapshot_state(drm_enc->dev); in dpu_encoder_underrun_callback()
1322 trace_dpu_enc_underrun_cb(DRMID(drm_enc), in dpu_encoder_underrun_callback()
1327 void dpu_encoder_assign_crtc(struct drm_encoder *drm_enc, struct drm_crtc *crtc) in dpu_encoder_assign_crtc() argument
1329 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_assign_crtc()
1339 void dpu_encoder_toggle_vblank_for_crtc(struct drm_encoder *drm_enc, in dpu_encoder_toggle_vblank_for_crtc() argument
1342 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_toggle_vblank_for_crtc()
1346 trace_dpu_enc_vblank_cb(DRMID(drm_enc), enable); in dpu_encoder_toggle_vblank_for_crtc()
1363 void dpu_encoder_register_frame_event_callback(struct drm_encoder *drm_enc, in dpu_encoder_register_frame_event_callback() argument
1367 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_register_frame_event_callback()
1373 if (!drm_enc) { in dpu_encoder_register_frame_event_callback()
1377 trace_dpu_enc_frame_event_cb(DRMID(drm_enc), enable); in dpu_encoder_register_frame_event_callback()
1386 struct drm_encoder *drm_enc, in dpu_encoder_frame_done_callback() argument
1389 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_frame_done_callback()
1401 trace_dpu_enc_frame_done_cb_not_busy(DRMID(drm_enc), event, in dpu_encoder_frame_done_callback()
1410 trace_dpu_enc_frame_done_cb(DRMID(drm_enc), i, in dpu_encoder_frame_done_callback()
1420 dpu_encoder_resource_control(drm_enc, in dpu_encoder_frame_done_callback()
1453 static void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc, in _dpu_encoder_trigger_flush() argument
1481 trace_dpu_enc_trigger_flush(DRMID(drm_enc), in _dpu_encoder_trigger_flush()
1549 struct drm_encoder *drm_enc; in dpu_encoder_helper_hw_reset() local
1553 drm_enc = phys_enc->parent; in dpu_encoder_helper_hw_reset()
1558 DRM_DEBUG_KMS("id:%u ctl %d reset\n", DRMID(drm_enc), in dpu_encoder_helper_hw_reset()
1564 msm_disp_snapshot_state(drm_enc->dev); in dpu_encoder_helper_hw_reset()
1627 void dpu_encoder_trigger_kickoff_pending(struct drm_encoder *drm_enc) in dpu_encoder_trigger_kickoff_pending() argument
1635 if (!drm_enc) { in dpu_encoder_trigger_kickoff_pending()
1639 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_trigger_kickoff_pending()
1704 int dpu_encoder_vsync_time(struct drm_encoder *drm_enc, ktime_t *wakeup_time) in dpu_encoder_vsync_time() argument
1713 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_vsync_time()
1715 if (!drm_enc->crtc || !drm_enc->crtc->state) { in dpu_encoder_vsync_time()
1719 mode = &drm_enc->crtc->state->adjusted_mode; in dpu_encoder_vsync_time()
1754 struct drm_encoder *drm_enc = &dpu_enc->base; in dpu_encoder_vsync_event_handler() local
1758 if (!drm_enc->dev || !drm_enc->crtc) { in dpu_encoder_vsync_event_handler()
1763 priv = drm_enc->dev->dev_private; in dpu_encoder_vsync_event_handler()
1765 if (drm_enc->crtc->index >= ARRAY_SIZE(priv->event_thread)) { in dpu_encoder_vsync_event_handler()
1769 event_thread = &priv->event_thread[drm_enc->crtc->index]; in dpu_encoder_vsync_event_handler()
1772 drm_enc->crtc->index); in dpu_encoder_vsync_event_handler()
1882 void dpu_encoder_prepare_for_kickoff(struct drm_encoder *drm_enc) in dpu_encoder_prepare_for_kickoff() argument
1889 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_prepare_for_kickoff()
1891 trace_dpu_enc_prepare_kickoff(DRMID(drm_enc)); in dpu_encoder_prepare_for_kickoff()
1904 dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_KICKOFF); in dpu_encoder_prepare_for_kickoff()
1908 trace_dpu_enc_prepare_kickoff_reset(DRMID(drm_enc)); in dpu_encoder_prepare_for_kickoff()
1918 bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc) in dpu_encoder_is_valid_for_commit() argument
1924 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_is_valid_for_commit()
1926 if (drm_enc->encoder_type == DRM_MODE_ENCODER_VIRTUAL) { in dpu_encoder_is_valid_for_commit()
1939 void dpu_encoder_kickoff(struct drm_encoder *drm_enc) in dpu_encoder_kickoff() argument
1948 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_kickoff()
1950 trace_dpu_enc_kickoff(DRMID(drm_enc)); in dpu_encoder_kickoff()
1953 drm_mode_vrefresh(&drm_enc->crtc->state->adjusted_mode); in dpu_encoder_kickoff()
1970 !dpu_encoder_vsync_time(drm_enc, &wakeup_time)) { in dpu_encoder_kickoff()
1971 trace_dpu_enc_early_kickoff(DRMID(drm_enc), in dpu_encoder_kickoff()
2080 void dpu_encoder_prepare_commit(struct drm_encoder *drm_enc) in dpu_encoder_prepare_commit() argument
2086 if (!drm_enc) { in dpu_encoder_prepare_commit()
2090 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_prepare_commit()
2123 static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc) in _dpu_encoder_init_debugfs() argument
2125 struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); in _dpu_encoder_init_debugfs()
2130 if (!drm_enc->dev) { in _dpu_encoder_init_debugfs()
2135 snprintf(name, DPU_NAME_SIZE, "encoder%u", drm_enc->base.id); in _dpu_encoder_init_debugfs()
2139 drm_enc->dev->primary->debugfs_root); in _dpu_encoder_init_debugfs()
2154 static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc) in _dpu_encoder_init_debugfs() argument
2371 struct drm_encoder *drm_enc = &dpu_enc->base; in dpu_encoder_frame_done_timeout() local
2374 if (!drm_enc->dev) { in dpu_encoder_frame_done_timeout()
2381 DRMID(drm_enc), dpu_enc->frame_busy_mask[0]); in dpu_encoder_frame_done_timeout()
2384 DRM_DEBUG_KMS("id:%u invalid timeout\n", DRMID(drm_enc)); in dpu_encoder_frame_done_timeout()
2391 trace_dpu_enc_frame_done_timeout(DRMID(drm_enc), event); in dpu_encoder_frame_done_timeout()
2413 struct drm_encoder *drm_enc = NULL; in dpu_encoder_setup() local
2450 if (drm_enc) in dpu_encoder_setup()
2451 dpu_encoder_destroy(drm_enc); in dpu_encoder_setup()
2486 int dpu_encoder_wait_for_event(struct drm_encoder *drm_enc, in dpu_encoder_wait_for_event() argument
2493 if (!drm_enc) { in dpu_encoder_wait_for_event()
2497 dpu_enc = to_dpu_encoder_virt(drm_enc); in dpu_encoder_wait_for_event()