mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
drm/i915/dp_mst: Extract helper to compute link for given joiner config
Move the joiner-dependent portion of mst_stream_compute_config() into mst_stream_compute_link_for_joined_pipes(), which computes the MST link configuration for a specific num_joined_pipes. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260202103731.357416-10-ankit.k.nautiyal@intel.com
This commit is contained in:
parent
a120f802e0
commit
331a58a603
|
|
@ -595,40 +595,19 @@ mst_stream_compute_config_limits(struct intel_dp *intel_dp,
|
|||
dsc);
|
||||
}
|
||||
|
||||
static int mst_stream_compute_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *pipe_config,
|
||||
struct drm_connector_state *conn_state)
|
||||
static int mst_stream_compute_link_for_joined_pipes(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *pipe_config,
|
||||
struct drm_connector_state *conn_state,
|
||||
int num_joined_pipes)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_atomic_state *state = to_intel_atomic_state(conn_state->state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
||||
struct intel_dp *intel_dp = to_primary_dp(encoder);
|
||||
struct intel_connector *connector =
|
||||
to_intel_connector(conn_state->connector);
|
||||
const struct drm_display_mode *adjusted_mode =
|
||||
&pipe_config->hw.adjusted_mode;
|
||||
struct link_config_limits limits;
|
||||
bool dsc_needed, joiner_needs_dsc;
|
||||
int num_joined_pipes;
|
||||
int ret = 0;
|
||||
|
||||
if (pipe_config->fec_enable &&
|
||||
!intel_dp_supports_fec(intel_dp, connector, pipe_config))
|
||||
return -EINVAL;
|
||||
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return -EINVAL;
|
||||
|
||||
pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB;
|
||||
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
|
||||
pipe_config->has_pch_encoder = false;
|
||||
|
||||
num_joined_pipes = intel_dp_num_joined_pipes(intel_dp, connector,
|
||||
adjusted_mode->crtc_hdisplay,
|
||||
adjusted_mode->crtc_clock);
|
||||
if (num_joined_pipes > 1)
|
||||
pipe_config->joiner_pipes = GENMASK(crtc->pipe + num_joined_pipes - 1, crtc->pipe);
|
||||
|
||||
joiner_needs_dsc = intel_dp_joiner_needs_dsc(display, num_joined_pipes);
|
||||
|
||||
dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
|
||||
|
|
@ -683,6 +662,8 @@ static int mst_stream_compute_config(struct intel_encoder *encoder,
|
|||
ret = intel_dp_dsc_compute_config(intel_dp, pipe_config,
|
||||
conn_state, &limits,
|
||||
pipe_config->dp_m_n.tu);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
|
|
@ -692,6 +673,48 @@ static int mst_stream_compute_config(struct intel_encoder *encoder,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mst_stream_compute_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *pipe_config,
|
||||
struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_atomic_state *state = to_intel_atomic_state(conn_state->state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
||||
struct intel_dp *intel_dp = to_primary_dp(encoder);
|
||||
struct intel_connector *connector =
|
||||
to_intel_connector(conn_state->connector);
|
||||
const struct drm_display_mode *adjusted_mode =
|
||||
&pipe_config->hw.adjusted_mode;
|
||||
int num_joined_pipes;
|
||||
int ret = 0;
|
||||
|
||||
if (pipe_config->fec_enable &&
|
||||
!intel_dp_supports_fec(intel_dp, connector, pipe_config))
|
||||
return -EINVAL;
|
||||
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return -EINVAL;
|
||||
|
||||
pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB;
|
||||
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
|
||||
pipe_config->has_pch_encoder = false;
|
||||
|
||||
num_joined_pipes = intel_dp_num_joined_pipes(intel_dp, connector,
|
||||
adjusted_mode->crtc_hdisplay,
|
||||
adjusted_mode->crtc_clock);
|
||||
if (num_joined_pipes > 1)
|
||||
pipe_config->joiner_pipes = GENMASK(crtc->pipe + num_joined_pipes - 1, crtc->pipe);
|
||||
|
||||
ret = mst_stream_compute_link_for_joined_pipes(encoder,
|
||||
pipe_config,
|
||||
conn_state,
|
||||
num_joined_pipes);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pipe_config->limited_color_range =
|
||||
intel_dp_limited_color_range(pipe_config, conn_state);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user