diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index d4ba989b1c9d..6f2e04ac6281 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -3255,6 +3255,21 @@ static void dw_hdmi_connector_atomic_commit(struct drm_connector *connector, set_dw_hdmi_hdcp_enable(hdmi, connector, state); } +void dw_hdmi_qp_set_quant_range(struct dw_hdmi_qp *hdmi) +{ + void *data = hdmi->plat_data->phy_data; + + if (hdmi->disabled) + return; + + if (hdmi->plat_data->get_quant_range) + hdmi->hdmi_data.quant_range = + hdmi->plat_data->get_quant_range(data); + + hdmi_config_AVI(hdmi, hdmi->curr_conn, &hdmi->previous_mode); +} +EXPORT_SYMBOL_GPL(dw_hdmi_qp_set_quant_range); + void dw_hdmi_qp_set_output_type(struct dw_hdmi_qp *hdmi, u64 val) { hdmi->force_output = val; diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index a0fdcdf3ba9a..88cbe5788030 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -3227,15 +3227,13 @@ dw_hdmi_rockchip_attach_properties(struct drm_connector *connector, drm_object_attach_property(&connector->base, prop, 0); } - if (!hdmi->is_hdmi_qp) { - prop = drm_property_create_enum(connector->dev, 0, - "quant_range", - quant_range_enum_list, - ARRAY_SIZE(quant_range_enum_list)); - if (prop) { - hdmi->quant_range = prop; - drm_object_attach_property(&connector->base, prop, 0); - } + prop = drm_property_create_enum(connector->dev, 0, + "quant_range", + quant_range_enum_list, + ARRAY_SIZE(quant_range_enum_list)); + if (prop) { + hdmi->quant_range = prop; + drm_object_attach_property(&connector->base, prop, 0); } prop = connector->dev->mode_config.hdr_output_metadata_property; @@ -3364,8 +3362,12 @@ dw_hdmi_rockchip_set_property(struct drm_connector *connector, u64 quant_range = hdmi->hdmi_quant_range; hdmi->hdmi_quant_range = val; - if (quant_range != hdmi->hdmi_quant_range) - dw_hdmi_set_quant_range(hdmi->hdmi); + if (quant_range != hdmi->hdmi_quant_range) { + if (hdmi->is_hdmi_qp) + dw_hdmi_qp_set_quant_range(hdmi->hdmi_qp); + else + dw_hdmi_set_quant_range(hdmi->hdmi); + } return 0; } else if (property == config->hdr_output_metadata_property) { return 0; diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 557e5d4efbe9..9e4e4b114914 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -356,6 +356,7 @@ void dw_hdmi_qp_audio_enable(struct dw_hdmi_qp *hdmi); void dw_hdmi_qp_audio_disable(struct dw_hdmi_qp *hdmi); int dw_hdmi_qp_set_plugged_cb(struct dw_hdmi_qp *hdmi, hdmi_codec_plugged_cb fn, struct device *codec_dev); +void dw_hdmi_qp_set_quant_range(struct dw_hdmi_qp *hdmi); void dw_hdmi_qp_set_output_type(struct dw_hdmi_qp *hdmi, u64 val); bool dw_hdmi_qp_get_output_whether_hdmi(struct dw_hdmi_qp *hdmi); int dw_hdmi_qp_get_output_type_cap(struct dw_hdmi_qp *hdmi);