Skip to contentSkip to conversation

Add Colorspace connector property interface

PATCH Superseded Uma Shankar 3 participants 11 messages Dec 27, 2018 – Jan 9, 2019

Subsystems (3)

v6 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add Colorspace connector property interface

This patch series creates a new connector property to program colorspace to sink devices. Modern sink devices support more than 1 type of colorspace like 601, 709, BT2020 etc. This helps to switch based on content type which is to be displayed. The decision lies with compositors as to in which scenarios, a particular colorspace will be picked.

This will be helpful mostly to switch to higher gamut colorspaces like BT2020 when the media content is encoded as BT2020. Thereby giving a good visual experience to users.

The expectation from userspace is that it should parse the EDID and get supported colorspaces. Use this property and switch to the one supported. Kernel will not give the supported colorspaces since this is panel dependent and our current property infrastructure is not supporting it.

Basically the expectation from userspace is:
- Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink colorspace
- Set this new property to let the sink know what it converted the CRTC output to.
- This property is just to inform sink what colorspace source is trying to drive.

Have tested this using xrandr by using below command:
xrandr --output HDMI2 --set "Colorspace" "BT2020_rgb"

v2: Addressed Ville and Maarten's review comments. Merged the 2nd and 3rd patch into one common logical patch.

v3: Removed Adobe references from enum definitions as per Ville, Hans Verkuil and Jonas Karlman suggestions. Changed default to an unset state where driver will assign the colorspace when not chosen by user, suggested by Ville and Maarten. Addressed other misc review comments from Maarten. Split the changes to have separate colorspace property for DP and HDMI.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard. Handled the default case more efficiently.

v5: Modified the colorspace property creation helper to take platform specific enum list based on the capabilities of the platform as suggested by Shashank. With this there is no need for segregation between DP and HDMI.

v6: Addressed Shashank's review comments.

Uma Shankar (2):
drm: Add colorspace connector property drm/i915: Attach colorspace property and enable modeset

 drivers/gpu/drm/drm_atomic_uapi.c      |  4 ++
 drivers/gpu/drm/drm_connector.c        | 82 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 ++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 18 ++++++++
 include/drm/drm_connector.h            | 17 +++++++
 include/uapi/drm/drm_mode.h            | 33 ++++++++++++++
 8 files changed, 219 insertions(+)
Signature · 23 lines
1.9.1

Uma Shankar (2):
  drm: Add colorspace connector property
  drm/i915: Attach colorspace property and enable modeset

 drivers/gpu/drm/drm_atomic_uapi.c      |  4 ++
 drivers/gpu/drm/drm_connector.c        | 79 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 +++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 19 ++++++++
 include/drm/drm_connector.h            | 17 ++++++++
 include/uapi/drm/drm_mode.h            | 33 ++++++++++++++
 8 files changed, 217 insertions(+)

-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.CHECKPATCH: warning for Add Colorspace connector property interface (rev6)

== Series Details ==

== Series Details ==

