Skip to content

Commit 8df0d7d

Browse files
Fangzhi Zuoalexdeucher
authored andcommitted
drm/amd/display: Allow 16 max_slices for DP2 DSC
Enable 12 and 16 max_slices for DP2 DSC Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Acked-by: Hersen Wu <hersenxs.wu@amd.com> Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 92e11f0 commit 8df0d7d

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ void dsc2_get_enc_caps(struct dsc_enc_caps *dsc_enc_caps, int pixel_clock_100Hz)
137137
dsc_enc_caps->max_total_throughput_mps = DCN20_MAX_DISPLAY_CLOCK_Mhz * 2;
138138
}
139139

140-
// TODO DSC: This is actually image width limitation, not a slice width. This should be added to the criteria to use ODM.
140+
/* For pixel clock bigger than a single-pipe limit needing four engines ODM 4:1, which then quardruples our
141+
* throughput and number of slices
142+
*/
143+
if (pixel_clock_100Hz > DCN20_MAX_PIXEL_CLOCK_Mhz*10000*2) {
144+
dsc_enc_caps->slice_caps.bits.NUM_SLICES_12 = 1;
145+
dsc_enc_caps->slice_caps.bits.NUM_SLICES_16 = 1;
146+
dsc_enc_caps->max_total_throughput_mps = DCN20_MAX_DISPLAY_CLOCK_Mhz * 4;
147+
}
148+
141149
dsc_enc_caps->max_slice_width = 5184; /* (including 64 overlap pixels for eDP MSO mode) */
142150
dsc_enc_caps->bpp_increment_div = 16; /* 1/16th of a bit */
143151
}

drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ static bool intersect_dsc_caps(
512512
dsc_sink_caps->slice_caps1.bits.NUM_SLICES_4 && dsc_enc_caps->slice_caps.bits.NUM_SLICES_4;
513513
dsc_common_caps->slice_caps.bits.NUM_SLICES_8 =
514514
dsc_sink_caps->slice_caps1.bits.NUM_SLICES_8 && dsc_enc_caps->slice_caps.bits.NUM_SLICES_8;
515+
dsc_common_caps->slice_caps.bits.NUM_SLICES_12 =
516+
dsc_sink_caps->slice_caps1.bits.NUM_SLICES_12 && dsc_enc_caps->slice_caps.bits.NUM_SLICES_12;
517+
dsc_common_caps->slice_caps.bits.NUM_SLICES_16 =
518+
dsc_sink_caps->slice_caps2.bits.NUM_SLICES_16 && dsc_enc_caps->slice_caps.bits.NUM_SLICES_16;
519+
515520
if (!dsc_common_caps->slice_caps.raw)
516521
return false;
517522

@@ -703,6 +708,12 @@ static int get_available_dsc_slices(union dsc_enc_slice_caps slice_caps, int *av
703708
if (slice_caps.bits.NUM_SLICES_8)
704709
available_slices[idx++] = 8;
705710

711+
if (slice_caps.bits.NUM_SLICES_12)
712+
available_slices[idx++] = 12;
713+
714+
if (slice_caps.bits.NUM_SLICES_16)
715+
available_slices[idx++] = 16;
716+
706717
return idx;
707718
}
708719

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ union dsc_enc_slice_caps {
7676
uint8_t NUM_SLICES_3 : 1; /* This one is not per DSC spec, but our encoder supports it */
7777
uint8_t NUM_SLICES_4 : 1;
7878
uint8_t NUM_SLICES_8 : 1;
79+
uint8_t NUM_SLICES_12 : 1;
80+
uint8_t NUM_SLICES_16 : 1;
7981
} bits;
8082
uint8_t raw;
8183
};

0 commit comments

Comments
 (0)