Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dp: fix the max supported bpp logic
@ 2024-07-25 22:03 Abhinav Kumar
  2024-07-27  0:24 ` Stephen Boyd
  2024-07-27 12:51 ` Dmitry Baryshkov
  0 siblings, 2 replies; 7+ messages in thread
From: Abhinav Kumar @ 2024-07-25 22:03 UTC (permalink / raw)
  To: freedreno, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Sean Paul,
	Marijn Suijten, David Airlie, Daniel Vetter, Guenter Roeck,
	Tanmay Shah, Vara Reddy, Stephen Boyd
  Cc: dri-devel, quic_jesszhan, neil.armstrong, abel.vesa, quic_khsieh,
	Rob Clark, Chandan Uddaraju, linux-arm-msm, linux-kernel

Currently the DP driver hard-codes the max supported bpp to 30.
This is incorrect because the number of lanes and max data rate
supported by the lanes need to be taken into account.

Replace the hardcoded limit with the appropriate math which accounts
for the accurate number of lanes and max data rate.

Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support")
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/dp/dp_panel.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
index a916b5f3b317..56ce5e4008f8 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ b/drivers/gpu/drm/msm/dp/dp_panel.c
@@ -397,6 +397,7 @@ int dp_panel_init_panel_info(struct dp_panel *dp_panel)
 {
 	struct drm_display_mode *drm_mode;
 	struct dp_panel_private *panel;
+	u32 max_supported_bpp;
 
 	drm_mode = &dp_panel->dp_mode.drm_mode;
 
@@ -423,8 +424,10 @@ int dp_panel_init_panel_info(struct dp_panel *dp_panel)
 				drm_mode->clock);
 	drm_dbg_dp(panel->drm_dev, "bpp = %d\n", dp_panel->dp_mode.bpp);
 
-	dp_panel->dp_mode.bpp = max_t(u32, 18,
-				min_t(u32, dp_panel->dp_mode.bpp, 30));
+	max_supported_bpp = dp_panel_get_mode_bpp(dp_panel, dp_panel->dp_mode.bpp,
+						  dp_panel->dp_mode.drm_mode.clock);
+	dp_panel->dp_mode.bpp = max_t(u32, 18, max_supported_bpp);
+
 	drm_dbg_dp(panel->drm_dev, "updated bpp = %d\n",
 				dp_panel->dp_mode.bpp);
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-30 17:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 22:03 [PATCH] drm/msm/dp: fix the max supported bpp logic Abhinav Kumar
2024-07-27  0:24 ` Stephen Boyd
2024-07-29 18:28   ` Abhinav Kumar
2024-07-29 20:08     ` Stephen Boyd
2024-07-30 17:58       ` Abhinav Kumar
2024-07-27 12:51 ` Dmitry Baryshkov
2024-07-29 18:38   ` Abhinav Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox