<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Paul,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your feedbacks. I fixed many errors and typos you highlighted in this series. In cases where modification requires re-testing we or anyone can have follow-up patches in the future.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Paul Menzel <pmenzel@molgen.mpg.de><br>
<b>Sent:</b> 19 March 2022 01:16<br>
<b>To:</b> Hung, Alex <Alex.Hung@amd.com>; Othman, Ahmad <Ahmad.Othman@amd.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Siqueira,
Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Liu, Wenjing <Wenjing.Liu@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>;
Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com><br>
<b>Subject:</b> Re: [PATCH 01/13] drm/amd/display: HDCP SEND AKI INIT error</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Dear Alex, dear Ahmad,<br>
<br>
<br>
Thank you for the patch.<br>
<br>
Am 18.03.22 um 22:47 schrieb Alex Hung:<br>
> From: Ahmad Othman <ahmad.othman@amd.com><br>
<br>
Could you please make the commit message summary/title a statement by <br>
adding a verb (imperative mood) [1]. Maybe:<br>
<br>
drm/amd/display: Fix HDCP SEND AKI INIT error<br>
<br>
> [why]<br>
> HDCP sends AKI INIT error in case of multiple display on dock<br>
<br>
What is the test setup exactly, and how can the error be reproduced? <br>
Does Linux log something?<br>
<br>
> [how]<br>
> Added new checks and method to handfle display adjustment<br>
<br>
s/Added/Add/<br>
s/handfle/handle/<br>
<br>
> for multiple display cases<br>
<br>
Why are these checks and methods correct, and what do they try to <br>
achieve? Is it the HDCP(?) specification?<br>
<br>
> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com><br>
> Acked-by: Alex Hung <alex.hung@amd.com><br>
> Signed-off-by: Ahmad Othman <ahmad.othman@amd.com><br>
<br>
Could the order be reversed, so it’s clear that the Signed-off-by line <br>
came first and not after the review? Or is it actually signed off after <br>
the review again?<br>
<br>
> ---<br>
> .../gpu/drm/amd/display/modules/hdcp/hdcp.c | 38 ++++++++++++++++++-<br>
> .../gpu/drm/amd/display/modules/hdcp/hdcp.h | 8 ++++<br>
> .../drm/amd/display/modules/inc/mod_hdcp.h | 2 +-<br>
> 3 files changed, 46 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c<br>
> index 3e81850a7ffe..5e01c6e24cbc 100644<br>
> --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c<br>
> +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c<br>
> @@ -251,6 +251,33 @@ static enum mod_hdcp_status reset_connection(struct mod_hdcp *hdcp,<br>
> return status;<br>
> }<br>
> <br>
> +static enum mod_hdcp_status update_display_adjustments(struct mod_hdcp *hdcp,<br>
> + struct mod_hdcp_display *display,<br>
> + struct mod_hdcp_display_adjustment *adj)<br>
> +{<br>
> + enum mod_hdcp_status status = MOD_HDCP_STATUS_NOT_IMPLEMENTED;<br>
> +<br>
> + if (is_in_authenticated_states(hdcp) &&<br>
> + is_dp_mst_hdcp(hdcp) &&<br>
> + display->adjust.disable == true &&<br>
> + adj->disable == false) {<br>
> + display->adjust.disable = false;<br>
> + if (is_hdcp1(hdcp))<br>
> + status = mod_hdcp_hdcp1_enable_dp_stream_encryption(hdcp);<br>
> + else if (is_hdcp2(hdcp))<br>
> + status = mod_hdcp_hdcp2_enable_dp_stream_encryption(hdcp);<br>
> +<br>
> + if (status != MOD_HDCP_STATUS_SUCCESS)<br>
> + display->adjust.disable = true;<br>
> + }<br>
> +<br>
> + if (status == MOD_HDCP_STATUS_SUCCESS &&<br>
> + memcmp(adj, &display->adjust,<br>
> + sizeof(struct mod_hdcp_display_adjustment)) != 0)<br>
> + status = MOD_HDCP_STATUS_NOT_IMPLEMENTED;<br>
> +<br>
> + return status;<br>
> +}<br>
> /*<br>
> * Implementation of functions in mod_hdcp.h<br>
> */<br>
> @@ -391,7 +418,7 @@ enum mod_hdcp_status mod_hdcp_remove_display(struct mod_hdcp *hdcp,<br>
> return status;<br>
> }<br>
> <br>
> -enum mod_hdcp_status mod_hdcp_update_authentication(struct mod_hdcp *hdcp,<br>
> +enum mod_hdcp_status mod_hdcp_update_display(struct mod_hdcp *hdcp,<br>
> uint8_t index,<br>
> struct mod_hdcp_link_adjustment *link_adjust,<br>
> struct mod_hdcp_display_adjustment *display_adjust,<br>
> @@ -419,6 +446,15 @@ enum mod_hdcp_status mod_hdcp_update_authentication(struct mod_hdcp *hdcp,<br>
> goto out;<br>
> }<br>
> <br>
> + if (memcmp(link_adjust, &hdcp->connection.link.adjust,<br>
> + sizeof(struct mod_hdcp_link_adjustment)) == 0 &&<br>
> + memcmp(display_adjust, &display->adjust,<br>
> + sizeof(struct mod_hdcp_display_adjustment)) != 0) {<br>
> + status = update_display_adjustments(hdcp, display, display_adjust);<br>
> + if (status != MOD_HDCP_STATUS_NOT_IMPLEMENTED)<br>
> + goto out;<br>
> + }<br>
> +<br>
> /* stop current authentication */<br>
> status = reset_authentication(hdcp, output);<br>
> if (status != MOD_HDCP_STATUS_SUCCESS)<br>
> diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h<br>
> index 399fbca8947b..6b195207de90 100644<br>
> --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h<br>
> +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h<br>
> @@ -445,6 +445,14 @@ static inline uint8_t is_in_hdcp2_dp_states(struct mod_hdcp *hdcp)<br>
> current_state(hdcp) <= HDCP2_DP_STATE_END);<br>
> }<br>
> <br>
> +static inline uint8_t is_in_authenticated_states(struct mod_hdcp *hdcp)<br>
> +{<br>
> + return (current_state(hdcp) == D1_A4_AUTHENTICATED ||<br>
> + current_state(hdcp) == H1_A45_AUTHENTICATED ||<br>
> + current_state(hdcp) == D2_A5_AUTHENTICATED ||<br>
> + current_state(hdcp) == H2_A5_AUTHENTICATED);<br>
> +}<br>
> +<br>
<br>
The compiler is probably going to optimize the four `current_state` <br>
calls away, but maybe use a helper variable, so it’s clear for the <br>
reader the same function is each time. Also, why not put the helper into<br>
`drivers/gpu/drm/amd/display/modules/hdcp/hdcp.h`?<br>
<br>
> static inline uint8_t is_hdcp1(struct mod_hdcp *hdcp)<br>
> {<br>
> return (is_in_hdcp1_states(hdcp) || is_in_hdcp1_dp_states(hdcp));<br>
> diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h b/drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h<br>
> index f7420c3f5672..3348bb97ef81 100644<br>
> --- a/drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h<br>
> +++ b/drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h<br>
> @@ -294,7 +294,7 @@ enum mod_hdcp_status mod_hdcp_remove_display(struct mod_hdcp *hdcp,<br>
> uint8_t index, struct mod_hdcp_output *output);<br>
> <br>
> /* called per display to apply new authentication adjustment */<br>
> -enum mod_hdcp_status mod_hdcp_update_authentication(struct mod_hdcp *hdcp,<br>
> +enum mod_hdcp_status mod_hdcp_update_display(struct mod_hdcp *hdcp,<br>
> uint8_t index,<br>
> struct mod_hdcp_link_adjustment *link_adjust,<br>
> struct mod_hdcp_display_adjustment *display_adjust,<br>
<br>
<br>
Kind regards,<br>
<br>
Paul<br>
<br>
<br>
[1]: <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fchris.beams.io%2Fposts%2Fgit-commit%2F&data=04%7C01%7Calex.hung%40amd.com%7Ce0754902cc3545234c1508da097874f2%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637832710221132603%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=nixPwZB4AwGHzYIF3euukbDQcgJ0zE0GwzBQVIlUe2U%3D&reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fchris.beams.io%2Fposts%2Fgit-commit%2F&data=04%7C01%7Calex.hung%40amd.com%7Ce0754902cc3545234c1508da097874f2%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637832710221132603%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=nixPwZB4AwGHzYIF3euukbDQcgJ0zE0GwzBQVIlUe2U%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>