[v9,02/39] drm: header for i915 - MEI_HDCP interface

Submitted by Ramalingam C on Dec. 13, 2018, 4:01 a.m.

Details

Message ID 1544673701-6353-3-git-send-email-ramalingam.c@intel.com
State New
Headers show
Series "drm/i915: Implement HDCP2.2" ( rev: 12 11 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Ramalingam C Dec. 13, 2018, 4:01 a.m.
Header defines the interface for the I915 and MEI_HDCP drivers.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 include/drm/i915_mei_hdcp_interface.h | 132 ++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100644 include/drm/i915_mei_hdcp_interface.h

Patch hide | download patch | download mbox

diff --git a/include/drm/i915_mei_hdcp_interface.h b/include/drm/i915_mei_hdcp_interface.h
new file mode 100644
index 000000000000..e3b7fb32612a
--- /dev/null
+++ b/include/drm/i915_mei_hdcp_interface.h
@@ -0,0 +1,132 @@ 
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/*
+ * Copyright © 2017-2018 Intel Corporation
+ *
+ * Authors:
+ * Ramalingam C <ramalingam.c@intel.com>
+ */
+
+#ifndef _I915_MEI_HDCP_INTERFACE_H_
+#define _I915_MEI_HDCP_INTERFACE_H_
+
+#include <linux/mutex.h>
+#include <drm/drm_hdcp.h>
+
+/**
+ * enum hdcp_port_type - HDCP port implementation type defined by ME FW
+ * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type
+ * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port
+ * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON
+ *			   (HDMI 2.0) solution
+ * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP (DP 1.3)
+ *			 solution
+ */
+enum hdcp_port_type {
+	HDCP_PORT_TYPE_INVALID,
+	HDCP_PORT_TYPE_INTEGRATED,
+	HDCP_PORT_TYPE_LSPCON,
+	HDCP_PORT_TYPE_CPDP
+};
+
+/**
+ * enum hdcp_wired_protocol - HDCP adaptation used on the port
+ * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol
+ * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port
+ * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port
+ */
+enum hdcp_wired_protocol {
+	HDCP_PROTOCOL_INVALID,
+	HDCP_PROTOCOL_HDMI,
+	HDCP_PROTOCOL_DP
+};
+
+/**
+ * struct hdcp_port_data - intel specific HDCP port data
+ * @port: port index as per I915
+ * @port_type: HDCP port type as per ME FW classification
+ * @protocol: HDCP adaptation as per ME FW
+ * @k: No of streams transmitted on a port. Only on DP MST this is != 1
+ * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated.
+ *	       Initialized to 0 on AKE_INIT. Incremented after every successful
+ *	       transmission of RepeaterAuth_Stream_Manage message. When it rolls
+ *	       over re-Auth has to be triggered.
+ * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the
+ *	     streams
+ */
+struct hdcp_port_data {
+	short int port;
+	u8 port_type;
+	u8 protocol;
+	u16 k;
+	u32 seq_num_m;
+	struct hdcp2_streamid_type *streams;
+};
+
+/**
+ * struct i915_hdcp_component_ops- ops for HDCP2.2 services.
+ * @owner: Module providing the ops
+ * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.
+ *			    And Prepare AKE_Init.
+ * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate
+ *				     AKE_Send_Cert and prepare
+				     AKE_Stored_Km/AKE_No_Stored_Km
+ * @verify_hprime: Verify AKE_Send_H_prime
+ * @store_pairing_info: Store pairing info received
+ * @initiate_locality_check: Prepare LC_Init
+ * @verify_lprime: Verify lprime
+ * @get_session_key: Prepare SKE_Send_Eks
+ * @repeater_check_flow_prepare_ack: Validate the Downstream topology
+ *				     and prepare rep_ack
+ * @verify_mprime: Verify mprime
+ * @enable_hdcp_authentication:  Mark a port as authenticated.
+ * @close_hdcp_session: Close the Wired HDCP Tx session per port.
+ *			This also disables the authenticated state of the port.
+ */
+struct i915_hdcp_component_ops {
+	/**
+	 * @owner: mei_hdcp module
+	 */
+	struct module *owner;
+
+	int (*initiate_hdcp2_session)(struct device *dev,
+				      struct hdcp_port_data *data,
+				      struct hdcp2_ake_init *ake_data);
+	int (*verify_receiver_cert_prepare_km)(struct device *dev,
+					       struct hdcp_port_data *data,
+					       struct hdcp2_ake_send_cert
+								*rx_cert,
+					       bool *km_stored,
+					       struct hdcp2_ake_no_stored_km
+								*ek_pub_km,
+					       size_t *msg_sz);
+	int (*verify_hprime)(struct device *dev,
+			     struct hdcp_port_data *data,
+			     struct hdcp2_ake_send_hprime *rx_hprime);
+	int (*store_pairing_info)(struct device *dev,
+				  struct hdcp_port_data *data,
+				  struct hdcp2_ake_send_pairing_info
+								*pairing_info);
+	int (*initiate_locality_check)(struct device *dev,
+				       struct hdcp_port_data *data,
+				       struct hdcp2_lc_init *lc_init_data);
+	int (*verify_lprime)(struct device *dev,
+			     struct hdcp_port_data *data,
+			     struct hdcp2_lc_send_lprime *rx_lprime);
+	int (*get_session_key)(struct device *dev,
+			       struct hdcp_port_data *data,
+			       struct hdcp2_ske_send_eks *ske_data);
+	int (*repeater_check_flow_prepare_ack)(struct device *dev,
+					       struct hdcp_port_data *data,
+					       struct hdcp2_rep_send_receiverid_list
+								*rep_topology,
+					       struct hdcp2_rep_send_ack
+								*rep_send_ack);
+	int (*verify_mprime)(struct device *dev,
+			     struct hdcp_port_data *data,
+			     struct hdcp2_rep_stream_ready *stream_ready);
+	int (*enable_hdcp_authentication)(struct device *dev,
+					  struct hdcp_port_data *data);
+	int (*close_hdcp_session)(struct device *dev,
+				  struct hdcp_port_data *data);
+};
+#endif /* _I915_MEI_HDCP_NTERFACE_H_ */

Comments

> 

> Header defines the interface for the I915 and MEI_HDCP drivers.

> 

> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>

> ---

>  include/drm/i915_mei_hdcp_interface.h | 132

> ++++++++++++++++++++++++++++++++++

>  1 file changed, 132 insertions(+)

>  create mode 100644 include/drm/i915_mei_hdcp_interface.h

> 

> diff --git a/include/drm/i915_mei_hdcp_interface.h

> b/include/drm/i915_mei_hdcp_interface.h

> new file mode 100644

> index 000000000000..e3b7fb32612a

> --- /dev/null

> +++ b/include/drm/i915_mei_hdcp_interface.h



This should be just 'i915_hdcp_interface.h' 

> @@ -0,0 +1,132 @@

> +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */

> +/*

> + * Copyright © 2017-2018 Intel Corporation

> + *

> + * Authors:

> + * Ramalingam C <ramalingam.c@intel.com>  */

> +

> +#ifndef _I915_MEI_HDCP_INTERFACE_H_

> +#define _I915_MEI_HDCP_INTERFACE_H_

Drop MEI
> +

> +#include <linux/mutex.h>

> +#include <drm/drm_hdcp.h>

> +

> +/**

> + * enum hdcp_port_type - HDCP port implementation type defined by ME FW

> + * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type

> + * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port

> + * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON

> + *			   (HDMI 2.0) solution

> + * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP

> (DP 1.3)

> + *			 solution

> + */

> +enum hdcp_port_type {

> +	HDCP_PORT_TYPE_INVALID,

> +	HDCP_PORT_TYPE_INTEGRATED,

> +	HDCP_PORT_TYPE_LSPCON,

> +	HDCP_PORT_TYPE_CPDP

> +};

> +

> +/**

> + * enum hdcp_wired_protocol - HDCP adaptation used on the port

> + * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol

> + * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port

> + * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port  */ enum

> +hdcp_wired_protocol {

> +	HDCP_PROTOCOL_INVALID,

> +	HDCP_PROTOCOL_HDMI,

> +	HDCP_PROTOCOL_DP

> +};

> +

> +/**

> + * struct hdcp_port_data - intel specific HDCP port data

> + * @port: port index as per I915

> + * @port_type: HDCP port type as per ME FW classification

> + * @protocol: HDCP adaptation as per ME FW

> + * @k: No of streams transmitted on a port. Only on DP MST this is != 1

> + * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated.

> + *	       Initialized to 0 on AKE_INIT. Incremented after every successful

> + *	       transmission of RepeaterAuth_Stream_Manage message. When it

> rolls

> + *	       over re-Auth has to be triggered.

> + * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the

> + *	     streams

> + */

> +struct hdcp_port_data {

> +	short int port;

> +	u8 port_type;

> +	u8 protocol;

> +	u16 k;

> +	u32 seq_num_m;

> +	struct hdcp2_streamid_type *streams;

> +};

> +

> +/**

> + * struct i915_hdcp_component_ops- ops for HDCP2.2 services.

> + * @owner: Module providing the ops

> + * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.

> + *			    And Prepare AKE_Init.

> + * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate

> + *				     AKE_Send_Cert and prepare

> +				     AKE_Stored_Km/AKE_No_Stored_Km

> + * @verify_hprime: Verify AKE_Send_H_prime

> + * @store_pairing_info: Store pairing info received

> + * @initiate_locality_check: Prepare LC_Init

> + * @verify_lprime: Verify lprime

> + * @get_session_key: Prepare SKE_Send_Eks

> + * @repeater_check_flow_prepare_ack: Validate the Downstream topology

> + *				     and prepare rep_ack

> + * @verify_mprime: Verify mprime

> + * @enable_hdcp_authentication:  Mark a port as authenticated.

> + * @close_hdcp_session: Close the Wired HDCP Tx session per port.

> + *			This also disables the authenticated state of the port.

> + */

> +struct i915_hdcp_component_ops {

> +	/**

> +	 * @owner: mei_hdcp module

> +	 */

> +	struct module *owner;

> +

> +	int (*initiate_hdcp2_session)(struct device *dev,

> +				      struct hdcp_port_data *data,

> +				      struct hdcp2_ake_init *ake_data);

> +	int (*verify_receiver_cert_prepare_km)(struct device *dev,

> +					       struct hdcp_port_data *data,

> +					       struct hdcp2_ake_send_cert

> +								*rx_cert,

> +					       bool *km_stored,

> +					       struct hdcp2_ake_no_stored_km

> +								*ek_pub_km,

> +					       size_t *msg_sz);

> +	int (*verify_hprime)(struct device *dev,

> +			     struct hdcp_port_data *data,

> +			     struct hdcp2_ake_send_hprime *rx_hprime);

> +	int (*store_pairing_info)(struct device *dev,

> +				  struct hdcp_port_data *data,

> +				  struct hdcp2_ake_send_pairing_info

> +

> 	*pairing_info);

> +	int (*initiate_locality_check)(struct device *dev,

> +				       struct hdcp_port_data *data,

> +				       struct hdcp2_lc_init *lc_init_data);

> +	int (*verify_lprime)(struct device *dev,

> +			     struct hdcp_port_data *data,

> +			     struct hdcp2_lc_send_lprime *rx_lprime);

> +	int (*get_session_key)(struct device *dev,

> +			       struct hdcp_port_data *data,

> +			       struct hdcp2_ske_send_eks *ske_data);

> +	int (*repeater_check_flow_prepare_ack)(struct device *dev,

> +					       struct hdcp_port_data *data,

> +					       struct

> hdcp2_rep_send_receiverid_list

> +

> 	*rep_topology,

> +					       struct hdcp2_rep_send_ack

> +

> 	*rep_send_ack);

> +	int (*verify_mprime)(struct device *dev,

> +			     struct hdcp_port_data *data,

> +			     struct hdcp2_rep_stream_ready *stream_ready);

> +	int (*enable_hdcp_authentication)(struct device *dev,

> +					  struct hdcp_port_data *data);

> +	int (*close_hdcp_session)(struct device *dev,

> +				  struct hdcp_port_data *data);

> +};

> +#endif /* _I915_MEI_HDCP_NTERFACE_H_ */

DROP MEI
> 2.7.4
On Mon, Dec 17, 2018 at 12:28 PM Winkler, Tomas <tomas.winkler@intel.com> wrote:
>
> >
> > Header defines the interface for the I915 and MEI_HDCP drivers.
> >
> > Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> > ---
> >  include/drm/i915_mei_hdcp_interface.h | 132
> > ++++++++++++++++++++++++++++++++++
> >  1 file changed, 132 insertions(+)
> >  create mode 100644 include/drm/i915_mei_hdcp_interface.h
> >
> > diff --git a/include/drm/i915_mei_hdcp_interface.h
> > b/include/drm/i915_mei_hdcp_interface.h
> > new file mode 100644
> > index 000000000000..e3b7fb32612a
> > --- /dev/null
> > +++ b/include/drm/i915_mei_hdcp_interface.h
>
>
> This should be just 'i915_hdcp_interface.h'

We have other hdcp engines than the mei one. Discrete gpus will
definitely get a differnt hdcp2 engine even, can't rely on ME for
those. Keeping mei in the names to make that clear makes sense to me,
removing it would just cause more confusion I think.

We already had the entire "should we have a common hdcp interface in
drm" discussion when we orginally landed this, and looking at all the
intel and non-intel implementations floating around that didn't make
sense, due to lack of comonality of how things flow and interact with
the hdmi/dp ports.
-Daniel

>
> > @@ -0,0 +1,132 @@
> > +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
> > +/*
> > + * Copyright © 2017-2018 Intel Corporation
> > + *
> > + * Authors:
> > + * Ramalingam C <ramalingam.c@intel.com>  */
> > +
> > +#ifndef _I915_MEI_HDCP_INTERFACE_H_
> > +#define _I915_MEI_HDCP_INTERFACE_H_
> Drop MEI
> > +
> > +#include <linux/mutex.h>
> > +#include <drm/drm_hdcp.h>
> > +
> > +/**
> > + * enum hdcp_port_type - HDCP port implementation type defined by ME FW
> > + * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type
> > + * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port
> > + * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON
> > + *                      (HDMI 2.0) solution
> > + * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP
> > (DP 1.3)
> > + *                    solution
> > + */
> > +enum hdcp_port_type {
> > +     HDCP_PORT_TYPE_INVALID,
> > +     HDCP_PORT_TYPE_INTEGRATED,
> > +     HDCP_PORT_TYPE_LSPCON,
> > +     HDCP_PORT_TYPE_CPDP
> > +};
> > +
> > +/**
> > + * enum hdcp_wired_protocol - HDCP adaptation used on the port
> > + * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol
> > + * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port
> > + * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port  */ enum
> > +hdcp_wired_protocol {
> > +     HDCP_PROTOCOL_INVALID,
> > +     HDCP_PROTOCOL_HDMI,
> > +     HDCP_PROTOCOL_DP
> > +};
> > +
> > +/**
> > + * struct hdcp_port_data - intel specific HDCP port data
> > + * @port: port index as per I915
> > + * @port_type: HDCP port type as per ME FW classification
> > + * @protocol: HDCP adaptation as per ME FW
> > + * @k: No of streams transmitted on a port. Only on DP MST this is != 1
> > + * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated.
> > + *          Initialized to 0 on AKE_INIT. Incremented after every successful
> > + *          transmission of RepeaterAuth_Stream_Manage message. When it
> > rolls
> > + *          over re-Auth has to be triggered.
> > + * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the
> > + *        streams
> > + */
> > +struct hdcp_port_data {
> > +     short int port;
> > +     u8 port_type;
> > +     u8 protocol;
> > +     u16 k;
> > +     u32 seq_num_m;
> > +     struct hdcp2_streamid_type *streams;
> > +};
> > +
> > +/**
> > + * struct i915_hdcp_component_ops- ops for HDCP2.2 services.
> > + * @owner: Module providing the ops
> > + * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.
> > + *                       And Prepare AKE_Init.
> > + * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate
> > + *                                AKE_Send_Cert and prepare
> > +                                  AKE_Stored_Km/AKE_No_Stored_Km
> > + * @verify_hprime: Verify AKE_Send_H_prime
> > + * @store_pairing_info: Store pairing info received
> > + * @initiate_locality_check: Prepare LC_Init
> > + * @verify_lprime: Verify lprime
> > + * @get_session_key: Prepare SKE_Send_Eks
> > + * @repeater_check_flow_prepare_ack: Validate the Downstream topology
> > + *                                and prepare rep_ack
> > + * @verify_mprime: Verify mprime
> > + * @enable_hdcp_authentication:  Mark a port as authenticated.
> > + * @close_hdcp_session: Close the Wired HDCP Tx session per port.
> > + *                   This also disables the authenticated state of the port.
> > + */
> > +struct i915_hdcp_component_ops {
> > +     /**
> > +      * @owner: mei_hdcp module
> > +      */
> > +     struct module *owner;
> > +
> > +     int (*initiate_hdcp2_session)(struct device *dev,
> > +                                   struct hdcp_port_data *data,
> > +                                   struct hdcp2_ake_init *ake_data);
> > +     int (*verify_receiver_cert_prepare_km)(struct device *dev,
> > +                                            struct hdcp_port_data *data,
> > +                                            struct hdcp2_ake_send_cert
> > +                                                             *rx_cert,
> > +                                            bool *km_stored,
> > +                                            struct hdcp2_ake_no_stored_km
> > +                                                             *ek_pub_km,
> > +                                            size_t *msg_sz);
> > +     int (*verify_hprime)(struct device *dev,
> > +                          struct hdcp_port_data *data,
> > +                          struct hdcp2_ake_send_hprime *rx_hprime);
> > +     int (*store_pairing_info)(struct device *dev,
> > +                               struct hdcp_port_data *data,
> > +                               struct hdcp2_ake_send_pairing_info
> > +
> >       *pairing_info);
> > +     int (*initiate_locality_check)(struct device *dev,
> > +                                    struct hdcp_port_data *data,
> > +                                    struct hdcp2_lc_init *lc_init_data);
> > +     int (*verify_lprime)(struct device *dev,
> > +                          struct hdcp_port_data *data,
> > +                          struct hdcp2_lc_send_lprime *rx_lprime);
> > +     int (*get_session_key)(struct device *dev,
> > +                            struct hdcp_port_data *data,
> > +                            struct hdcp2_ske_send_eks *ske_data);
> > +     int (*repeater_check_flow_prepare_ack)(struct device *dev,
> > +                                            struct hdcp_port_data *data,
> > +                                            struct
> > hdcp2_rep_send_receiverid_list
> > +
> >       *rep_topology,
> > +                                            struct hdcp2_rep_send_ack
> > +
> >       *rep_send_ack);
> > +     int (*verify_mprime)(struct device *dev,
> > +                          struct hdcp_port_data *data,
> > +                          struct hdcp2_rep_stream_ready *stream_ready);
> > +     int (*enable_hdcp_authentication)(struct device *dev,
> > +                                       struct hdcp_port_data *data);
> > +     int (*close_hdcp_session)(struct device *dev,
> > +                               struct hdcp_port_data *data);
> > +};
> > +#endif /* _I915_MEI_HDCP_NTERFACE_H_ */
> DROP MEI
> > 2.7.4
>
> 

> On Mon, Dec 17, 2018 at 12:28 PM Winkler, Tomas

> <tomas.winkler@intel.com> wrote:

> >

> > >

> > > Header defines the interface for the I915 and MEI_HDCP drivers.

> > >

> > > Signed-off-by: Ramalingam C <ramalingam.c@intel.com>

> > > ---

> > >  include/drm/i915_mei_hdcp_interface.h | 132

> > > ++++++++++++++++++++++++++++++++++

> > >  1 file changed, 132 insertions(+)

> > >  create mode 100644 include/drm/i915_mei_hdcp_interface.h

> > >

> > > diff --git a/include/drm/i915_mei_hdcp_interface.h

> > > b/include/drm/i915_mei_hdcp_interface.h

> > > new file mode 100644

> > > index 000000000000..e3b7fb32612a

> > > --- /dev/null

> > > +++ b/include/drm/i915_mei_hdcp_interface.h

> >

> >

> > This should be just 'i915_hdcp_interface.h'

> 

> We have other hdcp engines than the mei one. Discrete gpus will definitely get

> a differnt hdcp2 engine even, can't rely on ME for those. Keeping mei in the

> names to make that clear makes sense to me, removing it would just cause

> more confusion I think.


We would like to create a DHCP interface and hold the specific implementation w/o hdcp_mei  

> 

> We already had the entire "should we have a common hdcp interface in drm"

> discussion when we orginally landed this, and looking at all the intel and non-

> intel implementations floating around that didn't make sense, due to lack of

> comonality of how things flow and interact with the hdmi/dp ports.

> -Daniel


Sorry, was not part of that discussion, though it looks strange to me as the DHCP is a standard no Intel invention. 

> 

> >

> > > @@ -0,0 +1,132 @@

> > > +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */

> > > +/*

> > > + * Copyright © 2017-2018 Intel Corporation

> > > + *

> > > + * Authors:

> > > + * Ramalingam C <ramalingam.c@intel.com>  */

> > > +

> > > +#ifndef _I915_MEI_HDCP_INTERFACE_H_ #define

> > > +_I915_MEI_HDCP_INTERFACE_H_

> > Drop MEI

> > > +

> > > +#include <linux/mutex.h>

> > > +#include <drm/drm_hdcp.h>

> > > +

> > > +/**

> > > + * enum hdcp_port_type - HDCP port implementation type defined by

> > > +ME FW

> > > + * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type

> > > + * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port

> > > + * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with

> LSPCON

> > > + *                      (HDMI 2.0) solution

> > > + * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the

> > > +CPDP

> > > (DP 1.3)

> > > + *                    solution

> > > + */

> > > +enum hdcp_port_type {

> > > +     HDCP_PORT_TYPE_INVALID,

> > > +     HDCP_PORT_TYPE_INTEGRATED,

> > > +     HDCP_PORT_TYPE_LSPCON,

> > > +     HDCP_PORT_TYPE_CPDP

> > > +};

> > > +

> > > +/**

> > > + * enum hdcp_wired_protocol - HDCP adaptation used on the port

> > > + * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol

> > > + * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port

> > > + * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port  */

> > > +enum hdcp_wired_protocol {

> > > +     HDCP_PROTOCOL_INVALID,

> > > +     HDCP_PROTOCOL_HDMI,

> > > +     HDCP_PROTOCOL_DP

> > > +};

> > > +

> > > +/**

> > > + * struct hdcp_port_data - intel specific HDCP port data

> > > + * @port: port index as per I915

> > > + * @port_type: HDCP port type as per ME FW classification

> > > + * @protocol: HDCP adaptation as per ME FW

> > > + * @k: No of streams transmitted on a port. Only on DP MST this is

> > > +!= 1

> > > + * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg

> propagated.

> > > + *          Initialized to 0 on AKE_INIT. Incremented after every successful

> > > + *          transmission of RepeaterAuth_Stream_Manage message. When it

> > > rolls

> > > + *          over re-Auth has to be triggered.

> > > + * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for

> the

> > > + *        streams

> > > + */

> > > +struct hdcp_port_data {

> > > +     short int port;

> > > +     u8 port_type;

> > > +     u8 protocol;

> > > +     u16 k;

> > > +     u32 seq_num_m;

> > > +     struct hdcp2_streamid_type *streams; };

> > > +

> > > +/**

> > > + * struct i915_hdcp_component_ops- ops for HDCP2.2 services.

> > > + * @owner: Module providing the ops

> > > + * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.

> > > + *                       And Prepare AKE_Init.

> > > + * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate

> > > + *                                AKE_Send_Cert and prepare

> > > +                                  AKE_Stored_Km/AKE_No_Stored_Km

> > > + * @verify_hprime: Verify AKE_Send_H_prime

> > > + * @store_pairing_info: Store pairing info received

> > > + * @initiate_locality_check: Prepare LC_Init

> > > + * @verify_lprime: Verify lprime

> > > + * @get_session_key: Prepare SKE_Send_Eks

> > > + * @repeater_check_flow_prepare_ack: Validate the Downstream

> topology

> > > + *                                and prepare rep_ack

> > > + * @verify_mprime: Verify mprime

> > > + * @enable_hdcp_authentication:  Mark a port as authenticated.

> > > + * @close_hdcp_session: Close the Wired HDCP Tx session per port.

> > > + *                   This also disables the authenticated state of the port.

> > > + */

> > > +struct i915_hdcp_component_ops {

> > > +     /**

> > > +      * @owner: mei_hdcp module

> > > +      */

> > > +     struct module *owner;

> > > +

> > > +     int (*initiate_hdcp2_session)(struct device *dev,

> > > +                                   struct hdcp_port_data *data,

> > > +                                   struct hdcp2_ake_init *ake_data);

> > > +     int (*verify_receiver_cert_prepare_km)(struct device *dev,

> > > +                                            struct hdcp_port_data *data,

> > > +                                            struct hdcp2_ake_send_cert

> > > +                                                             *rx_cert,

> > > +                                            bool *km_stored,

> > > +                                            struct hdcp2_ake_no_stored_km

> > > +                                                             *ek_pub_km,

> > > +                                            size_t *msg_sz);

> > > +     int (*verify_hprime)(struct device *dev,

> > > +                          struct hdcp_port_data *data,

> > > +                          struct hdcp2_ake_send_hprime *rx_hprime);

> > > +     int (*store_pairing_info)(struct device *dev,

> > > +                               struct hdcp_port_data *data,

> > > +                               struct hdcp2_ake_send_pairing_info

> > > +

> > >       *pairing_info);

> > > +     int (*initiate_locality_check)(struct device *dev,

> > > +                                    struct hdcp_port_data *data,

> > > +                                    struct hdcp2_lc_init *lc_init_data);

> > > +     int (*verify_lprime)(struct device *dev,

> > > +                          struct hdcp_port_data *data,

> > > +                          struct hdcp2_lc_send_lprime *rx_lprime);

> > > +     int (*get_session_key)(struct device *dev,

> > > +                            struct hdcp_port_data *data,

> > > +                            struct hdcp2_ske_send_eks *ske_data);

> > > +     int (*repeater_check_flow_prepare_ack)(struct device *dev,

> > > +                                            struct hdcp_port_data *data,

> > > +                                            struct

> > > hdcp2_rep_send_receiverid_list

> > > +

> > >       *rep_topology,

> > > +                                            struct

> > > + hdcp2_rep_send_ack

> > > +

> > >       *rep_send_ack);

> > > +     int (*verify_mprime)(struct device *dev,

> > > +                          struct hdcp_port_data *data,

> > > +                          struct hdcp2_rep_stream_ready *stream_ready);

> > > +     int (*enable_hdcp_authentication)(struct device *dev,

> > > +                                       struct hdcp_port_data *data);

> > > +     int (*close_hdcp_session)(struct device *dev,

> > > +                               struct hdcp_port_data *data); };

> > > +#endif /* _I915_MEI_HDCP_NTERFACE_H_ */

> > DROP MEI

> > > 2.7.4

> >

> 

> 

> --

> Daniel Vetter

> Software Engineer, Intel Corporation

> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
On Mon, Dec 17, 2018 at 2:42 PM Winkler, Tomas <tomas.winkler@intel.com> wrote:
>
> >
> > On Mon, Dec 17, 2018 at 12:28 PM Winkler, Tomas
> > <tomas.winkler@intel.com> wrote:
> > >
> > > >
> > > > Header defines the interface for the I915 and MEI_HDCP drivers.
> > > >
> > > > Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> > > > ---
> > > >  include/drm/i915_mei_hdcp_interface.h | 132
> > > > ++++++++++++++++++++++++++++++++++
> > > >  1 file changed, 132 insertions(+)
> > > >  create mode 100644 include/drm/i915_mei_hdcp_interface.h
> > > >
> > > > diff --git a/include/drm/i915_mei_hdcp_interface.h
> > > > b/include/drm/i915_mei_hdcp_interface.h
> > > > new file mode 100644
> > > > index 000000000000..e3b7fb32612a
> > > > --- /dev/null
> > > > +++ b/include/drm/i915_mei_hdcp_interface.h
> > >
> > >
> > > This should be just 'i915_hdcp_interface.h'
> >
> > We have other hdcp engines than the mei one. Discrete gpus will definitely get
> > a differnt hdcp2 engine even, can't rely on ME for those. Keeping mei in the
> > names to make that clear makes sense to me, removing it would just cause
> > more confusion I think.
>
> We would like to create a DHCP interface and hold the specific implementation w/o hdcp_mei

mei_hdcp is only part of the hw interface, the other part is setting
the right bits at the right time on the i915 side (afaiui ME has a
priviledge hw channel to hand the key over to the display hw). Only
the overall thing implements hdcp.

> > We already had the entire "should we have a common hdcp interface in drm"
> > discussion when we orginally landed this, and looking at all the intel and non-
> > intel implementations floating around that didn't make sense, due to lack of
> > comonality of how things flow and interact with the hdmi/dp ports.
> > -Daniel
>
> Sorry, was not part of that discussion, though it looks strange to me as the DHCP is a standard no Intel invention.

The stuff going over the wire is a standard, and we have a header for
those bits in drm_hdcp.h. The programming interface exposed by the
hardware isn't standardized. We do share some code in the i915 driver,
because a bunch of things work the same way across hdcd1/mei_hdcp and
dp/hdmi, but that's about it.
-Daniel

>
> >
> > >
> > > > @@ -0,0 +1,132 @@
> > > > +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
> > > > +/*
> > > > + * Copyright © 2017-2018 Intel Corporation
> > > > + *
> > > > + * Authors:
> > > > + * Ramalingam C <ramalingam.c@intel.com>  */
> > > > +
> > > > +#ifndef _I915_MEI_HDCP_INTERFACE_H_ #define
> > > > +_I915_MEI_HDCP_INTERFACE_H_
> > > Drop MEI
> > > > +
> > > > +#include <linux/mutex.h>
> > > > +#include <drm/drm_hdcp.h>
> > > > +
> > > > +/**
> > > > + * enum hdcp_port_type - HDCP port implementation type defined by
> > > > +ME FW
> > > > + * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type
> > > > + * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port
> > > > + * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with
> > LSPCON
> > > > + *                      (HDMI 2.0) solution
> > > > + * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the
> > > > +CPDP
> > > > (DP 1.3)
> > > > + *                    solution
> > > > + */
> > > > +enum hdcp_port_type {
> > > > +     HDCP_PORT_TYPE_INVALID,
> > > > +     HDCP_PORT_TYPE_INTEGRATED,
> > > > +     HDCP_PORT_TYPE_LSPCON,
> > > > +     HDCP_PORT_TYPE_CPDP
> > > > +};
> > > > +
> > > > +/**
> > > > + * enum hdcp_wired_protocol - HDCP adaptation used on the port
> > > > + * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol
> > > > + * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port
> > > > + * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port  */
> > > > +enum hdcp_wired_protocol {
> > > > +     HDCP_PROTOCOL_INVALID,
> > > > +     HDCP_PROTOCOL_HDMI,
> > > > +     HDCP_PROTOCOL_DP
> > > > +};
> > > > +
> > > > +/**
> > > > + * struct hdcp_port_data - intel specific HDCP port data
> > > > + * @port: port index as per I915
> > > > + * @port_type: HDCP port type as per ME FW classification
> > > > + * @protocol: HDCP adaptation as per ME FW
> > > > + * @k: No of streams transmitted on a port. Only on DP MST this is
> > > > +!= 1
> > > > + * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg
> > propagated.
> > > > + *          Initialized to 0 on AKE_INIT. Incremented after every successful
> > > > + *          transmission of RepeaterAuth_Stream_Manage message. When it
> > > > rolls
> > > > + *          over re-Auth has to be triggered.
> > > > + * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for
> > the
> > > > + *        streams
> > > > + */
> > > > +struct hdcp_port_data {
> > > > +     short int port;
> > > > +     u8 port_type;
> > > > +     u8 protocol;
> > > > +     u16 k;
> > > > +     u32 seq_num_m;
> > > > +     struct hdcp2_streamid_type *streams; };
> > > > +
> > > > +/**
> > > > + * struct i915_hdcp_component_ops- ops for HDCP2.2 services.
> > > > + * @owner: Module providing the ops
> > > > + * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.
> > > > + *                       And Prepare AKE_Init.
> > > > + * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate
> > > > + *                                AKE_Send_Cert and prepare
> > > > +                                  AKE_Stored_Km/AKE_No_Stored_Km
> > > > + * @verify_hprime: Verify AKE_Send_H_prime
> > > > + * @store_pairing_info: Store pairing info received
> > > > + * @initiate_locality_check: Prepare LC_Init
> > > > + * @verify_lprime: Verify lprime
> > > > + * @get_session_key: Prepare SKE_Send_Eks
> > > > + * @repeater_check_flow_prepare_ack: Validate the Downstream
> > topology
> > > > + *                                and prepare rep_ack
> > > > + * @verify_mprime: Verify mprime
> > > > + * @enable_hdcp_authentication:  Mark a port as authenticated.
> > > > + * @close_hdcp_session: Close the Wired HDCP Tx session per port.
> > > > + *                   This also disables the authenticated state of the port.
> > > > + */
> > > > +struct i915_hdcp_component_ops {
> > > > +     /**
> > > > +      * @owner: mei_hdcp module
> > > > +      */
> > > > +     struct module *owner;
> > > > +
> > > > +     int (*initiate_hdcp2_session)(struct device *dev,
> > > > +                                   struct hdcp_port_data *data,
> > > > +                                   struct hdcp2_ake_init *ake_data);
> > > > +     int (*verify_receiver_cert_prepare_km)(struct device *dev,
> > > > +                                            struct hdcp_port_data *data,
> > > > +                                            struct hdcp2_ake_send_cert
> > > > +                                                             *rx_cert,
> > > > +                                            bool *km_stored,
> > > > +                                            struct hdcp2_ake_no_stored_km
> > > > +                                                             *ek_pub_km,
> > > > +                                            size_t *msg_sz);
> > > > +     int (*verify_hprime)(struct device *dev,
> > > > +                          struct hdcp_port_data *data,
> > > > +                          struct hdcp2_ake_send_hprime *rx_hprime);
> > > > +     int (*store_pairing_info)(struct device *dev,
> > > > +                               struct hdcp_port_data *data,
> > > > +                               struct hdcp2_ake_send_pairing_info
> > > > +
> > > >       *pairing_info);
> > > > +     int (*initiate_locality_check)(struct device *dev,
> > > > +                                    struct hdcp_port_data *data,
> > > > +                                    struct hdcp2_lc_init *lc_init_data);
> > > > +     int (*verify_lprime)(struct device *dev,
> > > > +                          struct hdcp_port_data *data,
> > > > +                          struct hdcp2_lc_send_lprime *rx_lprime);
> > > > +     int (*get_session_key)(struct device *dev,
> > > > +                            struct hdcp_port_data *data,
> > > > +                            struct hdcp2_ske_send_eks *ske_data);
> > > > +     int (*repeater_check_flow_prepare_ack)(struct device *dev,
> > > > +                                            struct hdcp_port_data *data,
> > > > +                                            struct
> > > > hdcp2_rep_send_receiverid_list
> > > > +
> > > >       *rep_topology,
> > > > +                                            struct
> > > > + hdcp2_rep_send_ack
> > > > +
> > > >       *rep_send_ack);
> > > > +     int (*verify_mprime)(struct device *dev,
> > > > +                          struct hdcp_port_data *data,
> > > > +                          struct hdcp2_rep_stream_ready *stream_ready);
> > > > +     int (*enable_hdcp_authentication)(struct device *dev,
> > > > +                                       struct hdcp_port_data *data);
> > > > +     int (*close_hdcp_session)(struct device *dev,
> > > > +                               struct hdcp_port_data *data); };
> > > > +#endif /* _I915_MEI_HDCP_NTERFACE_H_ */
> > > DROP MEI
> > > > 2.7.4
> > >
> >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
On Thu, Dec 13, 2018 at 09:31:04AM +0530, Ramalingam C wrote:
> Header defines the interface for the I915 and MEI_HDCP drivers.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>

Yeah I think everything together is much neater, and I didn't have any
material concerns with the interface from v8.

> ---
>  include/drm/i915_mei_hdcp_interface.h | 132 ++++++++++++++++++++++++++++++++++
>  1 file changed, 132 insertions(+)
>  create mode 100644 include/drm/i915_mei_hdcp_interface.h
> 
> diff --git a/include/drm/i915_mei_hdcp_interface.h b/include/drm/i915_mei_hdcp_interface.h
> new file mode 100644
> index 000000000000..e3b7fb32612a
> --- /dev/null
> +++ b/include/drm/i915_mei_hdcp_interface.h
> @@ -0,0 +1,132 @@
> +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
> +/*
> + * Copyright © 2017-2018 Intel Corporation
> + *
> + * Authors:
> + * Ramalingam C <ramalingam.c@intel.com>

To address Tomas questions, maybe add a comment here that this is the
mei_hdcp specific interface specific to mei and gen9+ intel display IP,
and doesn't implment the entirety of hdcp2, hence why it's specific and
not generic. Plus maybe mention that all the generic/standardized bits are
in drm/drm_hdcp.h.

Either way Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>


> + */
> +
> +#ifndef _I915_MEI_HDCP_INTERFACE_H_
> +#define _I915_MEI_HDCP_INTERFACE_H_
> +
> +#include <linux/mutex.h>
> +#include <drm/drm_hdcp.h>
> +
> +/**
> + * enum hdcp_port_type - HDCP port implementation type defined by ME FW
> + * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type
> + * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port
> + * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON
> + *			   (HDMI 2.0) solution
> + * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP (DP 1.3)
> + *			 solution
> + */
> +enum hdcp_port_type {
> +	HDCP_PORT_TYPE_INVALID,
> +	HDCP_PORT_TYPE_INTEGRATED,
> +	HDCP_PORT_TYPE_LSPCON,
> +	HDCP_PORT_TYPE_CPDP
> +};
> +
> +/**
> + * enum hdcp_wired_protocol - HDCP adaptation used on the port
> + * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol
> + * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port
> + * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port
> + */
> +enum hdcp_wired_protocol {
> +	HDCP_PROTOCOL_INVALID,
> +	HDCP_PROTOCOL_HDMI,
> +	HDCP_PROTOCOL_DP
> +};
> +
> +/**
> + * struct hdcp_port_data - intel specific HDCP port data
> + * @port: port index as per I915
> + * @port_type: HDCP port type as per ME FW classification
> + * @protocol: HDCP adaptation as per ME FW
> + * @k: No of streams transmitted on a port. Only on DP MST this is != 1
> + * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated.
> + *	       Initialized to 0 on AKE_INIT. Incremented after every successful
> + *	       transmission of RepeaterAuth_Stream_Manage message. When it rolls
> + *	       over re-Auth has to be triggered.
> + * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the
> + *	     streams
> + */
> +struct hdcp_port_data {
> +	short int port;
> +	u8 port_type;
> +	u8 protocol;
> +	u16 k;
> +	u32 seq_num_m;
> +	struct hdcp2_streamid_type *streams;
> +};
> +
> +/**
> + * struct i915_hdcp_component_ops- ops for HDCP2.2 services.
> + * @owner: Module providing the ops
> + * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.
> + *			    And Prepare AKE_Init.
> + * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate
> + *				     AKE_Send_Cert and prepare
> +				     AKE_Stored_Km/AKE_No_Stored_Km
> + * @verify_hprime: Verify AKE_Send_H_prime
> + * @store_pairing_info: Store pairing info received
> + * @initiate_locality_check: Prepare LC_Init
> + * @verify_lprime: Verify lprime
> + * @get_session_key: Prepare SKE_Send_Eks
> + * @repeater_check_flow_prepare_ack: Validate the Downstream topology
> + *				     and prepare rep_ack
> + * @verify_mprime: Verify mprime
> + * @enable_hdcp_authentication:  Mark a port as authenticated.
> + * @close_hdcp_session: Close the Wired HDCP Tx session per port.
> + *			This also disables the authenticated state of the port.
> + */
> +struct i915_hdcp_component_ops {
> +	/**
> +	 * @owner: mei_hdcp module
> +	 */
> +	struct module *owner;
> +
> +	int (*initiate_hdcp2_session)(struct device *dev,
> +				      struct hdcp_port_data *data,
> +				      struct hdcp2_ake_init *ake_data);
> +	int (*verify_receiver_cert_prepare_km)(struct device *dev,
> +					       struct hdcp_port_data *data,
> +					       struct hdcp2_ake_send_cert
> +								*rx_cert,
> +					       bool *km_stored,
> +					       struct hdcp2_ake_no_stored_km
> +								*ek_pub_km,
> +					       size_t *msg_sz);
> +	int (*verify_hprime)(struct device *dev,
> +			     struct hdcp_port_data *data,
> +			     struct hdcp2_ake_send_hprime *rx_hprime);
> +	int (*store_pairing_info)(struct device *dev,
> +				  struct hdcp_port_data *data,
> +				  struct hdcp2_ake_send_pairing_info
> +								*pairing_info);
> +	int (*initiate_locality_check)(struct device *dev,
> +				       struct hdcp_port_data *data,
> +				       struct hdcp2_lc_init *lc_init_data);
> +	int (*verify_lprime)(struct device *dev,
> +			     struct hdcp_port_data *data,
> +			     struct hdcp2_lc_send_lprime *rx_lprime);
> +	int (*get_session_key)(struct device *dev,
> +			       struct hdcp_port_data *data,
> +			       struct hdcp2_ske_send_eks *ske_data);
> +	int (*repeater_check_flow_prepare_ack)(struct device *dev,
> +					       struct hdcp_port_data *data,
> +					       struct hdcp2_rep_send_receiverid_list
> +								*rep_topology,
> +					       struct hdcp2_rep_send_ack
> +								*rep_send_ack);
> +	int (*verify_mprime)(struct device *dev,
> +			     struct hdcp_port_data *data,
> +			     struct hdcp2_rep_stream_ready *stream_ready);
> +	int (*enable_hdcp_authentication)(struct device *dev,
> +					  struct hdcp_port_data *data);
> +	int (*close_hdcp_session)(struct device *dev,
> +				  struct hdcp_port_data *data);
> +};
> +#endif /* _I915_MEI_HDCP_NTERFACE_H_ */
> -- 
> 2.7.4
>