aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-06-19 06:24:56 -0400
committerDave Airlie <airlied@redhat.com>2010-08-01 20:00:06 -0400
commit7eea7e9eea106a9c49cddf780f590dd8161481fa (patch)
tree84a31f2fd452ee22ab0cdcbee1c5fb77896408cd /drivers/gpu/drm
parente7aeeba6a8fb86ac52bcffa0b72942f784f2b37f (diff)
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: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/r600_audio.c6
-rw-r--r--drivers/gpu/drm/radeon/radeon.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/r600_audio.c b/drivers/gpu/drm/radeon/r600_audio.c
index 2b26553c352c..631e1edc373a 100644
--- a/drivers/gpu/drm/radeon/r600_audio.c
+++ b/drivers/gpu/drm/radeon/r600_audio.c
@@ -160,6 +160,7 @@ static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable)
160{ 160{
161 DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling"); 161 DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling");
162 WREG32_P(R600_AUDIO_ENABLE, enable ? 0x81000000 : 0x0, ~0x81000000); 162 WREG32_P(R600_AUDIO_ENABLE, enable ? 0x81000000 : 0x0, ~0x81000000);
163 rdev->audio_enabled = enable;
163} 164}
164 165
165/* 166/*
@@ -200,7 +201,8 @@ void r600_audio_enable_polling(struct drm_encoder *encoder)
200 return; 201 return;
201 202
202 radeon_encoder->audio_polling_active = 1; 203 radeon_encoder->audio_polling_active = 1;
203 mod_timer(&rdev->audio_timer, jiffies + 1); 204 if (rdev->audio_enabled)
205 mod_timer(&rdev->audio_timer, jiffies + 1);
204} 206}
205 207
206/* 208/*
@@ -266,7 +268,7 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock)
266 */ 268 */
267void r600_audio_fini(struct radeon_device *rdev) 269void r600_audio_fini(struct radeon_device *rdev)
268{ 270{
269 if (!radeon_audio || !r600_audio_chipset_supported(rdev)) 271 if (!rdev->audio_enabled)
270 return; 272 return;
271 273
272 del_timer(&rdev->audio_timer); 274 del_timer(&rdev->audio_timer);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index be8420e65f01..03141755c2ea 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1084,6 +1084,7 @@ struct radeon_device {
1084 struct mutex vram_mutex; 1084 struct mutex vram_mutex;
1085 1085
1086 /* audio stuff */ 1086 /* audio stuff */
1087 bool audio_enabled;
1087 struct timer_list audio_timer; 1088 struct timer_list audio_timer;
1088 int audio_channels; 1089 int audio_channels;
1089 int audio_rate; 1090 int audio_rate;