Skip to content

Commit 63e7ee6

Browse files
Peterson Guoalexdeucher
authored andcommitted
drm/amd/display: Add a left edge pixel if in YCbCr422 or YCbCr420 and odm
[WHY] On some cards when odm is used, the monitor will have 2 separate pipes split vertically. When compression is used on the YCbCr colour space on the second pipe to have correct colours, we need to read a pixel from the end of first pipe to accurately display colours. Hardware was programmed properly to account for this extra pixel but it was not calculated properly in software causing a split screen on some monitors. [HOW] The fix adjusts the second pipe's viewport and timings if the pixel encoding is YCbCr422 or YCbCr420. Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Cc: [email protected] Reviewed-by: George Shen <[email protected]> Signed-off-by: Peterson Guo <[email protected]> Signed-off-by: Alex Hung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 55ed120 commit 63e7ee6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,7 @@ bool dcn20_split_stream_for_odm(
15101510

15111511
if (prev_odm_pipe->plane_state) {
15121512
struct scaler_data *sd = &prev_odm_pipe->plane_res.scl_data;
1513+
struct output_pixel_processor *opp = next_odm_pipe->stream_res.opp;
15131514
int new_width;
15141515

15151516
/* HACTIVE halved for odm combine */
@@ -1543,7 +1544,28 @@ bool dcn20_split_stream_for_odm(
15431544
sd->viewport_c.x += dc_fixpt_floor(dc_fixpt_mul_int(
15441545
sd->ratios.horz_c, sd->h_active - sd->recout.x));
15451546
sd->recout.x = 0;
1547+
1548+
/*
1549+
* When odm is used in YcbCr422 or 420 colour space, a split screen
1550+
* will be seen with the previous calculations since the extra left
1551+
* edge pixel is accounted for in fmt but not in viewport.
1552+
*
1553+
* Below are calculations which fix the split by fixing the calculations
1554+
* if there is an extra left edge pixel.
1555+
*/
1556+
if (opp && opp->funcs->opp_get_left_edge_extra_pixel_count
1557+
&& opp->funcs->opp_get_left_edge_extra_pixel_count(
1558+
opp, next_odm_pipe->stream->timing.pixel_encoding,
1559+
resource_is_pipe_type(next_odm_pipe, OTG_MASTER)) == 1) {
1560+
sd->h_active += 1;
1561+
sd->recout.width += 1;
1562+
sd->viewport.x -= dc_fixpt_ceil(dc_fixpt_mul_int(sd->ratios.horz, 1));
1563+
sd->viewport_c.x -= dc_fixpt_ceil(dc_fixpt_mul_int(sd->ratios.horz, 1));
1564+
sd->viewport_c.width += dc_fixpt_ceil(dc_fixpt_mul_int(sd->ratios.horz, 1));
1565+
sd->viewport.width += dc_fixpt_ceil(dc_fixpt_mul_int(sd->ratios.horz, 1));
1566+
}
15461567
}
1568+
15471569
if (!next_odm_pipe->top_pipe)
15481570
next_odm_pipe->stream_res.opp = pool->opps[next_odm_pipe->pipe_idx];
15491571
else
@@ -2132,6 +2154,7 @@ bool dcn20_fast_validate_bw(
21322154
ASSERT(0);
21332155
}
21342156
}
2157+
21352158
/* Actual dsc count per stream dsc validation*/
21362159
if (!dcn20_validate_dsc(dc, context)) {
21372160
context->bw_ctx.dml.vba.ValidationStatus[context->bw_ctx.dml.vba.soc.num_states] =

0 commit comments

Comments
 (0)