On Thu, 2025-11-27 at 19:49 +0200, Imre Deak wrote:
> eDP 1.5 supports all the slice counts reported via DP_DSC_SLICE_CAP_1,
> so adjust drm_dp_dsc_sink_max_slice_count() accordingly.
> 
> Cc: [email protected]
> Signed-off-by: Imre Deak <[email protected]>
> ---
>  drivers/gpu/drm/display/drm_dp_helper.c | 41 +++++++++++--------------
>  1 file changed, 18 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_dp_helper.c 
> b/drivers/gpu/drm/display/drm_dp_helper.c
> index f9fdf19de74a9..19564c1afba6c 100644
> --- a/drivers/gpu/drm/display/drm_dp_helper.c
> +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> @@ -2725,15 +2725,7 @@ u8 drm_dp_dsc_sink_max_slice_count(const u8 
> dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE],
>  {
>       u8 slice_cap1 = dsc_dpcd[DP_DSC_SLICE_CAP_1 - DP_DSC_SUPPORT];
>  
> -     if (is_edp) {
> -             /* For eDP, register DSC_SLICE_CAPABILITIES_1 gives slice count 
> */
> -             if (slice_cap1 & DP_DSC_4_PER_DP_DSC_SINK)
> -                     return 4;
> -             if (slice_cap1 & DP_DSC_2_PER_DP_DSC_SINK)
> -                     return 2;
> -             if (slice_cap1 & DP_DSC_1_PER_DP_DSC_SINK)
> -                     return 1;
> -     } else {
> +     if (!is_edp) {
>               /* For DP, use values from DSC_SLICE_CAP_1 and DSC_SLICE_CAP2 */
>               u8 slice_cap2 = dsc_dpcd[DP_DSC_SLICE_CAP_2 - DP_DSC_SUPPORT];
>  
> @@ -2743,22 +2735,25 @@ u8 drm_dp_dsc_sink_max_slice_count(const u8 
> dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE],
>                       return 20;
>               if (slice_cap2 & DP_DSC_16_PER_DP_DSC_SINK)
>                       return 16;
> -             if (slice_cap1 & DP_DSC_12_PER_DP_DSC_SINK)
> -                     return 12;
> -             if (slice_cap1 & DP_DSC_10_PER_DP_DSC_SINK)
> -                     return 10;
> -             if (slice_cap1 & DP_DSC_8_PER_DP_DSC_SINK)
> -                     return 8;
> -             if (slice_cap1 & DP_DSC_6_PER_DP_DSC_SINK)
> -                     return 6;
> -             if (slice_cap1 & DP_DSC_4_PER_DP_DSC_SINK)
> -                     return 4;
> -             if (slice_cap1 & DP_DSC_2_PER_DP_DSC_SINK)
> -                     return 2;
> -             if (slice_cap1 & DP_DSC_1_PER_DP_DSC_SINK)
> -                     return 1;
>       }
>  
> +     /* DP, eDP v1.5+ */
> +     if (slice_cap1 & DP_DSC_12_PER_DP_DSC_SINK)
> +             return 12;
> +     if (slice_cap1 & DP_DSC_10_PER_DP_DSC_SINK)
> +             return 10;
> +     if (slice_cap1 & DP_DSC_8_PER_DP_DSC_SINK)
> +             return 8;
> +     if (slice_cap1 & DP_DSC_6_PER_DP_DSC_SINK)
> +             return 6;
> +     /* DP, eDP v1.4+ */
> +     if (slice_cap1 & DP_DSC_4_PER_DP_DSC_SINK)
> +             return 4;
> +     if (slice_cap1 & DP_DSC_2_PER_DP_DSC_SINK)
> +             return 2;
> +     if (slice_cap1 & DP_DSC_1_PER_DP_DSC_SINK)
> +             return 1;
> +
>       return 0;
>  }
>  EXPORT_SYMBOL(drm_dp_dsc_sink_max_slice_count);

I'm assuming you decided to ignore cases where, for instance,
DP_DSC_12_PER_DP_DSC_SINK would be set even though we're using eDP <
1.5, right?

The change looks good to me, I'm just wondering what would happen in
this case.

Reviewed-by: Luca Coelho <[email protected]>

--
Cheers,
Luca.

Reply via email to