Commit ae4f902b authored by Suraj Kandpal's avatar Suraj Kandpal Committed by Uma Shankar

drm/i915/hdcp: Send the correct aux for DPMST HDCP scenario

Up until now we were sending the base aux stored in dig_port which
is not correct as this causes an issue when monitor is connected via
a DPMST hub causing it to be remote hence we end up seeing AUX
failures so let's send the remote aux in case of DPMST.
Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: default avatarArun R Murthy <arun.r.mruthy@intel.com>
Signed-off-by: default avatarUma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230828063401.600414-4-suraj.kandpal@intel.com
parent 524240b2
...@@ -330,15 +330,26 @@ static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = { ...@@ -330,15 +330,26 @@ static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = {
0, 0 }, 0, 0 },
}; };
static struct drm_dp_aux *
intel_dp_hdcp_get_aux(struct intel_connector *connector)
{
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
if (intel_encoder_is_mst(connector->encoder))
return &connector->port->aux;
else
return &dig_port->dp.aux;
}
static int static int
intel_dp_hdcp2_read_rx_status(struct intel_connector *connector, intel_dp_hdcp2_read_rx_status(struct intel_connector *connector,
u8 *rx_status) u8 *rx_status)
{ {
struct drm_i915_private *i915 = to_i915(connector->base.dev); struct drm_i915_private *i915 = to_i915(connector->base.dev);
struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector);
ssize_t ret; ssize_t ret;
ret = drm_dp_dpcd_read(&dig_port->dp.aux, ret = drm_dp_dpcd_read(aux,
DP_HDCP_2_2_REG_RXSTATUS_OFFSET, rx_status, DP_HDCP_2_2_REG_RXSTATUS_OFFSET, rx_status,
HDCP_2_2_DP_RXSTATUS_LEN); HDCP_2_2_DP_RXSTATUS_LEN);
if (ret != HDCP_2_2_DP_RXSTATUS_LEN) { if (ret != HDCP_2_2_DP_RXSTATUS_LEN) {
...@@ -440,7 +451,6 @@ static ...@@ -440,7 +451,6 @@ static
int intel_dp_hdcp2_write_msg(struct intel_connector *connector, int intel_dp_hdcp2_write_msg(struct intel_connector *connector,
void *buf, size_t size) void *buf, size_t size)
{ {
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
unsigned int offset; unsigned int offset;
u8 *byte = buf; u8 *byte = buf;
ssize_t ret, bytes_to_write, len; ssize_t ret, bytes_to_write, len;
...@@ -453,7 +463,7 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *connector, ...@@ -453,7 +463,7 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *connector,
offset = hdcp2_msg_data->offset; offset = hdcp2_msg_data->offset;
aux = &dig_port->dp.aux; aux = intel_dp_hdcp_get_aux(connector);
/* No msg_id in DP HDCP2.2 msgs */ /* No msg_id in DP HDCP2.2 msgs */
bytes_to_write = size - 1; bytes_to_write = size - 1;
...@@ -480,11 +490,11 @@ static ...@@ -480,11 +490,11 @@ static
ssize_t get_receiver_id_list_rx_info(struct intel_connector *connector, ssize_t get_receiver_id_list_rx_info(struct intel_connector *connector,
u32 *dev_cnt, u8 *byte) u32 *dev_cnt, u8 *byte)
{ {
struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector);
ssize_t ret; ssize_t ret;
u8 *rx_info = byte; u8 *rx_info = byte;
ret = drm_dp_dpcd_read(&dig_port->dp.aux, ret = drm_dp_dpcd_read(aux,
DP_HDCP_2_2_REG_RXINFO_OFFSET, DP_HDCP_2_2_REG_RXINFO_OFFSET,
(void *)rx_info, HDCP_2_2_RXINFO_LEN); (void *)rx_info, HDCP_2_2_RXINFO_LEN);
if (ret != HDCP_2_2_RXINFO_LEN) if (ret != HDCP_2_2_RXINFO_LEN)
...@@ -506,6 +516,7 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, ...@@ -506,6 +516,7 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector,
struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
struct intel_hdcp *hdcp = &connector->hdcp; struct intel_hdcp *hdcp = &connector->hdcp;
struct drm_dp_aux *aux;
unsigned int offset; unsigned int offset;
u8 *byte = buf; u8 *byte = buf;
ssize_t ret, bytes_to_recv, len; ssize_t ret, bytes_to_recv, len;
...@@ -519,6 +530,8 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, ...@@ -519,6 +530,8 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector,
return -EINVAL; return -EINVAL;
offset = hdcp2_msg_data->offset; offset = hdcp2_msg_data->offset;
aux = intel_dp_hdcp_get_aux(connector);
ret = intel_dp_hdcp2_wait_for_msg(connector, hdcp2_msg_data); ret = intel_dp_hdcp2_wait_for_msg(connector, hdcp2_msg_data);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -551,7 +564,7 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, ...@@ -551,7 +564,7 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector,
msg_end = ktime_add_ms(ktime_get_raw(), msg_end = ktime_add_ms(ktime_get_raw(),
hdcp2_msg_data->msg_read_timeout); hdcp2_msg_data->msg_read_timeout);
ret = drm_dp_dpcd_read(&dig_port->dp.aux, offset, ret = drm_dp_dpcd_read(aux, offset,
(void *)byte, len); (void *)byte, len);
if (ret < 0) { if (ret < 0) {
drm_dbg_kms(&i915->drm, "msg_id %d, ret %zd\n", drm_dbg_kms(&i915->drm, "msg_id %d, ret %zd\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment