public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Uma Shankar <uma.shankar@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: ville.syrjala@intel.com, maarten.lankhorst@intel.com
Subject: [v11 2/4] drm: Add DP colorspace property
Date: Tue,  5 Feb 2019 21:33:35 +0530	[thread overview]
Message-ID: <1549382617-8951-3-git-send-email-uma.shankar@intel.com> (raw)
In-Reply-To: <1549382617-8951-1-git-send-email-uma.shankar@intel.com>

This patch adds a DP colorspace 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: 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: Merged the DP handling along with platform colorspace
handling as per Shashank's comments.

v6: Reverted to old design of exposing all colorspaces to
userspace as per Ville's review comment

v7: Fixed sparse warnings, updated the RB from Maarten and Jani's ack.

v8: Addressed Ville's review comments and updated the colorspace
macro definitions.

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_connector.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 4309873..86b368bf 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -853,6 +853,24 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
 	{ DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" },
 };
 
+static const struct drm_prop_enum_list dp_colorspaces[] = {
+	/* For Default case, driver will set the colorspace */
+	{ DRM_MODE_COLORIMETRY_DEFAULT, "Default" },
+	/* 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-5 */
+	{ DRM_MODE_COLORIMETRY_OPRGB, "opRGB" },
+	{ DRM_MODE_COLORIMETRY_DCI_P3, "DCI-P3" },
+	/* DP MSA Colorimetry */
+	{ DRM_MODE_DP_COLORIMETRY_YCBCR_ITU_601, "YCBCR_ITU_601" },
+	{ DRM_MODE_DP_COLORIMETRY_YCBCR_ITU_709, "YCBCR_ITU_709" },
+	{ DRM_MODE_DP_COLORIMETRY_SRGB, "sRGB" },
+	{ DRM_MODE_DP_COLORIMETRY_RGB_WIDE_GAMUT, "RGB Wide Gamut" },
+	{ DRM_MODE_DP_COLORIMETRY_SCRGB, "scRGB" },
+};
+
 /**
  * DOC: standard connector properties
  *
@@ -1614,6 +1632,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_eDP ||
+		   connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
+		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;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-02-05 16:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 16:03 [v11 0/4] Add Colorspace connector property interface Uma Shankar
2019-02-05 16:03 ` [v11 1/4] drm: Add HDMI colorspace property Uma Shankar
2019-02-05 16:31   ` Ville Syrjälä
2019-02-05 17:32     ` Shankar, Uma
2019-02-05 18:13       ` Ville Syrjälä
2019-02-05 19:22         ` Shankar, Uma
2019-02-07 19:03           ` Ville Syrjälä
2019-02-08 12:15             ` Shankar, Uma
2019-02-08 12:36               ` Sharma, Shashank
2019-02-08 12:52                 ` [Intel-gfx] " Ville Syrjälä
2019-02-08 13:06                   ` Sharma, Shashank
2019-02-08 13:30                     ` Ville Syrjälä
2019-02-08 14:06                       ` Sharma, Shashank
2019-02-08 14:37                         ` Ville Syrjälä
2019-02-08 15:03                           ` Shankar, Uma
2019-02-08 15:35                             ` [Intel-gfx] " Ville Syrjälä
2019-02-08 16:31                               ` Shankar, Uma
2019-02-05 16:03 ` Uma Shankar [this message]
2019-02-05 16:03 ` [v11 3/4] drm: Add colorspace info to AVI Infoframe Uma Shankar
2019-02-05 16:32   ` Ville Syrjälä
2019-02-05 17:33     ` [Intel-gfx] " Shankar, Uma
2019-02-05 16:03 ` [v11 4/4] drm/i915: Attach colorspace property and enable modeset Uma Shankar
2019-02-05 16:05 ` ✗ Fi.CI.BAT: failure for Add Colorspace connector property interface (rev11) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1549382617-8951-3-git-send-email-uma.shankar@intel.com \
    --to=uma.shankar@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@intel.com \
    --cc=ville.syrjala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox