Commit d6a209dd authored by Daniel Vetter's avatar Daniel Vetter

Merge tag 'drm-intel-fixes-2024-03-01' of...

Merge tag 'drm-intel-fixes-2024-03-01' of https://anongit.freedesktop.org/git/drm/drm-intel into drm-fixes

- Fix to extract HDCP information from primary connector
- Check for NULL mmu_interval_notifier before removing
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZeGOUTfiA0_FNKLg@jlahtine-mobl.ger.corp.intel.com
parents 9b467b42 01bb1ae3
...@@ -330,23 +330,13 @@ static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = { ...@@ -330,23 +330,13 @@ 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 drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector); struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct drm_dp_aux *aux = &dig_port->dp.aux;
ssize_t ret; ssize_t ret;
ret = drm_dp_dpcd_read(aux, ret = drm_dp_dpcd_read(aux,
...@@ -399,7 +389,9 @@ intel_dp_hdcp2_wait_for_msg(struct intel_connector *connector, ...@@ -399,7 +389,9 @@ intel_dp_hdcp2_wait_for_msg(struct intel_connector *connector,
const struct hdcp2_dp_msg_data *hdcp2_msg_data) const struct hdcp2_dp_msg_data *hdcp2_msg_data)
{ {
struct drm_i915_private *i915 = to_i915(connector->base.dev); struct drm_i915_private *i915 = to_i915(connector->base.dev);
struct intel_hdcp *hdcp = &connector->hdcp; struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct intel_dp *dp = &dig_port->dp;
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
u8 msg_id = hdcp2_msg_data->msg_id; u8 msg_id = hdcp2_msg_data->msg_id;
int ret, timeout; int ret, timeout;
bool msg_ready = false; bool msg_ready = false;
...@@ -454,8 +446,9 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *connector, ...@@ -454,8 +446,9 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *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;
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct drm_dp_aux *aux = &dig_port->dp.aux;
const struct hdcp2_dp_msg_data *hdcp2_msg_data; const struct hdcp2_dp_msg_data *hdcp2_msg_data;
struct drm_dp_aux *aux;
hdcp2_msg_data = get_hdcp2_dp_msg_data(*byte); hdcp2_msg_data = get_hdcp2_dp_msg_data(*byte);
if (!hdcp2_msg_data) if (!hdcp2_msg_data)
...@@ -463,8 +456,6 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *connector, ...@@ -463,8 +456,6 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *connector,
offset = hdcp2_msg_data->offset; offset = hdcp2_msg_data->offset;
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;
byte++; byte++;
...@@ -490,7 +481,8 @@ static ...@@ -490,7 +481,8 @@ 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 drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector); struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct drm_dp_aux *aux = &dig_port->dp.aux;
ssize_t ret; ssize_t ret;
u8 *rx_info = byte; u8 *rx_info = byte;
...@@ -515,8 +507,9 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, ...@@ -515,8 +507,9 @@ 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 drm_dp_aux *aux = &dig_port->dp.aux;
struct drm_dp_aux *aux; struct intel_dp *dp = &dig_port->dp;
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
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;
...@@ -530,8 +523,6 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, ...@@ -530,8 +523,6 @@ 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;
...@@ -561,13 +552,8 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, ...@@ -561,13 +552,8 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector,
/* Entire msg read timeout since initiate of msg read */ /* Entire msg read timeout since initiate of msg read */
if (bytes_to_recv == size - 1 && hdcp2_msg_data->msg_read_timeout > 0) { if (bytes_to_recv == size - 1 && hdcp2_msg_data->msg_read_timeout > 0) {
if (intel_encoder_is_mst(connector->encoder)) 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 *
connector->port->parent->num_ports);
else
msg_end = ktime_add_ms(ktime_get_raw(),
hdcp2_msg_data->msg_read_timeout);
} }
ret = drm_dp_dpcd_read(aux, offset, ret = drm_dp_dpcd_read(aux, offset,
...@@ -651,12 +637,11 @@ static ...@@ -651,12 +637,11 @@ static
int intel_dp_hdcp2_capable(struct intel_connector *connector, int intel_dp_hdcp2_capable(struct intel_connector *connector,
bool *capable) bool *capable)
{ {
struct drm_dp_aux *aux; struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
struct drm_dp_aux *aux = &dig_port->dp.aux;
u8 rx_caps[3]; u8 rx_caps[3];
int ret; int ret;
aux = intel_dp_hdcp_get_aux(connector);
*capable = false; *capable = false;
ret = drm_dp_dpcd_read(aux, ret = drm_dp_dpcd_read(aux,
DP_HDCP_2_2_REG_RX_CAPS_OFFSET, DP_HDCP_2_2_REG_RX_CAPS_OFFSET,
......
...@@ -379,6 +379,9 @@ i915_gem_userptr_release(struct drm_i915_gem_object *obj) ...@@ -379,6 +379,9 @@ i915_gem_userptr_release(struct drm_i915_gem_object *obj)
{ {
GEM_WARN_ON(obj->userptr.page_ref); GEM_WARN_ON(obj->userptr.page_ref);
if (!obj->userptr.notifier.mm)
return;
mmu_interval_notifier_remove(&obj->userptr.notifier); mmu_interval_notifier_remove(&obj->userptr.notifier);
obj->userptr.notifier.mm = NULL; obj->userptr.notifier.mm = NULL;
} }
......
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