Skip to content

Commit 5b30d1c

Browse files
Paloma Arellanolumag
authored andcommitted
drm/msm/dp: store mode YUV420 information to be used by rest of DP
Wide bus is not supported when the mode is YUV420 in DP. In preparation for changing the DPU programming to reflect this, the value and assignment location of wide_bus_en for the DP submodules must be changed. Move it from boot time in dp_init_sub_modules() to run time in dp_display_mode_set. Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/579614/ Link: https://lore.kernel.org/r/20240222194025.25329-8-quic_parellan@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 3ed77f3 commit 5b30d1c

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -766,10 +766,6 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
766766
goto error_ctrl;
767767
}
768768

769-
/* populate wide_bus_supported to different layers */
770-
dp->ctrl->wide_bus_en = dp->wide_bus_supported;
771-
dp->catalog->wide_bus_en = dp->wide_bus_supported;
772-
773769
return rc;
774770

775771
error_ctrl:
@@ -790,6 +786,7 @@ static int dp_display_set_mode(struct msm_dp *dp_display,
790786
drm_mode_copy(&dp->panel->dp_mode.drm_mode, &mode->drm_mode);
791787
dp->panel->dp_mode.bpp = mode->bpp;
792788
dp->panel->dp_mode.capabilities = mode->capabilities;
789+
dp->panel->dp_mode.out_fmt_is_yuv_420 = mode->out_fmt_is_yuv_420;
793790
dp_panel_init_panel_info(dp->panel);
794791
return 0;
795792
}
@@ -1381,6 +1378,9 @@ bool msm_dp_wide_bus_available(const struct msm_dp *dp_display)
13811378

13821379
dp = container_of(dp_display, struct dp_display_private, dp_display);
13831380

1381+
if (dp->dp_mode.out_fmt_is_yuv_420)
1382+
return false;
1383+
13841384
return dp->wide_bus_supported;
13851385
}
13861386

@@ -1570,6 +1570,15 @@ void dp_bridge_mode_set(struct drm_bridge *drm_bridge,
15701570

15711571
dp_display->dp_mode.h_active_low =
15721572
!!(dp_display->dp_mode.drm_mode.flags & DRM_MODE_FLAG_NHSYNC);
1573+
1574+
dp_display->dp_mode.out_fmt_is_yuv_420 =
1575+
drm_mode_is_420_only(&dp->connector->display_info, adjusted_mode);
1576+
1577+
/* populate wide_bus_support to different layers */
1578+
dp_display->ctrl->wide_bus_en =
1579+
dp_display->dp_mode.out_fmt_is_yuv_420 ? false : dp_display->wide_bus_supported;
1580+
dp_display->catalog->wide_bus_en =
1581+
dp_display->dp_mode.out_fmt_is_yuv_420 ? false : dp_display->wide_bus_supported;
15731582
}
15741583

15751584
void dp_bridge_hpd_enable(struct drm_bridge *bridge)

drivers/gpu/drm/msm/dp/dp_panel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct dp_display_mode {
1919
u32 bpp;
2020
u32 h_active_low;
2121
u32 v_active_low;
22+
bool out_fmt_is_yuv_420;
2223
};
2324

2425
struct dp_panel_in {

0 commit comments

Comments
 (0)