amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Harry Wentland <hwentlan@amd.com>
To: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: harry.wentland@amd.com
Subject: Re: [PATCH 2/5] drm/amd/display: update psp interface header
Date: Wed, 22 Jan 2020 11:10:43 -0500	[thread overview]
Message-ID: <7850186b-9556-1aa2-ca3f-5a02b71da97d@amd.com> (raw)
In-Reply-To: <20200116202945.21801-3-Bhawanpreet.Lakha@amd.com>

On 2020-01-16 3:29 p.m., Bhawanpreet Lakha wrote:
> [Why]
> We need to support SRM

Why do we need to support SRM?

Please refer to section 5 "Renewability" of the HDCP 2.x spec and its
requirement to store the SRM in non-volatile memory.

Why does this involve PSP?

Describe that for AMD's content protection solution PSP owns the SRM
check but has no ability to store it in SRM memory directly, hence the
need for the kernel driver to facilitate it.

Why a sysfs?

Describe that the kernel driver cannot (or should not) write to the file
system. Outline how we expect usermode scripts to facilitate this and
use the sysfs to retrieve an SRM from PSP to store it to the filesystem
and passes it to PSP from the filesystem. We'll want to highlight at
which points (boot, suspend, etc.) we expect this to happen.

I recommend documenting this whole process here in the patch description
to provide a reference for posterity as it's not necessarily clear from
the patches why and what we're doing.

Harry

> 
> [How]
> Add the interface to the header file
> 
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> ---
>  .../drm/amd/display/modules/hdcp/hdcp_psp.h   | 26 ++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h
> index 82a5e997d573..d5cb3f46606f 100644
> --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h
> +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h
> @@ -117,6 +117,8 @@ struct ta_dtm_shared_memory {
>  int psp_cmd_submit_buf(struct psp_context *psp, struct amdgpu_firmware_info *ucode, struct psp_gfx_cmd_resp *cmd,
>  		uint64_t fence_mc_addr);
>  
> +enum { PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE = 5120 };
> +
>  enum ta_hdcp_command {
>  	TA_HDCP_COMMAND__INITIALIZE,
>  	TA_HDCP_COMMAND__HDCP1_CREATE_SESSION,
> @@ -134,7 +136,10 @@ enum ta_hdcp_command {
>  	TA_HDCP_COMMAND__UNUSED_3,
>  	TA_HDCP_COMMAND__HDCP2_CREATE_SESSION_V2,
>  	TA_HDCP_COMMAND__HDCP2_PREPARE_PROCESS_AUTHENTICATION_MSG_V2,
> -	TA_HDCP_COMMAND__HDCP2_ENABLE_DP_STREAM_ENCRYPTION
> +	TA_HDCP_COMMAND__HDCP2_ENABLE_DP_STREAM_ENCRYPTION,
> +	TA_HDCP_COMMAND__HDCP_DESTROY_ALL_SESSIONS,
> +	TA_HDCP_COMMAND__HDCP_SET_SRM,
> +	TA_HDCP_COMMAND__HDCP_GET_SRM
>  };
>  
>  enum ta_hdcp2_msg_id {
> @@ -415,6 +420,22 @@ struct ta_hdcp_cmd_hdcp2_enable_dp_stream_encryption_input {
>  	uint32_t display_handle;
>  };
>  
> +struct ta_hdcp_cmd_set_srm_input {
> +	uint32_t srm_buf_size;
> +	uint8_t srm_buf[PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE];
> +};
> +
> +struct ta_hdcp_cmd_set_srm_output {
> +	uint8_t valid_signature;
> +	uint32_t srm_version;
> +};
> +
> +struct ta_hdcp_cmd_get_srm_output {
> +	uint32_t srm_version;
> +	uint32_t srm_buf_size;
> +	uint8_t srm_buf[PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE];
> +};
> +
>  /**********************************************************/
>  /* Common input structure for HDCP callbacks */
>  union ta_hdcp_cmd_input {
> @@ -432,6 +453,7 @@ union ta_hdcp_cmd_input {
>  	struct ta_hdcp_cmd_hdcp2_process_prepare_authentication_message_input_v2
>  		hdcp2_prepare_process_authentication_message_v2;
>  	struct ta_hdcp_cmd_hdcp2_enable_dp_stream_encryption_input hdcp2_enable_dp_stream_encryption;
> +	struct ta_hdcp_cmd_set_srm_input hdcp_set_srm;
>  };
>  
>  /* Common output structure for HDCP callbacks */
> @@ -444,6 +466,8 @@ union ta_hdcp_cmd_output {
>  	struct ta_hdcp_cmd_hdcp2_create_session_output_v2 hdcp2_create_session_v2;
>  	struct ta_hdcp_cmd_hdcp2_process_prepare_authentication_message_output_v2
>  		hdcp2_prepare_process_authentication_message_v2;
> +	struct ta_hdcp_cmd_set_srm_output hdcp_set_srm;
> +	struct ta_hdcp_cmd_get_srm_output hdcp_get_srm;
>  };
>  /**********************************************************/
>  
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2020-01-22 16:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 20:29 [PATCH 0/5] HDCP SRM interface Bhawanpreet Lakha
2020-01-16 20:29 ` [PATCH 1/5] drm/amd/display: Pass amdgpu_device instead of psp_context Bhawanpreet Lakha
2020-01-16 20:29 ` [PATCH 2/5] drm/amd/display: update psp interface header Bhawanpreet Lakha
2020-01-22 16:10   ` Harry Wentland [this message]
2020-01-16 20:29 ` [PATCH 3/5] drm/amd/display: Add sysfs interface for set/get srm Bhawanpreet Lakha
2020-01-17 19:23   ` Alex Deucher
2020-01-17 19:29     ` Bhawanpreet Lakha
2020-01-22 19:03   ` Harry Wentland
2020-01-16 20:29 ` [PATCH 4/5] drm/amd/display: Load srm before enabling HDCP Bhawanpreet Lakha
2020-01-16 20:29 ` [PATCH 5/5] drm/amd/display: call psp set/get interfaces Bhawanpreet Lakha
2020-01-22 19:25   ` Harry Wentland
2020-01-22 16:11 ` [PATCH 0/5] HDCP SRM interface Harry Wentland
2020-01-22 16:23   ` Alex Deucher
2020-01-22 16:44     ` Bhawanpreet Lakha
2020-01-22 19:27       ` Harry Wentland
2020-01-22 19:49         ` Deucher, Alexander

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=7850186b-9556-1aa2-ca3f-5a02b71da97d@amd.com \
    --to=hwentlan@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).