HDCP2.2 Content Type support
Subsystems (3)
v2 cover HDCP2.2 Content Type support
This series adds a property called Content_protection_type onto HDCP2.2 capable intel connectors.
Using this property userspace app can set the Content Type of the stream as per HDCP2.2 specification.
v2:
Separated from the other patches for SRM and Downstream_info Restrictions at atomic_set_property is removed [Maarten] CP appreviation is expanded [Daniel]
kernel does HDCP restart when type change is requested when CP is on.
Needed to remove the restriction of at atomic_set_property.
Test-with: [email protected]
Ramalingam C (2):
drm: Add Content protection type property
drm/i915: Attach content type property
drivers/gpu/drm/drm_atomic_uapi.c | 4 ++ drivers/gpu/drm/drm_connector.c | 63 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_ddi.c | 21 ++++++++--- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_hdcp.c | 30 ++++++++++++--- include/drm/drm_connector.h | 15 ++++++++ include/uapi/drm/drm_mode.h | 4 ++ 7 files changed, 127 insertions(+), 12 deletions(-)
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/2 drm: Add Content protection type property
This patch adds a DRM ENUM property to the selected connectors. This property is used for mentioning the protected content's type from userspace to kernel HDCP authentication.
Type of the stream is decided by the protected content providers. Type 0 content can be rendered on any HDCP protected display wires. But Type 1 content can be rendered only on HDCP2.2 protected paths.
So when a userspace sets this property to Type 1 and starts the HDCP enable, kernel will honour it only if HDCP2.2 authentication is through for type 1. Else HDCP enable will be failed.
v2:
cp_content_type is replaced with content_protection_type [daniel] check at atomic_set_property is removed [Maarten]
--- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++ drivers/gpu/drm/drm_connector.c | 63 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 15 ++++++++ include/uapi/drm/drm_mode.h | 4 ++ 4 files changed, 86 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +4 -0
@@ -746,6 +746,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,return -EINVAL ; } state->content_protection = val; + }else if (property == connector->content_protection_type_property) { + state->content_protection_type = val; }else if (property == connector->colorspace_property) { state->colorspace = val; }else if (property == config->writeback_fb_id_property) {
@@ -822,6 +824,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = state->scaling_mode; }else if (property == connector->content_protection_property) { *val = state->content_protection; + }else if (property == connector->content_protection_type_property) { + *val = state->content_protection_type; }else if (property == config->writeback_fb_id_property) {/* Writeback framebuffer is one-shot, write and forget */ *val =0 ;
drivers/gpu/drm/drm_connector.c +63 -0
81 lines not on this page · raw message
include/drm/drm_connector.h +15 -0
@@ -518,6 +518,12 @@ struct drm_connector_state {*/ unsigned int content_type; +/** +* @content_protection_type: Connector property to pass the type of +* protected content. This is most commonly used for HDCP. +*/ +unsigned int content_protection_type; +/** * @scaling_mode: Connector property to control the * upscaling, mostly used for built-in panels.
@@ -1035,6 +1041,12 @@ struct drm_connector {*/ struct drm_property *colorspace_property; +/** +* @content_protection_type_property: DRM ENUM property for type of +* Protected Content. +*/ +struct drm_property *content_protection_type_property; +/** * @path_blob_ptr: *
@@ -1294,6 +1306,7 @@ const char *drm_get_dvi_i_select_name(int val);const char *drm_get_tv_subconnector_name (int val);const char *drm_get_tv_select_name (int val);const char *drm_get_content_protection_name (int val); +const char *drm_get_content_protection_type_name (int val);int drm_mode_create_dvi_i_properties (struct drm_device *dev);int drm_mode_create_tv_margin_properties (struct drm_device *dev);
@@ -1309,6 +1322,8 @@ int drm_connector_attach_vrr_capable_property( struct drm_connector *connector);int drm_connector_attach_content_protection_property (struct drm_connector *connector); +int drm_connector_attach_content_protection_type_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);
include/uapi/drm/drm_mode.h +4 -0
@@ -210,6 +210,10 @@ extern "C" {#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2 +/* Content Type classification for HDCP2.2 vs others */ +#define DRM_MODE_CONTENT_PROTECTION_TYPE0 0 +#define DRM_MODE_CONTENT_PROTECTION_TYPE1 1 +struct drm_mode_modeinfo {__u32 clock;__u16 hdisplay;
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/2 drm/i915: Attach content type property
In reply to Ramalingam CAttaches the content type property for HDCP2.2 capable connectors.
Implements the update of content type from property and apply the restriction on HDCP version selection.
v2:
s/cp_content_type/content_protection_type [daniel] disable at hdcp_atomic_check to avoid check at atomic_set_property
[Maarten]
--- drivers/gpu/drm/i915/intel_ddi.c | 21 +++++++++++++++------ drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_hdcp.c | 30 +++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +15 -6
@@ -3499,7 +3499,8 @@ static void intel_enable_ddi(struct intel_encoder *encoder,/* Enable hdcp if it's desired */ if (conn_state->content_protection ==DRM_MODE_CONTENT_PROTECTION_DESIRED ) -intel_hdcp_enable (to_intel_connector (conn_state->connector)); +intel_hdcp_enable (to_intel_connector (conn_state->connector), + (u8 )conn_state->content_protection_type); } static void intel_disable_ddi_dp(struct intel_encoder *encoder,
@@ -3562,21 +3563,29 @@ static void intel_ddi_update_pipe_dp(struct intel_encoder *encoder,intel_panel_update_backlight (encoder, crtc_state, conn_state); } -static void intel_ddi_update_pipe (struct intel_encoder *encoder, +static void intel_ddi_update_hdcp (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state) { -if (!intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) -intel_ddi_update_pipe_dp (encoder, crtc_state, conn_state); -if (conn_state->content_protection ==DRM_MODE_CONTENT_PROTECTION_DESIRED ) -intel_hdcp_enable (to_intel_connector (conn_state->connector)); +intel_hdcp_enable (to_intel_connector (conn_state->connector), + (u8 )conn_state->content_protection_type);else if (conn_state->content_protection ==DRM_MODE_CONTENT_PROTECTION_UNDESIRED )intel_hdcp_disable (to_intel_connector (conn_state->connector)); } +static void intel_ddi_update_pipe (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state) +{ +if (!intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )) +intel_ddi_update_pipe_dp (encoder, crtc_state, conn_state); + +intel_ddi_update_hdcp (encoder, crtc_state, conn_state); +} +static void intel_ddi_set_fia_lane_count (struct intel_encoder *encoder,const struct intel_crtc_state *pipe_config,enum port port)
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -2172,7 +2172,7 @@ void intel_hdcp_atomic_check(struct drm_connector *connector, struct drm_connector_state *new_state);int intel_hdcp_init (struct intel_connector *connector,const struct intel_hdcp_shim *hdcp_shim); -int intel_hdcp_enable (struct intel_connector *connector); +int intel_hdcp_enable (struct intel_connector *connector,u8 content_type);int intel_hdcp_disable (struct intel_connector *connector);bool is_hdcp_supported (struct drm_i915_private *dev_priv,enum port port);bool intel_hdcp_capable (struct intel_connector *connector);
drivers/gpu/drm/i915/intel_hdcp.c +25 -5
@@ -1782,6 +1782,13 @@ static void intel_hdcp2_init(struct intel_connector *connector)return ; } + ret =drm_connector_attach_content_protection_type_property ( + &connector->base); +if (ret) { +kfree (hdcp->port_data.streams); +return ; + } + hdcp->hdcp2_supported = true; }
@@ -1811,7 +1818,7 @@ int intel_hdcp_init(struct intel_connector *connector,return 0 ; } -int intel_hdcp_enable (struct intel_connector *connector) +int intel_hdcp_enable (struct intel_connector *connector,u8 content_type) {struct intel_hdcp *hdcp = &connector->hdcp;unsigned long check_link_interval =DRM_HDCP_CHECK_PERIOD_MS ;
@@ -1822,6 +1829,7 @@ int intel_hdcp_enable(struct intel_connector *connector)mutex_lock (&hdcp->mutex);WARN_ON (hdcp->value ==DRM_MODE_CONTENT_PROTECTION_ENABLED ); + hdcp->content_type = content_type;/* * Considering that HDCP2.2 is more secure than HDCP1.4, If the setup
@@ -1833,8 +1841,12 @@ int intel_hdcp_enable(struct intel_connector *connector) check_link_interval =DRM_HDCP2_CHECK_PERIOD_MS ; } -/* When HDCP2.2 fails, HDCP1.4 will be attempted */ -if (ret &&intel_hdcp_capable (connector)) { +/* +* When HDCP2.2 fails and Content Type is not Type1, HDCP1.4 will +* be attempted. +*/ +if (ret &&intel_hdcp_capable (connector) && + hdcp->content_type !=DRM_MODE_CONTENT_PROTECTION_TYPE1 ) { ret =_intel_hdcp_enable (connector); }
@@ -1901,6 +1913,8 @@ void intel_hdcp_atomic_check(struct drm_connector *connector, {u64 old_cp = old_state->content_protection;u64 new_cp = new_state->content_protection; +u64 old_type = old_state->content_protection_type; +u64 new_type = new_state->content_protection_type;struct drm_crtc_state *crtc_state;if (!new_state->crtc) {
@@ -1920,8 +1934,14 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,*/ if (old_cp == new_cp || (old_cp ==DRM_MODE_CONTENT_PROTECTION_DESIRED && - new_cp ==DRM_MODE_CONTENT_PROTECTION_ENABLED )) -return ; + new_cp ==DRM_MODE_CONTENT_PROTECTION_ENABLED )) { +if (old_type == new_type) +return ; + + new_state->content_protection = +DRM_MODE_CONTENT_PROTECTION_DESIRED ; +intel_hdcp_disable (to_intel_connector (connector)); + } crtc_state =drm_atomic_get_new_crtc_state (new_state->state, new_state->crtc);
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/8 drm/i915: debugfs: HDCP2.2 capability read
In reply to Ramalingam CAdding the HDCP2.2 capability of HDCP src and sink info into debugfs entry "i915_hdcp_sink_capability"
This helps the userspace tests to skip the HDCP2.2 test on non HDCP2.2 sinks.
--- drivers/gpu/drm/i915/i915_debugfs.c | 13 +++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_hdcp.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +11 -2
@@ -4755,6 +4755,7 @@ static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data) {struct drm_connector *connector = m->private;struct intel_connector *intel_connector =to_intel_connector (connector); +bool hdcp_cap, hdcp2_cap;if (connector->status != connector_status_connected)return -ENODEV ;
@@ -4765,8 +4766,16 @@ static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)seq_printf (m,"%s:%d HDCP version: " , connector->name, connector->base.id); -seq_printf (m,"%s " , !intel_hdcp_capable (intel_connector) ? -"None" :"HDCP1.4" ); + hdcp_cap =intel_hdcp_capable (intel_connector); + hdcp2_cap =intel_hdcp2_capable (intel_connector); + +if (hdcp_cap) +seq_puts (m,"HDCP1.4 " ); +if (hdcp2_cap) +seq_puts (m,"HDCP2.2 " ); + +if (!hdcp_cap && !hdcp2_cap) +seq_puts (m,"None" );seq_puts (m,"\n" );return 0 ;
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -2176,6 +2176,7 @@ int intel_hdcp_enable(struct intel_connector *connector);int intel_hdcp_disable (struct intel_connector *connector);bool is_hdcp_supported (struct drm_i915_private *dev_priv,enum port port);bool intel_hdcp_capable (struct intel_connector *connector); +bool intel_hdcp2_capable (struct intel_connector *connector);void intel_hdcp_component_init (struct drm_i915_private *dev_priv);void intel_hdcp_component_fini (struct drm_i915_private *dev_priv);void intel_hdcp_cleanup (struct intel_connector *connector);
drivers/gpu/drm/i915/intel_hdcp.c +1 -1
@@ -76,7 +76,7 @@ bool intel_hdcp_capable(struct intel_connector *connector) }/* Is HDCP2.2 capable on Platform and Sink */ -static bool intel_hdcp2_capable (struct intel_connector *connector) +bool intel_hdcp2_capable (struct intel_connector *connector) {struct drm_i915_private *dev_priv =to_i915 (connector->base.dev);struct intel_digital_port *intel_dig_port =conn_to_dig_port (connector);
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for HDCP2.2 Content Type support
In reply to Ramalingam C== Series Details ==
== Series Details ==
Series: HDCP2.2 Content Type support
URL : https://patchwork.freedesktop.org/series/57757/
State : failure
== Summary ==
Series 57757 revision 1 Test-with: [email protected] not found
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx