Skip to content

Commit 8676f46

Browse files
committed
drm/i915/display: Use joined pipes in dsc helpers for slices, bpp
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.18.1.el9_6 commit-author Ankit Nautiyal <ankit.k.nautiyal@intel.com> commit f2e2092 Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-5.14.0-570.18.1.el9_6/f2e2092a.failed In preparation of ultrajoiner, use number of joined pipes in the dsc helpers to compute dsc slices and max compressed bpp, instead of using the joiner flag. v2: Adjust the formulae to use num of pipes as 1 (no joiner) or 2 (bigjoiner). (Ankit) Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> (v1) Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-5-ankit.k.nautiyal@intel.com (cherry picked from commit f2e2092) Signed-off-by: Jonathan Maple <jmaple@ciq.com> # Conflicts: # drivers/gpu/drm/i915/display/intel_dp_mst.c
1 parent 25ea0bb commit 8676f46

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
drm/i915/display: Use joined pipes in dsc helpers for slices, bpp
2+
3+
jira NONE_AUTOMATION
4+
Rebuild_History Non-Buildable kernel-5.14.0-570.18.1.el9_6
5+
commit-author Ankit Nautiyal <ankit.k.nautiyal@intel.com>
6+
commit f2e2092a979cd46b43445daf23628015ac776ac3
7+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
8+
Will be included in final tarball splat. Ref for failed cherry-pick at:
9+
ciq/ciq_backports/kernel-5.14.0-570.18.1.el9_6/f2e2092a.failed
10+
11+
In preparation of ultrajoiner, use number of joined pipes in the dsc
12+
helpers to compute dsc slices and max compressed bpp, instead of using
13+
the joiner flag.
14+
15+
v2: Adjust the formulae to use num of pipes as 1 (no joiner) or 2
16+
(bigjoiner). (Ankit)
17+
18+
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
19+
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> (v1)
20+
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
21+
Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-5-ankit.k.nautiyal@intel.com
22+
(cherry picked from commit f2e2092a979cd46b43445daf23628015ac776ac3)
23+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
24+
25+
# Conflicts:
26+
# drivers/gpu/drm/i915/display/intel_dp_mst.c
27+
diff --cc drivers/gpu/drm/i915/display/intel_dp_mst.c
28+
index 3dc3c85fef64,dc050da29815..000000000000
29+
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
30+
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
31+
@@@ -100,8 -101,15 +100,20 @@@ static int intel_dp_mst_bw_overhead(con
32+
flags |= ssc ? DRM_DP_BW_OVERHEAD_SSC_REF_CLK : 0;
33+
flags |= crtc_state->fec_enable ? DRM_DP_BW_OVERHEAD_FEC : 0;
34+
35+
++<<<<<<< HEAD
36+
+ if (dsc_slice_count)
37+
+ flags |= DRM_DP_BW_OVERHEAD_DSC;
38+
++=======
39+
+ if (dsc) {
40+
+ int num_joined_pipes = intel_crtc_num_joined_pipes(crtc_state);
41+
+
42+
+ flags |= DRM_DP_BW_OVERHEAD_DSC;
43+
+ dsc_slice_count = intel_dp_dsc_get_slice_count(connector,
44+
+ adjusted_mode->clock,
45+
+ adjusted_mode->hdisplay,
46+
+ num_joined_pipes);
47+
+ }
48+
++>>>>>>> f2e2092a979c (drm/i915/display: Use joined pipes in dsc helpers for slices, bpp)
49+
50+
overhead = drm_dp_bw_overhead(crtc_state->lane_count,
51+
adjusted_mode->hdisplay,
52+
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
53+
index 5e17097f703b..e50ed7526f2c 100644
54+
--- a/drivers/gpu/drm/i915/display/intel_dp.c
55+
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
56+
@@ -868,14 +868,14 @@ u32 intel_dp_dsc_nearest_valid_bpp(struct drm_i915_private *i915, u32 bpp, u32 p
57+
static
58+
u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
59+
u32 mode_clock, u32 mode_hdisplay,
60+
- bool bigjoiner)
61+
+ int num_joined_pipes)
62+
{
63+
u32 max_bpp_small_joiner_ram;
64+
65+
/* Small Joiner Check: output bpp <= joiner RAM (bits) / Horiz. width */
66+
max_bpp_small_joiner_ram = small_joiner_ram_size_bits(i915) / mode_hdisplay;
67+
68+
- if (bigjoiner) {
69+
+ if (num_joined_pipes == 2) {
70+
int bigjoiner_interface_bits = DISPLAY_VER(i915) >= 14 ? 36 : 24;
71+
/* With bigjoiner multiple dsc engines are used in parallel so PPC is 2 */
72+
int ppc = 2;
73+
@@ -894,7 +894,7 @@ u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
74+
u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
75+
u32 link_clock, u32 lane_count,
76+
u32 mode_clock, u32 mode_hdisplay,
77+
- bool bigjoiner,
78+
+ int num_joined_pipes,
79+
enum intel_output_format output_format,
80+
u32 pipe_bpp,
81+
u32 timeslots)
82+
@@ -940,7 +940,7 @@ u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
83+
intel_dp_mode_to_fec_clock(mode_clock));
84+
85+
joiner_max_bpp = get_max_compressed_bpp_with_joiner(i915, mode_clock,
86+
- mode_hdisplay, bigjoiner);
87+
+ mode_hdisplay, num_joined_pipes);
88+
bits_per_pixel = min(bits_per_pixel, joiner_max_bpp);
89+
90+
bits_per_pixel = intel_dp_dsc_nearest_valid_bpp(i915, bits_per_pixel, pipe_bpp);
91+
@@ -950,7 +950,7 @@ u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
92+
93+
u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
94+
int mode_clock, int mode_hdisplay,
95+
- bool bigjoiner)
96+
+ int num_joined_pipes)
97+
{
98+
struct drm_i915_private *i915 = to_i915(connector->base.dev);
99+
u8 min_slice_count, i;
100+
@@ -984,14 +984,14 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
101+
102+
/* Find the closest match to the valid slice count values */
103+
for (i = 0; i < ARRAY_SIZE(valid_dsc_slicecount); i++) {
104+
- u8 test_slice_count = valid_dsc_slicecount[i] << bigjoiner;
105+
+ u8 test_slice_count = valid_dsc_slicecount[i] * num_joined_pipes;
106+
107+
if (test_slice_count >
108+
drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd, false))
109+
break;
110+
111+
/* big joiner needs small joiner to be enabled */
112+
- if (bigjoiner && test_slice_count < 4)
113+
+ if (num_joined_pipes == 2 && test_slice_count < 4)
114+
continue;
115+
116+
if (min_slice_count <= test_slice_count)
117+
@@ -1390,14 +1390,14 @@ intel_dp_mode_valid(struct drm_connector *_connector,
118+
max_lanes,
119+
target_clock,
120+
mode->hdisplay,
121+
- joiner,
122+
+ num_joined_pipes,
123+
output_format,
124+
pipe_bpp, 64);
125+
dsc_slice_count =
126+
intel_dp_dsc_get_slice_count(connector,
127+
target_clock,
128+
mode->hdisplay,
129+
- joiner);
130+
+ num_joined_pipes);
131+
}
132+
133+
dsc = dsc_max_compressed_bpp && dsc_slice_count;
134+
@@ -2113,6 +2113,7 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
135+
int dsc_src_min_bpp, dsc_sink_min_bpp, dsc_min_bpp;
136+
int dsc_src_max_bpp, dsc_sink_max_bpp, dsc_max_bpp;
137+
int dsc_joiner_max_bpp;
138+
+ int num_joined_pipes = intel_crtc_num_joined_pipes(pipe_config);
139+
140+
dsc_src_min_bpp = dsc_src_min_compressed_bpp();
141+
dsc_sink_min_bpp = intel_dp_dsc_sink_min_compressed_bpp(pipe_config);
142+
@@ -2127,7 +2128,7 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
143+
144+
dsc_joiner_max_bpp = get_max_compressed_bpp_with_joiner(i915, adjusted_mode->clock,
145+
adjusted_mode->hdisplay,
146+
- pipe_config->joiner_pipes);
147+
+ num_joined_pipes);
148+
dsc_max_bpp = min(dsc_max_bpp, dsc_joiner_max_bpp);
149+
dsc_max_bpp = min(dsc_max_bpp, fxp_q4_to_int(limits->link.max_bpp_x16));
150+
151+
@@ -2312,6 +2313,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
152+
to_intel_connector(conn_state->connector);
153+
const struct drm_display_mode *adjusted_mode =
154+
&pipe_config->hw.adjusted_mode;
155+
+ int num_joined_pipes = intel_crtc_num_joined_pipes(pipe_config);
156+
int ret;
157+
158+
pipe_config->fec_enable = pipe_config->fec_enable ||
159+
@@ -2361,7 +2363,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
160+
intel_dp_dsc_get_slice_count(connector,
161+
adjusted_mode->crtc_clock,
162+
adjusted_mode->crtc_hdisplay,
163+
- pipe_config->joiner_pipes);
164+
+ num_joined_pipes);
165+
if (!dsc_dp_slice_count) {
166+
drm_dbg_kms(&dev_priv->drm,
167+
"Compressed Slice Count not supported\n");
168+
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
169+
index 3aef57dd463a..a0a31fb64716 100644
170+
--- a/drivers/gpu/drm/i915/display/intel_dp.h
171+
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
172+
@@ -143,7 +143,7 @@ int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
173+
u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
174+
u32 link_clock, u32 lane_count,
175+
u32 mode_clock, u32 mode_hdisplay,
176+
- bool bigjoiner,
177+
+ int num_joined_pipes,
178+
enum intel_output_format output_format,
179+
u32 pipe_bpp,
180+
u32 timeslots);
181+
@@ -153,7 +153,7 @@ int intel_dp_dsc_sink_max_compressed_bpp(const struct intel_connector *connector
182+
int bpc);
183+
u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
184+
int mode_clock, int mode_hdisplay,
185+
- bool bigjoiner);
186+
+ int num_joined_pipes);
187+
bool intel_dp_need_joiner(struct intel_dp *intel_dp,
188+
struct intel_connector *connector,
189+
int hdisplay, int clock);
190+
* Unmerged path drivers/gpu/drm/i915/display/intel_dp_mst.c

0 commit comments

Comments
 (0)