Commit graph

39 commits

Author SHA1 Message Date
Alex Deucher
7726e72b3d drm/radeon: rework audio modeset to handle non-audio hdmi features
Need to setup the deep color and avi packets regardless of
audio setup.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-29 15:50:28 -04:00
Alex Deucher
d0ea397e22 drm/radeon: rework audio detect (v4)
1. Always assign audio function pointers even if the display does
not support audio.  We need to properly disable the audio stream
when when using a non-audio capable monitor.  Fixes purple line
on some hdmi monitors.

2. Check if a pin is in use by another encoder before disabling
it.

v2: make sure we've fetched the edid before checking audio and
    look up the encoder before calling audio_detect since
    connector->encoder may not be assigned yet.  Separate
    pin and afmt.  They are allocated at different times and
    have no dependency on eachother.
v3: fix connector fetching in encoder functions
v4: fix missed dig->pin check in dce6_afmt_write_latency_fields

bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=93701
https://bugzilla.redhat.com/show_bug.cgi?id=1236337
https://bugs.freedesktop.org/show_bug.cgi?id=91041

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-07-29 15:48:05 -04:00
Alex Deucher
479e9a9512 drm/radeon: only check the sink type on DP connectors
Avoids a crash on pre-DP asics that support HDMI.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-06-30 09:30:01 -04:00
Dave Airlie
a8a50fce60 Linux 4.1-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVa7zvAAoJEHm+PkMAQRiGtfMIAILs3sxFtrC1hApgcfRLF/7z
 K34bwTRqErzqUO/orTwakEr9kSIpIL0zIPSryTCOTPZLfMGkQjhHXO3KR/DSbbTV
 MZ8y/BM/yelFA/Np+1LjbiYjTNRnTRvCoaQihkIH8Rn02g7ob9HyL4gIGKpuGFcZ
 04GacL2cgChqsRSACdNef948jCoJXKgcuDpe39DXphDWZnBKNZ3HFuJ6bryGJf9A
 1/eCI4is85BNwKPemQUYR0xx83UIzDfrghatZP2mOCDDSA2MNg8HNxLTd12LGoQD
 tfgX4B7aftzW9Y7GSEDfZ0IKm2NRzgPmCVj6PjVR/iI0lIK4Aq0Z/lDJxxEq3XQ=
 =AJM5
 -----END PGP SIGNATURE-----

Merge tag 'v4.1-rc6' into drm-next

Linux 4.1-rc6

backmerge 4.1-rc6 as some of the later pull reqs are based on newer bases
and I'd prefer to do the fixup myself.
2015-06-04 09:23:51 +10:00
Alex Deucher
0106219361 drm/radeon: clean up radeon_audio_enable
- make it static
- fix mask/bool handling for last param

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-05-28 00:03:39 -04:00
Alex Deucher
2d1c18bba1 Revert "drm/radeon: only mark audio as connected if the monitor supports it (v3)"
This breaks too many things.

bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=99041
https://bugs.freedesktop.org/show_bug.cgi?id=90681

This reverts commit 0f55db36d4.

Cc: stable@vger.kernel.org
2015-05-27 12:08:29 -04:00
Alex Deucher
d73a824acc drm/radeon: don't setup audio on asics that don't support it
bug: https://bugzilla.kernel.org/show_bug.cgi?id=97701

Reported-by: Mikael Pettersson <mikpelinux@gmail.com>
Tested-by: Mikael Pettersson <mikpelinux@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-05-05 09:46:10 -04:00
Alex Deucher
0f55db36d4 drm/radeon: only mark audio as connected if the monitor supports it (v3)
Otherwise the driver may try and send audio which may confuse the
monitor.

