mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
drm/bridge: synopsys: dw-hdmi-qp: Add property to set quant range
quant_range: flags: enum enums: default=0 limit=1 full=2 Change-Id: I6a4d30c2c45cf744a47f93162fd0f81bed75bc73 Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user