On Mon, Dec 08, 2025 at 01:24:54PM +0200, Luca Coelho wrote:
> 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?

An eDP sink with a DPCD_REV version less than 1.5 may support slice
counts added by the eDP 1.5 Standard only, but still not indicate that
it's fully compliant with the 1.5 Standard by setting its DPCD_REV
register to 1.5 (since for instance it doesn't support some other
feature mandated by 1.5).

This also matches what the Windows driver does, i.e. it parses all the
slice counts in the DP_DSC_SLICE_CAP_1 register for an eDP panel with
1.4 in the panel's DPCD_REV register.

> 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