From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
daniel.vetter@intel.com, gwan-gyeong.mun@intel.com
Subject: [PATCH v6 09/10] drm/hdcp: update content protection property with uevent
Date: Thu, 2 May 2019 18:53:02 +0530 [thread overview]
Message-ID: <20190502132303.27696-10-ramalingam.c@intel.com> (raw)
In-Reply-To: <20190502132303.27696-1-ramalingam.c@intel.com>
drm function is defined and exported to update a connector's
content protection property state and to generate a uevent along
with it.
Need ACK for the uevent from userspace consumer.
v2:
Update only when state is different from old one.
v3:
KDoc is added [Daniel]
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/drm_hdcp.c | 32 ++++++++++++++++++++++++++++++++
include/drm/drm_hdcp.h | 2 ++
2 files changed, 34 insertions(+)
diff --git a/drivers/gpu/drm/drm_hdcp.c b/drivers/gpu/drm/drm_hdcp.c
index fc9083db833d..75ae4cd90c53 100644
--- a/drivers/gpu/drm/drm_hdcp.c
+++ b/drivers/gpu/drm/drm_hdcp.c
@@ -381,6 +381,10 @@ DRM_ENUM_NAME_FN(drm_get_hdcp_content_type_name,
*
* The content protection will be set to &drm_connector_state.content_protection
*
+ * When kernel triggered content protection state change like DESIRED->ENABLED
+ * and ENABLED->DESIRED, will use drm_hdcp_update_content_protection() to update
+ * the content protection state of a connector.
+ *
* Returns:
* Zero on success, negative errno on failure.
*/
@@ -421,3 +425,31 @@ int drm_connector_attach_content_protection_property(
return 0;
}
EXPORT_SYMBOL(drm_connector_attach_content_protection_property);
+
+/**
+ * drm_hdcp_update_content_protection - Updates the content protection state
+ * of a connector
+ *
+ * @connector: drm_connector on which content protection state needs an update
+ * @val: New state of the content protection property
+ *
+ * This function can be used by display drivers, to update the kernel triggered
+ * content protection state change of a drm_connector. This function update the
+ * new state of the property into the connector's state and generate an uevent
+ * to notify the userspace.
+ */
+void drm_hdcp_update_content_protection(struct drm_connector *connector,
+ u64 val)
+{
+ struct drm_device *dev = connector->dev;
+ struct drm_connector_state *state = connector->state;
+
+ WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
+ if (state->content_protection == val)
+ return;
+
+ state->content_protection = val;
+ drm_sysfs_connector_status_event(connector,
+ dev->mode_config.content_protection_property);
+}
+EXPORT_SYMBOL(drm_hdcp_update_content_protection);
diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index c9dd973f43df..e49fe40f767f 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -292,4 +292,6 @@ 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, bool hdcp_content_type);
+void drm_hdcp_update_content_protection(struct drm_connector *connector,
+ u64 val);
#endif
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-05-02 13:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 13:22 [PATCH v6 00/10] HDCP2.2 Phase II Ramalingam C
2019-05-02 13:22 ` [PATCH v6 01/10] drm: move content protection property to mode_config Ramalingam C
2019-05-02 13:22 ` [PATCH v6 02/10] drm/i915: debugfs: HDCP2.2 capability read Ramalingam C
2019-05-02 13:22 ` [PATCH v6 03/10] drm: revocation check at drm subsystem Ramalingam C
2019-05-06 16:56 ` Daniel Vetter
2019-05-06 21:58 ` Matt Roper
2019-05-07 12:13 ` Singh, Satyeshwar
2019-05-02 13:22 ` [PATCH v6 04/10] drm/i915: SRM revocation check for HDCP1.4 and 2.2 Ramalingam C
2019-05-02 13:22 ` [PATCH v6 05/10] drm/hdcp: gathering hdcp related code into drm_hdcp.c Ramalingam C
2019-05-02 13:22 ` [PATCH v6 06/10] drm: Add Content protection type property Ramalingam C
2019-05-02 13:23 ` [PATCH v6 07/10] drm/i915: Attach content " Ramalingam C
2019-05-02 13:23 ` [PATCH v6 08/10] drm: uevent for connector status change Ramalingam C
2019-05-02 13:23 ` Ramalingam C [this message]
2019-05-02 13:23 ` [PATCH v6 10/10] drm/i915: update the hdcp state with uevent Ramalingam C
2019-05-02 13:37 ` [PATCH v6 00/10] HDCP2.2 Phase II Ramalingam C
2019-05-02 13:55 ` ✗ Fi.CI.CHECKPATCH: warning for HDCP2.2 Phase II (rev8) Patchwork
2019-05-02 14:02 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-05-02 14:17 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-02 17:58 ` ✓ 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=20190502132303.27696-10-ramalingam.c@intel.com \
--to=ramalingam.c@intel.com \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gwan-gyeong.mun@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox