All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	daniel.vetter@intel.com
Subject: [RFC v1 15/20] drm/hdcp2.2: Display driver service functions
Date: Wed, 12 Jul 2017 13:58:59 +0530	[thread overview]
Message-ID: <1499848144-8456-16-git-send-email-ramalingam.c@intel.com> (raw)
In-Reply-To: <1499848144-8456-1-git-send-email-ramalingam.c@intel.com>

DRM HDCP2.2 service function interface is defiend.
This will be initialized from display driver.

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

diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index 1f9a04d..94acd8d 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -30,6 +30,18 @@
 struct drm_connector;
 struct drm_hdcp;
 
+struct wired_ake_init;
+struct wired_ake_send_cert;
+struct wired_ake_no_stored_km;
+struct wired_ake_send_hprime;
+struct wired_ake_send_pairing_info;
+struct wired_lc_init;
+struct wired_lc_send_lprime;
+struct wired_ske_send_eks;
+struct wired_rep_send_receiverid_list;
+struct wired_rep_send_ack;
+struct wired_rep_stream_ready;
+
 /**
  * HDCP Software stack specific
  */
@@ -71,6 +83,200 @@ enum wired_protocol {
 	WIRED_PROTOCOL_DP
 };
 
+struct drm_hdcp2_funcs {
+
+	/* Authencation and Key Exchange related */
+	/**
+	 * @prepare_ake_init:
+	 *
+	 * Function to prepare the complete ake_init message and
+	 * pass it onto DRM.
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*prepare_ake_init)(struct drm_hdcp *hdcp,
+			struct wired_ake_init *ake_data, size_t buf_sz,
+			size_t *msg_sz);
+
+	/**
+	 * @verify_rx_cert:
+	 *
+	 * Service Function for verifying the DCP signature of rx
+	 * certificate received from HDCP sink and prepare the msg with km as
+	 * AKE_No_Stored_km or AKE_Stored_km.
+	 *
+	 *	Involves:
+	 *	  DCP signature verification.
+	 *	  Receiver ID check against the SRM table's revocation list.
+	 *	  For Non-Paired receiver
+	 *	    Generate a pseudo-random 128-bit Master Key Km
+	 *	    Encrypt km with kpub_rx
+	 *	    Form AKE_No_Stored_km msg
+	 *	  For Paired Device
+	 *	    Forms AKE_Stored_km with stored Ekh(km) and m
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*verify_rx_cert_prepare_km)(struct drm_hdcp *hdcp,
+			struct wired_ake_send_cert *rx_cert,
+			size_t rx_cert_sz, bool *paired,
+			struct wired_ake_no_stored_km *ek_pub_km,
+			size_t buf_sz, size_t *msg_sz);
+
+	/**
+	 * @verify_hprime:
+	 *
+	 * Service Function for verifying the hprime received from receiver.
+	 *	Involves:
+	 *	  Prepare hprime and compare with received hprime
+	 *		hprime = HMAC_SHA256(r_tx || RxCaps || TxCaps, kd)
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*verify_hprime)(struct drm_hdcp *hdcp,
+			struct wired_ake_send_hprime *rx_hprime,
+			size_t hprime_sz);
+
+	/**
+	 * @store_paring_info:
+	 *
+	 * Service Function to store the Ekh(km) along with m in
+	 * non-volatile memory. This is just to fast track the authentication
+	 * of same receiver from next time onwards.
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*store_paring_info)(struct drm_hdcp *hdcp,
+			struct wired_ake_send_pairing_info *pairing_info,
+			size_t pairing_info_sz);
+
+	/* Locality check related services */
+	/**
+	 * @prepare_lc_init:
+	 *
+	 * Service Function to prepare LC_INIT
+	 *	Involves:
+	 *	  Generation of 64bit pseudo aandom nonce rn
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*prepare_lc_init)(struct drm_hdcp *hdcp,
+			struct wired_lc_init *lc_init_data, size_t buf_sz,
+			size_t *msg_sz);
+
+	/**
+	 * @verify_lprime:
+	 *
+	 * Service Function to verify the lprime received from receiver
+	 *	Involves
+	 *	  Calculate L = HMAC-SHA256(rn, kd XOR rrx)
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*verify_lprime)(struct drm_hdcp *hdcp,
+			struct wired_lc_send_lprime *rx_lprime,
+			size_t lprime_sz);
+
+	/* SKE related services */
+	/**
+	 * @prepare_skey:
+	 *
+	 * Service Function to prepare SKE_Send_Eks msg
+	 *	Involves
+	 *	  Generation of Edkey(ks) and riv
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*prepare_skey)(struct drm_hdcp *hdcp,
+			struct wired_ske_send_eks *ske_data,
+			size_t buf_sz, size_t *msg_sz);
+
+	/* Repeater Support services */
+	/**
+	 * @verify_rep_topology:
+	 *
+	 * Service Function to validate the downstream topology and to prepare
+	 * repeater_auth_ack message.
+	 *	Involves
+	 *	  Validate the devcie count and Depth
+	 *	  Look out for HDCP1.x devices or HDCP2.0 devices
+	 *	  Check receiver ID list against revocation list
+	 *	  Check for roll over of seq_num_V
+	 *	  validate the vprime with Most Significant 128bits of V
+	 *	  V’ = HMAC-SHA256(ReceiverID list || RxInfo || seq_num_V, kd)
+	 *	  Least Significant 128bits of V is formed as ack msg.
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*verify_rep_topology_prepare_ack)(
+			struct drm_hdcp *hdcp,
+			struct wired_rep_send_receiverid_list *rep_topology,
+			size_t receiverid_list_sz,
+			struct wired_rep_send_ack *rep_send_ack, size_t buf_sz,
+			size_t *msg_sz);
+
+	/**
+	 * @verify_mprime:
+	 *
+	 * Service Function to verify the MPrime received
+	 *	M’(or M) = HMAC-SHA256(StreamID_Type || seq_num_M, SHA256(kd))
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*verify_mprime)(struct drm_hdcp *hdcp,
+			struct wired_rep_stream_ready *stream_ready,
+			size_t stream_ready_sz);
+
+	/**
+	 * @authenticate:
+	 *
+	 * Service Function to configure HW as Authenticated
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*authenticate)(struct drm_hdcp *hdcp);
+
+	/**
+	 * @deauthenticate:
+	 *
+	 * Service Function to configure HW as deauthenticated
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*deauthenticate)(struct drm_hdcp *hdcp);
+
+	/**
+	 * @enable_encryption:
+	 *
+	 * Service Function to enable encryption at platform level.
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*enable_encryption)(struct drm_hdcp *hdcp);
+
+	/**
+	 * @disable_encryption:
+	 *
+	 * Service function to disable encryption at platform level.
+	 *
+	 * returns HDCP_STATUS_SUCCESS on success
+	 *		else non-zero HDCP error states
+	 **/
+	enum hdcp_status (*disable_encryption)(struct drm_hdcp *hdcp);
+};
+
 struct drm_hdcp_funcs {
 
 	/**
@@ -125,6 +331,7 @@ struct drm_hdcp {
 	enum wired_protocol protocol;
 
 	const struct drm_hdcp_funcs *hdcp_funcs;
+	const struct drm_hdcp2_funcs *hdcp2_funcs;
 
 	struct mutex mutex;
 };
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-07-12  8:28 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12  8:28 [RFC v1 00/20] DRM Interfaces for HDCP support Ramalingam C
2017-07-12  8:28 ` [RFC v1 01/20] drm/hdcp: HDCP bitmask property for connectors Ramalingam C
2017-07-12  9:54   ` Daniel Vetter
2017-07-12 14:56     ` [Intel-gfx] " Ramalingam C
2017-07-12 19:10       ` Sean Paul
2017-07-13  6:09         ` Daniel Vetter
2017-07-13  6:54           ` Ramalingam C
2017-07-13  8:45             ` Daniel Vetter
2017-07-13 10:15               ` [Intel-gfx] " Ramalingam C
2017-07-13 10:36                 ` Daniel Vetter
2017-07-13 12:59                   ` Ramalingam C
2017-07-13 19:02                     ` [Intel-gfx] " Daniel Vetter
2017-07-14 10:40                       ` Ramalingam C
2017-07-14 11:21                         ` [RFC v2] drm/hdcp: drm enum property for HDCP State Ramalingam C
2017-07-14 13:55                           ` Sean Paul
2017-07-21 13:02                             ` Ramalingam C
2017-07-24 13:23                               ` Sean Paul
2017-07-24 13:34                                 ` Ramalingam C
2017-07-24 18:12                                 ` [RFC v3] drm/hdcp: drm enum property for CP State Ramalingam C
2017-07-25 12:34                                   ` Sean Paul
2017-07-26  9:54                                     ` Ramalingam C
2017-07-26 14:52                                       ` Sean Paul
2017-07-26 16:51                                         ` C, Ramalingam
2017-07-26 17:54                                           ` Sean Paul
2017-08-02 15:32                                             ` Ramalingam C
2017-08-02 15:53                                               ` [RFC v4] " Ramalingam C
2017-08-05 15:51                                                 ` Ramalingam C
2017-08-07  5:32                                                   ` Ramalingam C
2017-07-13  6:36         ` [Intel-gfx] [RFC v1 01/20] drm/hdcp: HDCP bitmask property for connectors Ramalingam C
2017-07-12  8:28 ` [RFC v1 02/20] drm/hdcp: HDCP SRM blob " Ramalingam C
2017-07-12  8:28 ` [RFC v1 03/20] drm/sysfs: Generate drm uevent with custom string Ramalingam C
2017-07-12  8:28 ` [RFC v1 04/20] drm/hdcp: Struct drm_hdcp for connector's hdcp state Ramalingam C
2017-07-12  8:28 ` [RFC v1 05/20] drm/hdcp: HDCP status code for DRM HDCP stack Ramalingam C
2017-07-12  8:28 ` [RFC v1 06/20] drm/hdcp: display driver callback funcs defined Ramalingam C
2017-07-12  8:28 ` [RFC v1 07/20] drm/hdcp: Initialization of DRM hdcp stack Ramalingam C
2017-07-12  8:28 ` [RFC v1 08/20] drm/hdcp: Add KBuild for DRM HDCP support Ramalingam C
2017-07-12  8:28 ` [RFC v1 09/20] drm/hdcp: Generic enable, disable and late_init Ramalingam C
2017-07-12  8:28 ` [RFC v1 10/20] drm/hdcp: Handler for connector state change Ramalingam C
2017-07-12  8:28 ` [RFC v1 11/20] drm/hdcp: Registering " Ramalingam C
2017-07-12  8:28 ` [RFC v1 12/20] drm/hdcp: Atomic set and get property for hdcp Ramalingam C
2017-07-12  8:28 ` [RFC v1 13/20] drm/hdcp: Updating DRM Property val with HDCP state Ramalingam C
2017-07-12  8:28 ` [RFC v1 14/20] drm/hdcp2.2: HDCP2.2 protocol msg definitions Ramalingam C
2017-07-12  8:28 ` Ramalingam C [this message]
2017-07-12  8:29 ` [RFC v1 16/20] drm/hdcp2.2: HDCP2.2 Initialization Ramalingam C
2017-07-12  8:29 ` [RFC v1 17/20] drm/hdcp2.2: Definitions of HDMI HDCP2.2 registers Ramalingam C
2017-07-12  8:29 ` [RFC v1 18/20] drm/hdcp2.2: Late_init: Capability probing on panel Ramalingam C
2017-07-12  8:29 ` [RFC v1 19/20] drm/hdcp2.2: HDCP2.2 enable as a asynchronous work Ramalingam C
2017-07-12  8:29 ` [RFC v1 20/20] drm/hdcp2.2: HDCP2.2 disable " Ramalingam C
2017-07-12  8:35 ` ✗ Fi.CI.BAT: failure for DRM Interfaces for HDCP support Patchwork
2017-07-14 11:26 ` ✗ Fi.CI.BAT: failure for DRM Interfaces for HDCP support (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499848144-8456-16-git-send-email-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.