All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	daniel@ffwll.ch
Subject: [PATCH v4 01/13] drm: move content protection property to mode_config
Date: Fri,  5 Apr 2019 14:12:50 +0530	[thread overview]
Message-ID: <20190405084302.5548-2-ramalingam.c@intel.com> (raw)
In-Reply-To: <20190405084302.5548-1-ramalingam.c@intel.com>

Content protection property is created once and stored in
drm_mode_config. And attached to all HDCP capable connectors.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c |  4 ++--
 drivers/gpu/drm/drm_connector.c   | 13 +++++++------
 include/drm/drm_connector.h       |  6 ------
 include/drm/drm_mode_config.h     |  6 ++++++
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 4eb81f10bc54..e52acad9005f 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -740,7 +740,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 		state->content_type = val;
 	} else if (property == connector->scaling_mode_property) {
 		state->scaling_mode = val;
-	} else if (property == connector->content_protection_property) {
+	} else if (property == config->content_protection_property) {
 		if (val == DRM_MODE_CONTENT_PROTECTION_ENABLED) {
 			DRM_DEBUG_KMS("only drivers can set CP Enabled\n");
 			return -EINVAL;
@@ -820,7 +820,7 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 		*val = state->colorspace;
 	} else if (property == connector->scaling_mode_property) {
 		*val = state->scaling_mode;
-	} else if (property == connector->content_protection_property) {
+	} else if (property == config->content_protection_property) {
 		*val = state->content_protection;
 	} else if (property == config->writeback_fb_id_property) {
 		/* Writeback framebuffer is one-shot, write and forget */
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 2355124849db..7c0eda9cca60 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1534,18 +1534,19 @@ int drm_connector_attach_content_protection_property(
 		struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_property *prop;
+	struct drm_property *prop =
+			dev->mode_config.content_protection_property;
 
-	prop = drm_property_create_enum(dev, 0, "Content Protection",
-					drm_cp_enum_list,
-					ARRAY_SIZE(drm_cp_enum_list));
+	if (!prop)
+		prop = drm_property_create_enum(dev, 0, "Content Protection",
+						drm_cp_enum_list,
+						ARRAY_SIZE(drm_cp_enum_list));
 	if (!prop)
 		return -ENOMEM;
 
 	drm_object_attach_property(&connector->base, prop,
 				   DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
-
-	connector->content_protection_property = prop;
+	dev->mode_config.content_protection_property = prop;
 
 	return 0;
 }
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index c8061992d6cb..bcaffd68202e 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1023,12 +1023,6 @@ struct drm_connector {
 	 */
 	struct drm_property *vrr_capable_property;
 
-	/**
-	 * @content_protection_property: DRM ENUM property for content
-	 * protection. See drm_connector_attach_content_protection_property().
-	 */
-	struct drm_property *content_protection_property;
-
 	/**
 	 * @colorspace_property: Connector property to set the suitable
 	 * colorspace supported by the sink.
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index 7f60e8eb269a..5764ee3c7453 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -836,6 +836,12 @@ struct drm_mode_config {
 	 */
 	struct drm_property *writeback_out_fence_ptr_property;
 
+	/**
+	 * @content_protection_property: DRM ENUM property for content
+	 * protection. See drm_connector_attach_content_protection_property().
+	 */
+	struct drm_property *content_protection_property;
+
 	/* dumb ioctl parameters */
 	uint32_t preferred_depth, prefer_shadow;
 
-- 
2.19.1

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

  reply	other threads:[~2019-04-05  8:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05  8:42 [PATCH v4 00/13] HDCP2.2 Phase II Ramalingam C
2019-04-05  8:42 ` Ramalingam C [this message]
2019-04-05  8:42 ` [PATCH v4 02/13] drm/i915: debugfs: HDCP2.2 capability read Ramalingam C
2019-04-05  8:42 ` [PATCH v4 03/13] drm: Add Content protection type property Ramalingam C
2019-04-05  8:42 ` [PATCH v4 04/13] drm/i915: Attach content " Ramalingam C
2019-04-05  8:42 ` [PATCH v4 05/13] drivers: create binary sysfs for class Ramalingam C
2019-04-05  9:23   ` Greg Kroah-Hartman
2019-04-05 10:36     ` Ramalingam C
2019-04-05 12:32       ` Greg Kroah-Hartman
2019-04-15 12:41         ` Ramalingam C
2019-04-15 14:47           ` Greg Kroah-Hartman
2019-04-15 17:14             ` Ramalingam C
2019-04-15 18:01               ` Greg Kroah-Hartman
2019-04-15 19:14                 ` Daniel Vetter
2019-04-16  9:04                   ` Greg Kroah-Hartman
2019-04-16  9:25                     ` Daniel Vetter
2019-04-05  8:42 ` [PATCH v4 06/13] drm: HDCP SRM binary sysfs for subsystem Ramalingam C
2019-04-05  8:42 ` [PATCH v4 07/13] drm/i915: SRM revocation check for HDCP1.4 and 2.2 Ramalingam C
2019-04-05  8:42 ` [PATCH v4 08/13] drm/hdcp: gathering hdcp related code into drm_hdcp.c Ramalingam C
2019-04-05  8:42 ` [PATCH v4 09/13] drm: uevent for connector status change Ramalingam C
2019-04-05  8:42 ` [PATCH v4 10/13] drm/hdcp: update content protection property with uevent Ramalingam C
2019-04-05  8:43 ` [PATCH v4 11/13] drm/i915: update the hdcp state " Ramalingam C
2019-04-05  8:43 ` [PATCH v4 12/13] drm: Add CP downstream_info property Ramalingam C
2019-04-05  8:43 ` [PATCH v4 13/13] drm/i915: Populate downstream info for HDCP Ramalingam C
2019-04-05 12:03   ` Ramalingam C
2019-04-05 11:16 ` ✗ Fi.CI.CHECKPATCH: warning for HDCP2.2 Phase II (rev5) Patchwork
2019-04-05 11:26 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-05 11:41 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-06  7:11 ` ✓ Fi.CI.IGT: " 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=20190405084302.5548-2-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.