<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks and Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Arun R Murthy</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
--------------------</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> Kandpal, Suraj <suraj.kandpal@intel.com><br>
<b>Sent:</b> Thursday, August 10, 2023 1:17 PM<br>
<b>To:</b> intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>; uma.shakar@intel.com <uma.shakar@intel.com>; Murthy, Arun R <arun.r.murthy@intel.com>; Kandpal, Suraj <suraj.kandpal@intel.com><br>
<b>Subject:</b> [PATCH 1/4] drm/i915/hdcp: Use intel_connector argument in intel_hdcp_shim</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Update intel_hdcp_shim funcs specifically read_2_2_message,<br>
write_2_2_message and config_stream_type to use intel_connector<br>
argument instead of intel_digital_port as this will help in getting<br>
correct aux later for dp mst scenarios also already hdcp funcs<br>
derive digital_port from connector and then many funcs again get back<br>
the connector from dig_port which doesn't seem right.<br>
Connector specific hdcp functions can derive dig_port on need basis.<br>
<br>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com><br>
---<br>
.../drm/i915/display/intel_display_types.h | 6 ++--<br>
drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 10 ++++---<br>
drivers/gpu/drm/i915/display/intel_hdcp.c | 30 ++++++++-----------<br>
drivers/gpu/drm/i915/display/intel_hdmi.c | 6 ++--<br>
4 files changed, 26 insertions(+), 26 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h<br>
index 731f2ec04d5c..c62f4ec315e8 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_display_types.h<br>
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h<br>
@@ -504,11 +504,11 @@ struct intel_hdcp_shim {<br>
bool *capable);<br>
<br>
/* Write HDCP2.2 messages */<br>
- int (*write_2_2_msg)(struct intel_digital_port *dig_port,<br>
+ int (*write_2_2_msg)(struct intel_connector *connector,<br>
void *buf, size_t size);<br>
<br>
/* Read HDCP2.2 messages */<br>
- int (*read_2_2_msg)(struct intel_digital_port *dig_port,<br>
+ int (*read_2_2_msg)(struct intel_connector *connector,<br>
u8 msg_id, void *buf, size_t size);<br>
<br>
/*<br>
@@ -516,7 +516,7 @@ struct intel_hdcp_shim {<br>
* type to Receivers. In DP HDCP2.2 Stream type is one of the input to<br>
* the HDCP2.2 Cipher for En/De-Cryption. Not applicable for HDMI.<br>
*/<br>
- int (*config_stream_type)(struct intel_digital_port *dig_port,<br>
+ int (*config_stream_type)(struct intel_connector *connector,<br>
bool is_repeater, u8 type);<br>
<br>
/* Enable/Disable HDCP 2.2 stream encryption on DP MST Transport Link */<br>
diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c<br>
index e0c177161407..6cd42363837a 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c<br>
@@ -437,9 +437,10 @@ static const struct hdcp2_dp_msg_data *get_hdcp2_dp_msg_data(u8 msg_id)<br>
}<br>
<br>
static<br>
-int intel_dp_hdcp2_write_msg(struct intel_digital_port *dig_port,<br>
+int intel_dp_hdcp2_write_msg(struct intel_connector *connector,<br>
void *buf, size_t size)<br>
{<br>
+ struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
unsigned int offset;<br>
u8 *byte = buf;<br>
ssize_t ret, bytes_to_write, len;<br>
@@ -494,9 +495,10 @@ ssize_t get_receiver_id_list_rx_info(struct intel_digital_port *dig_port, u32 *d<br>
}<br>
<br>
static<br>
-int intel_dp_hdcp2_read_msg(struct intel_digital_port *dig_port,<br>
+int intel_dp_hdcp2_read_msg(struct intel_connector *connector,<br>
u8 msg_id, void *buf, size_t size)<br>
{<br>
+ struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);<br>
struct intel_dp *dp = &dig_port->dp;<br>
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;<br>
@@ -574,7 +576,7 @@ int intel_dp_hdcp2_read_msg(struct intel_digital_port *dig_port,<br>
}<br>
<br>
static<br>
-int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *dig_port,<br>
+int intel_dp_hdcp2_config_stream_type(struct intel_connector *connector,<br>
bool is_repeater, u8 content_type)<br>
{<br>
int ret;<br>
@@ -593,7 +595,7 @@ int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *dig_port,<br>
stream_type_msg.msg_id = HDCP_2_2_ERRATA_DP_STREAM_TYPE;<br>
stream_type_msg.stream_type = content_type;<br>
<br>
- ret = intel_dp_hdcp2_write_msg(dig_port, &stream_type_msg,<br>
+ ret = intel_dp_hdcp2_write_msg(connector, &stream_type_msg,<br>
sizeof(stream_type_msg));<br>
<br>
return ret < 0 ? ret : 0;<br>
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c<br>
index a42549fa9691..cb45f21f71eb 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c<br>
@@ -1415,7 +1415,6 @@ static int hdcp2_deauthenticate_port(struct intel_connector *connector)<br>
/* Authentication flow starts from here */<br>
static int hdcp2_authentication_key_exchange(struct intel_connector *connector)<br>
{<br>
- struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
struct drm_i915_private *i915 = to_i915(connector->base.dev);<br>
struct intel_hdcp *hdcp = &connector->hdcp;<br>
union {<br>
@@ -1437,12 +1436,12 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)<br>
if (ret < 0)<br>
return ret;<br>
<br>
- ret = shim->write_2_2_msg(dig_port, &msgs.ake_init,<br>
+ ret = shim->write_2_2_msg(connector, &msgs.ake_init,<br>
sizeof(msgs.ake_init));<br>
if (ret < 0)<br>
return ret;<br>
<br>
- ret = shim->read_2_2_msg(dig_port, HDCP_2_2_AKE_SEND_CERT,<br>
+ ret = shim->read_2_2_msg(connector, HDCP_2_2_AKE_SEND_CERT,<br>
&msgs.send_cert, sizeof(msgs.send_cert));<br>
if (ret < 0)<br>
return ret;<br>
@@ -1471,11 +1470,11 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)<br>
if (ret < 0)<br>
return ret;<br>
<br>
- ret = shim->write_2_2_msg(dig_port, &msgs.no_stored_km, size);<br>
+ ret = shim->write_2_2_msg(connector, &msgs.no_stored_km, size);<br>
if (ret < 0)<br>
return ret;<br>
<br>
- ret = shim->read_2_2_msg(dig_port, HDCP_2_2_AKE_SEND_HPRIME,<br>
+ ret = shim->read_2_2_msg(connector, HDCP_2_2_AKE_SEND_HPRIME,<br>
&msgs.send_hprime, sizeof(msgs.send_hprime));<br>
if (ret < 0)<br>
return ret;<br>
@@ -1486,7 +1485,7 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)<br>
<br>
if (!hdcp->is_paired) {<br>
/* Pairing is required */<br>
- ret = shim->read_2_2_msg(dig_port,<br>
+ ret = shim->read_2_2_msg(connector,<br>
HDCP_2_2_AKE_SEND_PAIRING_INFO,<br>
&msgs.pairing_info,<br>
sizeof(msgs.pairing_info));<br>
@@ -1504,7 +1503,6 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)<br>
<br>
static int hdcp2_locality_check(struct intel_connector *connector)<br>
{<br>
- struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
struct intel_hdcp *hdcp = &connector->hdcp;<br>
union {<br>
struct hdcp2_lc_init lc_init;<br>
@@ -1518,12 +1516,12 @@ static int hdcp2_locality_check(struct intel_connector *connector)<br>
if (ret < 0)<br>
continue;<br>
<br>
- ret = shim->write_2_2_msg(dig_port, &msgs.lc_init,<br>
+ ret = shim->write_2_2_msg(connector, &msgs.lc_init,<br>
sizeof(msgs.lc_init));<br>
if (ret < 0)<br>
continue;<br>
<br>
- ret = shim->read_2_2_msg(dig_port,<br>
+ ret = shim->read_2_2_msg(connector,<br>
HDCP_2_2_LC_SEND_LPRIME,<br>
&msgs.send_lprime,<br>
sizeof(msgs.send_lprime));<br>
@@ -1540,7 +1538,6 @@ static int hdcp2_locality_check(struct intel_connector *connector)<br>
<br>
static int hdcp2_session_key_exchange(struct intel_connector *connector)<br>
{<br>
- struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
struct intel_hdcp *hdcp = &connector->hdcp;<br>
struct hdcp2_ske_send_eks send_eks;<br>
int ret;<br>
@@ -1549,7 +1546,7 @@ static int hdcp2_session_key_exchange(struct intel_connector *connector)<br>
if (ret < 0)<br>
return ret;<br>
<br>
- ret = hdcp->shim->write_2_2_msg(dig_port, &send_eks,<br>
+ ret = hdcp->shim->write_2_2_msg(connector, &send_eks,<br>
sizeof(send_eks));<br>
if (ret < 0)<br>
return ret;<br>
@@ -1587,12 +1584,12 @@ int _hdcp2_propagate_stream_management_info(struct intel_connector *connector)<br>
streams_size_delta = (HDCP_2_2_MAX_CONTENT_STREAMS_CNT - data->k) *<br>
sizeof(struct hdcp2_streamid_type);<br>
/* Send it to Repeater */<br>
- ret = shim->write_2_2_msg(dig_port, &msgs.stream_manage,<br>
+ ret = shim->write_2_2_msg(connector, &msgs.stream_manage,<br>
sizeof(msgs.stream_manage) - streams_size_delta);<br>
if (ret < 0)<br>
goto out;<br>
<br>
- ret = shim->read_2_2_msg(dig_port, HDCP_2_2_REP_STREAM_READY,<br>
+ ret = shim->read_2_2_msg(connector, HDCP_2_2_REP_STREAM_READY,<br>
&msgs.stream_ready, sizeof(msgs.stream_ready));<br>
if (ret < 0)<br>
goto out;<br>
@@ -1622,7 +1619,7 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)<br>
u8 *rx_info;<br>
int ret;<br>
<br>
- ret = shim->read_2_2_msg(dig_port, HDCP_2_2_REP_SEND_RECVID_LIST,<br>
+ ret = shim->read_2_2_msg(connector, HDCP_2_2_REP_SEND_RECVID_LIST,<br>
&msgs.recvid_list, sizeof(msgs.recvid_list));<br>
if (ret < 0)<br>
return ret;<br>
@@ -1675,7 +1672,7 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)<br>
return ret;<br>
<br>
hdcp->seq_num_v = seq_num_v;<br>
- ret = shim->write_2_2_msg(dig_port, &msgs.rep_ack,<br>
+ ret = shim->write_2_2_msg(connector, &msgs.rep_ack,<br>
sizeof(msgs.rep_ack));<br>
if (ret < 0)<br>
return ret;<br>
@@ -1685,7 +1682,6 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)<br>
<br>
static int hdcp2_authenticate_sink(struct intel_connector *connector)<br>
{<br>
- struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
struct drm_i915_private *i915 = to_i915(connector->base.dev);<br>
struct intel_hdcp *hdcp = &connector->hdcp;<br>
const struct intel_hdcp_shim *shim = hdcp->shim;<br>
@@ -1711,7 +1707,7 @@ static int hdcp2_authenticate_sink(struct intel_connector *connector)<br>
}<br>
<br>
if (shim->config_stream_type) {<br>
- ret = shim->config_stream_type(dig_port,<br>
+ ret = shim->config_stream_type(connector,<br>
hdcp->is_repeater,<br>
hdcp->content_type);<br>
if (ret < 0)<br>
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c<br>
index 94a7e1537f42..4c66618537ae 100644<br>
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c<br>
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c<br>
@@ -1665,9 +1665,10 @@ intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *dig_port,<br>
}<br>
<br>
static<br>
-int intel_hdmi_hdcp2_write_msg(struct intel_digital_port *dig_port,<br>
+int intel_hdmi_hdcp2_write_msg(struct intel_connector *connector,<br>
void *buf, size_t size)<br>
{<br>
+ struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
unsigned int offset;<br>
<br>
offset = HDCP_2_2_HDMI_REG_WR_MSG_OFFSET;<br>
@@ -1675,9 +1676,10 @@ int intel_hdmi_hdcp2_write_msg(struct intel_digital_port *dig_port,<br>
}<br>
<br>
static<br>
-int intel_hdmi_hdcp2_read_msg(struct intel_digital_port *dig_port,<br>
+int intel_hdmi_hdcp2_read_msg(struct intel_connector *connector,<br>
u8 msg_id, void *buf, size_t size)<br>
{<br>
+ struct intel_digital_port *dig_port = intel_attached_dig_port(connector);<br>
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);<br>
struct intel_hdmi *hdmi = &dig_port->hdmi;<br>
struct intel_hdcp *hdcp = &hdmi->attached_connector->hdcp;<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</body>
</html>