HDCP2.2 Phase II
Subsystems (3)
v2 cover HDCP2.2 Phase II
HDCP2.2 phase-II mojorly adds below features:
Addition of three connector properties
CP_Content_Type
CP_Downstream_Info
Addition of binary sysfs "hdcp_srm"
parsing for HDCP1.4 and 2.2 SRM table
Once HDCP1.4/2.2 authentication is completed gathering the all
downstream topology for userspace
Extending debugfs entry to provide the HDCP2.2 capability too.
CP_Content_Type:
This property is used to indicate the content type
classification of a stream. Which indicate the HDCP version required for the rendering of that streams. This conten type is one of the parameter in the HDCP2.2 authentication flow, as even downstream repeaters will mandate the HDCP version requirement.
Two values possible for content type of a stream:
Type 0: Stream can be rendered only on HDCP encrypted link no
restriction on HDCP versions.
Type 1: Stream can be rendered only on HDCP2.2 encrypted link.
There is a parallel effort in #wayland community to add the support for HDCP2.2 along with content type support. Patches are under review in #wayland community.
CP_downstream_info:
This blob property is used by the kernel to pass the downstream topology of the HDCP encrypted port to the userspace.
This is used by the userspace to implement the HDCP repeater, which KMD implementing the HDCP transmitters(downstream ports) and userspace implementing the upstream port(HDCP receiver).
Discussion is on going to add the downstream_info support in the weston HDCP stack.
hdcp_srm: write only binary sysfs used by the userspace to pass the SRM table of HDCP1.4 and 2.2. These are nothing but revocated list of receiver IDs of the HDCP sinks. KMD will use this list to identify the revocated devices in the HDCP authentication and deny the hdcp encryption to it.
Test-with: [email protected]
v2:
srm is passed through binary sysfs [Daniel]
CP abbreviation is expanded except for downstream_info [Daniel] restrictions at atomic_set_property is removed [Maarten] upon content type change durin encryption, HDCP is restarted within
kernel [Maarten]
Please note content_type support is submitted for review separately at
https://patchwork.freedesktop.org/series/57757/
Still retained here for dependancy and testing all of them together.
Ramalingam C (8):
drm/i915: debugfs: HDCP2.2 capability read
drm: Add Content protection type property
drm/i915: Attach content type property
drm/i915: HDCP SRM parsing and revocation check
drm/i915/sysfs: Node for hdcp srm
drm: Add CP downstream_info property
drm/i915: Populate downstream info for HDCP1.4
drm/i915: Populate downstream info for HDCP2.2
drivers/gpu/drm/drm_atomic_uapi.c | 8 + drivers/gpu/drm/drm_connector.c | 152 +++++++++++ drivers/gpu/drm/i915/i915_debugfs.c | 13 +- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm/i915/i915_drv.h | 6 + drivers/gpu/drm/i915/i915_sysfs.c | 32 +++ drivers/gpu/drm/i915/intel_ddi.c | 21 +- drivers/gpu/drm/i915/intel_drv.h | 7 +- drivers/gpu/drm/i915/intel_hdcp.c | 405 ++++++++++++++++++++++++++-- include/drm/drm_connector.h | 27 ++ include/drm/drm_hdcp.h | 33 +++ include/uapi/drm/drm_mode.h | 39 +++ 12 files changed, 712 insertions(+), 32 deletions(-)
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
Adding 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
PATCH v2 2/8 drm: Add Content protection type property
In reply to Ramalingam CThis 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 3/8 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 4/8 drm/i915: HDCP SRM parsing and revocation check
In reply to Ramalingam CImplements the SRM table parsing for HDCP 1.4 and 2.2. And also revocation check is added at authentication of HDCP1.4 and 2.2
--- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm/i915/i915_drv.h | 6 + drivers/gpu/drm/i915/intel_drv.h | 2 + drivers/gpu/drm/i915/intel_hdcp.c | 308 ++++++++++++++++++++++++++++-- include/drm/drm_hdcp.h | 32 ++++ 5 files changed, 334 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +1 -0
@@ -873,6 +873,7 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv)mutex_init (&dev_priv->wm.wm_mutex);mutex_init (&dev_priv->pps_mutex);mutex_init (&dev_priv->hdcp_comp_mutex); +mutex_init (&dev_priv->srm_mutex);i915_memcpy_init_early (dev_priv);intel_runtime_pm_init_early (dev_priv);
drivers/gpu/drm/i915/i915_drv.h +6 -0
@@ -2054,6 +2054,12 @@ struct drm_i915_private {/* Mutex to protect the above hdcp component related values. */ struct mutex hdcp_comp_mutex; +unsigned int revocated_ksv_cnt; +u8 *revocated_ksv_list; + +/* Mutex to protect the data about revocated ksvs */ +struct mutex srm_mutex; +/* * NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch * will be rejected. Instead look for a better place.
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -2181,6 +2181,8 @@ 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);void intel_hdcp_handle_cp_irq (struct intel_connector *connector); +ssize_t intel_hdcp_srm_update (struct drm_i915_private *dev_priv,char *buf, +size_t count);/* intel_psr.c */ #define CAN_PSR (dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
drivers/gpu/drm/i915/intel_hdcp.c +293 -15
389 lines not on this page · raw message
include/drm/drm_hdcp.h +32 -0
@@ -265,4 +265,36 @@ void drm_hdcp2_u32_to_seq_num(u8 seq_num[HDCP_2_2_SEQ_NUM_LEN], u32 val) seq_num[2] = val; } +#define DRM_HDCP_1_4_SRM_ID 0x8 +#define DRM_HDCP_1_4_VRL_LENGTH_SIZE 3 +#define DRM_HDCP_1_4_DCP_SIG_SIZE 40 + +struct hdcp_srm_header { +struct { +u8 reserved_hi:4 ; +u8 srm_id:4 ; +u8 reserved_lo; + } spec_indicator; +u16 srm_version; +u8 srm_gen_no; +} __packed; + +#define DRM_HDCP_2_SRM_ID 0x9 +#define DRM_HDCP_2_INDICATOR 0x1 +#define DRM_HDCP_2_VRL_LENGTH_SIZE 3 +#define DRM_HDCP_2_DCP_SIG_SIZE 384 +#define DRM_HDCP_2_NO_OF_DEV_PLUS_RESERVED_SZ 4 + +#define DRM_HDCP_2_KSV_COUNT_2_LSBITS (byte) (((byte) & 0xC) >> 6) + +struct hdcp2_srm_header { +struct { +u8 hdcp2_indicator:4 ; +u8 srm_id:4 ; +u8 reserved; + } spec_indicator; +u16 srm_version; +u8 srm_gen_no; +} __packed; +#endif
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 5/8 drm/i915/sysfs: Node for hdcp srm
In reply to Ramalingam CBinary Sysfs entry is created to pass the HDCP SRM table into kerel for the HDCP authentication purpose.
--- drivers/gpu/drm/i915/i915_sysfs.c | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +32 -0
@@ -576,6 +576,36 @@ static void i915_setup_error_capture(struct device *kdev) {}static void i915_teardown_error_capture (struct device *kdev) {}#endif +static ssize_t +i915_srm_write (struct file *filp,struct kobject *kobj, +struct bin_attribute *attr,char *buf, +loff_t offset,size_t count) +{ +struct device *kdev =kobj_to_dev (kobj); +struct drm_i915_private *dev_priv =kdev_minor_to_i915 (kdev); + +return intel_hdcp_srm_update (dev_priv, buf, count); +} + +static const struct bin_attribute srm_attrs = { + .attr = {.name ="hdcp_srm" , .mode =S_IWUSR }, + .read =NULL , + .write = i915_srm_write, + .mmap =NULL , + .private = (void *)0 +}; + +static void i915_setup_hdcp_srm (struct device *kdev) +{ +if (sysfs_create_bin_file (&kdev->kobj, &srm_attrs)) +DRM_ERROR ("error_state sysfs setup failed\n" ); +} + +static void i915_teardown_hdcp_srm (struct device *kdev) +{ +sysfs_remove_bin_file (&kdev->kobj, &srm_attrs); +} +void i915_setup_sysfs (struct drm_i915_private *dev_priv) {struct device *kdev = dev_priv->drm.primary->kdev;
@@ -623,12 +653,14 @@ void i915_setup_sysfs(struct drm_i915_private *dev_priv)DRM_ERROR ("RPS sysfs setup failed\n" );i915_setup_error_capture (kdev); +i915_setup_hdcp_srm (kdev); }void i915_teardown_sysfs (struct drm_i915_private *dev_priv) {struct device *kdev = dev_priv->drm.primary->kdev; +i915_teardown_hdcp_srm (kdev);i915_teardown_error_capture (kdev);if (IS_VALLEYVIEW (dev_priv) ||IS_CHERRYVIEW (dev_priv))
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 6/8 drm: Add CP downstream_info property
In reply to Ramalingam CThis patch adds a optional CP downstream info blob property to the connectors. This enables the Userspace to read the information of HDCP authenticated downstream topology.
Driver will updated this blob with all downstream information at the end of the authentication.
In case userspace configures this platform as repeater, then this information is needed for the authentication with upstream HDCP transmitter.
v2:
%s/cp_downstream/content_protection_downstream [daniel]
--- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++ drivers/gpu/drm/drm_connector.c | 89 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 12 +++++ include/uapi/drm/drm_mode.h | 27 ++++++++++ 4 files changed, 132 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +4 -0
@@ -826,6 +826,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = state->content_protection; }else if (property == connector->content_protection_type_property) { *val = state->content_protection_type; + }else if (property == + connector->content_protection_downstream_property) { + *val = connector->content_protection_downstream_blob_ptr ? + connector->content_protection_downstream_blob_ptr->base.id :0 ; }else if (property == config->writeback_fb_id_property) {/* Writeback framebuffer is one-shot, write and forget */ *val =0 ;
drivers/gpu/drm/drm_connector.c +89 -0
107 lines not on this page · raw message
include/drm/drm_connector.h +12 -0
@@ -1047,6 +1047,13 @@ struct drm_connector {*/ struct drm_property *content_protection_type_property; +/** +* @content_protection_downstream_property: DRM BLOB property for +* content protection downstream information. +*/ +struct drm_property *content_protection_downstream_property; +struct drm_property_blob *content_protection_downstream_blob_ptr; +/** * @path_blob_ptr: *
@@ -1324,6 +1331,11 @@ 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_connector_attach_content_protection_downstream_property ( +struct drm_connector *connector); +int drm_connector_update_content_protection_downstream_property ( +struct drm_connector *connector, +const struct content_protection_downstream_info *info);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 +27 -0
@@ -214,6 +214,33 @@ extern "C" {#define DRM_MODE_CONTENT_PROTECTION_TYPE0 0#define DRM_MODE_CONTENT_PROTECTION_TYPE1 1 +#define DRM_MODE_HDCP_KSV_LEN 5 +#define DRM_MODE_HDCP_MAX_DEVICE_CNT 127 + +struct content_protection_downstream_info { +/* KSV of immediate HDCP Sink. In Little-Endian Format. */ +char bksv[DRM_MODE_HDCP_KSV_LEN ]; + +/* Whether Immediate HDCP sink is a repeater? */ +bool is_repeater; + +/* Depth received from immediate downstream repeater */ +__u8 depth; + +/* Device count received from immediate downstream repeater */ +__u32 device_count; + +/* +* Max buffer required to hold ksv list received from immediate +* repeater. In this array first device_count * DRM_MODE_HDCP_KSV_LEN +* will hold the valid ksv bytes. +* If authentication specification is +* HDCP1.4 - each KSV's Bytes will be in Little-Endian format. +* HDCP2.2 - each KSV's Bytes will be in Big-Endian format. +*/ +char ksv_list[DRM_MODE_HDCP_KSV_LEN *DRM_MODE_HDCP_MAX_DEVICE_CNT ]; +}; +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 7/8 drm/i915: Populate downstream info for HDCP1.4
In reply to Ramalingam CImplements drm blob property content_protection_downstream_info property on HDCP capable connectors.
Downstream topology info is gathered across authentication stages and stored in intel_hdcp. When HDCP authentication is complete, new blob with latest downstream topology information is updated to content_protection_downstream_info property.
v2:
%s/cp_downstream/content_protection_downstream [daniel]
--- drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdcp.c | 35 ++++++++++++++++++++++++++++++- include/drm/drm_hdcp.h | 1 + include/uapi/drm/drm_mode.h | 5 +++++ 4 files changed, 42 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -482,6 +482,8 @@ struct intel_hdcp {wait_queue_head_t cp_irq_queue;atomic_t cp_irq_count;int cp_irq_count_cached; + +struct content_protection_downstream_info *downstream_info; };struct intel_connector {
drivers/gpu/drm/i915/intel_hdcp.c +34 -1
@@ -580,6 +580,9 @@ int intel_hdcp_auth_downstream(struct intel_hdcp *hdcp,if (num_downstream ==0 )return -EINVAL ; + hdcp->downstream_info->device_count = num_downstream; + hdcp->downstream_info->depth =DRM_HDCP_DEPTH (bstatus[1 ]); + ksv_fifo =kcalloc (DRM_HDCP_KSV_LEN , num_downstream,GFP_KERNEL );if (!ksv_fifo)return -ENOMEM ;
@@ -593,6 +596,8 @@ int intel_hdcp_auth_downstream(struct intel_hdcp *hdcp,return -EPERM ; } +memcpy (hdcp->downstream_info->ksv_list, ksv_fifo, + num_downstream *DRM_HDCP_KSV_LEN );/* * When V prime mismatches, DP Spec mandates re-read of * V prime atleast twice.
@@ -694,15 +699,20 @@ static int intel_hdcp_auth(struct intel_connector *connector)return -EPERM ; } + hdcp->downstream_info->ver_in_force =DRM_MODE_HDCP14_IN_FORCE ; +memcpy (hdcp->downstream_info->bksv, bksv.shim,DRM_MODE_HDCP_KSV_LEN ); +I915_WRITE (PORT_HDCP_BKSVLO (port), bksv.reg[0 ]);I915_WRITE (PORT_HDCP_BKSVHI (port), bksv.reg[1 ]); ret = shim->repeater_present (intel_dig_port, &repeater_present);if (ret)return ret; -if (repeater_present) +if (repeater_present) {I915_WRITE (HDCP_REP_CTL ,intel_hdcp_get_repeater_ctl (intel_dig_port)); + hdcp->downstream_info->is_repeater = true; + } ret = shim->toggle_signalling (intel_dig_port, true);if (ret)
@@ -798,6 +808,14 @@ static int _intel_hdcp_disable(struct intel_connector *connector)return ret; } +memset (hdcp->downstream_info,0 , +sizeof (struct content_protection_downstream_info )); + +if (drm_connector_update_content_protection_downstream_property ( + &connector->base, + connector->hdcp.downstream_info)) +DRM_ERROR ("Downstream_info update failed.\n" ); +DRM_DEBUG_KMS ("HDCP is disabled\n" );return 0 ; }
@@ -831,6 +849,10 @@ static int _intel_hdcp_enable(struct intel_connector *connector) ret =intel_hdcp_auth (connector);if (!ret) { connector->hdcp.hdcp_encrypted = true; +if (drm_connector_update_content_protection_downstream_property ( + &connector->base, + connector->hdcp.downstream_info)) +DRM_ERROR ("Downstream_info update failed.\n" );return 0 ; }
@@ -1882,6 +1904,17 @@ int intel_hdcp_init(struct intel_connector *connector,if (ret)return ret; + ret =drm_connector_attach_content_protection_downstream_property ( + &connector->base); +if (ret) +return ret; + + hdcp->downstream_info = +kzalloc (sizeof (struct content_protection_downstream_info ), +GFP_KERNEL ); +if (!hdcp->downstream_info) +return -ENOMEM ; + hdcp->shim = shim;mutex_init (&hdcp->mutex);INIT_DELAYED_WORK (&hdcp->check_work, intel_hdcp_check_work);
include/drm/drm_hdcp.h +1 -0
@@ -23,6 +23,7 @@#define DRM_HDCP_V_PRIME_PART_LEN 4#define DRM_HDCP_V_PRIME_NUM_PARTS 5#define DRM_HDCP_NUM_DOWNSTREAM (x) (x & 0x7f) +#define DRM_HDCP_DEPTH (x) ((x) & 0x7)#define DRM_HDCP_MAX_CASCADE_EXCEEDED (x) (x & BIT(3))#define DRM_HDCP_MAX_DEVICE_EXCEEDED (x) (x & BIT(7))
include/uapi/drm/drm_mode.h +5 -0
@@ -216,8 +216,13 @@ extern "C" {#define DRM_MODE_HDCP_KSV_LEN 5#define DRM_MODE_HDCP_MAX_DEVICE_CNT 127 +#define DRM_MODE_HDCP14_IN_FORCE (1 << 0) +#define DRM_MODE_HDCP22_IN_FORCE (1 << 1)struct content_protection_downstream_info { +/* Version of HDCP authenticated (1.4/2.2) */ +__u32 ver_in_force; +/* KSV of immediate HDCP Sink. In Little-Endian Format. */ char bksv[DRM_MODE_HDCP_KSV_LEN ];
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 8/8 drm/i915: Populate downstream info for HDCP2.2
In reply to Ramalingam CPopulates the downstream info for HDCP2.2 encryption also. On success of encryption Blob is updated.
Additional two variable are added to downstream info blob. Such as ver_in_force and content type.
v2:
s/cp_downstream/content_protection_downstream [daniel]
--- drivers/gpu/drm/i915/intel_hdcp.c | 30 +++++++++++++++++++++++++++++- include/uapi/drm/drm_mode.h | 3 +++ 2 files changed, 32 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdcp.c +29 -1
@@ -1283,6 +1283,12 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)return -EPERM ; } + hdcp->downstream_info->ver_in_force =DRM_MODE_HDCP22_IN_FORCE ; + hdcp->downstream_info->content_type = hdcp->content_type; +memcpy (hdcp->downstream_info->bksv, msgs.send_cert.cert_rx.receiver_id, +HDCP_2_2_RECEIVER_ID_LEN ); + hdcp->downstream_info->is_repeater = hdcp->is_repeater; +/* * Here msgs.no_stored_km will hold msgs corresponding to the km * stored also.
@@ -1474,6 +1480,11 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)return -EPERM ; } + hdcp->downstream_info->device_count = device_cnt; + hdcp->downstream_info->depth =HDCP_2_2_DEPTH (rx_info[0 ]); +memcpy (hdcp->downstream_info->ksv_list, msgs.recvid_list.receiver_ids, + device_cnt *HDCP_2_2_RECEIVER_ID_LEN ); + ret =hdcp2_verify_rep_topology_prepare_ack (connector, &msgs.recvid_list, &msgs.rep_ack);
@@ -1660,6 +1671,13 @@ static int _intel_hdcp2_enable(struct intel_connector *connector)if (ret) {DRM_DEBUG_KMS ("HDCP2 Type%d Enabling Failed. (%d)\n" , hdcp->content_type, ret); + +memset (hdcp->downstream_info,0 , +sizeof (struct content_protection_downstream_info )); +drm_connector_update_content_protection_downstream_property ( + &connector->base, + hdcp->downstream_info); +return ret; }
@@ -1667,12 +1685,17 @@ static int _intel_hdcp2_enable(struct intel_connector *connector) connector->base.name, connector->base.base.id, hdcp->content_type); +drm_connector_update_content_protection_downstream_property ( + &connector->base, + hdcp->downstream_info); hdcp->hdcp2_encrypted = true; +return 0 ; }static int _intel_hdcp2_disable (struct intel_connector *connector) { +struct intel_hdcp *hdcp = &connector->hdcp;int ret; DRM_DEBUG_KMS("[%s:%d] HDCP2.2 is being Disabled\n",
@@ -1683,8 +1706,13 @@ static int _intel_hdcp2_disable(struct intel_connector *connector)if (hdcp2_deauthenticate_port (connector) <0 )DRM_DEBUG_KMS ("Port deauth failed.\n" ); - connector->hdcp.hdcp2_encrypted = false; + hdcp->hdcp2_encrypted = false; +memset (hdcp->downstream_info,0 , +sizeof (struct content_protection_downstream_info )); +drm_connector_update_content_protection_downstream_property ( + &connector->base, + hdcp->downstream_info);return ret; }
include/uapi/drm/drm_mode.h +3 -0
@@ -223,6 +223,9 @@ struct content_protection_downstream_info {/* Version of HDCP authenticated (1.4/2.2) */ __u32 ver_in_force; +/* Applicable only for HDCP2.2 */ +__u8 content_type; +/* KSV of immediate HDCP Sink. In Little-Endian Format. */ char bksv[DRM_MODE_HDCP_KSV_LEN ];
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 Phase II (rev2)
In reply to Ramalingam C== Series Details ==
== Series Details ==
Series: HDCP2.2 Phase II (rev2)
URL : https://patchwork.freedesktop.org/series/57232/
State : failure
== Summary ==
Series 57232 revision 2 Test-with: [email protected] not found
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx