Loading drivers/gpu/drm/drm_connector.c +85 −17 Original line number Diff line number Diff line Loading @@ -882,6 +882,39 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = { { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" }, }; /* * As per DP 1.4a spec, 2.2.5.7.5 VSC SDP Payload for Pixel Encoding/Colorimetry * Format Table 2-120 */ static const struct drm_prop_enum_list dp_colorspaces[] = { /* For Default case, driver will set the colorspace */ { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, { DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, "RGB_Wide_Gamut_Fixed_Point" }, /* Colorimetry based on scRGB (IEC 61966-2-2) */ { DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, "RGB_Wide_Gamut_Floating_Point" }, /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, /* Colorimetry based on SMPTE RP 431-2 */ { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, { DRM_MODE_COLORIMETRY_BT601_YCC, "BT601_YCC" }, { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, /* High Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, /* Colorimetry based on IEC 61966-2-5 [33] */ { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, }; /** * DOC: standard connector properties * Loading Loading @@ -1674,7 +1707,6 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); * DOC: standard connector properties * * Colorspace: * drm_mode_create_colorspace_property - create colorspace property * This property helps select a suitable colorspace based on the sink * capability. Modern sink devices support wider gamut like BT2020. * This helps switch to BT2020 mode if the BT2020 encoded video stream Loading @@ -1694,32 +1726,68 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); * - This property is just to inform sink what colorspace * source is trying to drive. * * Because between HDMI and DP have different colorspaces, * drm_mode_create_hdmi_colorspace_property() is used for HDMI connector and * drm_mode_create_dp_colorspace_property() is used for DP connector. */ /** * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property * @connector: connector to create the Colorspace property on. * * Called by a driver the first time it's needed, must be attached to desired * connectors. * HDMI connectors. * * Returns: * Zero on success, negative errono on failure. */ int drm_mode_create_colorspace_property(struct drm_connector *connector) int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) { struct drm_device *dev = connector->dev; struct drm_property *prop; if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", if (connector->colorspace_property) return 0; connector->colorspace_property = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", hdmi_colorspaces, ARRAY_SIZE(hdmi_colorspaces)); if (!prop) if (!connector->colorspace_property) return -ENOMEM; } else { DRM_DEBUG_KMS("Colorspace property not supported\n"); return 0; } EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); /** * drm_mode_create_dp_colorspace_property - create dp colorspace property * @connector: connector to create the Colorspace property on. * * Called by a driver the first time it's needed, must be attached to desired * DP connectors. * * Returns: * Zero on success, negative errono on failure. */ int drm_mode_create_dp_colorspace_property(struct drm_connector *connector) { struct drm_device *dev = connector->dev; if (connector->colorspace_property) return 0; connector->colorspace_property = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", dp_colorspaces, ARRAY_SIZE(dp_colorspaces)); connector->colorspace_property = prop; if (!connector->colorspace_property) return -ENOMEM; return 0; } EXPORT_SYMBOL(drm_mode_create_colorspace_property); EXPORT_SYMBOL(drm_mode_create_dp_colorspace_property); /** * drm_mode_create_content_type_property - create content type property Loading drivers/gpu/drm/i915/display/intel_connector.c +1 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,7 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector) void intel_attach_colorspace_property(struct drm_connector *connector) { if (!drm_mode_create_colorspace_property(connector)) if (!drm_mode_create_hdmi_colorspace_property(connector)) drm_object_attach_property(&connector->base, connector->colorspace_property, 0); } include/drm/drm_connector.h +6 −1 Original line number Diff line number Diff line Loading @@ -282,6 +282,10 @@ enum drm_panel_orientation { /* Additional Colorimetry extension added as part of CTA 861.G */ #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12 /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ #define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 13 #define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 14 #define DRM_MODE_COLORIMETRY_BT601_YCC 15 /** * enum drm_bus_flags - bus_flags info for &drm_display_info Loading Loading @@ -1579,7 +1583,8 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, int drm_connector_attach_vrr_capable_property( struct drm_connector *connector); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); int drm_mode_create_colorspace_property(struct drm_connector *connector); int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector); int drm_mode_create_dp_colorspace_property(struct drm_connector *connector); int drm_mode_create_content_type_property(struct drm_device *dev); void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, const struct drm_connector_state *conn_state); Loading Loading
drivers/gpu/drm/drm_connector.c +85 −17 Original line number Diff line number Diff line Loading @@ -882,6 +882,39 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = { { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" }, }; /* * As per DP 1.4a spec, 2.2.5.7.5 VSC SDP Payload for Pixel Encoding/Colorimetry * Format Table 2-120 */ static const struct drm_prop_enum_list dp_colorspaces[] = { /* For Default case, driver will set the colorspace */ { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, { DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, "RGB_Wide_Gamut_Fixed_Point" }, /* Colorimetry based on scRGB (IEC 61966-2-2) */ { DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, "RGB_Wide_Gamut_Floating_Point" }, /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, /* Colorimetry based on SMPTE RP 431-2 */ { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, { DRM_MODE_COLORIMETRY_BT601_YCC, "BT601_YCC" }, { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, /* High Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, /* Colorimetry based on IEC 61966-2-5 [33] */ { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, }; /** * DOC: standard connector properties * Loading Loading @@ -1674,7 +1707,6 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); * DOC: standard connector properties * * Colorspace: * drm_mode_create_colorspace_property - create colorspace property * This property helps select a suitable colorspace based on the sink * capability. Modern sink devices support wider gamut like BT2020. * This helps switch to BT2020 mode if the BT2020 encoded video stream Loading @@ -1694,32 +1726,68 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); * - This property is just to inform sink what colorspace * source is trying to drive. * * Because between HDMI and DP have different colorspaces, * drm_mode_create_hdmi_colorspace_property() is used for HDMI connector and * drm_mode_create_dp_colorspace_property() is used for DP connector. */ /** * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property * @connector: connector to create the Colorspace property on. * * Called by a driver the first time it's needed, must be attached to desired * connectors. * HDMI connectors. * * Returns: * Zero on success, negative errono on failure. */ int drm_mode_create_colorspace_property(struct drm_connector *connector) int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) { struct drm_device *dev = connector->dev; struct drm_property *prop; if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", if (connector->colorspace_property) return 0; connector->colorspace_property = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", hdmi_colorspaces, ARRAY_SIZE(hdmi_colorspaces)); if (!prop) if (!connector->colorspace_property) return -ENOMEM; } else { DRM_DEBUG_KMS("Colorspace property not supported\n"); return 0; } EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); /** * drm_mode_create_dp_colorspace_property - create dp colorspace property * @connector: connector to create the Colorspace property on. * * Called by a driver the first time it's needed, must be attached to desired * DP connectors. * * Returns: * Zero on success, negative errono on failure. */ int drm_mode_create_dp_colorspace_property(struct drm_connector *connector) { struct drm_device *dev = connector->dev; if (connector->colorspace_property) return 0; connector->colorspace_property = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", dp_colorspaces, ARRAY_SIZE(dp_colorspaces)); connector->colorspace_property = prop; if (!connector->colorspace_property) return -ENOMEM; return 0; } EXPORT_SYMBOL(drm_mode_create_colorspace_property); EXPORT_SYMBOL(drm_mode_create_dp_colorspace_property); /** * drm_mode_create_content_type_property - create content type property Loading
drivers/gpu/drm/i915/display/intel_connector.c +1 −1 Original line number Diff line number Diff line Loading @@ -277,7 +277,7 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector) void intel_attach_colorspace_property(struct drm_connector *connector) { if (!drm_mode_create_colorspace_property(connector)) if (!drm_mode_create_hdmi_colorspace_property(connector)) drm_object_attach_property(&connector->base, connector->colorspace_property, 0); }
include/drm/drm_connector.h +6 −1 Original line number Diff line number Diff line Loading @@ -282,6 +282,10 @@ enum drm_panel_orientation { /* Additional Colorimetry extension added as part of CTA 861.G */ #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12 /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ #define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 13 #define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 14 #define DRM_MODE_COLORIMETRY_BT601_YCC 15 /** * enum drm_bus_flags - bus_flags info for &drm_display_info Loading Loading @@ -1579,7 +1583,8 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, int drm_connector_attach_vrr_capable_property( struct drm_connector *connector); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); int drm_mode_create_colorspace_property(struct drm_connector *connector); int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector); int drm_mode_create_dp_colorspace_property(struct drm_connector *connector); int drm_mode_create_content_type_property(struct drm_device *dev); void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, const struct drm_connector_state *conn_state); Loading