51
51
#include "intel_vdsc.h"
52
52
#include "skl_scaler.h"
53
53
54
- static int intel_dp_mst_check_constraints (struct drm_i915_private * i915 , int bpp ,
55
- const struct drm_display_mode * adjusted_mode ,
56
- struct intel_crtc_state * crtc_state ,
57
- bool dsc )
54
+ static int intel_dp_mst_max_dpt_bpp (const struct intel_crtc_state * crtc_state ,
55
+ bool dsc )
58
56
{
59
- if (intel_dp_is_uhbr (crtc_state ) && DISPLAY_VER (i915 ) < 20 && dsc ) {
60
- int output_bpp = bpp ;
61
- int symbol_clock = intel_dp_link_symbol_clock (crtc_state -> port_clock );
62
- /*
63
- * Bspec/49259 suggests that the FEC overhead needs to be
64
- * applied here, though HW people claim that neither this FEC
65
- * or any other overhead is applicable here (that is the actual
66
- * available_bw is just symbol_clock * 72). However based on
67
- * testing on MTL-P the
68
- * - DELL U3224KBA display
69
- * - Unigraf UCD-500 CTS test sink
70
- * devices the
71
- * - 5120x2880/995.59Mhz
72
- * - 6016x3384/1357.23Mhz
73
- * - 6144x3456/1413.39Mhz
74
- * modes (all the ones having a DPT limit on the above devices),
75
- * both the channel coding efficiency and an additional 3%
76
- * overhead needs to be accounted for.
77
- */
78
- int available_bw = mul_u32_u32 (symbol_clock * 72 ,
79
- drm_dp_bw_channel_coding_efficiency (true)) /
80
- 1030000 ;
81
-
82
- if (output_bpp * adjusted_mode -> crtc_clock >
83
- available_bw ) {
84
- drm_dbg_kms (& i915 -> drm , "UHBR check failed(required bw %d available %d)\n" ,
85
- output_bpp * adjusted_mode -> crtc_clock , available_bw );
86
- return - EINVAL ;
87
- }
88
- }
57
+ struct drm_i915_private * i915 = to_i915 (crtc_state -> uapi .crtc -> dev );
58
+ const struct drm_display_mode * adjusted_mode =
59
+ & crtc_state -> hw .adjusted_mode ;
89
60
90
- return 0 ;
61
+ if (!intel_dp_is_uhbr (crtc_state ) || DISPLAY_VER (i915 ) >= 20 || !dsc )
62
+ return INT_MAX ;
63
+
64
+ /*
65
+ * DSC->DPT interface width:
66
+ * ICL-MTL: 72 bits (each branch has 72 bits, only left branch is used)
67
+ * LNL+: 144 bits (not a bottleneck in any config)
68
+ *
69
+ * Bspec/49259 suggests that the FEC overhead needs to be
70
+ * applied here, though HW people claim that neither this FEC
71
+ * or any other overhead is applicable here (that is the actual
72
+ * available_bw is just symbol_clock * 72). However based on
73
+ * testing on MTL-P the
74
+ * - DELL U3224KBA display
75
+ * - Unigraf UCD-500 CTS test sink
76
+ * devices the
77
+ * - 5120x2880/995.59Mhz
78
+ * - 6016x3384/1357.23Mhz
79
+ * - 6144x3456/1413.39Mhz
80
+ * modes (all the ones having a DPT limit on the above devices),
81
+ * both the channel coding efficiency and an additional 3%
82
+ * overhead needs to be accounted for.
83
+ */
84
+ return div64_u64 (mul_u32_u32 (intel_dp_link_symbol_clock (crtc_state -> port_clock ) * 72 ,
85
+ drm_dp_bw_channel_coding_efficiency (true)),
86
+ mul_u32_u32 (adjusted_mode -> crtc_clock , 1030000 ));
91
87
}
92
88
93
89
static int intel_dp_mst_bw_overhead (const struct intel_crtc_state * crtc_state ,
@@ -175,6 +171,7 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
175
171
const struct drm_display_mode * adjusted_mode =
176
172
& crtc_state -> hw .adjusted_mode ;
177
173
int bpp , slots = - EINVAL ;
174
+ int max_dpt_bpp ;
178
175
int ret = 0 ;
179
176
180
177
mst_state = drm_atomic_get_mst_topology_state (state , & intel_dp -> mst_mgr );
@@ -195,6 +192,13 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
195
192
crtc_state -> port_clock ,
196
193
crtc_state -> lane_count );
197
194
195
+ max_dpt_bpp = intel_dp_mst_max_dpt_bpp (crtc_state , dsc );
196
+ if (max_bpp > max_dpt_bpp ) {
197
+ drm_dbg_kms (& i915 -> drm , "Limiting bpp to max DPT bpp (%d -> %d)\n" ,
198
+ max_bpp , max_dpt_bpp );
199
+ max_bpp = max_dpt_bpp ;
200
+ }
201
+
198
202
drm_dbg_kms (& i915 -> drm , "Looking for slots in range min bpp %d max bpp %d\n" ,
199
203
min_bpp , max_bpp );
200
204
@@ -206,10 +210,6 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
206
210
207
211
drm_dbg_kms (& i915 -> drm , "Trying bpp %d\n" , bpp );
208
212
209
- ret = intel_dp_mst_check_constraints (i915 , bpp , adjusted_mode , crtc_state , dsc );
210
- if (ret )
211
- continue ;
212
-
213
213
link_bpp_x16 = to_bpp_x16 (dsc ? bpp :
214
214
intel_dp_output_bpp (crtc_state -> output_format , bpp ));
215
215
0 commit comments