Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dpu: rework vsync_source handling

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

+5 -7
+1 -4
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 743 743 vsync_cfg.pp_count = dpu_enc->num_phys_encs; 744 744 vsync_cfg.frame_rate = drm_mode_vrefresh(&dpu_enc->base.crtc->state->adjusted_mode); 745 745 746 - if (disp_info->is_te_using_watchdog_timer) 747 - vsync_cfg.vsync_source = DPU_VSYNC_SOURCE_WD_TIMER_0; 748 - else 749 - vsync_cfg.vsync_source = DPU_VSYNC_SOURCE_GPIO_0; 746 + vsync_cfg.vsync_source = disp_info->vsync_source; 750 747 751 748 hw_mdptop->ops.setup_vsync_source(hw_mdptop, &vsync_cfg); 752 749
+2 -3
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
··· 26 26 * @h_tile_instance: Controller instance used per tile. Number of elements is 27 27 * based on num_of_h_tiles 28 28 * @is_cmd_mode Boolean to indicate if the CMD mode is requested 29 - * @is_te_using_watchdog_timer: Boolean to indicate watchdog TE is 30 - * used instead of panel TE in cmd mode panels 29 + * @vsync_source: Source of the TE signal for DSI CMD devices 31 30 */ 32 31 struct msm_display_info { 33 32 enum dpu_intf_type intf_type; 34 33 uint32_t num_of_h_tiles; 35 34 uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY]; 36 35 bool is_cmd_mode; 37 - bool is_te_using_watchdog_timer; 36 + enum dpu_vsync_source vsync_source; 38 37 }; 39 38 40 39 /**
+2
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
··· 543 543 544 544 info.is_cmd_mode = msm_dsi_is_cmd_mode(priv->dsi[i]); 545 545 546 + info.vsync_source = DPU_VSYNC_SOURCE_GPIO_0; 547 + 546 548 encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_DSI, &info); 547 549 if (IS_ERR(encoder)) { 548 550 DPU_ERROR("encoder init failed for dsi display\n");