mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
drm/i915/display/hdcp: Make WARN* drm specific where drm_priv ptr is available
drm specific WARN* calls include device information in the backtrace, so we know what device the warnings originate from. Covert all the calls of WARN* with device specific drm_WARN* variants in functions where drm_i915_private struct pointer is readily available. The conversion was done automatically with below coccinelle semantic patch. checkpatch errors/warnings are fixed manually. @rule1@ identifier func, T; @@ func(...) { ... struct drm_i915_private *T = ...; <+... ( -WARN( +drm_WARN(&T->drm, ...) | -WARN_ON( +drm_WARN_ON(&T->drm, ...) | -WARN_ONCE( +drm_WARN_ONCE(&T->drm, ...) | -WARN_ON_ONCE( +drm_WARN_ON_ONCE(&T->drm, ...) ) ...+> } @rule2@ identifier func, T; @@ func(struct drm_i915_private *T,...) { <+... ( -WARN( +drm_WARN(&T->drm, ...) | -WARN_ON( +drm_WARN_ON(&T->drm, ...) | -WARN_ONCE( +drm_WARN_ONCE(&T->drm, ...) | -WARN_ON_ONCE( +drm_WARN_ON_ONCE(&T->drm, ...) ) ...+> } Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200220165507.16823-7-pankaj.laxminarayan.bharadiya@intel.com
This commit is contained in:
parent
eb020ca3d4
commit
bb393dc56e
@ -872,7 +872,8 @@ static int intel_hdcp_check_link(struct intel_connector *connector)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (WARN_ON(!intel_hdcp_in_use(dev_priv, cpu_transcoder, port))) {
|
||||
if (drm_WARN_ON(&dev_priv->drm,
|
||||
!intel_hdcp_in_use(dev_priv, cpu_transcoder, port))) {
|
||||
drm_err(&dev_priv->drm,
|
||||
"%s:%d HDCP link stopped encryption,%x\n",
|
||||
connector->base.name, connector->base.base.id,
|
||||
@ -1561,7 +1562,8 @@ static int hdcp2_enable_encryption(struct intel_connector *connector)
|
||||
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
||||
int ret;
|
||||
|
||||
WARN_ON(intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
|
||||
drm_WARN_ON(&dev_priv->drm,
|
||||
intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
|
||||
LINK_ENCRYPTION_STATUS);
|
||||
if (hdcp->shim->toggle_signalling) {
|
||||
ret = hdcp->shim->toggle_signalling(intel_dig_port, true);
|
||||
@ -1599,7 +1601,7 @@ static int hdcp2_disable_encryption(struct intel_connector *connector)
|
||||
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
||||
int ret;
|
||||
|
||||
WARN_ON(!(intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
|
||||
drm_WARN_ON(&dev_priv->drm, !(intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
|
||||
LINK_ENCRYPTION_STATUS));
|
||||
|
||||
intel_de_write(dev_priv, HDCP2_CTL(dev_priv, cpu_transcoder, port),
|
||||
@ -1720,7 +1722,8 @@ static int intel_hdcp2_check_link(struct intel_connector *connector)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (WARN_ON(!intel_hdcp2_in_use(dev_priv, cpu_transcoder, port))) {
|
||||
if (drm_WARN_ON(&dev_priv->drm,
|
||||
!intel_hdcp2_in_use(dev_priv, cpu_transcoder, port))) {
|
||||
drm_err(&dev_priv->drm,
|
||||
"HDCP2.2 link stopped the encryption, %x\n",
|
||||
intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)));
|
||||
@ -1916,7 +1919,7 @@ void intel_hdcp_component_init(struct drm_i915_private *dev_priv)
|
||||
return;
|
||||
|
||||
mutex_lock(&dev_priv->hdcp_comp_mutex);
|
||||
WARN_ON(dev_priv->hdcp_comp_added);
|
||||
drm_WARN_ON(&dev_priv->drm, dev_priv->hdcp_comp_added);
|
||||
|
||||
dev_priv->hdcp_comp_added = true;
|
||||
mutex_unlock(&dev_priv->hdcp_comp_mutex);
|
||||
@ -1990,7 +1993,8 @@ int intel_hdcp_enable(struct intel_connector *connector,
|
||||
return -ENOENT;
|
||||
|
||||
mutex_lock(&hdcp->mutex);
|
||||
WARN_ON(hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED);
|
||||
drm_WARN_ON(&dev_priv->drm,
|
||||
hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED);
|
||||
hdcp->content_type = content_type;
|
||||
|
||||
if (INTEL_GEN(dev_priv) >= 12) {
|
||||
|
Loading…
Reference in New Issue
Block a user