disp: msm: dp: populate supported colorspace property for DP

Populate the supported colorspaces property for DP
as part of getting the display modes.

This will expose the supported colorspaces of the sink to
userspace and in-turn the userspace shall pick the colorspace
suitable for the use-case.

Change-Id: I70408c719610bc63f9c06dad8cd50f7fa5d94908
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
This commit is contained in:
Abhinav Kumar
2019-05-28 17:16:04 -07:00
父節點 aacd9e9585
當前提交 c79760ba97
共有 3 個文件被更改,包括 34 次插入0 次删除

查看文件

@@ -1480,6 +1480,20 @@ static void sde_connector_update_hdr_props(struct drm_connector *connector)
&hdr, sizeof(hdr), CONNECTOR_PROP_EXT_HDR_INFO);
}
static void sde_connector_update_colorspace(struct drm_connector *connector)
{
int ret;
ret = msm_property_set_property(
sde_connector_get_propinfo(connector),
sde_connector_get_property_state(connector->state),
CONNECTOR_PROP_SUPPORTED_COLORSPACES,
connector->color_enc_fmt);
if (ret)
SDE_ERROR("failed to set colorspace property for connector\n");
}
static enum drm_connector_status
sde_connector_detect(struct drm_connector *connector, bool force)
{
@@ -1919,6 +1933,9 @@ static int sde_connector_get_modes(struct drm_connector *connector)
if (c_conn->hdr_capable)
sde_connector_update_hdr_props(connector);
if (c_conn->connector_type == DRM_MODE_CONNECTOR_DisplayPort)
sde_connector_update_colorspace(connector);
return mode_count;
}
@@ -2388,6 +2405,12 @@ static int _sde_connector_install_properties(struct drm_device *dev,
c_conn->bl_scale = MAX_BL_SCALE_LEVEL;
c_conn->bl_scale_sv = MAX_SV_BL_SCALE_LEVEL;
if (connector_type == DRM_MODE_CONNECTOR_DisplayPort)
msm_property_install_range(&c_conn->property_info,
"supported_colorspaces",
DRM_MODE_PROP_IMMUTABLE, 0, 0xffff, 0,
CONNECTOR_PROP_SUPPORTED_COLORSPACES);
/* enum/bitmask properties */
msm_property_install_enum(&c_conn->property_info, "topology_name",
DRM_MODE_PROP_IMMUTABLE, 0, e_topology_name,