drm/i915/audio: Make sure we write the whole ELD buffer
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 26 Oct 2022 17:01:45 +0000 (20:01 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 27 Oct 2022 17:19:26 +0000 (20:19 +0300)
commit0234cda2ceb9b90da55e3bc43dfda451b152acb1
tree2ba7f10dc70598807ea07f8c6ad06f4d6be31fbb
parent1c0ab71acc83091f55f9c9091f9959d5be565dff
drm/i915/audio: Make sure we write the whole ELD buffer

Currently we only write as many dwords into the hardware
ELD buffers as drm_eld_size() tells us. That could mean the
remainder of the hardware buffer is left with whatever
stale garbage it had before, which doesn't seem entirely
great. Let's zero out the remainder of the buffer in case
the provided ELD doesn't fill it fully.

We can also sanity check out idea of the hardware ELD buffer's
size by making sure the address wrapped back to zero once
we wrote the entire buffer.

Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026170150.2654-11-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_audio.c