Skip to content
  • Ville Syrjälä's avatar
    drm/i915/sdvo: Implement proper HDMI audio support for SDVO · d74408f5
    Ville Syrjälä authored
    
    
    Our SDVO audio support is pretty bogus. We can't push audio over the
    SDVO bus, so trying to enable audio in the SDVO control register doesn't
    do anything. In fact it looks like the SDVO encoder will always mix in
    the audio coming over HDA, and there's no (at least documented) way to
    disable that from our side. So HDMI audio does work currently on gen4
    but only by luck really. On gen3 it got broken by the referenced commit.
    And what has always been missing on every platform is the ELD.
    
    To pass the ELD to the audio driver we need to write it to magic buffer
    in the SDVO encoder hardware which then gets pulled out via HDA in the
    other end. Ie. pretty much the same thing we had for native HDMI before
    we started to just pass the ELD between the drivers. This sort of
    explains why we even have that silly hardware buffer with native HDMI.
    
    $ cat /proc/asound/card0/eld#1.0
    -monitor_present		0
    -eld_valid		0
    +monitor_present		1
    +eld_valid		1
    +monitor_name		LG TV
    +connection_type		HDMI
    +...
    
    This also fixes our state readout since we can now query the SDVO
    encoder about the state of the "ELD valid" and "presence detect"
    bits. As mentioned those don't actually control whether audio
    gets sent over the HDMI cable, but it's the best we can do. And with
    the state checker appeased we can re-enable HDMI audio for gen3.
    
    Cc: stable@vger.kernel.org
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: zardam@gmail.com
    Tested-by: default avatar <zardam@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108976
    Fixes: de44e256
    
     ("drm/i915/sdvo: Shut up state checker with hdmi cards on gen3")
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190409144054.24561-3-ville.syrjala@linux.intel.com
    
    
    Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
    (cherry picked from commit dc49a56b
    
    )
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    d74408f5