]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/dp: Parse all DSC slice count caps for eDP 1.5
authorImre Deak <imre.deak@intel.com>
Mon, 15 Dec 2025 19:23:41 +0000 (21:23 +0200)
committerImre Deak <imre.deak@intel.com>
Fri, 19 Dec 2025 14:45:44 +0000 (16:45 +0200)
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: dri-devel@lists.freedesktop.org
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251215192357.172201-2-imre.deak@intel.com
drivers/gpu/drm/display/drm_dp_helper.c

index f9fdf19de74a94d313a71d71400270fdc38748a4..19564c1afba6c03cdaf4736bb43ae9e74f54e9aa 100644 (file)
@@ -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);