Commit 61ea4c6f authored by Jun Lei's avatar Jun Lei Committed by Alex Deucher

drm/amd/display: Add driver-side parsing for CM

Although 4 unique register values exist for gamma modes, two are
actually the same (the two RAMs) It’s not possible for caller to
understand this HW specific behavior, so some parsing is necessary
in driver
Signed-off-by: default avatarJun Lei <Jun.Lei@amd.com>
Reviewed-by: default avatarWesley Chalmers <Wesley.Chalmers@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 550db288
...@@ -314,14 +314,35 @@ static unsigned int dcn10_get_cm_states(struct dc *dc, char *pBuf, unsigned int ...@@ -314,14 +314,35 @@ static unsigned int dcn10_get_cm_states(struct dc *dc, char *pBuf, unsigned int
struct dpp *dpp = pool->dpps[i]; struct dpp *dpp = pool->dpps[i];
struct dcn_dpp_state s = {0}; struct dcn_dpp_state s = {0};
dpp->funcs->dpp_read_state(dpp, &s); dpp->funcs->dpp_read_state(dpp, &s);
if (s.is_enabled) { if (s.is_enabled) {
chars_printed = snprintf_count(pBuf, remaining_buffer, "%x,%x,%x,%x,%x,%x," chars_printed = snprintf_count(pBuf, remaining_buffer, "%x,%x,"
"%08x,%08x,%08x,%08x,%08x,%08x" "%s,%s,%s,"
"%x,%08x,%08x,%08x,%08x,%08x,%08x"
"\n", "\n",
dpp->inst, s.igam_input_format, s.igam_lut_mode, s.dgam_lut_mode, dpp->inst, s.igam_input_format,
s.rgam_lut_mode, s.gamut_remap_mode, s.gamut_remap_c11_c12, (s.igam_lut_mode == 0) ? "BypassFixed" :
((s.igam_lut_mode == 1) ? "BypassFloat" :
((s.igam_lut_mode == 2) ? "RAM" :
((s.igam_lut_mode == 3) ? "RAM" :
"Unknown"))),
(s.dgam_lut_mode == 0) ? "Bypass" :
((s.dgam_lut_mode == 1) ? "sRGB" :
((s.dgam_lut_mode == 2) ? "Ycc" :
((s.dgam_lut_mode == 3) ? "RAM" :
((s.dgam_lut_mode == 4) ? "RAM" :
"Unknown")))),
(s.rgam_lut_mode == 0) ? "Bypass" :
((s.rgam_lut_mode == 1) ? "sRGB" :
((s.rgam_lut_mode == 2) ? "Ycc" :
((s.rgam_lut_mode == 3) ? "RAM" :
((s.rgam_lut_mode == 4) ? "RAM" :
"Unknown")))),
s.gamut_remap_mode, s.gamut_remap_c11_c12,
s.gamut_remap_c13_c14, s.gamut_remap_c21_c22, s.gamut_remap_c23_c24, s.gamut_remap_c13_c14, s.gamut_remap_c21_c22, s.gamut_remap_c23_c24,
s.gamut_remap_c31_c32, s.gamut_remap_c33_c34); s.gamut_remap_c31_c32, s.gamut_remap_c33_c34);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment