Skip to content

Commit f264075

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: read gamut remap matrix in fixed-point 31.32 format
Instead of read gamut remap data from hw values, convert HW register values (S2D13) into a fixed-point 31.32 matrix for color state log. Change DCN10 log to print data in the format of the gamut remap matrix. Signed-off-by: Melissa Wen <[email protected]> Reviewed-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 07b2483 commit f264075

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,26 @@ static void dcn10_log_color_state(struct dc *dc,
290290
struct resource_pool *pool = dc->res_pool;
291291
int i;
292292

293-
DTN_INFO("DPP: IGAM format IGAM mode DGAM mode RGAM mode"
294-
" GAMUT mode C11 C12 C13 C14 C21 C22 C23 C24 "
295-
"C31 C32 C33 C34\n");
293+
DTN_INFO("DPP: IGAM format IGAM mode DGAM mode RGAM mode"
294+
" GAMUT adjust "
295+
"C11 C12 C13 C14 "
296+
"C21 C22 C23 C24 "
297+
"C31 C32 C33 C34 \n");
296298
for (i = 0; i < pool->pipe_count; i++) {
297299
struct dpp *dpp = pool->dpps[i];
298300
struct dcn_dpp_state s = {0};
299301

300302
dpp->funcs->dpp_read_state(dpp, &s);
303+
dpp->funcs->dpp_get_gamut_remap(dpp, &s.gamut_remap);
301304

302305
if (!s.is_enabled)
303306
continue;
304307

305-
DTN_INFO("[%2d]: %11xh %-11s %-11s %-11s"
306-
"%8x %08xh %08xh %08xh %08xh %08xh %08xh",
308+
DTN_INFO("[%2d]: %11xh %11s %9s %9s"
309+
" %12s "
310+
"%010lld %010lld %010lld %010lld "
311+
"%010lld %010lld %010lld %010lld "
312+
"%010lld %010lld %010lld %010lld",
307313
dpp->inst,
308314
s.igam_input_format,
309315
(s.igam_lut_mode == 0) ? "BypassFixed" :
@@ -323,13 +329,21 @@ static void dcn10_log_color_state(struct dc *dc,
323329
((s.rgam_lut_mode == 3) ? "RAM" :
324330
((s.rgam_lut_mode == 4) ? "RAM" :
325331
"Unknown")))),
326-
s.gamut_remap_mode,
327-
s.gamut_remap_c11_c12,
328-
s.gamut_remap_c13_c14,
329-
s.gamut_remap_c21_c22,
330-
s.gamut_remap_c23_c24,
331-
s.gamut_remap_c31_c32,
332-
s.gamut_remap_c33_c34);
332+
(s.gamut_remap.gamut_adjust_type == 0) ? "Bypass" :
333+
((s.gamut_remap.gamut_adjust_type == 1) ? "HW" :
334+
"SW"),
335+
s.gamut_remap.temperature_matrix[0].value,
336+
s.gamut_remap.temperature_matrix[1].value,
337+
s.gamut_remap.temperature_matrix[2].value,
338+
s.gamut_remap.temperature_matrix[3].value,
339+
s.gamut_remap.temperature_matrix[4].value,
340+
s.gamut_remap.temperature_matrix[5].value,
341+
s.gamut_remap.temperature_matrix[6].value,
342+
s.gamut_remap.temperature_matrix[7].value,
343+
s.gamut_remap.temperature_matrix[8].value,
344+
s.gamut_remap.temperature_matrix[9].value,
345+
s.gamut_remap.temperature_matrix[10].value,
346+
s.gamut_remap.temperature_matrix[11].value);
333347
DTN_INFO("\n");
334348
}
335349
DTN_INFO("\n");

drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,16 @@ struct dcn_dpp_state {
141141
uint32_t igam_input_format;
142142
uint32_t dgam_lut_mode;
143143
uint32_t rgam_lut_mode;
144+
// gamut_remap data for dcn10_get_cm_states()
144145
uint32_t gamut_remap_mode;
145146
uint32_t gamut_remap_c11_c12;
146147
uint32_t gamut_remap_c13_c14;
147148
uint32_t gamut_remap_c21_c22;
148149
uint32_t gamut_remap_c23_c24;
149150
uint32_t gamut_remap_c31_c32;
150151
uint32_t gamut_remap_c33_c34;
152+
// gamut_remap data for dcn*_log_color_state()
153+
struct dpp_grph_csc_adjustment gamut_remap;
151154
};
152155

153156
struct CM_bias_params {

0 commit comments

Comments
 (0)