Skip to content

Commit f52bbfe

Browse files
committed
drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_max_bpp()
Use the connector's DSC DPCD capabilities in intel_dp_dsc_compute_max_bpp() instead of the version stored in the encoder. 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 102c801 commit f52bbfe

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
12151215
* TBD pass the connector BPC,
12161216
* for now U8_MAX so that max BPC on that platform would be picked
12171217
*/
1218-
pipe_bpp = intel_dp_dsc_compute_max_bpp(intel_dp, U8_MAX);
1218+
pipe_bpp = intel_dp_dsc_compute_max_bpp(connector, U8_MAX);
12191219

12201220
/*
12211221
* Output bpp is stored in 6.4 format so right shift by 4 to get the
@@ -1577,9 +1577,10 @@ u8 intel_dp_dsc_max_src_input_bpc(struct drm_i915_private *i915)
15771577
return 0;
15781578
}
15791579

1580-
int intel_dp_dsc_compute_max_bpp(struct intel_dp *intel_dp, u8 max_req_bpc)
1580+
int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
1581+
u8 max_req_bpc)
15811582
{
1582-
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1583+
struct drm_i915_private *i915 = to_i915(connector->base.dev);
15831584
int i, num_bpc;
15841585
u8 dsc_bpc[3] = {0};
15851586
u8 dsc_max_bpc;
@@ -1591,7 +1592,7 @@ int intel_dp_dsc_compute_max_bpp(struct intel_dp *intel_dp, u8 max_req_bpc)
15911592

15921593
dsc_max_bpc = min_t(u8, dsc_max_bpc, max_req_bpc);
15931594

1594-
num_bpc = drm_dp_dsc_sink_supported_input_bpcs(intel_dp->dsc_dpcd,
1595+
num_bpc = drm_dp_dsc_sink_supported_input_bpcs(connector->dp.dsc_dpcd,
15951596
dsc_bpc);
15961597
for (i = 0; i < num_bpc; i++) {
15971598
if (dsc_max_bpc >= dsc_bpc[i])
@@ -2056,6 +2057,8 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20562057
struct link_config_limits *limits)
20572058
{
20582059
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
2060+
struct intel_connector *connector =
2061+
to_intel_connector(conn_state->connector);
20592062
int pipe_bpp, forced_bpp;
20602063
int dsc_src_min_bpp, dsc_sink_min_bpp, dsc_min_bpp;
20612064
int dsc_src_max_bpp, dsc_sink_max_bpp, dsc_max_bpp;
@@ -2068,7 +2071,7 @@ static int intel_edp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
20682071
int max_bpc = min(limits->pipe.max_bpp / 3, (int)conn_state->max_requested_bpc);
20692072

20702073
/* For eDP use max bpp that can be supported with DSC. */
2071-
pipe_bpp = intel_dp_dsc_compute_max_bpp(intel_dp, max_bpc);
2074+
pipe_bpp = intel_dp_dsc_compute_max_bpp(connector, max_bpc);
20722075
if (!is_dsc_pipe_bpp_sufficient(i915, conn_state, limits, pipe_bpp)) {
20732076
drm_dbg_kms(&i915->drm,
20742077
"Computed BPC is not in DSC BPC limits\n");

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ void intel_read_dp_sdp(struct intel_encoder *encoder,
116116
struct intel_crtc_state *crtc_state,
117117
unsigned int type);
118118
bool intel_digital_port_connected(struct intel_encoder *encoder);
119-
int intel_dp_dsc_compute_max_bpp(struct intel_dp *intel_dp, u8 dsc_max_bpc);
119+
int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
120+
u8 dsc_max_bpc);
120121
u16 intel_dp_dsc_get_max_compressed_bpp(struct drm_i915_private *i915,
121122
u32 link_clock, u32 lane_count,
122123
u32 mode_clock, u32 mode_hdisplay,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
10031003
* TBD pass the connector BPC,
10041004
* for now U8_MAX so that max BPC on that platform would be picked
10051005
*/
1006-
int pipe_bpp = intel_dp_dsc_compute_max_bpp(intel_dp, U8_MAX);
1006+
int pipe_bpp = intel_dp_dsc_compute_max_bpp(intel_connector, U8_MAX);
10071007

10081008
if (drm_dp_sink_supports_fec(intel_dp->fec_capable)) {
10091009
dsc_max_compressed_bpp =

0 commit comments

Comments
 (0)