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

drm/msm/dpu: fix the programming of INTF_CFG2_DATA_HCTL_EN

Currently INTF_CFG2_DATA_HCTL_EN is coupled with the enablement
of widebus but this is incorrect because we should be enabling
this bit independent of widebus except for cases where compression
is enabled in one pixel per clock mode.

Fix this by making the condition checks more explicit and enabling
INTF_CFG2_DATA_HCTL_EN for all other cases when supported by DPU.

Fixes: 3309a7563971 ("drm/msm/dpu: revise timing engine programming to support widebus feature")
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/576722/
Link: https://lore.kernel.org/r/20240201004737.2478-1-quic_abhinavk@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Abhinav Kumar and committed by
Dmitry Baryshkov
2f4a67a3 6215f155

+25 -6
+7
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 226 226 return dpu_enc->wide_bus_en; 227 227 } 228 228 229 + bool dpu_encoder_is_dsc_enabled(const struct drm_encoder *drm_enc) 230 + { 231 + const struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); 232 + 233 + return dpu_enc->dsc ? true : false; 234 + } 235 + 229 236 int dpu_encoder_get_crc_values_cnt(const struct drm_encoder *drm_enc) 230 237 { 231 238 struct dpu_encoder_virt *dpu_enc;
+7
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
··· 159 159 bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc); 160 160 161 161 /** 162 + * dpu_encoder_is_dsc_enabled - indicate whether dsc is enabled 163 + * for the encoder. 164 + * @drm_enc: Pointer to previously created drm encoder structure 165 + */ 166 + bool dpu_encoder_is_dsc_enabled(const struct drm_encoder *drm_enc); 167 + 168 + /** 162 169 * dpu_encoder_get_crc_values_cnt - get number of physical encoders contained 163 170 * in virtual encoder that can collect CRC values 164 171 * @drm_enc: Pointer to previously created drm encoder structure
+1
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
··· 102 102 } 103 103 104 104 timing->wide_bus_en = dpu_encoder_is_widebus_enabled(phys_enc->parent); 105 + timing->compression_en = dpu_encoder_is_dsc_enabled(phys_enc->parent); 105 106 106 107 /* 107 108 * for DP, divide the horizonal parameters by 2 when
+9 -6
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
··· 163 163 hsync_ctl = (hsync_period << 16) | p->hsync_pulse_width; 164 164 display_hctl = (hsync_end_x << 16) | hsync_start_x; 165 165 166 - /* 167 - * DATA_HCTL_EN controls data timing which can be different from 168 - * video timing. It is recommended to enable it for all cases, except 169 - * if compression is enabled in 1 pixel per clock mode 170 - */ 171 166 if (p->wide_bus_en) 172 - intf_cfg2 |= INTF_CFG2_DATABUS_WIDEN | INTF_CFG2_DATA_HCTL_EN; 167 + intf_cfg2 |= INTF_CFG2_DATABUS_WIDEN; 173 168 174 169 data_width = p->width; 175 170 ··· 224 229 DPU_REG_WRITE(c, INTF_CONFIG, intf_cfg); 225 230 DPU_REG_WRITE(c, INTF_PANEL_FORMAT, panel_format); 226 231 if (ctx->cap->features & BIT(DPU_DATA_HCTL_EN)) { 232 + /* 233 + * DATA_HCTL_EN controls data timing which can be different from 234 + * video timing. It is recommended to enable it for all cases, except 235 + * if compression is enabled in 1 pixel per clock mode 236 + */ 237 + if (!(p->compression_en && !p->wide_bus_en)) 238 + intf_cfg2 |= INTF_CFG2_DATA_HCTL_EN; 239 + 227 240 DPU_REG_WRITE(c, INTF_CONFIG2, intf_cfg2); 228 241 DPU_REG_WRITE(c, INTF_DISPLAY_DATA_HCTL, display_data_hctl); 229 242 DPU_REG_WRITE(c, INTF_ACTIVE_DATA_HCTL, active_data_hctl);
+1
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
··· 33 33 u32 hsync_skew; 34 34 35 35 bool wide_bus_en; 36 + bool compression_en; 36 37 }; 37 38 38 39 struct dpu_hw_intf_prog_fetch {