Skip to content

Commit bb414c9

Browse files
committed
drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_max_sink_compressed_bppx16()
Use the connector's DSC DPCD capabilities in intel_dp_dsc_max_sink_compressed_bppx16(). Reviewed-by: Stanislav Lisovskiy <[email protected]> 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 0d8665e commit bb414c9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,11 +1767,11 @@ static int dsc_compute_link_config(struct intel_dp *intel_dp,
17671767
}
17681768

17691769
static
1770-
u16 intel_dp_dsc_max_sink_compressed_bppx16(struct intel_dp *intel_dp,
1770+
u16 intel_dp_dsc_max_sink_compressed_bppx16(const struct intel_connector *connector,
17711771
struct intel_crtc_state *pipe_config,
17721772
int bpc)
17731773
{
1774-
u16 max_bppx16 = drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd);
1774+
u16 max_bppx16 = drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd);
17751775

17761776
if (max_bppx16)
17771777
return max_bppx16;
@@ -1810,11 +1810,11 @@ static int dsc_sink_min_compressed_bpp(struct intel_crtc_state *pipe_config)
18101810
return 0;
18111811
}
18121812

1813-
static int dsc_sink_max_compressed_bpp(struct intel_dp *intel_dp,
1813+
static int dsc_sink_max_compressed_bpp(const struct intel_connector *connector,
18141814
struct intel_crtc_state *pipe_config,
18151815
int bpc)
18161816
{
1817-
return intel_dp_dsc_max_sink_compressed_bppx16(intel_dp,
1817+
return intel_dp_dsc_max_sink_compressed_bppx16(connector,
18181818
pipe_config, bpc) >> 4;
18191819
}
18201820

@@ -1913,6 +1913,7 @@ xelpd_dsc_compute_link_config(struct intel_dp *intel_dp,
19131913
}
19141914

19151915
static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
1916+
const struct intel_connector *connector,
19161917
struct intel_crtc_state *pipe_config,
19171918
struct link_config_limits *limits,
19181919
int pipe_bpp,
@@ -1930,7 +1931,7 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
19301931
dsc_min_bpp = max(dsc_min_bpp, to_bpp_int_roundup(limits->link.min_bpp_x16));
19311932

19321933
dsc_src_max_bpp = dsc_src_max_compressed_bpp(intel_dp);
1933-
dsc_sink_max_bpp = dsc_sink_max_compressed_bpp(intel_dp, pipe_config, pipe_bpp / 3);
1934+
dsc_sink_max_bpp = dsc_sink_max_compressed_bpp(connector, pipe_config, pipe_bpp / 3);
19341935
dsc_max_bpp = dsc_sink_max_bpp ? min(dsc_sink_max_bpp, dsc_src_max_bpp) : dsc_src_max_bpp;
19351936

19361937
dsc_joiner_max_bpp = get_max_compressed_bpp_with_joiner(i915, adjusted_mode->clock,
@@ -2002,6 +2003,8 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20022003
int timeslots)
20032004
{
20042005
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
2006+
const struct intel_connector *connector =
2007+
to_intel_connector(conn_state->connector);
20052008
u8 max_req_bpc = conn_state->max_requested_bpc;
20062009
u8 dsc_max_bpc, dsc_max_bpp;
20072010
u8 dsc_min_bpc, dsc_min_bpp;
@@ -2012,7 +2015,7 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20122015
forced_bpp = intel_dp_force_dsc_pipe_bpp(intel_dp, conn_state, limits);
20132016

20142017
if (forced_bpp) {
2015-
ret = dsc_compute_compressed_bpp(intel_dp, pipe_config,
2018+
ret = dsc_compute_compressed_bpp(intel_dp, connector, pipe_config,
20162019
limits, forced_bpp, timeslots);
20172020
if (ret == 0) {
20182021
pipe_config->pipe_bpp = forced_bpp;
@@ -2041,7 +2044,7 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20412044
break;
20422045
if (pipe_bpp > dsc_max_bpp)
20432046
continue;
2044-
ret = dsc_compute_compressed_bpp(intel_dp, pipe_config,
2047+
ret = dsc_compute_compressed_bpp(intel_dp, connector, pipe_config,
20452048
limits, pipe_bpp, timeslots);
20462049
if (ret == 0) {
20472050
pipe_config->pipe_bpp = pipe_bpp;
@@ -2088,7 +2091,7 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20882091
dsc_min_bpp = max(dsc_min_bpp, to_bpp_int_roundup(limits->link.min_bpp_x16));
20892092

20902093
dsc_src_max_bpp = dsc_src_max_compressed_bpp(intel_dp);
2091-
dsc_sink_max_bpp = dsc_sink_max_compressed_bpp(intel_dp, pipe_config, pipe_bpp / 3);
2094+
dsc_sink_max_bpp = dsc_sink_max_compressed_bpp(connector, pipe_config, pipe_bpp / 3);
20922095
dsc_max_bpp = dsc_sink_max_bpp ? min(dsc_sink_max_bpp, dsc_src_max_bpp) : dsc_src_max_bpp;
20932096
dsc_max_bpp = min(dsc_max_bpp, to_bpp_int(limits->link.max_bpp_x16));
20942097

0 commit comments

Comments
 (0)