Commit 3e36c490 authored by Suraj Kandpal's avatar Suraj Kandpal Committed by Ankit Nautiyal

drm/i915/hdcp: Rename comp_mutex to hdcp_mutex

Rename comp_mutex to hdcp_mutex as it does not just
protect component related variables which was a terminology
used when hdcp was to be binded as a mei component from MTL
we use gsc cs which does not use the component binding path
for HDCP.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: default avatarChaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230529110740.1522985-4-suraj.kandpal@intel.com
parent 5c8ec987
......@@ -404,8 +404,8 @@ struct intel_display {
* this is only populated post Meteorlake
*/
struct intel_hdcp_gsc_message *hdcp_message;
/* Mutex to protect the above hdcp component related values. */
struct mutex comp_mutex;
/* Mutex to protect the above hdcp related values. */
struct mutex hdcp_mutex;
} hdcp;
struct {
......
......@@ -182,12 +182,12 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
}
/* MEI/GSC interface is solid depending on which is used */
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
if (!i915->display.hdcp.comp_added || !i915->display.hdcp.arbiter) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return false;
}
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
/* Sink's capability for HDCP2.2 */
hdcp->shim->hdcp_2_2_capable(dig_port, &capable);
......@@ -1117,11 +1117,11 @@ hdcp2_prepare_ake_init(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1129,7 +1129,7 @@ hdcp2_prepare_ake_init(struct intel_connector *connector,
if (ret)
drm_dbg_kms(&i915->drm, "Prepare_ake_init failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1147,11 +1147,11 @@ hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1161,7 +1161,7 @@ hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector,
if (ret < 0)
drm_dbg_kms(&i915->drm, "Verify rx_cert failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1175,18 +1175,18 @@ static int hdcp2_verify_hprime(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
ret = arbiter->ops->verify_hprime(arbiter->hdcp_dev, data, rx_hprime);
if (ret < 0)
drm_dbg_kms(&i915->drm, "Verify hprime failed. %d\n", ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1201,11 +1201,11 @@ hdcp2_store_pairing_info(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1213,7 +1213,7 @@ hdcp2_store_pairing_info(struct intel_connector *connector,
if (ret < 0)
drm_dbg_kms(&i915->drm, "Store pairing info failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1228,11 +1228,11 @@ hdcp2_prepare_lc_init(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1240,7 +1240,7 @@ hdcp2_prepare_lc_init(struct intel_connector *connector,
if (ret < 0)
drm_dbg_kms(&i915->drm, "Prepare lc_init failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1255,11 +1255,11 @@ hdcp2_verify_lprime(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1267,7 +1267,7 @@ hdcp2_verify_lprime(struct intel_connector *connector,
if (ret < 0)
drm_dbg_kms(&i915->drm, "Verify L_Prime failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1281,11 +1281,11 @@ static int hdcp2_prepare_skey(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1293,7 +1293,7 @@ static int hdcp2_prepare_skey(struct intel_connector *connector,
if (ret < 0)
drm_dbg_kms(&i915->drm, "Get session key failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1310,11 +1310,11 @@ hdcp2_verify_rep_topology_prepare_ack(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1325,7 +1325,7 @@ hdcp2_verify_rep_topology_prepare_ack(struct intel_connector *connector,
if (ret < 0)
drm_dbg_kms(&i915->drm,
"Verify rep topology failed. %d\n", ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1340,18 +1340,18 @@ hdcp2_verify_mprime(struct intel_connector *connector,
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
ret = arbiter->ops->verify_mprime(arbiter->hdcp_dev, data, stream_ready);
if (ret < 0)
drm_dbg_kms(&i915->drm, "Verify mprime failed. %d\n", ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1364,11 +1364,11 @@ static int hdcp2_authenticate_port(struct intel_connector *connector)
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
......@@ -1376,7 +1376,7 @@ static int hdcp2_authenticate_port(struct intel_connector *connector)
if (ret < 0)
drm_dbg_kms(&i915->drm, "Enable hdcp auth failed. %d\n",
ret);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -1388,17 +1388,17 @@ static int hdcp2_close_session(struct intel_connector *connector)
struct i915_hdcp_arbiter *arbiter;
int ret;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
arbiter = i915->display.hdcp.arbiter;
if (!arbiter || !arbiter->ops) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return -EINVAL;
}
ret = arbiter->ops->close_hdcp_session(arbiter->hdcp_dev,
&dig_port->hdcp_port_data);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......@@ -2108,10 +2108,10 @@ static int i915_hdcp_component_bind(struct device *i915_kdev,
struct drm_i915_private *i915 = kdev_to_i915(i915_kdev);
drm_dbg(&i915->drm, "I915 HDCP comp bind\n");
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
i915->display.hdcp.arbiter = (struct i915_hdcp_arbiter *)data;
i915->display.hdcp.arbiter->hdcp_dev = mei_kdev;
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return 0;
}
......@@ -2122,9 +2122,9 @@ static void i915_hdcp_component_unbind(struct device *i915_kdev,
struct drm_i915_private *i915 = kdev_to_i915(i915_kdev);
drm_dbg(&i915->drm, "I915 HDCP comp unbind\n");
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
i915->display.hdcp.arbiter = NULL;
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
}
static const struct component_ops i915_hdcp_ops = {
......@@ -2214,11 +2214,11 @@ void intel_hdcp_component_init(struct drm_i915_private *i915)
if (!is_hdcp2_supported(i915))
return;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
drm_WARN_ON(&i915->drm, i915->display.hdcp.comp_added);
i915->display.hdcp.comp_added = true;
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
if (intel_hdcp_gsc_cs_required(i915))
ret = intel_hdcp_gsc_init(i915);
else
......@@ -2228,9 +2228,9 @@ void intel_hdcp_component_init(struct drm_i915_private *i915)
if (ret < 0) {
drm_dbg_kms(&i915->drm, "Failed at fw component add(%d)\n",
ret);
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
i915->display.hdcp.comp_added = false;
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return;
}
}
......@@ -2500,14 +2500,14 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
void intel_hdcp_component_fini(struct drm_i915_private *i915)
{
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
if (!i915->display.hdcp.comp_added) {
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return;
}
i915->display.hdcp.comp_added = false;
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
if (intel_hdcp_gsc_cs_required(i915))
intel_hdcp_gsc_fini(i915);
......
......@@ -704,12 +704,12 @@ int intel_hdcp_gsc_init(struct drm_i915_private *i915)
if (!data)
return -ENOMEM;
mutex_lock(&i915->display.hdcp.comp_mutex);
mutex_lock(&i915->display.hdcp.hdcp_mutex);
i915->display.hdcp.arbiter = data;
i915->display.hdcp.arbiter->hdcp_dev = i915->drm.dev;
i915->display.hdcp.arbiter->ops = &gsc_hdcp_ops;
ret = intel_hdcp_gsc_hdcp2_init(i915);
mutex_unlock(&i915->display.hdcp.comp_mutex);
mutex_unlock(&i915->display.hdcp.hdcp_mutex);
return ret;
}
......
......@@ -222,7 +222,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
mutex_init(&dev_priv->display.audio.mutex);
mutex_init(&dev_priv->display.wm.wm_mutex);
mutex_init(&dev_priv->display.pps.mutex);
mutex_init(&dev_priv->display.hdcp.comp_mutex);
mutex_init(&dev_priv->display.hdcp.hdcp_mutex);
i915_memcpy_init_early(dev_priv);
intel_runtime_pm_init_early(&dev_priv->runtime_pm);
......
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