Commit 7eea7e9e authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Dave Airlie

drm/radeon/kms: track audio engine state, do not use not setup timer

This is needed to enable audio support on devices using polling. In case user
decides to disable audio (module parameter) we still will try to use timer in
r600_audio_enable_polling. This would lead to BUG in kernel/timer.c.
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent e7aeeba6
...@@ -160,6 +160,7 @@ static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable) ...@@ -160,6 +160,7 @@ static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable)
{ {
DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling"); DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling");
WREG32_P(R600_AUDIO_ENABLE, enable ? 0x81000000 : 0x0, ~0x81000000); WREG32_P(R600_AUDIO_ENABLE, enable ? 0x81000000 : 0x0, ~0x81000000);
rdev->audio_enabled = enable;
} }
/* /*
...@@ -200,7 +201,8 @@ void r600_audio_enable_polling(struct drm_encoder *encoder) ...@@ -200,7 +201,8 @@ void r600_audio_enable_polling(struct drm_encoder *encoder)
return; return;
radeon_encoder->audio_polling_active = 1; radeon_encoder->audio_polling_active = 1;
mod_timer(&rdev->audio_timer, jiffies + 1); if (rdev->audio_enabled)
mod_timer(&rdev->audio_timer, jiffies + 1);
} }
/* /*
...@@ -266,7 +268,7 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock) ...@@ -266,7 +268,7 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock)
*/ */
void r600_audio_fini(struct radeon_device *rdev) void r600_audio_fini(struct radeon_device *rdev)
{ {
if (!radeon_audio || !r600_audio_chipset_supported(rdev)) if (!rdev->audio_enabled)
return; return;
del_timer(&rdev->audio_timer); del_timer(&rdev->audio_timer);
......
...@@ -1084,6 +1084,7 @@ struct radeon_device { ...@@ -1084,6 +1084,7 @@ struct radeon_device {
struct mutex vram_mutex; struct mutex vram_mutex;
/* audio stuff */ /* audio stuff */
bool audio_enabled;
struct timer_list audio_timer; struct timer_list audio_timer;
int audio_channels; int audio_channels;
int audio_rate; int audio_rate;
......
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