Skip to content

Commit fcccdaf

Browse files
Kuogee HsiehAbhinav Kumar
authored andcommitted
drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case
MSA MISC0 bit 1 to 7 contains Colorimetry Indicator Field. dp_link_get_colorimetry_config() returns wrong colorimetry value in the DP_TEST_DYNAMIC_RANGE_CEA case in the current implementation. Hence fix this problem by having dp_link_get_colorimetry_config() return defined CEA RGB colorimetry value in the case of DP_TEST_DYNAMIC_RANGE_CEA. Changes in V2: -- drop retrieving colorimetry from colorspace -- drop dr = link->dp_link.test_video.test_dyn_range assignment Changes in V3: -- move defined MISCr0a Colorimetry vale to dp_reg.h -- rewording commit title -- rewording commit text to more precise describe this patch Fixes: c943b49 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/574888/ Link: https://lore.kernel.org/r/1705526010-597-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
1 parent 77e8aad commit fcccdaf

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <drm/drm_print.h>
99

10+
#include "dp_reg.h"
1011
#include "dp_link.h"
1112
#include "dp_panel.h"
1213

@@ -1082,7 +1083,7 @@ int dp_link_process_request(struct dp_link *dp_link)
10821083

10831084
int dp_link_get_colorimetry_config(struct dp_link *dp_link)
10841085
{
1085-
u32 cc;
1086+
u32 cc = DP_MISC0_COLORIMERY_CFG_LEGACY_RGB;
10861087
struct dp_link_private *link;
10871088

10881089
if (!dp_link) {
@@ -1096,10 +1097,11 @@ int dp_link_get_colorimetry_config(struct dp_link *dp_link)
10961097
* Unless a video pattern CTS test is ongoing, use RGB_VESA
10971098
* Only RGB_VESA and RGB_CEA supported for now
10981099
*/
1099-
if (dp_link_is_video_pattern_requested(link))
1100-
cc = link->dp_link.test_video.test_dyn_range;
1101-
else
1102-
cc = DP_TEST_DYNAMIC_RANGE_VESA;
1100+
if (dp_link_is_video_pattern_requested(link)) {
1101+
if (link->dp_link.test_video.test_dyn_range &
1102+
DP_TEST_DYNAMIC_RANGE_CEA)
1103+
cc = DP_MISC0_COLORIMERY_CFG_CEA_RGB;
1104+
}
11031105

11041106
return cc;
11051107
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
#define DP_MISC0_COLORIMETRY_CFG_SHIFT (0x00000001)
144144
#define DP_MISC0_TEST_BITS_DEPTH_SHIFT (0x00000005)
145145

146+
#define DP_MISC0_COLORIMERY_CFG_LEGACY_RGB (0)
147+
#define DP_MISC0_COLORIMERY_CFG_CEA_RGB (0x04)
148+
146149
#define REG_DP_VALID_BOUNDARY (0x00000030)
147150
#define REG_DP_VALID_BOUNDARY_2 (0x00000034)
148151

0 commit comments

Comments
 (0)