@@ -882,6 +882,47 @@ 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" },
+ /* Colorimetry based on sRGB (IEC 61966-2-1) */
+ { DRM_MODE_COLORIMETRY_CEA_RGB, "CEA_RGB" },
+ { 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" },
+ { DRM_MODE_COLORIMETRY_RGB_CUSTOM_COLOR_PROFILE, "RGB_Custom_Color_Profile" },
+ /* 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" },
+ /*
+ * Colorimetry based on Digital Imaging and Communications in Medicine
+ * (DICOM) Part 14: Grayscale Standard Display Function
+ */
+ { DRM_MODE_COLORIMETRY_Y_ONLY_DICOM_P14_GRAYSCALE, "Y_ONLY_DICOM_Part_14_Grayscale" },
+ { DRM_MODE_COLORIMETRY_RAW_CUSTOM_COLOR_PROFILE, "Raw_Custom_Color_Profile" },
+};
+
/**
* DOC: standard connector properties
*
@@ -1710,6 +1751,14 @@ int drm_mode_create_colorspace_property(struct drm_connector *connector)
ARRAY_SIZE(hdmi_colorspaces));
if (!prop)
return -ENOMEM;
+ } else if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
+ connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+ prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM,
+ "Colorspace",
+ dp_colorspaces,
+ ARRAY_SIZE(dp_colorspaces));
+ if (!prop)
+ return -ENOMEM;
} else {
DRM_DEBUG_KMS("Colorspace property not supported\n");
return 0;
@@ -281,6 +281,14 @@ 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_CEA_RGB 13
+#define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 14
+#define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 15
+#define DRM_MODE_COLORIMETRY_RGB_CUSTOM_COLOR_PROFILE 16
+#define DRM_MODE_COLORIMETRY_BT601_YCC 17
+#define DRM_MODE_COLORIMETRY_Y_ONLY_DICOM_P14_GRAYSCALE 18
+#define DRM_MODE_COLORIMETRY_RAW_CUSTOM_COLOR_PROFILE 19
/**
* enum drm_bus_flags - bus_flags info for &drm_display_info