From: Alex Deucher <alexdeucher@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>, stable@vger.kernel.org
Subject: [PATCH] drm/radeon: properly select encoder in radeon_audio_detect (v2)
Date: Tue, 19 May 2015 12:08:37 -0400 [thread overview]
Message-ID: <1432051717-2487-2-git-send-email-alexander.deucher@amd.com> (raw)
In-Reply-To: <1432051717-2487-1-git-send-email-alexander.deucher@amd.com>
Need to handle DVI where we way end up with an analog encoder
in some cases.
v2: rework checks. always set use_digital for DVI-D, HDMI-A
Reported-by: Julian Margetson <runaway@candw.ms>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
drivers/gpu/drm/radeon/radeon_audio.c | 20 +++++++++++---------
drivers/gpu/drm/radeon/radeon_connectors.c | 6 ++++--
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c
index dcb7796..ace2b4b 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -453,22 +453,24 @@ void radeon_audio_enable(struct radeon_device *rdev,
void radeon_audio_detect(struct drm_connector *connector,
enum drm_connector_status status)
{
- struct radeon_device *rdev;
- struct radeon_encoder *radeon_encoder;
+ struct drm_device *dev = connector->dev;
+ struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder_atom_dig *dig;
+ const struct drm_connector_helper_funcs *connector_funcs =
+ connector->helper_private;
+ struct drm_encoder *encoder = connector_funcs->best_encoder(connector);
+ struct radeon_encoder *radeon_encoder;
- if (!connector || !connector->encoder)
+ if (!radeon_audio_chipset_supported(rdev))
return;
- if (!radeon_encoder_is_digital(connector->encoder))
+ if (!encoder)
return;
- rdev = connector->encoder->dev->dev_private;
-
- if (!radeon_audio_chipset_supported(rdev))
+ if (!radeon_encoder_is_digital(encoder))
return;
- radeon_encoder = to_radeon_encoder(connector->encoder);
+ radeon_encoder = to_radeon_encoder(encoder);
dig = radeon_encoder->enc_priv;
if (!dig->afmt)
@@ -484,7 +486,7 @@ void radeon_audio_detect(struct drm_connector *connector,
else
radeon_encoder->audio = rdev->audio.hdmi_funcs;
- dig->afmt->pin = radeon_audio_get_pin(connector->encoder);
+ dig->afmt->pin = radeon_audio_get_pin(encoder);
if (drm_detect_monitor_audio(radeon_connector_edid(connector))) {
radeon_audio_enable(rdev, dig->afmt->pin, 0xf);
} else {
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index d17d251..8052759 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -1303,8 +1303,10 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
/* DVI-D and HDMI-A are digital only */
if ((connector->connector_type == DRM_MODE_CONNECTOR_DVID) ||
- (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA))
+ (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)) {
+ radeon_connector->use_digital = true;
goto out;
+ }
/* if we aren't forcing don't do destructive polling */
if (!force) {
@@ -1379,7 +1381,7 @@ out:
/* updated in get modes as well since we need to know if it's analog or digital */
radeon_connector_update_scratch_regs(connector, ret);
- if (radeon_audio != 0) {
+ if ((radeon_audio != 0) && (radeon_connector->use_digital)) {
radeon_connector_get_edid(connector);
radeon_audio_detect(connector, ret);
}
--
1.8.3.1
prev parent reply other threads:[~2015-05-19 16:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 16:08 [PATCH] drm/radeon: take the mode_config mutex when dealing with hpds (v2) Alex Deucher
2015-05-19 16:08 ` Alex Deucher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432051717-2487-2-git-send-email-alexander.deucher@amd.com \
--to=alexdeucher@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox