]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/msm/dpu: rework vsync_source handling
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 13 Jun 2024 17:05:08 +0000 (20:05 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 24 Jun 2024 16:41:05 +0000 (19:41 +0300)
The struct msm_display_info has is_te_using_watchdog_timer field which
is neither set anywhere nor is flexible enough to specify different
sources. Replace it with the field specifying the vsync source using
enum dpu_vsync_source.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Patchwork: https://patchwork.freedesktop.org/patch/598738/
Link: https://lore.kernel.org/r/20240613-dpu-handle-te-signal-v2-5-67a0116b5366@linaro.org
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

index 9bf2ba53428ecf89771d67269440c0db92242fd7..5d205e09cf45fc3c132f4a3eb34337ab52e45092 100644 (file)
@@ -743,10 +743,7 @@ static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc,
                vsync_cfg.pp_count = dpu_enc->num_phys_encs;
                vsync_cfg.frame_rate = drm_mode_vrefresh(&dpu_enc->base.crtc->state->adjusted_mode);
 
-               if (disp_info->is_te_using_watchdog_timer)
-                       vsync_cfg.vsync_source = DPU_VSYNC_SOURCE_WD_TIMER_0;
-               else
-                       vsync_cfg.vsync_source = DPU_VSYNC_SOURCE_GPIO_0;
+               vsync_cfg.vsync_source = disp_info->vsync_source;
 
                hw_mdptop->ops.setup_vsync_source(hw_mdptop, &vsync_cfg);
 
index 76be77e309544f5e22e6e2660b0b8cd1143a3c66..cb59bd4436f496590b5a24a90109563cae5f7d35 100644 (file)
  * @h_tile_instance:    Controller instance used per tile. Number of elements is
  *                      based on num_of_h_tiles
  * @is_cmd_mode                Boolean to indicate if the CMD mode is requested
- * @is_te_using_watchdog_timer:  Boolean to indicate watchdog TE is
- *                              used instead of panel TE in cmd mode panels
+ * @vsync_source:      Source of the TE signal for DSI CMD devices
  */
 struct msm_display_info {
        enum dpu_intf_type intf_type;
        uint32_t num_of_h_tiles;
        uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY];
        bool is_cmd_mode;
-       bool is_te_using_watchdog_timer;
+       enum dpu_vsync_source vsync_source;
 };
 
 /**
index 291af6b406b2a6c098597cb0106c819ac3c6c71a..d517e085baba60a4ad906a4f8a1007cc4b49e559 100644 (file)
@@ -543,6 +543,8 @@ static int _dpu_kms_initialize_dsi(struct drm_device *dev,
 
                info.is_cmd_mode = msm_dsi_is_cmd_mode(priv->dsi[i]);
 
+               info.vsync_source = DPU_VSYNC_SOURCE_GPIO_0;
+
                encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_DSI, &info);
                if (IS_ERR(encoder)) {
                        DPU_ERROR("encoder init failed for dsi display\n");