[PATCH 21/32] drm/i915/display: Use joined pipes in intel_dp_joiner_needs_dsc
Ankit Nautiyal
ankit.k.nautiyal at intel.com
Wed Sep 4 08:45:32 UTC 2024
In preparation of ultrajoiner, use number of joined pipes in the
intel_dp_joiner_needs_dsc helper, instead of joiner flag.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 19 ++++++++++++++-----
drivers/gpu/drm/i915/display/intel_dp.h | 4 +++-
drivers/gpu/drm/i915/display/intel_dp_mst.c | 13 ++++++++++---
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 5faa0cf81405..54fd7104e560 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -77,6 +77,7 @@
#include "intel_hdmi.h"
#include "intel_hotplug.h"
#include "intel_hotplug_irq.h"
+#include "intel_joiner.h"
#include "intel_lspcon.h"
#include "intel_lvds.h"
#include "intel_modeset_lock.h"
@@ -1306,6 +1307,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
u8 dsc_slice_count = 0;
enum drm_mode_status status;
bool dsc = false, joiner = false;
+ enum intel_joiner_pipe_count joined_pipes = INTEL_JOINER_NO_JOINER_PIPES;
status = intel_cpu_transcoder_mode_valid(dev_priv, mode);
if (status != MODE_OK)
@@ -1329,7 +1331,8 @@ intel_dp_mode_valid(struct drm_connector *_connector,
if (intel_dp_need_joiner(intel_dp, connector,
mode->hdisplay, target_clock)) {
joiner = true;
- max_dotclk *= 2;
+ joined_pipes = INTEL_JOINER_BIG_JOINER_PIPES;
+ max_dotclk *= INTEL_JOINER_BIG_JOINER_PIPES;
}
if (target_clock > max_dotclk)
return MODE_CLOCK_HIGH;
@@ -1387,7 +1390,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
dsc = dsc_max_compressed_bpp && dsc_slice_count;
}
- if (intel_dp_joiner_needs_dsc(dev_priv, joiner) && !dsc)
+ if (intel_dp_joiner_needs_dsc(dev_priv, joined_pipes) && !dsc)
return MODE_CLOCK_HIGH;
if (mode_rate > max_rate && !dsc)
@@ -2495,14 +2498,15 @@ int intel_dp_config_required_rate(const struct intel_crtc_state *crtc_state)
return intel_dp_link_required(adjusted_mode->crtc_clock, bpp);
}
-bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner)
+bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915,
+ enum intel_joiner_pipe_count joined_pipes)
{
/*
* Pipe joiner needs compression up to display 12 due to bandwidth
* limitation. DG2 onwards pipe joiner can be enabled without
* compression.
*/
- return DISPLAY_VER(i915) < 13 && use_joiner;
+ return DISPLAY_VER(i915) < 13 && (joined_pipes == INTEL_JOINER_BIG_JOINER_PIPES);
}
static int
@@ -2520,6 +2524,7 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct link_config_limits limits;
bool dsc_needed, joiner_needs_dsc;
+ enum intel_joiner_pipe_count joined_pipes;
int ret = 0;
if (pipe_config->fec_enable &&
@@ -2531,7 +2536,11 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
adjusted_mode->crtc_clock))
pipe_config->joiner_pipes = GENMASK(crtc->pipe + 1, crtc->pipe);
- joiner_needs_dsc = intel_dp_joiner_needs_dsc(i915, pipe_config->joiner_pipes);
+ joined_pipes = intel_joiner_get_num_pipes(pipe_config);
+ if (joined_pipes >= INTEL_JOINER_INVALID_JOINER_PIPES)
+ drm_warn(&i915->drm, "Invalid joined pipes : %d\n", joined_pipes);
+
+ joiner_needs_dsc = intel_dp_joiner_needs_dsc(i915, joined_pipes);
dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
!intel_dp_compute_config_limits(intel_dp, pipe_config,
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 1b9aaddd8c35..0a14db9bb20f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -8,6 +8,7 @@
#include <linux/types.h>
+enum intel_joiner_pipe_count;
enum intel_output_format;
enum pipe;
enum port;
@@ -123,7 +124,8 @@ int intel_dp_effective_data_rate(int pixel_clock, int bpp_x16,
int bw_overhead);
int intel_dp_max_link_data_rate(struct intel_dp *intel_dp,
int max_dprx_rate, int max_dprx_lanes);
-bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner);
+bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915,
+ enum intel_joiner_pipe_count joined_pipes);
bool intel_dp_has_joiner(struct intel_dp *intel_dp);
bool intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 0fc76455de1f..8b0f8f2dc6f5 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -569,6 +569,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
&pipe_config->hw.adjusted_mode;
struct link_config_limits limits;
bool dsc_needed, joiner_needs_dsc;
+ enum intel_joiner_pipe_count joined_pipes;
int ret = 0;
if (pipe_config->fec_enable &&
@@ -587,7 +588,11 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
pipe_config->has_pch_encoder = false;
- joiner_needs_dsc = intel_dp_joiner_needs_dsc(dev_priv, pipe_config->joiner_pipes);
+ joined_pipes = intel_joiner_get_num_pipes(pipe_config);
+ if (joined_pipes >= INTEL_JOINER_INVALID_JOINER_PIPES)
+ drm_warn(&dev_priv->drm, "Invalid joined pipes : %d\n", joined_pipes);
+
+ joiner_needs_dsc = intel_dp_joiner_needs_dsc(dev_priv, joined_pipes);
dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
!intel_dp_mst_compute_config_limits(intel_dp,
@@ -1427,6 +1432,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
u16 dsc_max_compressed_bpp = 0;
u8 dsc_slice_count = 0;
int target_clock = mode->clock;
+ enum intel_joiner_pipe_count joined_pipes = INTEL_JOINER_NO_JOINER_PIPES;
if (drm_connector_is_unregistered(connector)) {
*status = MODE_ERROR;
@@ -1469,7 +1475,8 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
if (intel_dp_need_joiner(intel_dp, intel_connector,
mode->hdisplay, target_clock)) {
joiner = true;
- max_dotclk *= 2;
+ joined_pipes = INTEL_JOINER_BIG_JOINER_PIPES;
+ max_dotclk *= INTEL_JOINER_BIG_JOINER_PIPES;
}
ret = drm_modeset_lock(&mgr->base.lock, ctx);
@@ -1509,7 +1516,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
dsc = dsc_max_compressed_bpp && dsc_slice_count;
}
- if (intel_dp_joiner_needs_dsc(dev_priv, joiner) && !dsc) {
+ if (intel_dp_joiner_needs_dsc(dev_priv, joined_pipes) && !dsc) {
*status = MODE_CLOCK_HIGH;
return 0;
}
--
2.45.2
More information about the Intel-gfx-trybot
mailing list