Skip to content

Commit 2c4907c

Browse files
committed
drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_params()
Use the connector's DSC DPCD capabilities in intel_dp_dsc_compute_params(). Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 11a33d6 commit 2c4907c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,11 +1636,10 @@ static int intel_dp_get_slice_height(int vactive)
16361636
return 2;
16371637
}
16381638

1639-
static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,
1639+
static int intel_dp_dsc_compute_params(const struct intel_connector *connector,
16401640
struct intel_crtc_state *crtc_state)
16411641
{
1642-
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1643-
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
1642+
struct drm_i915_private *i915 = to_i915(connector->base.dev);
16441643
struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
16451644
u8 line_buf_depth;
16461645
int ret;
@@ -1661,17 +1660,17 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,
16611660
return ret;
16621661

16631662
vdsc_cfg->dsc_version_major =
1664-
(intel_dp->dsc_dpcd[DP_DSC_REV - DP_DSC_SUPPORT] &
1663+
(connector->dp.dsc_dpcd[DP_DSC_REV - DP_DSC_SUPPORT] &
16651664
DP_DSC_MAJOR_MASK) >> DP_DSC_MAJOR_SHIFT;
16661665
vdsc_cfg->dsc_version_minor =
16671666
min(intel_dp_source_dsc_version_minor(i915),
1668-
intel_dp_sink_dsc_version_minor(intel_dp->dsc_dpcd));
1667+
intel_dp_sink_dsc_version_minor(connector->dp.dsc_dpcd));
16691668
if (vdsc_cfg->convert_rgb)
16701669
vdsc_cfg->convert_rgb =
1671-
intel_dp->dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] &
1670+
connector->dp.dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] &
16721671
DP_DSC_RGB;
16731672

1674-
line_buf_depth = drm_dp_dsc_sink_line_buf_depth(intel_dp->dsc_dpcd);
1673+
line_buf_depth = drm_dp_dsc_sink_line_buf_depth(connector->dp.dsc_dpcd);
16751674
if (!line_buf_depth) {
16761675
drm_dbg_kms(&i915->drm,
16771676
"DSC Sink Line Buffer Depth invalid\n");
@@ -1686,7 +1685,7 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,
16861685
DSC_1_1_MAX_LINEBUF_DEPTH_BITS : line_buf_depth;
16871686

16881687
vdsc_cfg->block_pred_enable =
1689-
intel_dp->dsc_dpcd[DP_DSC_BLK_PREDICTION_SUPPORT - DP_DSC_SUPPORT] &
1688+
connector->dp.dsc_dpcd[DP_DSC_BLK_PREDICTION_SUPPORT - DP_DSC_SUPPORT] &
16901689
DP_DSC_BLK_PREDICTION_IS_SUPPORTED;
16911690

16921691
return drm_dsc_compute_rc_parameters(vdsc_cfg);
@@ -2182,7 +2181,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
21822181
if (pipe_config->bigjoiner_pipes || pipe_config->dsc.slice_count > 1)
21832182
pipe_config->dsc.dsc_split = true;
21842183

2185-
ret = intel_dp_dsc_compute_params(&dig_port->base, pipe_config);
2184+
ret = intel_dp_dsc_compute_params(connector, pipe_config);
21862185
if (ret < 0) {
21872186
drm_dbg_kms(&dev_priv->drm,
21882187
"Cannot compute valid DSC parameters for Input Bpp = %d "

0 commit comments

Comments
 (0)