Series: Add Colorspace connector property interface (rev6)
URL : https://patchwork.freedesktop.org/series/47132/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
cf8d05e1f401 drm: Add colorspace connector property
0116721231c7 drm/i915: Attach colorspace property and enable modeset
-:115: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#115: FILE: drivers/gpu/drm/i915/intel_connector.c:316:
+		if (!drm_mode_create_colorspace_property(connector,
+			gen10_hdmi_colorspaces,

-:118: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #118: FILE: drivers/gpu/drm/i915/intel_connector.c:319:
+ drm_object_attach_property(&connector->base,
+ connector->colorspace_property, 0);

-:121: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #121: FILE: drivers/gpu/drm/i915/intel_connector.c:322:
+ if (!drm_mode_create_colorspace_property(connector,
+ legacy_hdmi_colorspaces,

-:124: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #124: FILE: drivers/gpu/drm/i915/intel_connector.c:325:
+ drm_object_attach_property(&connector->base,
+ connector->colorspace_property, 0);

total: 0 errors, 0 warnings, 4 checks, 117 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.SPARSE: warning for Add Colorspace connector property interface (rev6)

In reply to Uma Shankar
== Series Details ==

== Series Details ==

Series: Add Colorspace connector property interface (rev6)
URL : https://patchwork.freedesktop.org/series/47132/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Sparse version: v0.5.2
Commit: drm: Add colorspace connector property
Okay!

Commit: drm/i915: Attach colorspace property and enable modeset
+drivers/gpu/drm/i915/intel_hdmi.c:510:51: int enum absolute_colorimetry_list versus
+drivers/gpu/drm/i915/intel_hdmi.c:510:51: int enum hdmi_colorimetry
+drivers/gpu/drm/i915/intel_hdmi.c:510:51: warning: mixing different enum types

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

PATCH v6 1/2 drm: Add colorspace connector property

In reply to Uma Shankar

This patch adds a colorspace connector property, enabling userspace to switch to various supported colorspaces. This will help enable BT2020 along with other colorspaces.

v2: Addressed Maarten and Ville's review comments. Enhanced the colorspace enum to incorporate both HDMI and DP supported colorspaces. Also, added a default option for colorspace.

v3: Removed Adobe references from enum definitions as per Ville, Hans Verkuil and Jonas Karlman suggestions. Changed Default to an unset state where driver will assign the colorspace is not chosen by user, suggested by Ville and Maarten. Addressed other misc review comments from Maarten. Split the changes to have separate colorspace property for DP and HDMI.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard.

v5: Made the property creation helper accept enum list based on platform capabilties as suggested by Shashank. Consolidated HDMI and DP property creation in the common helper.

v6: Addressed Shashank's review comments.

---
 drivers/gpu/drm/drm_atomic_uapi.c |  4 ++
 drivers/gpu/drm/drm_connector.c   | 79 +++++++++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h       | 17 +++++++++
 include/uapi/drm/drm_mode.h       | 33 ++++++++++++++++
 4 files changed, 133 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +4 -0
index c408898..5e03292 100644
@@ -746,6 +746,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 			return -EINVAL;
 		}
 		state->content_protection = val;
+	} else if (property == connector->colorspace_property) {
+		state->colorspace = val;
 	} else if (property == config->writeback_fb_id_property) {
 		struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val);
 		int ret = drm_atomic_set_writeback_fb_for_connector(state, fb);
@@ -814,6 +816,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 		*val = state->picture_aspect_ratio;
 	} else if (property == config->content_type_property) {
 		*val = state->content_type;
+	} else if (property == connector->colorspace_property) {
+		*val = state->colorspace;
 	} else if (property == connector->scaling_mode_property) {
 		*val = state->scaling_mode;
 	} else if (property == connector->content_protection_property) {
drivers/gpu/drm/drm_connector.c +79 -0

91 lines not on this page · raw message

include/drm/drm_connector.h +17 -0
index f82701d..79fca87 100644
@@ -31,6 +31,7 @@
 #include <drm/drm_util.h>
 
 #include <uapi/drm/drm_mode.h>
+#include <drm/drm_property.h>
 
 struct drm_connector_helper_funcs;
 struct drm_modeset_acquire_ctx;
@@ -497,6 +498,13 @@ struct drm_connector_state {
 	unsigned int content_protection;
 
 	/**
+	 * @colorspace: State variable for Connector property to request
+	 * colorspace change on Sink. This is most commonly used to switch
+	 * to wider color gamuts like BT2020.
+	 */
+	enum absolute_colorimetry_list colorspace;
+
+	/**
 	 * @writeback_job: Writeback job for writeback connectors
 	 *
 	 * Holds the framebuffer and out-fence for a writeback connector. As
@@ -989,6 +997,12 @@ struct drm_connector {
 	struct drm_property *content_protection_property;
 
 	/**
+	 * @colorspace_property: Connector property to set the suitable
+	 * colorspace supported by the sink.
+	 */
+	struct drm_property *colorspace_property;
+
+	/**
 	 * @path_blob_ptr:
 	 *
 	 * DRM blob property data for the DP MST path property. This should only
@@ -1263,6 +1277,9 @@ int drm_connector_attach_vrr_capable_property(
 int drm_connector_attach_content_protection_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,
+					const struct drm_prop_enum_list *props,
+					int num_values);
 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);
include/uapi/drm/drm_mode.h +33 -0
index a439c2e..4406dcf 100644
@@ -210,6 +210,39 @@
 #define DRM_MODE_CONTENT_PROTECTION_DESIRED     1
 #define DRM_MODE_CONTENT_PROTECTION_ENABLED     2
 
+/*
+ * This is a consolidated colorimetry list supported by HDMI and
+ * DP protocol standard. The respective connectors will register
+ * a property with the subset of this list (supported by that
+ * respective protocol). Userspace will set the colorspace through
+ * a colorspace property which will be created and exposed to
+ * userspace.
+ */
+enum absolute_colorimetry_list {
+	/* For Default case, driver will set the colorspace */
+	COLORIMETRY_DEFAULT = 0,
+	/* CEA 861 Normal Colorimetry options */
+	COLORIMETRY_ITU_601,
+	COLORIMETRY_ITU_709,
+	/* CEA 861 Extended Colorimetry Options */
+	COLORIMETRY_XV_YCC_601,
+	COLORIMETRY_XV_YCC_709,
+	COLORIMETRY_S_YCC_601,
+	COLORIMETRY_OPYCC_601,
+	COLORIMETRY_OPRGB,
+	COLORIMETRY_BT2020_RGB,
+	COLORIMETRY_BT2020_YCC,
+	COLORIMETRY_BT2020_CYCC,
+	/* DP MSA Colorimetry Options */
+	DP_COLORIMETRY_Y_CBCR_ITU_601,
+	DP_COLORIMETRY_Y_CBCR_ITU_709,
+	DP_COLORIMETRY_SRGB,
+	DP_COLORIMETRY_RGB_WIDE_GAMUT,
+	DP_COLORIMETRY_SCRGB,
+	DP_COLORIMETRY_DCI_P3,
+	DP_COLORIMETRY_CUSTOM_COLOR_PROFILE,
+};
+
 struct drm_mode_modeinfo {
 	__u32 clock;
 	__u16 hdisplay;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [v6 1/2] drm: Add colorspace connector property

Hi Uma,

Quoted 234 lines · Uma Shankar

This patch adds a colorspace connector property, enabling userspace to switch to various supported colorspaces. This will help enable BT2020 along with other colorspaces.

v2: Addressed Maarten and Ville's review comments. Enhanced the colorspace enum to incorporate both HDMI and DP supported colorspaces. Also, added a default option for colorspace.

v3: Removed Adobe references from enum definitions as per Ville, Hans Verkuil and Jonas Karlman suggestions. Changed Default to an unset state where driver will assign the colorspace is not chosen by user, suggested by Ville and Maarten. Addressed other misc review comments from Maarten. Split the changes to have separate colorspace property for DP and HDMI.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard.

v5: Made the property creation helper accept enum list based on platform capabilties as suggested by Shashank. Consolidated HDMI and DP property creation in the common helper.

v6: Addressed Shashank's review comments.

---
 drivers/gpu/drm/drm_atomic_uapi.c |  4 ++
 drivers/gpu/drm/drm_connector.c   | 79 +++++++++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h       | 17 +++++++++
 include/uapi/drm/drm_mode.h       | 33 ++++++++++++++++
 4 files changed, 133 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +4 -0
index c408898..5e03292 100644
@@ -746,6 +746,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 			return -EINVAL;
 		}
 		state->content_protection = val;
+	} else if (property == connector->colorspace_property) {
+		state->colorspace = val;
 	} else if (property == config->writeback_fb_id_property) {
 		struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val);
 		int ret = drm_atomic_set_writeback_fb_for_connector(state, fb);
@@ -814,6 +816,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 		*val = state->picture_aspect_ratio;
 	} else if (property == config->content_type_property) {
 		*val = state->content_type;
+	} else if (property == connector->colorspace_property) {
+		*val = state->colorspace;
 	} else if (property == connector->scaling_mode_property) {
 		*val = state->scaling_mode;
 	} else if (property == connector->content_protection_property) {
drivers/gpu/drm/drm_connector.c +79 -0
index 8475396..ad1b862 100644
@@ -826,6 +826,54 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
 };
 DRM_ENUM_NAME_FN(drm_get_content_protection_name, drm_cp_enum_list)
 
+/* List of HDMI Colorspaces supported */
+static const struct drm_prop_enum_list hdmi_colorspaces[] = {
+	/* For Default case, driver will set the colorspace */
+	{ COLORIMETRY_DEFAULT, "Default" },
+	/* Standard Definition Colorimetry based on CEA 861 */
+	{ COLORIMETRY_ITU_601, "ITU_601" },
+	{ COLORIMETRY_ITU_709, "ITU_709" },
+	/* Standard Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_601, "XV_YCC_601" },
+	/* High Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_709, "XV_YCC_709" },
+	/* Colorimetry based on IEC 61966-2-1/Amendment 1 */
+	{ COLORIMETRY_S_YCC_601, "S_YCC_601" },
+	/* Colorimetry based on IEC 61966-2-5 [33] */
+	{ COLORIMETRY_OPYCC_601, "opYCC_601" },
+	/* Colorimetry based on IEC 61966-2-5 */
+	{ COLORIMETRY_OPRGB, "opRGB" },
+	/* Colorimetry based on ITU-R BT.2020 */
+	{ COLORIMETRY_BT2020_RGB, "BT2020_RGB" },
+	/* Colorimetry based on ITU-R BT.2020 */
+	{ COLORIMETRY_BT2020_YCC, "BT2020_YCC" },
+	/* Colorimetry based on ITU-R BT.2020 */
+	{ COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" },
+};
+
+/* List of DP Colorspaces supported */
+static const struct drm_prop_enum_list dp_colorspaces[] = {
+	/* For Default case, driver will set the colorspace */
+	{ COLORIMETRY_DEFAULT, "Default" },
+	/* Standard Definition Colorimetry based on CEA 861 */
+	{ COLORIMETRY_ITU_601, "ITU_601" },
+	{ COLORIMETRY_ITU_709, "ITU_709" },
+	/* Standard Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_601, "XV_YCC_601" },
+	/* High Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_709, "XV_YCC_709" },
+	/* Colorimetry based on IEC 61966-2-5 */
+	{ COLORIMETRY_OPRGB, "opRGB" },
+	/* DP MSA Colorimetry */
+	{ DP_COLORIMETRY_Y_CBCR_ITU_601, "YCBCR_ITU_601" },
+	{ DP_COLORIMETRY_Y_CBCR_ITU_709, "YCBCR_ITU_709" },
+	{ DP_COLORIMETRY_SRGB, "sRGB" },
+	{ DP_COLORIMETRY_RGB_WIDE_GAMUT, "RGB Wide Gamut" },
+	{ DP_COLORIMETRY_SCRGB, "scRGB" },
+	{ DP_COLORIMETRY_DCI_P3, "DCI-P3" },
+	{ DP_COLORIMETRY_CUSTOM_COLOR_PROFILE, "Custom Profile" },
+};
+
 /**
  * DOC: standard connector properties
  *
@@ -1548,6 +1596,37 @@ int drm_mode_create_aspect_ratio_property(struct drm_device *dev)
 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
+ *     is being played by the user, same for any other colorspace.
+ *     Called by a driver the first time it's needed, must be attached to
+ *     desired connectors.
+ */
+int drm_mode_create_colorspace_property(struct drm_connector *connector,
+					const struct drm_prop_enum_list *props,
+					int num_values)
+{
+	struct drm_device *dev = connector->dev;
+	struct drm_property *prop;
+
+	prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM,
+					"Colorspace",
+					props, num_values);
+	if (!prop)
+		return -ENOMEM;
+
+	connector->colorspace_property = prop;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_colorspace_property);
+
+/**
  * drm_mode_create_content_type_property - create content type property
  * @dev: DRM device
  *
include/drm/drm_connector.h +17 -0
index f82701d..79fca87 100644
@@ -31,6 +31,7 @@
 #include <drm/drm_util.h>
 
 #include <uapi/drm/drm_mode.h>
+#include <drm/drm_property.h>
 
 struct drm_connector_helper_funcs;
 struct drm_modeset_acquire_ctx;
@@ -497,6 +498,13 @@ struct drm_connector_state {
 	unsigned int content_protection;
 
 	/**
+	 * @colorspace: State variable for Connector property to request
+	 * colorspace change on Sink. This is most commonly used to switch
+	 * to wider color gamuts like BT2020.
+	 */
+	enum absolute_colorimetry_list colorspace;
+
+	/**
 	 * @writeback_job: Writeback job for writeback connectors
 	 *
 	 * Holds the framebuffer and out-fence for a writeback connector. As
@@ -989,6 +997,12 @@ struct drm_connector {
 	struct drm_property *content_protection_property;
 
 	/**
+	 * @colorspace_property: Connector property to set the suitable
+	 * colorspace supported by the sink.
+	 */
+	struct drm_property *colorspace_property;
+
+	/**
 	 * @path_blob_ptr:
 	 *
 	 * DRM blob property data for the DP MST path property. This should only
@@ -1263,6 +1277,9 @@ int drm_connector_attach_vrr_capable_property(
 int drm_connector_attach_content_protection_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,
+					const struct drm_prop_enum_list *props,
+					int num_values);
 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);
include/uapi/drm/drm_mode.h +23 -0
index a439c2e..4406dcf 100644
@@ -210,6 +210,39 @@
 #define DRM_MODE_CONTENT_PROTECTION_DESIRED     1
 #define DRM_MODE_CONTENT_PROTECTION_ENABLED     2
 
+/*
+ * This is a consolidated colorimetry list supported by HDMI and
+ * DP protocol standard. The respective connectors will register
+ * a property with the subset of this list (supported by that
+ * respective protocol). Userspace will set the colorspace through
+ * a colorspace property which will be created and exposed to
+ * userspace.
+ */
+enum absolute_colorimetry_list {
+	/* For Default case, driver will set the colorspace */
+	COLORIMETRY_DEFAULT = 0,
+	/* CEA 861 Normal Colorimetry options */
+	COLORIMETRY_ITU_601,
+	COLORIMETRY_ITU_709,
+	/* CEA 861 Extended Colorimetry Options */
+	COLORIMETRY_XV_YCC_601,
+	COLORIMETRY_XV_YCC_709,
+	COLORIMETRY_S_YCC_601,
+	COLORIMETRY_OPYCC_601,
+	COLORIMETRY_OPRGB,
+	COLORIMETRY_BT2020_RGB,
+	COLORIMETRY_BT2020_YCC,
+	COLORIMETRY_BT2020_CYCC,

include/uapi/drm/drm_mode.h line 245

Quoted 10 lines
include/uapi/drm/drm_mode.h +10 -0
+	/* DP MSA Colorimetry Options */
+	DP_COLORIMETRY_Y_CBCR_ITU_601,
+	DP_COLORIMETRY_Y_CBCR_ITU_709,
+	DP_COLORIMETRY_SRGB,
+	DP_COLORIMETRY_RGB_WIDE_GAMUT,
+	DP_COLORIMETRY_SCRGB,
+	DP_COLORIMETRY_DCI_P3,
+	DP_COLORIMETRY_CUSTOM_COLOR_PROFILE,
+};
+

I think the general intention is not to include property enum values in UAPI, and for userspace to instead match on strings. See the discussion at the start of this IRC log:
https://people.freedesktop.org/~cbrill/dri-log//?channel=dri-devel&date=2018-04-27

...though that does rather imply that we should maybe be putting the strings into uapi/ instead so that we don't inadvertently break userspace.

Thanks,
-Brian

Quoted 6 lines
include/uapi/drm/drm_mode.h +0 -0
 struct drm_mode_modeinfo {
 	__u32 clock;
 	__u16 hdisplay;
Signature · 1 line
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Re: [v6 1/2] drm: Add colorspace connector property

Quoted 277 lines

-----Original Message-----
From: Brian Starkey [mailto:[email protected]]
Sent: Tuesday, January 8, 2019 7:43 PM
To: Shankar, Uma <[email protected]>
Cc: [email protected]; [email protected]; Lankhorst, Maarten <[email protected]>; Syrjala, Ville <[email protected]>; Sharma, Shashank <[email protected]>; nd <[email protected]>
Subject: Re: [v6 1/2] drm: Add colorspace connector property

Hi Uma,

Quoted 23 lines · Uma Shankar

This patch adds a colorspace connector property, enabling userspace to switch to various supported colorspaces.
This will help enable BT2020 along with other colorspaces.

v2: Addressed Maarten and Ville's review comments. Enhanced the colorspace enum to incorporate both HDMI and DP supported colorspaces. Also, added a default option for colorspace.

v3: Removed Adobe references from enum definitions as per Ville, Hans Verkuil and Jonas Karlman suggestions. Changed Default to an unset state where driver will assign the colorspace is not chosen by user, suggested by Ville and Maarten. Addressed other misc review comments from Maarten. Split the changes to have separate colorspace property for DP and HDMI.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard.

v5: Made the property creation helper accept enum list based on platform capabilties as suggested by Shashank. Consolidated HDMI and DP property creation in the common helper.

Quoted 7 lines

v6: Addressed Shashank's review comments.

---
 drivers/gpu/drm/drm_atomic_uapi.c |  4 ++
 drivers/gpu/drm/drm_connector.c   | 79

+++++++++++++++++++++++++++++++++++++++

drivers/gpu/drm/drm_atomic_uapi.c static int drm_atomic_connector_set_property(struct

Quoted 10 lines
 include/drm/drm_connector.h       | 17 +++++++++
 include/uapi/drm/drm_mode.h       | 33 ++++++++++++++++
 4 files changed, 133 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +0 -0
index c408898..5e03292 100644
@@ -746,6 +746,8 @@ static int drm_atomic_connector_set_property(struct

drm_connector *connector,

drivers/gpu/drm/drm_atomic_uapi.c static int drm_atomic_connector_set_property(struct drm_connector *connector,

Quoted 7 lines
drivers/gpu/drm/drm_atomic_uapi.c +2 -0
 			return -EINVAL;
 		}
 		state->content_protection = val;
+	} else if (property == connector->colorspace_property) {
+		state->colorspace = val;
 	} else if (property == config->writeback_fb_id_property) {
 		struct drm_framebuffer *fb = drm_framebuffer_lookup(dev,

NULL, val);

drivers/gpu/drm/drm_atomic_uapi.c static int drm_atomic_connector_set_property(struct · line 753

Quoted 1 line
drivers/gpu/drm/drm_atomic_uapi.c +0 -0
 		int ret = drm_atomic_set_writeback_fb_for_connector(state,

fb); @@

Quoted 1 line

-814,6 +816,8 @@ static int drm_atomic_connector_set_property(struct

drm_connector *connector,

Quoted 13 lines
drivers/gpu/drm/drm_atomic_uapi.c +2 -0
 		*val = state->picture_aspect_ratio;
 	} else if (property == config->content_type_property) {
 		*val = state->content_type;
+	} else if (property == connector->colorspace_property) {
+		*val = state->colorspace;
 	} else if (property == connector->scaling_mode_property) {
 		*val = state->scaling_mode;
 	} else if (property == connector->content_protection_property) {
(quoted diff) +0 -0

b/drivers/gpu/drm/drm_connector.c index 8475396..ad1b862 100644

drivers/gpu/drm/drm_connector.c int drm_display_info_set_bus_formats(struct · line 827

Quoted 2 lines
drivers/gpu/drm/drm_connector.c +0 -0
@@ -826,6 +826,54 @@ int drm_display_info_set_bus_formats(struct
 drm_display_info *info,  };
 DRM_ENUM_NAME_FN(drm_get_content_protection_name,

drm_cp_enum_list)

Quoted 57 lines
drivers/gpu/drm/drm_connector.c +48 -0
+/* List of HDMI Colorspaces supported */ static const struct
+drm_prop_enum_list hdmi_colorspaces[] = {
+	/* For Default case, driver will set the colorspace */
+	{ COLORIMETRY_DEFAULT, "Default" },
+	/* Standard Definition Colorimetry based on CEA 861 */
+	{ COLORIMETRY_ITU_601, "ITU_601" },
+	{ COLORIMETRY_ITU_709, "ITU_709" },
+	/* Standard Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_601, "XV_YCC_601" },
+	/* High Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_709, "XV_YCC_709" },
+	/* Colorimetry based on IEC 61966-2-1/Amendment 1 */
+	{ COLORIMETRY_S_YCC_601, "S_YCC_601" },
+	/* Colorimetry based on IEC 61966-2-5 [33] */
+	{ COLORIMETRY_OPYCC_601, "opYCC_601" },
+	/* Colorimetry based on IEC 61966-2-5 */
+	{ COLORIMETRY_OPRGB, "opRGB" },
+	/* Colorimetry based on ITU-R BT.2020 */
+	{ COLORIMETRY_BT2020_RGB, "BT2020_RGB" },
+	/* Colorimetry based on ITU-R BT.2020 */
+	{ COLORIMETRY_BT2020_YCC, "BT2020_YCC" },
+	/* Colorimetry based on ITU-R BT.2020 */
+	{ COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, };
+
+/* List of DP Colorspaces supported */ static const struct
+drm_prop_enum_list dp_colorspaces[] = {
+	/* For Default case, driver will set the colorspace */
+	{ COLORIMETRY_DEFAULT, "Default" },
+	/* Standard Definition Colorimetry based on CEA 861 */
+	{ COLORIMETRY_ITU_601, "ITU_601" },
+	{ COLORIMETRY_ITU_709, "ITU_709" },
+	/* Standard Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_601, "XV_YCC_601" },
+	/* High Definition Colorimetry based on IEC 61966-2-4 */
+	{ COLORIMETRY_XV_YCC_709, "XV_YCC_709" },
+	/* Colorimetry based on IEC 61966-2-5 */
+	{ COLORIMETRY_OPRGB, "opRGB" },
+	/* DP MSA Colorimetry */
+	{ DP_COLORIMETRY_Y_CBCR_ITU_601, "YCBCR_ITU_601" },
+	{ DP_COLORIMETRY_Y_CBCR_ITU_709, "YCBCR_ITU_709" },
+	{ DP_COLORIMETRY_SRGB, "sRGB" },
+	{ DP_COLORIMETRY_RGB_WIDE_GAMUT, "RGB Wide Gamut" },
+	{ DP_COLORIMETRY_SCRGB, "scRGB" },
+	{ DP_COLORIMETRY_DCI_P3, "DCI-P3" },
+	{ DP_COLORIMETRY_CUSTOM_COLOR_PROFILE, "Custom Profile" }, };
+
 /**
  * DOC: standard connector properties
  *
@@ -1548,6 +1596,37 @@ int
 drm_mode_create_aspect_ratio_property(struct drm_device *dev)
 EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property);
 
 /**
+ * DOC: standard connector properties
+ *

drivers/gpu/drm/drm_connector.c int · line 1611

Quoted 10 lines
drivers/gpu/drm/drm_connector.c +10 -0
+ * 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
+ *     is being played by the user, same for any other colorspace.
+ *     Called by a driver the first time it's needed, must be attached to
+ *     desired connectors.
+ */
+int drm_mode_create_colorspace_property(struct drm_connector

*connector,

drivers/gpu/drm/drm_connector.c int · line 1612

Quoted 1 line
drivers/gpu/drm/drm_connector.c +1 -0
+					const struct drm_prop_enum_list

*props,

Quoted 63 lines
drivers/gpu/drm/drm_connector.c +18 -0
+					int num_values)
+{
+	struct drm_device *dev = connector->dev;
+	struct drm_property *prop;
+
+	prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM,
+					"Colorspace",
+					props, num_values);
+	if (!prop)
+		return -ENOMEM;
+
+	connector->colorspace_property = prop;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_colorspace_property);
+
+/**
  * drm_mode_create_content_type_property - create content type property
  * @dev: DRM device

*

include/drm/drm_connector.h +14 -0
index f82701d..79fca87 100644
@@ -31,6 +31,7 @@
 #include <drm/drm_util.h>
 
 #include <uapi/drm/drm_mode.h>
+#include <drm/drm_property.h>
 
 struct drm_connector_helper_funcs;
 struct drm_modeset_acquire_ctx;
@@ -497,6 +498,13 @@ struct drm_connector_state {
 	unsigned int content_protection;
 
 	/**
+	 * @colorspace: State variable for Connector property to request
+	 * colorspace change on Sink. This is most commonly used to switch
+	 * to wider color gamuts like BT2020.
+	 */
+	enum absolute_colorimetry_list colorspace;
+
+	/**
 	 * @writeback_job: Writeback job for writeback connectors
 	 *
 	 * Holds the framebuffer and out-fence for a writeback connector. As
@@ -989,6 +997,12 @@ struct drm_connector {
 	struct drm_property *content_protection_property;
 
 	/**
+	 * @colorspace_property: Connector property to set the suitable
+	 * colorspace supported by the sink.
+	 */
+	struct drm_property *colorspace_property;
+
+	/**
 	 * @path_blob_ptr:
 	 *
 	 * DRM blob property data for the DP MST path property. This should

only @@ -1263,6 +1277,9 @@ int drm_connector_attach_vrr_capable_property(
int drm_connector_attach_content_protection_property(

include/drm/drm_connector.h int drm_connector_attach_vrr_capable_property(

Quoted 3 lines
include/drm/drm_connector.h +1 -0
 		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,

include/drm/drm_connector.h

Quoted 1 line
include/drm/drm_connector.h +1 -0
+					const struct drm_prop_enum_list

*props,

Quoted 3 lines
include/drm/drm_connector.h +1 -0
+					int num_values);
 int drm_mode_create_content_type_property(struct drm_device *dev);

void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe

*frame,

Quoted 1 line

const struct drm_connector_state

*conn_state); diff --git

Quoted 31 lines

a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index a439c2e..4406dcf 100644

include/uapi/drm/drm_mode.h +23 -0
@@ -210,6 +210,39 @@
 #define DRM_MODE_CONTENT_PROTECTION_DESIRED     1
 #define DRM_MODE_CONTENT_PROTECTION_ENABLED     2
 
+/*
+ * This is a consolidated colorimetry list supported by HDMI and
+ * DP protocol standard. The respective connectors will register
+ * a property with the subset of this list (supported by that
+ * respective protocol). Userspace will set the colorspace through
+ * a colorspace property which will be created and exposed to
+ * userspace.
+ */
+enum absolute_colorimetry_list {
+	/* For Default case, driver will set the colorspace */
+	COLORIMETRY_DEFAULT = 0,
+	/* CEA 861 Normal Colorimetry options */
+	COLORIMETRY_ITU_601,
+	COLORIMETRY_ITU_709,
+	/* CEA 861 Extended Colorimetry Options */
+	COLORIMETRY_XV_YCC_601,
+	COLORIMETRY_XV_YCC_709,
+	COLORIMETRY_S_YCC_601,
+	COLORIMETRY_OPYCC_601,
+	COLORIMETRY_OPRGB,
+	COLORIMETRY_BT2020_RGB,
+	COLORIMETRY_BT2020_YCC,
+	COLORIMETRY_BT2020_CYCC,

include/uapi/drm/drm_mode.h line 245

Quoted 10 lines
include/uapi/drm/drm_mode.h +10 -0
+	/* DP MSA Colorimetry Options */
+	DP_COLORIMETRY_Y_CBCR_ITU_601,
+	DP_COLORIMETRY_Y_CBCR_ITU_709,
+	DP_COLORIMETRY_SRGB,
+	DP_COLORIMETRY_RGB_WIDE_GAMUT,
+	DP_COLORIMETRY_SCRGB,
+	DP_COLORIMETRY_DCI_P3,
+	DP_COLORIMETRY_CUSTOM_COLOR_PROFILE,
+};
+

I think the general intention is not to include property enum values in UAPI, and for userspace to instead match on strings. See the discussion at the start of this IRC log:
https://people.freedesktop.org/~cbrill/dri-log//?channel=dri-devel&date=2018-
04-27

Quoted 2 lines

...though that does rather imply that we should maybe be putting the strings into uapi/ instead so that we don't inadvertently break userspace.

Hi Brian,
Should I add these as macro defines instead of enum in uapi. Like below for connector types:

#define DRM_MODE_CONNECTOR_Unknown      0
#define DRM_MODE_CONNECTOR_VGA          1
#define DRM_MODE_CONNECTOR_DVII         2

Thanks & Regards,
Uma Shankar

Quoted 9 lines

Thanks,
-Brian

Quoted 6 lines
include/uapi/drm/drm_mode.h +0 -1
 struct drm_mode_modeinfo {
 	__u32 clock;
 	__u16 hdisplay;
--

1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

PATCH v6 2/2 drm/i915: Attach colorspace property and enable modeset

In reply to Uma Shankar

This patch attaches the colorspace connector property to the hdmi connector. Based on colorspace change, modeset will be triggered to switch to new colorspace.

Based on colorspace property value create an infoframe with appropriate colorspace. This can be used to send an infoframe packet with proper colorspace value set which will help to enable wider color gamut like BT2020 on sink.

This patch attaches and enables HDMI colorspace, DP will be taken care separately.

v2: Merged the changes of creating infoframe as well to this patch as per Maarten's suggestion.

v3: Addressed review comments from Shashank. Separated HDMI and DP colorspaces as suggested by Ville and Maarten.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard. Handle the default case properly.

v5: Added Platform specific colorspace enums and called the property creation helper using the same.

v6: Addressed Shashank's review comments.

---
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 19 ++++++++++
 4 files changed, 84 insertions(+)
drivers/gpu/drm/i915/intel_atomic.c +1 -0
index fdfc742..f5bf9db 100644
@@ -125,6 +125,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
 	 */
 	if (new_conn_state->force_audio != old_conn_state->force_audio ||
 	    new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb ||
+	    new_state->colorspace != old_state->colorspace ||
 	    new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
 	    new_conn_state->base.content_type != old_conn_state->base.content_type ||
 	    new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
drivers/gpu/drm/i915/intel_connector.c +63 -0

72 lines not on this page · raw message

drivers/gpu/drm/i915/intel_drv.h +1 -0
index 1a11c2be..41fcceb 100644
@@ -1782,6 +1782,7 @@ int intel_connector_update_modes(struct drm_connector *connector,
 void intel_attach_force_audio_property(struct drm_connector *connector);
 void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
 void intel_attach_aspect_ratio_property(struct drm_connector *connector);
+void intel_attach_colorspace_property(struct drm_connector *connector);
 
 /* intel_csr.c */
 void intel_csr_ucode_init(struct drm_i915_private *);
drivers/gpu/drm/i915/intel_hdmi.c +19 -0
index 07e803a..a969b4d 100644
@@ -503,6 +503,24 @@ static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
 	else
 		frame.avi.colorspace = HDMI_COLORSPACE_RGB;
 
+	if (conn_state->colorspace == COLORIMETRY_DEFAULT) {
+		/* Set ITU 709 as default for HDMI */
+		frame.avi.colorimetry = COLORIMETRY_ITU_709;
+	} else if (conn_state->colorspace < COLORIMETRY_XV_YCC_601) {
+		frame.avi.colorimetry = conn_state->colorspace;
+	} else {
+		frame.avi.colorimetry = HDMI_COLORIMETRY_EXTENDED;
+		/*
+		 * Starting from extended list where COLORIMETRY_XV_YCC_601
+		 * is the first extended mode and its value is 0 as per HDMI
+		 * specification.
+		 * TODO: This needs to be extended for LSPCON implementation
+		 * as well. Will be implemented separately.
+		 */
+		frame.avi.extended_colorimetry = conn_state->colorspace -
+							COLORIMETRY_XV_YCC_601;
+	}
+
 	drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode,
 					   crtc_state->limited_color_range ?
 					   HDMI_QUANTIZATION_RANGE_LIMITED :
@@ -2152,6 +2170,7 @@ static void intel_hdmi_destroy(struct drm_connector *connector)
 	intel_attach_force_audio_property(connector);
 	intel_attach_broadcast_rgb_property(connector);
 	intel_attach_aspect_ratio_property(connector);
+	intel_attach_colorspace_property(connector);
 	drm_connector_attach_content_type_property(connector);
 	connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

✓ Fi.CI.BAT: success for Add Colorspace connector property interface (rev6)

In reply to Uma Shankar
== Series Details ==

== Series Details ==

Series: Add Colorspace connector property interface (rev6)
URL : https://patchwork.freedesktop.org/series/47132/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5343 -> Patchwork_11158
====================================================

Summary
-------

**WARNING**

Minor unknown changes coming with Patchwork_11158 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_11158, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/47132/revisions/6/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11158:

### IGT changes ###

#### Warnings ####

* igt@prime_vgem@basic-fence-flip:
- fi-kbl-7500u: PASS -> SKIP +33

Known issues
------------

Here are the changes found in Patchwork_11158 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@userptr:
- fi-kbl-8809g: PASS -> DMESG-WARN [fdo#108965]

* {igt@runner@aborted}:
- fi-icl-y: NOTRUN -> FAIL [fdo#108915]

#### Possible fixes ####

* igt@gem_ctx_create@basic-files:
- fi-bsw-kefka: INCOMPLETE [fdo#105876] / [fdo#108714] -> PASS

* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS

* igt@i915_selftest@live_contexts:
- fi-byt-j1900: DMESG-WARN -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#105876]: https://bugs.freedesktop.org/show_bug.cgi?id=105876
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108714]: https://bugs.freedesktop.org/show_bug.cgi?id=108714
[fdo#108915]: https://bugs.freedesktop.org/show_bug.cgi?id=108915
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965

Participating hosts (46 -> 42)
------------------------------

Additional (2): fi-icl-y fi-pnv-d510
Missing (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600

Build changes
-------------

* Linux: CI_DRM_5343 -> Patchwork_11158

CI_DRM_5343: e7a162c10f4ab5e4338927ec5bc5be726ecf3e8b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4754: a176905d46d072300ba57f29ac2b98a0228e0e2d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11158: 0116721231c757313625586445f7997306c6747e @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

0116721231c7 drm/i915: Attach colorspace property and enable modeset cf8d05e1f401 drm: Add colorspace connector property

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11158/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

✗ Fi.CI.IGT: failure for Add Colorspace connector property interface (rev6)

In reply to Uma Shankar
== Series Details ==

== Series Details ==

Series: Add Colorspace connector property interface (rev6)
URL : https://patchwork.freedesktop.org/series/47132/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5343_full -> Patchwork_11158_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_11158_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_11158_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11158_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_flip_tiling@flip-x-tiled:
- shard-iclb: PASS -> FAIL

Known issues
------------

Here are the changes found in Patchwork_11158_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_suspend@shrink:
- shard-skl: NOTRUN -> INCOMPLETE [fdo#106886]

* igt@kms_busy@extended-modeset-hang-newfb-render-b:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#107956] +1

* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
- shard-iclb: NOTRUN -> DMESG-WARN [fdo#107956] +1

* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
- shard-skl: PASS -> DMESG-WARN [fdo#107956] +1

* igt@kms_chv_cursor_fail@pipe-c-128x128-bottom-edge:
- shard-skl: PASS -> FAIL [fdo#104671]

* igt@kms_color@pipe-a-ctm-green-to-red:
- shard-skl: PASS -> FAIL [fdo#107201]

* igt@kms_cursor_crc@cursor-128x128-random:
- shard-apl: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-256x256-random:
- shard-iclb: NOTRUN -> FAIL [fdo#103232] +2

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: PASS -> FAIL [fdo#102887] / [fdo#105363]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: PASS -> FAIL [fdo#103167]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
- shard-skl: NOTRUN -> FAIL [fdo#103167]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence:
- shard-skl: PASS -> FAIL [fdo#103191] / [fdo#107362]

* igt@kms_plane@pixel-format-pipe-a-planes:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#106885]

* igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
- shard-skl: NOTRUN -> FAIL [fdo#107815] / [fdo#108145]

* igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
- shard-skl: NOTRUN -> FAIL [fdo#108145] +1

* igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
- shard-kbl: NOTRUN -> FAIL [fdo#108145]

* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
- shard-glk: PASS -> FAIL [fdo#108145]

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: PASS -> FAIL [fdo#107815]

* igt@kms_plane_multiple@atomic-pipe-b-tiling-y:

    - shard-glk:          PASS -> FAIL [fdo#103166]
    - shard-apl:          PASS -> FAIL [fdo#103166]
    - shard-iclb:         NOTRUN -> FAIL [fdo#103166] +1

* igt@kms_plane_scaling@pipe-c-scaler-with-rotation:
- shard-iclb: NOTRUN -> DMESG-WARN [fdo#107724]

* igt@kms_setmode@basic:
- shard-kbl: PASS -> FAIL [fdo#99912]

* igt@perf_pmu@rc6-runtime-pm:
- shard-iclb: PASS -> FAIL [fdo#105010]

* igt@pm_rpm@gem-mmap-cpu:
- shard-skl: PASS -> INCOMPLETE [fdo#107807]

* igt@sw_sync@sync_busy_fork:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]

#### Possible fixes ####

* igt@gem_ctx_isolation@vcs1-s3:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS +1

* igt@kms_busy@extended-pageflip-hang-newfb-render-b:
- shard-glk: DMESG-WARN [fdo#107956] -> PASS

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-glk: FAIL [fdo#103232] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-iclb: FAIL [fdo#103167] -> PASS +5

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-fullscreen:
- shard-glk: FAIL [fdo#103167] -> PASS +1

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-mmap-wc:
- shard-iclb: DMESG-FAIL [fdo#107724] -> PASS

* igt@kms_frontbuffer_tracking@fbcpsr-suspend:
- shard-skl: INCOMPLETE [fdo#104108] / [fdo#106978] -> PASS

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
- shard-skl: INCOMPLETE [fdo#104108] / [fdo#107773] -> PASS

* igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
- shard-iclb: FAIL [fdo#103166] -> PASS

* igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
- shard-glk: FAIL [fdo#103166] -> PASS +1

* igt@kms_rotation_crc@primary-yf-tiled-reflect-x-0:
- shard-iclb: DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +4

* igt@kms_vblank@pipe-a-ts-continuation-modeset-hang:
- shard-iclb: DMESG-WARN [fdo#107724] -> PASS +4

* igt@pm_rpm@modeset-lpsp-stress:
- shard-iclb: DMESG-WARN [fdo#108654] -> PASS

* igt@pm_rpm@universal-planes:
- shard-iclb: INCOMPLETE [fdo#108840] -> PASS

#### Warnings ####

* igt@kms_ccs@pipe-b-crc-primary-basic:
- shard-iclb: DMESG-WARN [fdo#107724] / [fdo#108336] -> FAIL [fdo#107725] +1

* igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
- shard-iclb: DMESG-WARN [fdo#107724] / [fdo#108336] -> FAIL [fdo#103166]

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#104671]: https://bugs.freedesktop.org/show_bug.cgi?id=104671
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
[fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
[fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
[fdo#107201]: https://bugs.freedesktop.org/show_bug.cgi?id=107201
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
[fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (7 -> 7)
------------------------------

No changes in participating hosts

Build changes
-------------

* Linux: CI_DRM_5343 -> Patchwork_11158

CI_DRM_5343: e7a162c10f4ab5e4338927ec5bc5be726ecf3e8b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4754: a176905d46d072300ba57f29ac2b98a0228e0e2d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11158: 0116721231c757313625586445f7997306c6747e @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11158/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw
In reply to Uma Shankar

Hi Uma,

Quoted 17 lines · Uma Shankar

This patch series creates a new connector property to program colorspace to sink devices. Modern sink devices support more than 1 type of colorspace like 601, 709, BT2020 etc. This helps to switch based on content type which is to be displayed. The decision lies with compositors as to in which scenarios, a particular colorspace will be picked.

This will be helpful mostly to switch to higher gamut colorspaces like BT2020 when the media content is encoded as BT2020. Thereby giving a good visual experience to users.

The expectation from userspace is that it should parse the EDID and get supported colorspaces. Use this property and switch to the one supported. Kernel will not give the supported colorspaces since this is panel dependent and our current property infrastructure is not supporting it.

Quoted 7 lines

Basically the expectation from userspace is:
- Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink colorspace
- Set this new property to let the sink know what it converted the CRTC output to.
- This property is just to inform sink what colorspace source is trying to drive.

All the above info is really important/useful stuff, but it's going to get lost because it's only in the cover letter. This should either find its way into the commit message of patch 1 or even better, into the kerneldoc for the property.

Cheers,
-Brian

Quoted 30 lines

Have tested this using xrandr by using below command:
xrandr --output HDMI2 --set "Colorspace" "BT2020_rgb"

v2: Addressed Ville and Maarten's review comments. Merged the 2nd and 3rd patch into one common logical patch.

v3: Removed Adobe references from enum definitions as per Ville, Hans Verkuil and Jonas Karlman suggestions. Changed default to an unset state where driver will assign the colorspace when not chosen by user, suggested by Ville and Maarten. Addressed other misc review comments from Maarten. Split the changes to have separate colorspace property for DP and HDMI.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard. Handled the default case more efficiently.

v5: Modified the colorspace property creation helper to take platform specific enum list based on the capabilities of the platform as suggested by Shashank. With this there is no need for segregation between DP and HDMI.

v6: Addressed Shashank's review comments.

Uma Shankar (2):
drm: Add colorspace connector property drm/i915: Attach colorspace property and enable modeset

Quoted 30 lines
 drivers/gpu/drm/drm_atomic_uapi.c      |  4 ++
 drivers/gpu/drm/drm_connector.c        | 82 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 ++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 18 ++++++++
 include/drm/drm_connector.h            | 17 +++++++
 include/uapi/drm/drm_mode.h            | 33 ++++++++++++++
 8 files changed, 219 insertions(+)
Signature · 18 lines
1.9.1

Uma Shankar (2):
  drm: Add colorspace connector property
  drm/i915: Attach colorspace property and enable modeset

 drivers/gpu/drm/drm_atomic_uapi.c      |  4 ++
 drivers/gpu/drm/drm_connector.c        | 79 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 +++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 19 ++++++++
 include/drm/drm_connector.h            | 17 ++++++++
 include/uapi/drm/drm_mode.h            | 33 ++++++++++++++
 8 files changed, 217 insertions(+)

-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#10 lore raw
Quoted 39 lines

-----Original Message-----
From: Brian Starkey [mailto:[email protected]]
Sent: Tuesday, January 8, 2019 7:37 PM
To: Shankar, Uma <[email protected]>
Cc: [email protected]; [email protected]; Lankhorst, Maarten <[email protected]>; Syrjala, Ville <[email protected]>; Sharma, Shashank <[email protected]>; nd <[email protected]>
Subject: Re: [v6 0/2] Add Colorspace connector property interface

Hi Uma,

Quoted 17 lines · Uma Shankar

This patch series creates a new connector property to program colorspace to sink devices. Modern sink devices support more than 1 type of colorspace like 601, 709, BT2020 etc. This helps to switch based on content type which is to be displayed. The decision lies with compositors as to in which scenarios, a particular colorspace will be picked.

This will be helpful mostly to switch to higher gamut colorspaces like BT2020 when the media content is encoded as BT2020. Thereby giving a good visual experience to users.

The expectation from userspace is that it should parse the EDID and get supported colorspaces. Use this property and switch to the one supported. Kernel will not give the supported colorspaces since this is panel dependent and our current property infrastructure is not supporting it.

Quoted 7 lines

Basically the expectation from userspace is:
- Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink colorspace
- Set this new property to let the sink know what it converted the CRTC output to.
- This property is just to inform sink what colorspace source is trying to drive.

Quoted 3 lines

All the above info is really important/useful stuff, but it's going to get lost because it's only in the cover letter. This should either find its way into the commit message of patch 1 or even better, into the kerneldoc for the property.

Sure Brian, Will add it to kernel doc as well to commit message so that it's not lost.

Regards,
Uma Shankar

Quoted 47 lines

Cheers,
-Brian

Quoted 24 lines

Have tested this using xrandr by using below command:
xrandr --output HDMI2 --set "Colorspace" "BT2020_rgb"

v2: Addressed Ville and Maarten's review comments. Merged the 2nd and 3rd patch into one common logical patch.

v3: Removed Adobe references from enum definitions as per Ville, Hans Verkuil and Jonas Karlman suggestions. Changed default to an unset state where driver will assign the colorspace when not chosen by user, suggested by Ville and Maarten. Addressed other misc review comments from Maarten. Split the changes to have separate colorspace property for DP and HDMI.

v4: Addressed Chris and Ville's review comments, and created a common colorspace property for DP and HDMI, filtered the list based on the colorspaces supported by the respective protocol standard. Handled the default case more efficiently.

v5: Modified the colorspace property creation helper to take platform specific enum list based on the capabilities of the platform as suggested by Shashank. With this there is no need for segregation between DP and HDMI.

Quoted 8 lines

v6: Addressed Shashank's review comments.

Uma Shankar (2):
drm: Add colorspace connector property drm/i915: Attach colorspace property and enable modeset

 drivers/gpu/drm/drm_atomic_uapi.c      |  4 ++
 drivers/gpu/drm/drm_connector.c        | 82

++++++++++++++++++++++++++++++++++

Quoted 11 lines
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 ++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 18 ++++++++
 include/drm/drm_connector.h            | 17 +++++++
 include/uapi/drm/drm_mode.h            | 33 ++++++++++++++
 8 files changed, 219 insertions(+)

--
1.9.1

Quoted 18 lines
Quoted 6 lines

Uma Shankar (2):
drm: Add colorspace connector property drm/i915: Attach colorspace property and enable modeset

 drivers/gpu/drm/drm_atomic_uapi.c      |  4 ++
 drivers/gpu/drm/drm_connector.c        | 79

++++++++++++++++++++++++++++++++++

Quoted 11 lines
 drivers/gpu/drm/i915/intel_atomic.c    |  1 +
 drivers/gpu/drm/i915/intel_connector.c | 63 +++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c      | 19 ++++++++
 include/drm/drm_connector.h            | 17 ++++++++
 include/uapi/drm/drm_mode.h            | 33 ++++++++++++++
 8 files changed, 217 insertions(+)

--
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel