[Intel-gfx] [PATCH 4/4] drm/i915/dp: Limit max_requested_bpc based on src DSC bpc limits

Ankit Nautiyal ankit.k.nautiyal at intel.com
Wed Oct 25 12:13:18 UTC 2023


At the moment the max requested bpc is limited to 6 to 10/12.
For platforms that support DSC, min and max src bpc with DSC are
different.

Account for DSC bpc limitations, when setting min and max value for
max_requested_bpc property.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index abc718f1a878..1935b9014b12 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5907,8 +5907,17 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
 	intel_attach_broadcast_rgb_property(connector);
 	if (HAS_GMCH(dev_priv))
 		drm_connector_attach_max_bpc_property(connector, 6, 10);
-	else if (DISPLAY_VER(dev_priv) >= 5)
-		drm_connector_attach_max_bpc_property(connector, 6, 12);
+	else if (DISPLAY_VER(dev_priv) >= 5) {
+		int min_bpc = 6, max_bpc = 12;
+		struct intel_connector *intel_connector = to_intel_connector(connector);
+
+		if (HAS_DSC(dev_priv) && drm_dp_sink_supports_dsc(intel_connector->dp.dsc_dpcd)) {
+			min_bpc = intel_dp_dsc_min_src_input_bpc(dev_priv);
+			max_bpc = intel_dp_dsc_max_src_input_bpc(dev_priv);
+		}
+
+		drm_connector_attach_max_bpc_property(connector, min_bpc, max_bpc);
+	}
 
 	/* Register HDMI colorspace for case of lspcon */
 	if (intel_bios_encoder_is_lspcon(dp_to_dig_port(intel_dp)->base.devdata)) {
-- 
2.40.1



More information about the Intel-gfx mailing list