Skip to content

Commit 77e8aad

Browse files
Kuogee HsiehAbhinav Kumar
authored andcommitted
drm/msms/dp: fixed link clock divider bits be over written in BPC unknown case
Since the value of DP_TEST_BIT_DEPTH_8 is already left shifted, in the BPC unknown case, the additional shift causes spill over to the other bits of the [DP_CONFIGURATION_CTRL] register. Fix this by changing the return value of dp_link_get_test_bits_depth() in the BPC unknown case to (DP_TEST_BIT_DEPTH_8 >> DP_TEST_BIT_DEPTH_SHIFT). Fixes: c943b49 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Kuogee Hsieh <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/573989/ Link: https://lore.kernel.org/r/[email protected] [[email protected]: fix minor checkpatch warning to align with opening braces] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent 1793ce9 commit 77e8aad

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl)
135135
tbd = dp_link_get_test_bits_depth(ctrl->link,
136136
ctrl->panel->dp_mode.bpp);
137137

138-
if (tbd == DP_TEST_BIT_DEPTH_UNKNOWN) {
139-
pr_debug("BIT_DEPTH not set. Configure default\n");
140-
tbd = DP_TEST_BIT_DEPTH_8;
141-
}
142-
143138
config |= tbd << DP_CONFIGURATION_CTRL_BPC_SHIFT;
144139

145140
/* Num of Lanes */

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,9 @@ void dp_link_reset_phy_params_vx_px(struct dp_link *dp_link)
11791179
u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp)
11801180
{
11811181
u32 tbd;
1182+
struct dp_link_private *link;
1183+
1184+
link = container_of(dp_link, struct dp_link_private, dp_link);
11821185

11831186
/*
11841187
* Few simplistic rules and assumptions made here:
@@ -1196,12 +1199,13 @@ u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp)
11961199
tbd = DP_TEST_BIT_DEPTH_10;
11971200
break;
11981201
default:
1199-
tbd = DP_TEST_BIT_DEPTH_UNKNOWN;
1202+
drm_dbg_dp(link->drm_dev, "bpp=%d not supported, use bpc=8\n",
1203+
bpp);
1204+
tbd = DP_TEST_BIT_DEPTH_8;
12001205
break;
12011206
}
12021207

1203-
if (tbd != DP_TEST_BIT_DEPTH_UNKNOWN)
1204-
tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT);
1208+
tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT);
12051209

12061210
return tbd;
12071211
}

0 commit comments

Comments
 (0)