Skip to content

Commit dbfbb48

Browse files
committed
drm/i915/display: Use joined pipes in intel_dp_joiner_needs_dsc
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 d095681 In preparation of ultrajoiner, use number of joined pipes in the intel_dp_joiner_needs_dsc helper, instead of joiner flag. v2: Use intel_crtc_num_joined_pipes. (Ville) Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-3-ankit.k.nautiyal@intel.com (cherry picked from commit d095681) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 05569b5 commit dbfbb48

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ bool intel_crtc_is_joiner_primary(const struct intel_crtc_state *crtc_state)
277277
crtc->pipe == joiner_primary_pipe(crtc_state);
278278
}
279279

280-
static int intel_crtc_num_joined_pipes(const struct intel_crtc_state *crtc_state)
280+
int intel_crtc_num_joined_pipes(const struct intel_crtc_state *crtc_state)
281281
{
282282
return hweight8(intel_crtc_joined_pipe_mask(crtc_state));
283283
}

drivers/gpu/drm/i915/display/intel_display.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,5 +586,6 @@ bool assert_port_valid(struct drm_i915_private *i915, enum port port);
586586
})
587587

588588
bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915);
589+
int intel_crtc_num_joined_pipes(const struct intel_crtc_state *crtc_state);
589590

590591
#endif

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
13181318
u8 dsc_slice_count = 0;
13191319
enum drm_mode_status status;
13201320
bool dsc = false, joiner = false;
1321+
int num_joined_pipes;
13211322

13221323
status = intel_cpu_transcoder_mode_valid(dev_priv, mode);
13231324
if (status != MODE_OK)
@@ -1343,6 +1344,9 @@ intel_dp_mode_valid(struct drm_connector *_connector,
13431344
joiner = true;
13441345
max_dotclk *= 2;
13451346
}
1347+
1348+
num_joined_pipes = joiner ? 2 : 1;
1349+
13461350
if (target_clock > max_dotclk)
13471351
return MODE_CLOCK_HIGH;
13481352

@@ -1399,7 +1403,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
13991403
dsc = dsc_max_compressed_bpp && dsc_slice_count;
14001404
}
14011405

1402-
if (intel_dp_joiner_needs_dsc(dev_priv, joiner) && !dsc)
1406+
if (intel_dp_joiner_needs_dsc(dev_priv, num_joined_pipes) && !dsc)
14031407
return MODE_CLOCK_HIGH;
14041408

14051409
if (mode_rate > max_rate && !dsc)
@@ -2507,14 +2511,15 @@ int intel_dp_config_required_rate(const struct intel_crtc_state *crtc_state)
25072511
return intel_dp_link_required(adjusted_mode->crtc_clock, bpp);
25082512
}
25092513

2510-
bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner)
2514+
bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915,
2515+
int num_joined_pipes)
25112516
{
25122517
/*
25132518
* Pipe joiner needs compression up to display 12 due to bandwidth
25142519
* limitation. DG2 onwards pipe joiner can be enabled without
25152520
* compression.
25162521
*/
2517-
return !HAS_UNCOMPRESSED_JOINER(i915) && use_joiner;
2522+
return !HAS_UNCOMPRESSED_JOINER(i915) && num_joined_pipes == 2;
25182523
}
25192524

25202525
static int
@@ -2532,6 +2537,7 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
25322537
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
25332538
struct link_config_limits limits;
25342539
bool dsc_needed, joiner_needs_dsc;
2540+
int num_joined_pipes;
25352541
int ret = 0;
25362542

25372543
if (pipe_config->fec_enable &&
@@ -2543,7 +2549,9 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
25432549
adjusted_mode->crtc_clock))
25442550
pipe_config->joiner_pipes = GENMASK(crtc->pipe + 1, crtc->pipe);
25452551

2546-
joiner_needs_dsc = intel_dp_joiner_needs_dsc(i915, pipe_config->joiner_pipes);
2552+
num_joined_pipes = intel_crtc_num_joined_pipes(pipe_config);
2553+
2554+
joiner_needs_dsc = intel_dp_joiner_needs_dsc(i915, num_joined_pipes);
25472555

25482556
dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
25492557
!intel_dp_compute_config_limits(intel_dp, pipe_config,

drivers/gpu/drm/i915/display/intel_dp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ int intel_dp_effective_data_rate(int pixel_clock, int bpp_x16,
123123
int bw_overhead);
124124
int intel_dp_max_link_data_rate(struct intel_dp *intel_dp,
125125
int max_dprx_rate, int max_dprx_lanes);
126-
bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner);
126+
bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915,
127+
int num_joined_pipes);
127128
bool intel_dp_has_joiner(struct intel_dp *intel_dp);
128129
bool intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state,
129130
const struct drm_connector_state *conn_state);

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
588588
&pipe_config->hw.adjusted_mode;
589589
struct link_config_limits limits;
590590
bool dsc_needed, joiner_needs_dsc;
591+
int num_joined_pipes;
591592
int ret = 0;
592593

593594
if (pipe_config->fec_enable &&
@@ -602,11 +603,13 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
602603
adjusted_mode->crtc_clock))
603604
pipe_config->joiner_pipes = GENMASK(crtc->pipe + 1, crtc->pipe);
604605

606+
num_joined_pipes = intel_crtc_num_joined_pipes(pipe_config);
607+
605608
pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB;
606609
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
607610
pipe_config->has_pch_encoder = false;
608611

609-
joiner_needs_dsc = intel_dp_joiner_needs_dsc(dev_priv, pipe_config->joiner_pipes);
612+
joiner_needs_dsc = intel_dp_joiner_needs_dsc(dev_priv, num_joined_pipes);
610613

611614
dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
612615
!intel_dp_mst_compute_config_limits(intel_dp,
@@ -1446,6 +1449,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
14461449
u16 dsc_max_compressed_bpp = 0;
14471450
u8 dsc_slice_count = 0;
14481451
int target_clock = mode->clock;
1452+
int num_joined_pipes;
14491453

14501454
if (drm_connector_is_unregistered(connector)) {
14511455
*status = MODE_ERROR;
@@ -1491,6 +1495,8 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
14911495
max_dotclk *= 2;
14921496
}
14931497

1498+
num_joined_pipes = joiner ? 2 : 1;
1499+
14941500
ret = drm_modeset_lock(&mgr->base.lock, ctx);
14951501
if (ret)
14961502
return ret;
@@ -1528,7 +1534,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
15281534
dsc = dsc_max_compressed_bpp && dsc_slice_count;
15291535
}
15301536

1531-
if (intel_dp_joiner_needs_dsc(dev_priv, joiner) && !dsc) {
1537+
if (intel_dp_joiner_needs_dsc(dev_priv, num_joined_pipes) && !dsc) {
15321538
*status = MODE_CLOCK_HIGH;
15331539
return 0;
15341540
}

0 commit comments

Comments
 (0)