All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Ramalingam C
	<ramalingam.c-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Daniel Vetter <daniel.vetter-/w4YWyX8dFk@public.gmane.org>
Subject: [PATCH 04/20] drm/hdcp: gathering hdcp related code into drm_hdcp.c
Date: Tue, 10 Sep 2019 15:05:38 -0400	[thread overview]
Message-ID: <20190910190554.1539-5-Bhawanpreet.Lakha@amd.com> (raw)
In-Reply-To: <20190910190554.1539-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>

From: Ramalingam C <ramalingam.c@intel.com>

Considering the significant size of hdcp related code in drm, all
hdcp related codes are moved into separate file called drm_hdcp.c.

v2:
  Rebased.
v2:
  Rebased.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190507162745.25600-7-ramalingam.c@intel.com
---
 drivers/gpu/drm/drm_connector.c | 44 ------------------------------
 drivers/gpu/drm/drm_hdcp.c      | 47 +++++++++++++++++++++++++++++++++
 include/drm/drm_connector.h     |  2 --
 include/drm/drm_hdcp.h          |  3 +++
 4 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 0490c204122d..11fcd25bc640 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -823,13 +823,6 @@ static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = {
 DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name,
 		 drm_tv_subconnector_enum_list)
 
-static struct drm_prop_enum_list drm_cp_enum_list[] = {
-	{ DRM_MODE_CONTENT_PROTECTION_UNDESIRED, "Undesired" },
-	{ DRM_MODE_CONTENT_PROTECTION_DESIRED, "Desired" },
-	{ DRM_MODE_CONTENT_PROTECTION_ENABLED, "Enabled" },
-};
-DRM_ENUM_NAME_FN(drm_get_content_protection_name, drm_cp_enum_list)
-
 static const struct drm_prop_enum_list hdmi_colorspaces[] = {
 	/* For Default case, driver will set the colorspace */
 	{ DRM_MODE_COLORIMETRY_DEFAULT, "Default" },
@@ -1509,43 +1502,6 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
 }
 EXPORT_SYMBOL(drm_connector_attach_scaling_mode_property);
 
-/**
- * drm_connector_attach_content_protection_property - attach content protection
- * property
- *
- * @connector: connector to attach CP property on.
- *
- * This is used to add support for content protection on select connectors.
- * Content Protection is intentionally vague to allow for different underlying
- * technologies, however it is most implemented by HDCP.
- *
- * The content protection will be set to &drm_connector_state.content_protection
- *
- * Returns:
- * Zero on success, negative errno on failure.
- */
-int drm_connector_attach_content_protection_property(
-		struct drm_connector *connector)
-{
-	struct drm_device *dev = connector->dev;
-	struct drm_property *prop =
-			dev->mode_config.content_protection_property;
-
-	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);
-	dev->mode_config.content_protection_property = prop;
-
-	return 0;
-}
-EXPORT_SYMBOL(drm_connector_attach_content_protection_property);
-
 /**
  * drm_mode_create_aspect_ratio_property - create aspect ratio property
  * @dev: DRM device
diff --git a/drivers/gpu/drm/drm_hdcp.c b/drivers/gpu/drm/drm_hdcp.c
index 5e5409505c31..0da7b3718bad 100644
--- a/drivers/gpu/drm/drm_hdcp.c
+++ b/drivers/gpu/drm/drm_hdcp.c
@@ -17,6 +17,9 @@
 #include <drm/drm_sysfs.h>
 #include <drm/drm_print.h>
 #include <drm/drm_device.h>
+#include <drm/drm_property.h>
+#include <drm/drm_mode_object.h>
+#include <drm/drm_connector.h>
 
 struct hdcp_srm {
 	u32 revoked_ksv_cnt;
@@ -331,3 +334,47 @@ void drm_teardown_hdcp_srm(struct class *drm_class)
 		kfree(srm_data);
 	}
 }
+
+static struct drm_prop_enum_list drm_cp_enum_list[] = {
+	{ DRM_MODE_CONTENT_PROTECTION_UNDESIRED, "Undesired" },
+	{ DRM_MODE_CONTENT_PROTECTION_DESIRED, "Desired" },
+	{ DRM_MODE_CONTENT_PROTECTION_ENABLED, "Enabled" },
+};
+DRM_ENUM_NAME_FN(drm_get_content_protection_name, drm_cp_enum_list)
+
+/**
+ * drm_connector_attach_content_protection_property - attach content protection
+ * property
+ *
+ * @connector: connector to attach CP property on.
+ *
+ * This is used to add support for content protection on select connectors.
+ * Content Protection is intentionally vague to allow for different underlying
+ * technologies, however it is most implemented by HDCP.
+ *
+ * The content protection will be set to &drm_connector_state.content_protection
+ *
+ * Returns:
+ * Zero on success, negative errno on failure.
+ */
+int drm_connector_attach_content_protection_property(
+		struct drm_connector *connector)
+{
+	struct drm_device *dev = connector->dev;
+	struct drm_property *prop =
+			dev->mode_config.content_protection_property;
+
+	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);
+	dev->mode_config.content_protection_property = prop;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_connector_attach_content_protection_property);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 5e41942e5679..da9e1f087fe4 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1339,8 +1339,6 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
 					       u32 scaling_mode_mask);
 int drm_connector_attach_vrr_capable_property(
 		struct drm_connector *connector);
