[Intel-gfx] [PATCH] drm/i915: intel_audio clear eld buf when disconnecting monitor
libin.yang at linux.intel.com
libin.yang at linux.intel.com
Mon Mar 21 05:03:29 UTC 2016
From: Libin Yang <libin.yang at linux.intel.com>
When disconnecting monitor, dev_priv->dig_port_map[port]
will be set NULL, which causes eld will not be updated in
i915_audio_component_get_eld().
This patch clears the eld buf when dev_priv->dig_port_map[port]
is NULL.
Signed-off-by: Libin Yang <libin.yang at linux.intel.com>
---
drivers/gpu/drm/i915/intel_audio.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index fdc8b2a..9d3879e 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -732,6 +732,13 @@ static int i915_audio_component_get_eld(struct device *dev, int port,
ret = drm_eld_size(eld);
memcpy(buf, eld, min(max_bytes, ret));
}
+ } else {
+ /* dev_priv->dig_port_map[port] will be set NULL in
+ * intel_audio_codec_disable when disconnecting monitor.
+ * We need clear the eld buf.
+ */
+ memset(buf, 0, max_bytes);
+ ret = 0;
}
mutex_unlock(&dev_priv->av_mutex);
--
1.9.1
More information about the Intel-gfx
mailing list