summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2018-01-12 10:12:43 -0500
committerTao Huang <huangtao@rock-chips.com>2018-08-15 17:28:40 +0800
commit29eec2954cb29ec649a474bf89deaf8177e52dc4 (patch)
treebfecd24dd0a307aa8c9d5c97a175b8cdb78cb3dc /include/drm
parentc1b002bdf2f4fd763976e40083053c518d84d77b (diff)
BACKPORT: drm: Add Content Protection property
This patch adds a new optional connector property to allow userspace to enable protection over the content it is displaying. This will typically be implemented by the driver using HDCP. The property is a tri-state with the following values: - OFF: Self explanatory, no content protection - DESIRED: Userspace requests that the driver enable protection - ENABLED: Once the driver has authenticated the link, it sets this value The driver is responsible for downgrading ENABLED to DESIRED if the link becomes unprotected. The driver should also maintain the desiredness of protection across hotplug/dpms/suspend. If this looks familiar, I posted [1] this 3 years ago. We have been using this in ChromeOS across exynos, mediatek, and rockchip over that time. Changes in v2: - Pimp kerneldoc for content_protection_property (Daniel) - Drop sysfs attribute Changes in v3: - None Changes in v4: - Changed kerneldoc to recommend userspace polling (Daniel) - Changed kerneldoc to briefly describe how to attach the property (Daniel) Changes in v5: - checkpatch whitespace noise - Change DRM_MODE_CONTENT_PROTECTION_OFF to DRM_MODE_CONTENT_PROTECTION_UNDESIRED Changes in v6: - None Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Sean Paul <seanpaul@chromium.org> [1] https://lists.freedesktop.org/archives/dri-devel/2014-December/073336.html Link: https://patchwork.freedesktop.org/patch/msgid/20180108195545.218615-4-seanpaul@chromium.org (cherry picked from commit 24557865c8b1a6d0eaccaac47aabd9b23badf8fd) Signed-off-by: Sean Paul <seanpaul@chromium.org> [downstream changes] - Fixed some conflicts in comments - Remove duplicate definition for drm_get_content_protection_name Change-Id: I825b4863bea715434cb8f76f99fdf6e3fca74a60 Reviewed-on: https://chromium-review.googlesource.com/849079 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Sean Paul <seanpaul@google.com> Reviewed-by: Sean Paul <seanpaul@google.com> Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_crtc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e7fb665befea..9b2d4b6766a9 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -716,6 +716,12 @@ struct drm_connector_state {
struct drm_atomic_state *state;
+ /**
+ * @content_protection: Connector property to request content
+ * protection. This is most commonly used for HDCP.
+ */
+ unsigned int content_protection;
+
struct drm_tv_connector_state tv;
/**
@@ -946,6 +952,7 @@ struct drm_encoder {
* @tile_v_loc: vertical location of this tile
* @tile_h_size: horizontal size of this tile.
* @tile_v_size: vertical size of this tile.
+ * @content_protection_property: Optional property to control content protection
*
* Each connector may be connected to one or more CRTCs, or may be clonable by
* another connector if they can share a CRTC. Each connector also has a specific
@@ -989,6 +996,12 @@ struct drm_connector {
struct drm_property_blob *edid_blob_ptr;
struct drm_object_properties properties;
+ /**
+ * @content_protection_property: DRM ENUM property for content
+ * protection
+ */
+ struct drm_property *content_protection_property;
+
struct drm_property_blob *path_blob_ptr;
struct drm_property_blob *tile_blob_ptr;
@@ -1840,6 +1853,7 @@ extern const char *drm_get_dvi_i_subconnector_name(int val);
extern const char *drm_get_dvi_i_select_name(int val);
extern const char *drm_get_tv_subconnector_name(int val);
extern const char *drm_get_tv_select_name(int val);
+extern const char *drm_get_content_protection_name(int val);
extern const char *drm_get_connector_name(int val);
extern void drm_fb_release(struct drm_file *file_priv);
extern void drm_property_destroy_user_blobs(struct drm_device *dev,
@@ -1937,6 +1951,8 @@ extern int drm_mode_create_tv_properties(struct drm_device *dev,
unsigned int num_modes,
const char * const modes[]);
extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
+extern int drm_connector_attach_content_protection_property(
+ struct drm_connector *connector);
extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
extern int drm_mode_create_suggested_offset_properties(struct drm_device *dev);