-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);
 int drm_mode_create_content_type_property(struct drm_device *dev);
diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index 2f0335d0a50f..13771a496e2b 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -286,7 +286,10 @@ struct hdcp_srm_header {
 } __packed;
 
 struct drm_device;
+struct drm_connector;
 
 bool drm_hdcp_check_ksvs_revoked(struct drm_device *dev,
 				 u8 *ksvs, u32 ksv_count);
+int drm_connector_attach_content_protection_property(
+		struct drm_connector *connector);
 #endif
-- 
2.17.1

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

  parent reply	other threads:[~2019-09-10 19:05 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 16:22 [PATCH 00/20] HDCP 1.4 Content Protection Bhawanpreet Lakha
     [not found] ` <20190829162253.10195-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-08-29 16:22   ` [PATCH 01/20] drm: move content protection property to mode_config Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 02/20] drm: generic fn converting be24 to cpu and vice versa Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 03/20] drm: revocation check at drm subsystem Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 04/20] drm/hdcp: gathering hdcp related code into drm_hdcp.c Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 05/20] drm: Add Content protection type property Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 06/20] drm: uevent for connector status change Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 07/20] drm/hdcp: update content protection property with uevent Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 08/20] drm/amdgpu: psp HDCP init Bhawanpreet Lakha
     [not found]     ` <20190829162253.10195-9-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-09-10 19:02       ` Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 09/20] drm/amdgpu: psp DTM init Bhawanpreet Lakha
     [not found]     ` <20190829162253.10195-10-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-09-05 19:31       ` Harry Wentland
     [not found]         ` <63ec7ec3-8e1b-96b1-61eb-5c59432063e1-5C7GfCeVMHo@public.gmane.org>
2019-09-05 19:36           ` Lakha, Bhawanpreet
     [not found]             ` <228d8024-edca-035b-dc33-fa0787bb1c81-5C7GfCeVMHo@public.gmane.org>
2019-09-05 20:13               ` Harry Wentland
2019-09-10 19:05       ` [PATCH 00/20] HDCP 1.4 Content Protection Bhawanpreet Lakha
     [not found]         ` <20190910190554.1539-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-09-10 19:05           ` [PATCH 01/20] drm: move content protection property to mode_config Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 02/20] drm: generic fn converting be24 to cpu and vice versa Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 03/20] drm: revocation check at drm subsystem Bhawanpreet Lakha
2019-09-10 19:05           ` Bhawanpreet Lakha [this message]
2019-09-10 19:05           ` [PATCH 05/20] drm: Add Content protection type property Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 06/20] drm: uevent for connector status change Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 07/20] drm/hdcp: update content protection property with uevent Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 08/20] drm/amdgpu: psp HDCP init Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 09/20] drm/amdgpu: psp DTM init Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 10/20] drm/amd/display: Add HDCP module Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 11/20] drm/amd/display: add PSP block to verify hdcp steps Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 12/20] drm/amd/display: Update hdcp display config Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 13/20] drm/amd/display: Create amdgpu_dm_hdcp Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 14/20] drm/amd/display: Create dpcd and i2c packing functions Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 15/20] drm/amd/display: Initialize HDCP work queue Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 16/20] drm/amd/display: Handle Content protection property changes Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 17/20] drm/amd/display: handle DP cpirq Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 18/20] drm/amd/display: Update CP property based on HW query Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 19/20] drm/amd/display: only enable HDCP for DCN+ Bhawanpreet Lakha
2019-09-10 19:05           ` [PATCH 20/20] drm/amd/display: Add hdcp to Kconfig Bhawanpreet Lakha
2019-09-11 13:56           ` [PATCH 00/20] HDCP 1.4 Content Protection Harry Wentland
2019-08-29 16:22   ` [PATCH 10/20] drm/amd/display: Add HDCP module Bhawanpreet Lakha
     [not found]     ` <20190829162253.10195-11-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-09-05 21:46       ` Liu, Wenjing
2019-08-29 16:22   ` [PATCH 11/20] drm/amd/display: add PSP block to verify hdcp steps Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 12/20] drm/amd/display: Update hdcp display config Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 13/20] drm/amd/display: Create amdgpu_dm_hdcp Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 14/20] drm/amd/display: Create dpcd and i2c packing functions Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 15/20] drm/amd/display: Initialize HDCP work queue Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 16/20] drm/amd/display: Handle Content protection property changes Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 17/20] drm/amd/display: handle DP cpirq Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 18/20] drm/amd/display: Update CP property based on HW query Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 19/20] drm/amd/display: only enable HDCP for DCN+ Bhawanpreet Lakha
2019-08-29 16:22   ` [PATCH 20/20] drm/amd/display: Add hdcp to Kconfig Bhawanpreet Lakha
2019-09-05 20:44   ` [PATCH 00/20] HDCP 1.4 Content Protection Harry Wentland
     [not found]     ` <eb83ae25-7635-45de-72dc-db24571066d2-5C7GfCeVMHo@public.gmane.org>
2019-09-10 19:04       ` Bhawanpreet Lakha
     [not found]         ` <20190910190422.794-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2019-09-10 19:04           ` [PATCH 01/20] drm: move content protection property to mode_config Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 02/20] drm: generic fn converting be24 to cpu and vice versa Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 03/20] drm: revocation check at drm subsystem Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 04/20] drm/hdcp: gathering hdcp related code into drm_hdcp.c Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 05/20] drm: Add Content protection type property Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 06/20] drm: uevent for connector status change Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 07/20] drm/hdcp: update content protection property with uevent Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 08/20] drm/amdgpu: psp HDCP init Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 09/20] drm/amdgpu: psp DTM init Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 10/20] drm/amd/display: Add HDCP module Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 11/20] drm/amd/display: add PSP block to verify hdcp steps Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 12/20] drm/amd/display: Update hdcp display config Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 13/20] drm/amd/display: Create amdgpu_dm_hdcp Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 14/20] drm/amd/display: Create dpcd and i2c packing functions Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 15/20] drm/amd/display: Initialize HDCP work queue Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 16/20] drm/amd/display: Handle Content protection property changes Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 17/20] drm/amd/display: handle DP cpirq Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 18/20] drm/amd/display: Update CP property based on HW query Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 19/20] drm/amd/display: only enable HDCP for DCN+ Bhawanpreet Lakha
2019-09-10 19:04           ` [PATCH 20/20] drm/amd/display: Add hdcp to Kconfig Bhawanpreet Lakha

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=20190910190554.1539-5-Bhawanpreet.Lakha@amd.com \
    --to=bhawanpreet.lakha-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=daniel.vetter-/w4YWyX8dFk@public.gmane.org \
    --cc=ramalingam.c-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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.