mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
drm: rockchip: hdmi: attach HDR_SOURCE_METADATA property
HDR_SOURCE_METADATA property is used to set source hdr metadata, which will be sent to sink though HDMI DRM infoframe. Change-Id: If3500cb505c16c2f0caf66b8e64b4d80b93b228f Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
@@ -794,6 +794,10 @@ dw_hdmi_rockchip_attach_properties(struct drm_connector *connector,
|
||||
hdmi->quant_range = prop;
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
}
|
||||
|
||||
prop = connector->dev->mode_config.hdr_output_metadata_property;
|
||||
if (version >= 0x211a)
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -841,6 +845,7 @@ dw_hdmi_rockchip_set_property(struct drm_connector *connector,
|
||||
void *data)
|
||||
{
|
||||
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
|
||||
struct drm_mode_config *config = &connector->dev->mode_config;
|
||||
|
||||
if (property == hdmi->color_depth_property) {
|
||||
hdmi->colordepth = val;
|
||||
@@ -851,6 +856,8 @@ dw_hdmi_rockchip_set_property(struct drm_connector *connector,
|
||||
} else if (property == hdmi->quant_range) {
|
||||
hdmi->hdmi_quant_range = val;
|
||||
return 0;
|
||||
} else if (property == config->hdr_output_metadata_property) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DRM_ERROR("failed to set rockchip hdmi connector property\n");
|
||||
@@ -866,6 +873,7 @@ dw_hdmi_rockchip_get_property(struct drm_connector *connector,
|
||||
{
|
||||
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
|
||||
struct drm_display_info *info = &connector->display_info;
|
||||
struct drm_mode_config *config = &connector->dev->mode_config;
|
||||
|
||||
if (property == hdmi->color_depth_property) {
|
||||
*val = hdmi->colordepth;
|
||||
@@ -904,6 +912,10 @@ dw_hdmi_rockchip_get_property(struct drm_connector *connector,
|
||||
} else if (property == hdmi->quant_range) {
|
||||
*val = hdmi->hdmi_quant_range;
|
||||
return 0;
|
||||
} else if (property == config->hdr_output_metadata_property) {
|
||||
*val = state->hdr_output_metadata ?
|
||||
state->hdr_output_metadata->base.id : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DRM_ERROR("failed to get rockchip hdmi connector property\n");
|
||||
|
||||
Reference in New Issue
Block a user