v2: set pin to NULL if no audio
v3: avoid crash with analog encoders

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-04-27 09:54:55 -04:00
Alex Deucher
12428327bb drm/radeon: drop dce6_dp_enable
It's mostly duplicated with evergreen_dp_enable. This
is a prerequisite for fix implemented in another patch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-04-27 09:54:53 -04:00
Alex Deucher
a1dcc2778b drm/radeon: setup quantization_range in AVI infoframe
If the display supports selectable range, set the range
based on what the user has selected for output csc.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83226

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-19 12:26:26 -04:00
Alex Deucher
aeefd07e90 drm/radeon: properly set dto for dp on DCE4/5
If DCPLL or ext PLL is used, use the disp clk.  If
PPLL is used, use the dp clock.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-03 17:28:24 -05:00
Alex Deucher
b20932dd62 drm/radeon/audio: update EDID derived fields in modeset
We don't necessarily have an EDID at this point when
audio detect gets called.  Ideally we'd update these
fields in detect, but that requires a larger rework
of the display detect code.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-03 17:28:23 -05:00
Alex Deucher
3ed7ceeabf drm/radeon: don't toggle audio state in modeset
Should be done only at detect time to avoid spurious
state changes on the audio side.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-03 17:28:22 -05:00
Alex Deucher
88af339f9f drm/radeon/audio: set mute around state setup
To avoid possible sound artifacts while setting up audio.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-03 17:28:22 -05:00
Alex Deucher
d3c34d2c73 drm/radeon: assign pin in detect
We need the pin from detect on, it's too late in dpms.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-03 17:28:21 -05:00
Alex Deucher
add7d75966 drm/radeon: fix the audio dpms callbacks
Don't touch the audio enable bits as these are already
handled in display detection.  Enable the hdmi secondary
streams in hdmi enable to match dp.  Rename dp dpms
callback to be consistent with hdmi.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=89327
https://bugzilla.kernel.org/show_bug.cgi?id=93921

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-03 17:28:20 -05:00
Alex Deucher
308de41ba3 drm/radeon: use NULL rather then 0 in audio detect
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:20 -05:00
Alex Deucher
f4c6c08182 drm/radeon: whitespace clean up in radeon_audio.c
Clean up some formatting in radeon_audio.c to be
more consistent with the rest of the driver.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:19 -05:00
Slava Grigorev
e55bca2618 radeon/audio: enable DP audio
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:19 -05:00
Slava Grigorev
ccd4be7eb7 radeon/audio: moved audio caps programming to audio_hotplug() function
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:18 -05:00
Slava Grigorev
6f945693be radeon/audio: applied audio_dpms() and audio_mode_set() calls
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:17 -05:00
Slava Grigorev
6e72376dcc radeon/audio: consolidate audio_mode_set() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:17 -05:00
Slava Grigorev
3be2e7d0e7 radeon/audio: moved mute programming to a separate function
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:15 -05:00
Slava Grigorev
1852c9a09a radeon/audio: moved audio packet programming to a separate function
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:14 -05:00
Slava Grigorev
baa7d8e451 radeon/audio: set_avi_packet() function cleanup
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:14 -05:00
Slava Grigorev
be273e58f0 radeon: moved HDMI color depth programming to a separate function
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:12 -05:00
Alex Deucher
930a978512 radeon/audio: moved VBI packet programming to separate functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:12 -05:00
Slava Grigorev
64424d6e45 radeon/audio: consolidate update_acr() functions (v2)
V2: fix missing dce6 callback

Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:11 -05:00
Slava Grigorev
96ea7afbc2 radeon/audio: consolidate update_avi_infoframe() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:10 -05:00
Slava Grigorev
a85d682a65 radeon/audio: consolidate audio_set_dto() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:10 -05:00
Slava Grigorev
7991d66501 radeon/audio: consolidate audio_fini() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:09 -05:00
Slava Grigorev
8bf598207e radeon/audio: consolidate audio_enable() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:08 -05:00
Slava Grigorev
88252d7728 radeon/audio: consolidate select_pin() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:07 -05:00
Slava Grigorev
3cdde027aa radeon/audio: consolidate audio_get_pin() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:07 -05:00
Slava Grigorev
87654f87af radeon/audio: consolidate write_latency_fields() functions
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:06 -05:00
Slava Grigorev
00a9d4bcf8 radeon/audio: consolidate write_speaker_allocation() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:42:05 -05:00
Alex Deucher
070a2e63f6 radeon/audio: consolidate write_sad_regs() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:41:55 -05:00
Slava Grigorev
1a626b68fb radeon/audio: defined initial audio interface that gets initialized via detect() call
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:39:00 -05:00
Slava Grigorev
bfc1f97d8a radeon/audio: consolidate audio_init() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-01-22 10:38:59 -05:00