Commit 6f9dbb52 authored by Alex Deucher's avatar Alex Deucher Committed by Greg Kroah-Hartman

drm/radeon: rework audio detect (v4)

commit d0ea397e upstream.

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=91041Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f62822f
...@@ -93,30 +93,26 @@ void dce6_afmt_select_pin(struct drm_encoder *encoder) ...@@ -93,30 +93,26 @@ void dce6_afmt_select_pin(struct drm_encoder *encoder)
struct radeon_device *rdev = encoder->dev->dev_private; struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
u32 offset;
if (!dig || !dig->afmt || !dig->afmt->pin) if (!dig || !dig->afmt || !dig->pin)
return; return;
offset = dig->afmt->offset; WREG32(AFMT_AUDIO_SRC_CONTROL + dig->afmt->offset,
AFMT_AUDIO_SRC_SELECT(dig->pin->id));
WREG32(AFMT_AUDIO_SRC_CONTROL + offset,
AFMT_AUDIO_SRC_SELECT(dig->afmt->pin->id));
} }
void dce6_afmt_write_latency_fields(struct drm_encoder *encoder, void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
struct drm_connector *connector, struct drm_display_mode *mode) struct drm_connector *connector,
struct drm_display_mode *mode)
{ {
struct radeon_device *rdev = encoder->dev->dev_private; struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
u32 tmp = 0, offset; u32 tmp = 0;
if (!dig || !dig->afmt || !dig->afmt->pin) if (!dig || !dig->afmt || !dig->pin)
return; return;
offset = dig->afmt->pin->offset;
if (mode->flags & DRM_MODE_FLAG_INTERLACE) { if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
if (connector->latency_present[1]) if (connector->latency_present[1])
tmp = VIDEO_LIPSYNC(connector->video_latency[1]) | tmp = VIDEO_LIPSYNC(connector->video_latency[1]) |
...@@ -130,7 +126,8 @@ void dce6_afmt_write_latency_fields(struct drm_encoder *encoder, ...@@ -130,7 +126,8 @@ void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
else else
tmp = VIDEO_LIPSYNC(0) | AUDIO_LIPSYNC(0); tmp = VIDEO_LIPSYNC(0) | AUDIO_LIPSYNC(0);
} }
WREG32_ENDPOINT(offset, AZ_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, tmp); WREG32_ENDPOINT(dig->pin->offset,
AZ_F0_CODEC_PIN_CONTROL_RESPONSE_LIPSYNC, tmp);
} }
void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
...@@ -139,15 +136,14 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, ...@@ -139,15 +136,14 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
struct radeon_device *rdev = encoder->dev->dev_private; struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
u32 offset, tmp; u32 tmp;
if (!dig || !dig->afmt || !dig->afmt->pin) if (!dig || !dig->afmt || !dig->pin)
return; return;
offset = dig->afmt->pin->offset;
/* program the speaker allocation */ /* program the speaker allocation */
tmp = RREG32_ENDPOINT(offset, AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER); tmp = RREG32_ENDPOINT(dig->pin->offset,
AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER);
tmp &= ~(DP_CONNECTION | SPEAKER_ALLOCATION_MASK); tmp &= ~(DP_CONNECTION | SPEAKER_ALLOCATION_MASK);
/* set HDMI mode */ /* set HDMI mode */
tmp |= HDMI_CONNECTION; tmp |= HDMI_CONNECTION;
...@@ -155,7 +151,8 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, ...@@ -155,7 +151,8 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
tmp |= SPEAKER_ALLOCATION(sadb[0]); tmp |= SPEAKER_ALLOCATION(sadb[0]);
else else
tmp |= SPEAKER_ALLOCATION(5); /* stereo */ tmp |= SPEAKER_ALLOCATION(5); /* stereo */
WREG32_ENDPOINT(offset, AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER, tmp); WREG32_ENDPOINT(dig->pin->offset,
AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER, tmp);
} }
void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder, void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
...@@ -164,15 +161,14 @@ void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder, ...@@ -164,15 +161,14 @@ void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
struct radeon_device *rdev = encoder->dev->dev_private; struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
u32 offset, tmp; u32 tmp;
if (!dig || !dig->afmt || !dig->afmt->pin) if (!dig || !dig->afmt || !dig->pin)
return; return;
offset = dig->afmt->pin->offset;
/* program the speaker allocation */ /* program the speaker allocation */
tmp = RREG32_ENDPOINT(offset, AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER); tmp = RREG32_ENDPOINT(dig->pin->offset,
AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER);
tmp &= ~(HDMI_CONNECTION | SPEAKER_ALLOCATION_MASK); tmp &= ~(HDMI_CONNECTION | SPEAKER_ALLOCATION_MASK);
/* set DP mode */ /* set DP mode */
tmp |= DP_CONNECTION; tmp |= DP_CONNECTION;
...@@ -180,13 +176,13 @@ void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder, ...@@ -180,13 +176,13 @@ void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
tmp |= SPEAKER_ALLOCATION(sadb[0]); tmp |= SPEAKER_ALLOCATION(sadb[0]);
else else
tmp |= SPEAKER_ALLOCATION(5); /* stereo */ tmp |= SPEAKER_ALLOCATION(5); /* stereo */
WREG32_ENDPOINT(offset, AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER, tmp); WREG32_ENDPOINT(dig->pin->offset,
AZ_F0_CODEC_PIN_CONTROL_CHANNEL_SPEAKER, tmp);
} }
void dce6_afmt_write_sad_regs(struct drm_encoder *encoder, void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
struct cea_sad *sads, int sad_count) struct cea_sad *sads, int sad_count)
{ {
u32 offset;
int i; int i;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
...@@ -206,11 +202,9 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder, ...@@ -206,11 +202,9 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
{ AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR13, HDMI_AUDIO_CODING_TYPE_WMA_PRO }, { AZ_F0_CODEC_PIN_CONTROL_AUDIO_DESCRIPTOR13, HDMI_AUDIO_CODING_TYPE_WMA_PRO },
}; };
if (!dig || !dig->afmt || !dig->afmt->pin) if (!dig || !dig->afmt || !dig->pin)
return; return;
offset = dig->afmt->pin->offset;
for (i = 0; i < ARRAY_SIZE(eld_reg_to_type); i++) { for (i = 0; i < ARRAY_SIZE(eld_reg_to_type); i++) {
u32 value = 0; u32 value = 0;
u8 stereo_freqs = 0; u8 stereo_freqs = 0;
...@@ -237,7 +231,7 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder, ...@@ -237,7 +231,7 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder,
value |= SUPPORTED_FREQUENCIES_STEREO(stereo_freqs); value |= SUPPORTED_FREQUENCIES_STEREO(stereo_freqs);
WREG32_ENDPOINT(offset, eld_reg_to_type[i][0], value); WREG32_ENDPOINT(dig->pin->offset, eld_reg_to_type[i][0], value);
} }
} }
......
...@@ -245,6 +245,28 @@ static struct radeon_audio_funcs dce6_dp_funcs = { ...@@ -245,6 +245,28 @@ static struct radeon_audio_funcs dce6_dp_funcs = {
static void radeon_audio_enable(struct radeon_device *rdev, static void radeon_audio_enable(struct radeon_device *rdev,
struct r600_audio_pin *pin, u8 enable_mask) struct r600_audio_pin *pin, u8 enable_mask)
{ {
struct drm_encoder *encoder;
struct radeon_encoder *radeon_encoder;
struct radeon_encoder_atom_dig *dig;
int pin_count = 0;
if (!pin)
return;
if (rdev->mode_info.mode_config_initialized) {
list_for_each_entry(encoder, &rdev->ddev->mode_config.encoder_list, head) {
if (radeon_encoder_is_digital(encoder)) {
radeon_encoder = to_radeon_encoder(encoder);
dig = radeon_encoder->enc_priv;
if (dig->pin == pin)
pin_count++;
}
}
if ((pin_count > 1) && (enable_mask == 0))
return;
}
if (rdev->audio.funcs->enable) if (rdev->audio.funcs->enable)
rdev->audio.funcs->enable(rdev, pin, enable_mask); rdev->audio.funcs->enable(rdev, pin, enable_mask);
} }
...@@ -336,24 +358,13 @@ void radeon_audio_endpoint_wreg(struct radeon_device *rdev, u32 offset, ...@@ -336,24 +358,13 @@ void radeon_audio_endpoint_wreg(struct radeon_device *rdev, u32 offset,
static void radeon_audio_write_sad_regs(struct drm_encoder *encoder) static void radeon_audio_write_sad_regs(struct drm_encoder *encoder)
{ {
struct radeon_encoder *radeon_encoder; struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
struct drm_connector *connector; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_connector *radeon_connector = NULL;
struct cea_sad *sads; struct cea_sad *sads;
int sad_count; int sad_count;
list_for_each_entry(connector, if (!connector)
&encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}
if (!radeon_connector) {
DRM_ERROR("Couldn't find encoder's connector\n");
return; return;
}
sad_count = drm_edid_to_sad(radeon_connector_edid(connector), &sads); sad_count = drm_edid_to_sad(radeon_connector_edid(connector), &sads);
if (sad_count <= 0) { if (sad_count <= 0) {
...@@ -362,8 +373,6 @@ static void radeon_audio_write_sad_regs(struct drm_encoder *encoder) ...@@ -362,8 +373,6 @@ static void radeon_audio_write_sad_regs(struct drm_encoder *encoder)
} }
BUG_ON(!sads); BUG_ON(!sads);
radeon_encoder = to_radeon_encoder(encoder);
if (radeon_encoder->audio && radeon_encoder->audio->write_sad_regs) if (radeon_encoder->audio && radeon_encoder->audio->write_sad_regs)
radeon_encoder->audio->write_sad_regs(encoder, sads, sad_count); radeon_encoder->audio->write_sad_regs(encoder, sads, sad_count);
...@@ -372,27 +381,16 @@ static void radeon_audio_write_sad_regs(struct drm_encoder *encoder) ...@@ -372,27 +381,16 @@ static void radeon_audio_write_sad_regs(struct drm_encoder *encoder)
static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder) static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder)
{ {
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct drm_connector *connector;
struct radeon_connector *radeon_connector = NULL;
u8 *sadb = NULL; u8 *sadb = NULL;
int sad_count; int sad_count;
list_for_each_entry(connector, if (!connector)
&encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}
if (!radeon_connector) {
DRM_ERROR("Couldn't find encoder's connector\n");
return; return;
}
sad_count = drm_edid_to_speaker_allocation( sad_count = drm_edid_to_speaker_allocation(radeon_connector_edid(connector),
radeon_connector_edid(connector), &sadb); &sadb);
if (sad_count < 0) { if (sad_count < 0) {
DRM_DEBUG("Couldn't read Speaker Allocation Data Block: %d\n", DRM_DEBUG("Couldn't read Speaker Allocation Data Block: %d\n",
sad_count); sad_count);
...@@ -408,24 +406,11 @@ static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder) ...@@ -408,24 +406,11 @@ static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder)
static void radeon_audio_write_latency_fields(struct drm_encoder *encoder, static void radeon_audio_write_latency_fields(struct drm_encoder *encoder,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct radeon_encoder *radeon_encoder; struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
struct drm_connector *connector; struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_connector *radeon_connector = 0;
list_for_each_entry(connector,
&encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}
if (!radeon_connector) { if (!connector)
DRM_ERROR("Couldn't find encoder's connector\n");
return; return;
}
radeon_encoder = to_radeon_encoder(encoder);
if (radeon_encoder->audio && radeon_encoder->audio->write_latency_fields) if (radeon_encoder->audio && radeon_encoder->audio->write_latency_fields)
radeon_encoder->audio->write_latency_fields(encoder, connector, mode); radeon_encoder->audio->write_latency_fields(encoder, connector, mode);
...@@ -451,29 +436,23 @@ static void radeon_audio_select_pin(struct drm_encoder *encoder) ...@@ -451,29 +436,23 @@ static void radeon_audio_select_pin(struct drm_encoder *encoder)
} }
void radeon_audio_detect(struct drm_connector *connector, void radeon_audio_detect(struct drm_connector *connector,
struct drm_encoder *encoder,
enum drm_connector_status status) enum drm_connector_status status)
{ {
struct radeon_device *rdev; struct drm_device *dev = connector->dev;
struct radeon_encoder *radeon_encoder; struct radeon_device *rdev = dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig; struct radeon_encoder_atom_dig *dig;
if (!connector || !connector->encoder) if (!radeon_audio_chipset_supported(rdev))
return; return;
rdev = connector->encoder->dev->dev_private; if (!radeon_encoder_is_digital(encoder))
if (!radeon_audio_chipset_supported(rdev))
return; return;
radeon_encoder = to_radeon_encoder(connector->encoder);
dig = radeon_encoder->enc_priv; dig = radeon_encoder->enc_priv;
if (status == connector_status_connected) { if (status == connector_status_connected) {
if (!drm_detect_monitor_audio(radeon_connector_edid(connector))) {
radeon_encoder->audio = NULL;
return;
}
if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct radeon_connector *radeon_connector = to_radeon_connector(connector);
...@@ -486,11 +465,17 @@ void radeon_audio_detect(struct drm_connector *connector, ...@@ -486,11 +465,17 @@ void radeon_audio_detect(struct drm_connector *connector,
radeon_encoder->audio = rdev->audio.hdmi_funcs; radeon_encoder->audio = rdev->audio.hdmi_funcs;
} }
dig->afmt->pin = radeon_audio_get_pin(connector->encoder); if (drm_detect_monitor_audio(radeon_connector_edid(connector))) {
radeon_audio_enable(rdev, dig->afmt->pin, 0xf); if (!dig->pin)
dig->pin = radeon_audio_get_pin(encoder);
radeon_audio_enable(rdev, dig->pin, 0xf);
} else { } else {
radeon_audio_enable(rdev, dig->afmt->pin, 0); radeon_audio_enable(rdev, dig->pin, 0);
dig->afmt->pin = NULL; dig->pin = NULL;
}
} else {
radeon_audio_enable(rdev, dig->pin, 0);
dig->pin = NULL;
} }
} }
...@@ -523,24 +508,13 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder, ...@@ -523,24 +508,13 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,
struct radeon_device *rdev = encoder->dev->dev_private; struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
struct drm_connector *connector; struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
struct radeon_connector *radeon_connector = NULL;
u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE]; u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE];
struct hdmi_avi_infoframe frame; struct hdmi_avi_infoframe frame;
int err; int err;
list_for_each_entry(connector, if (!connector)
&encoder->dev->mode_config.connector_list, head) { return -EINVAL;
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}
if (!radeon_connector) {
DRM_ERROR("Couldn't find encoder's connector\n");
return -ENOENT;
}
err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode); err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode);
if (err < 0) { if (err < 0) {
...@@ -563,8 +537,8 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder, ...@@ -563,8 +537,8 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,
return err; return err;
} }
if (dig && dig->afmt && if (dig && dig->afmt && radeon_encoder->audio &&
radeon_encoder->audio && radeon_encoder->audio->set_avi_packet) radeon_encoder->audio->set_avi_packet)
radeon_encoder->audio->set_avi_packet(rdev, dig->afmt->offset, radeon_encoder->audio->set_avi_packet(rdev, dig->afmt->offset,
buffer, sizeof(buffer)); buffer, sizeof(buffer));
...@@ -756,6 +730,9 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder, ...@@ -756,6 +730,9 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
struct radeon_connector_atom_dig *dig_connector = struct radeon_connector_atom_dig *dig_connector =
radeon_connector->con_priv; radeon_connector->con_priv;
if (!connector)
return;
if (!dig || !dig->afmt) if (!dig || !dig->afmt)
return; return;
......
...@@ -68,6 +68,7 @@ struct radeon_audio_funcs ...@@ -68,6 +68,7 @@ struct radeon_audio_funcs
int radeon_audio_init(struct radeon_device *rdev); int radeon_audio_init(struct radeon_device *rdev);
void radeon_audio_detect(struct drm_connector *connector, void radeon_audio_detect(struct drm_connector *connector,
struct drm_encoder *encoder,
enum drm_connector_status status); enum drm_connector_status status);
u32 radeon_audio_endpoint_rreg(struct radeon_device *rdev, u32 radeon_audio_endpoint_rreg(struct radeon_device *rdev,
u32 offset, u32 reg); u32 offset, u32 reg);
......
...@@ -1379,8 +1379,16 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) ...@@ -1379,8 +1379,16 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
/* updated in get modes as well since we need to know if it's analog or digital */ /* updated in get modes as well since we need to know if it's analog or digital */
radeon_connector_update_scratch_regs(connector, ret); radeon_connector_update_scratch_regs(connector, ret);
if (radeon_audio != 0) if ((radeon_audio != 0) && radeon_connector->use_digital) {
radeon_audio_detect(connector, ret); const struct drm_connector_helper_funcs *connector_funcs =
connector->helper_private;
encoder = connector_funcs->best_encoder(connector);
if (encoder && (encoder->encoder_type == DRM_MODE_ENCODER_TMDS)) {
radeon_connector_get_edid(connector);
radeon_audio_detect(connector, encoder, ret);
}
}
exit: exit:
pm_runtime_mark_last_busy(connector->dev->dev); pm_runtime_mark_last_busy(connector->dev->dev);
...@@ -1717,8 +1725,10 @@ radeon_dp_detect(struct drm_connector *connector, bool force) ...@@ -1717,8 +1725,10 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
radeon_connector_update_scratch_regs(connector, ret); radeon_connector_update_scratch_regs(connector, ret);
if (radeon_audio != 0) if ((radeon_audio != 0) && encoder) {
radeon_audio_detect(connector, ret); radeon_connector_get_edid(connector);
radeon_audio_detect(connector, encoder, ret);
}
out: out:
pm_runtime_mark_last_busy(connector->dev->dev); pm_runtime_mark_last_busy(connector->dev->dev);
......
...@@ -237,7 +237,6 @@ struct radeon_afmt { ...@@ -237,7 +237,6 @@ struct radeon_afmt {
int offset; int offset;
bool last_buffer_filled_status; bool last_buffer_filled_status;
int id; int id;
struct r600_audio_pin *pin;
}; };
struct radeon_mode_info { struct radeon_mode_info {
...@@ -439,6 +438,7 @@ struct radeon_encoder_atom_dig { ...@@ -439,6 +438,7 @@ struct radeon_encoder_atom_dig {
uint8_t backlight_level; uint8_t backlight_level;
int panel_mode; int panel_mode;
struct radeon_afmt *afmt; struct radeon_afmt *afmt;
struct r600_audio_pin *pin;
int active_mst_links; int active_mst_links;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment