summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/display/intel_hdcp.c
diff options
context:
space:
mode:
authorAnshuman Gupta <anshuman.gupta@intel.com>2021-01-11 13:41:05 +0530
committerAnshuman Gupta <anshuman.gupta@intel.com>2021-01-13 08:29:31 +0530
commit6c63e6e14da7f55114d7e9077e89dc9ab8adeebb (patch)
tree4cb92b2af9523dc6e910e55bf99e0e1c130c2688 /drivers/gpu/drm/i915/display/intel_hdcp.c
parent0abd3acf8a3113132ebf860f6a596d99a5a70c28 (diff)
downloadlinux-6c63e6e14da7f55114d7e9077e89dc9ab8adeebb.tar.gz
linux-6c63e6e14da7f55114d7e9077e89dc9ab8adeebb.tar.bz2
linux-6c63e6e14da7f55114d7e9077e89dc9ab8adeebb.zip
drm/i915/hdcp: No HDCP when encoder is't initialized
There can be situation when DP MST connector is created without mst modeset being done, in those cases connector->encoder will be NULL. MST connector->encoder initializes after modeset. Don't enable HDCP in such cases to prevent any crash. Cc: Ramalingam C <ramalingam.c@intel.com> Cc: Juston Li <juston.li@intel.com> Tested-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210111081120.28417-5-anshuman.gupta@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_hdcp.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_hdcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index b9d8825e2bb1..7d63e9495956 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -2106,6 +2106,12 @@ int intel_hdcp_enable(struct intel_connector *connector,
if (!hdcp->shim)
return -ENOENT;
+ if (!connector->encoder) {
+ drm_err(&dev_priv->drm, "[%s:%d] encoder is not initialized\n",
+ connector->base.name, connector->base.base.id);
+ return -ENODEV;
+ }
+
mutex_lock(&hdcp->mutex);
mutex_lock(&dig_port->hdcp_mutex);
drm_WARN_ON(&dev_priv->drm,