diff options
author | Wenjing Liu <wenjing.liu@amd.com> | 2024-04-12 15:58:05 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-04-30 09:54:05 -0400 |
commit | 3d1967ec9b990219c960b6da107231bf101e2255 (patch) | |
tree | 000aa573f44b74aa93c01d82713e31827f723079 | |
parent | 6aa96aa8ffbed1efab4c6f3b0d6106e6bbadfc68 (diff) | |
download | linux-3d1967ec9b990219c960b6da107231bf101e2255.tar.gz linux-3d1967ec9b990219c960b6da107231bf101e2255.tar.bz2 linux-3d1967ec9b990219c960b6da107231bf101e2255.zip |
drm/amd/display: take ODM slice count into account when deciding DSC slice
[why]
DSC slice must be divisible by ODM slice count.
[how]
If DSC slice count is not a multiple of ODM slice count, increase DSC
slice until it is. Otherwise fail to compute DSC configuration.
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c index 80ed905ebfe6..dd7091628b3c 100644 --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c @@ -922,14 +922,30 @@ static bool setup_dsc_config( else is_dsc_possible = false; } - // When we force 2:1 ODM, we can't have 1 slice to divide amongst 2 separate DSC instances - // need to enforce at minimum 2 horizontal slices - if (options->dsc_force_odm_hslice_override) { - num_slices_h = fit_num_slices_up(dsc_common_caps.slice_caps, 2); - if (num_slices_h == 0) - is_dsc_possible = false; + // When we force ODM, num dsc h slices must be divisible by num odm h slices + switch (options->dsc_force_odm_hslice_override) { + case 0: + case 1: + break; + case 2: + if (num_slices_h < 2) + num_slices_h = fit_num_slices_up(dsc_common_caps.slice_caps, 2); + break; + case 3: + if (dsc_common_caps.slice_caps.bits.NUM_SLICES_12) + num_slices_h = 12; + else + num_slices_h = 0; + break; + case 4: + if (num_slices_h < 4) + num_slices_h = fit_num_slices_up(dsc_common_caps.slice_caps, 4); + break; + default: + break; } - + if (num_slices_h == 0) + is_dsc_possible = false; if (!is_dsc_possible) goto done; |