Skip to content

Commit

Permalink
drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/574888/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Abhinav Kumar <[email protected]>
  • Loading branch information
Kuogee Hsieh authored and Abhinav Kumar committed Jan 24, 2024
1 parent 77e8aad commit fcccdaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/gpu/drm/msm/dp/dp_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <drm/drm_print.h>

#include "dp_reg.h"
#include "dp_link.h"
#include "dp_panel.h"

Expand Down Expand Up @@ -1082,7 +1083,7 @@ int dp_link_process_request(struct dp_link *dp_link)

int dp_link_get_colorimetry_config(struct dp_link *dp_link)
{
u32 cc;
u32 cc = DP_MISC0_COLORIMERY_CFG_LEGACY_RGB;
struct dp_link_private *link;

if (!dp_link) {
Expand All @@ -1096,10 +1097,11 @@ int dp_link_get_colorimetry_config(struct dp_link *dp_link)
* Unless a video pattern CTS test is ongoing, use RGB_VESA
* Only RGB_VESA and RGB_CEA supported for now
*/
if (dp_link_is_video_pattern_requested(link))
cc = link->dp_link.test_video.test_dyn_range;
else
cc = DP_TEST_DYNAMIC_RANGE_VESA;
if (dp_link_is_video_pattern_requested(link)) {
if (link->dp_link.test_video.test_dyn_range &
DP_TEST_DYNAMIC_RANGE_CEA)
cc = DP_MISC0_COLORIMERY_CFG_CEA_RGB;
}

return cc;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/msm/dp/dp_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
#define DP_MISC0_COLORIMETRY_CFG_SHIFT (0x00000001)
#define DP_MISC0_TEST_BITS_DEPTH_SHIFT (0x00000005)

#define DP_MISC0_COLORIMERY_CFG_LEGACY_RGB (0)
#define DP_MISC0_COLORIMERY_CFG_CEA_RGB (0x04)

#define REG_DP_VALID_BOUNDARY (0x00000030)
#define REG_DP_VALID_BOUNDARY_2 (0x00000034)

Expand Down

0 comments on commit fcccdaf

Please sign in to comment.