aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600_hdmi.c
diff options
context:
space:
mode:
authorChristian Koenig <christian.koenig@amd.com>2012-05-16 19:33:30 -0400
committerChristian König <deathsimple@vodafone.de>2012-06-21 03:38:50 -0400
commitfb98257a9d9d2089972b18079d5bdd4412e107e2 (patch)
tree72f6115ccae023c1e6122bdd82cf310c8014de23 /drivers/gpu/drm/radeon/r600_hdmi.c
parentc20dc3698dc7ecf053e2bf77299ae5982c0c2c45 (diff)
drm/radeon: apply Murphy's law to the kms irq code v3
1. It is really dangerous to have more than one spinlock protecting the same information. 2. radeon_irq_set sometimes wasn't called with lock protection, so it can happen that more than one CPU would tamper with the irq regs at the same time. 3. The pm.gui_idle variable was assuming that the 3D engine wasn't becoming idle between testing the register and setting the variable. So just remove it and test the register directly. v2: Also handle the hpd irq code the same way. v3: Rename hpd parameter for clarification. Signed-off-by: Christian Koenig <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_hdmi.c')
-rw-r--r--drivers/gpu/drm/radeon/r600_hdmi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
index 82a0a4c919c0..e3558c3ef24a 100644
--- a/drivers/gpu/drm/radeon/r600_hdmi.c
+++ b/drivers/gpu/drm/radeon/r600_hdmi.c
@@ -519,8 +519,7 @@ void r600_hdmi_enable(struct drm_encoder *encoder)
519 519
520 if (rdev->irq.installed) { 520 if (rdev->irq.installed) {
521 /* if irq is available use it */ 521 /* if irq is available use it */
522 rdev->irq.afmt[dig->afmt->id] = true; 522 radeon_irq_kms_enable_afmt(rdev, dig->afmt->id);
523 radeon_irq_set(rdev);
524 } 523 }
525 524
526 dig->afmt->enabled = true; 525 dig->afmt->enabled = true;
@@ -556,8 +555,7 @@ void r600_hdmi_disable(struct drm_encoder *encoder)
556 offset, radeon_encoder->encoder_id); 555 offset, radeon_encoder->encoder_id);
557 556
558 /* disable irq */ 557 /* disable irq */
559 rdev->irq.afmt[dig->afmt->id] = false; 558 radeon_irq_kms_disable_afmt(rdev, dig->afmt->id);
560 radeon_irq_set(rdev);
561 559
562 /* Older chipsets not handled by AtomBIOS */ 560 /* Older chipsets not handled by AtomBIOS */
563 if (rdev->family >= CHIP_R600 && !ASIC_IS_DCE3(rdev)) { 561 if (rdev->family >= CHIP_R600 && !ASIC_IS_DCE3(rdev)) {