diff options
author | Dave Airlie <airlied@redhat.com> | 2011-06-17 23:59:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-06-19 22:01:43 -0400 |
commit | 682f1a54a03513fd6bcede56845f1ba21f48c182 (patch) | |
tree | 03e3dce23297f943e48dbaedee5d7c4d35bbb6d3 | |
parent | 74d074eecbb4778e5f5ee7d59399da971682c532 (diff) |
drm/radeon: avoid warnings from r600/eg irq handlers on powered off card.
Since we were calling the wptr function before checking if the IH was
even enabled, or the GPU wasn't shutdown, we'd get spam in the logs when
the GPU readback 0xffffffff. This reorders things so we return early
in the no IH and GPU shutdown cases.
Reported-and-tested-by: ManDay on #radeon
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 15 |
2 files changed, 14 insertions, 18 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 7e3d96e7ac04..7162b7bacac0 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2695,28 +2695,25 @@ static inline u32 evergreen_get_ih_wptr(struct radeon_device *rdev) | |||
2695 | 2695 | ||
2696 | int evergreen_irq_process(struct radeon_device *rdev) | 2696 | int evergreen_irq_process(struct radeon_device *rdev) |
2697 | { | 2697 | { |
2698 | u32 wptr = evergreen_get_ih_wptr(rdev); | 2698 | u32 wptr; |
2699 | u32 rptr = rdev->ih.rptr; | 2699 | u32 rptr; |
2700 | u32 src_id, src_data; | 2700 | u32 src_id, src_data; |
2701 | u32 ring_index; | 2701 | u32 ring_index; |
2702 | unsigned long flags; | 2702 | unsigned long flags; |
2703 | bool queue_hotplug = false; | 2703 | bool queue_hotplug = false; |
2704 | 2704 | ||
2705 | DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); | 2705 | if (!rdev->ih.enabled || rdev->shutdown) |
2706 | if (!rdev->ih.enabled) | ||
2707 | return IRQ_NONE; | 2706 | return IRQ_NONE; |
2708 | 2707 | ||
2709 | spin_lock_irqsave(&rdev->ih.lock, flags); | 2708 | wptr = evergreen_get_ih_wptr(rdev); |
2709 | rptr = rdev->ih.rptr; | ||
2710 | DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); | ||
2710 | 2711 | ||
2712 | spin_lock_irqsave(&rdev->ih.lock, flags); | ||
2711 | if (rptr == wptr) { | 2713 | if (rptr == wptr) { |
2712 | spin_unlock_irqrestore(&rdev->ih.lock, flags); | 2714 | spin_unlock_irqrestore(&rdev->ih.lock, flags); |
2713 | return IRQ_NONE; | 2715 | return IRQ_NONE; |
2714 | } | 2716 | } |
2715 | if (rdev->shutdown) { | ||
2716 | spin_unlock_irqrestore(&rdev->ih.lock, flags); | ||
2717 | return IRQ_NONE; | ||
2718 | } | ||
2719 | |||
2720 | restart_ih: | 2717 | restart_ih: |
2721 | /* display interrupts */ | 2718 | /* display interrupts */ |
2722 | evergreen_irq_ack(rdev); | 2719 | evergreen_irq_ack(rdev); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 7dd45ca64e29..dc9fde38ef49 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -3294,27 +3294,26 @@ static inline u32 r600_get_ih_wptr(struct radeon_device *rdev) | |||
3294 | 3294 | ||
3295 | int r600_irq_process(struct radeon_device *rdev) | 3295 | int r600_irq_process(struct radeon_device *rdev) |
3296 | { | 3296 | { |
3297 | u32 wptr = r600_get_ih_wptr(rdev); | 3297 | u32 wptr; |
3298 | u32 rptr = rdev->ih.rptr; | 3298 | u32 rptr; |
3299 | u32 src_id, src_data; | 3299 | u32 src_id, src_data; |
3300 | u32 ring_index; | 3300 | u32 ring_index; |
3301 | unsigned long flags; | 3301 | unsigned long flags; |
3302 | bool queue_hotplug = false; | 3302 | bool queue_hotplug = false; |
3303 | 3303 | ||
3304 | DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); | 3304 | if (!rdev->ih.enabled || rdev->shutdown) |
3305 | if (!rdev->ih.enabled) | ||
3306 | return IRQ_NONE; | 3305 | return IRQ_NONE; |
3307 | 3306 | ||
3307 | wptr = r600_get_ih_wptr(rdev); | ||
3308 | rptr = rdev->ih.rptr; | ||
3309 | DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); | ||
3310 | |||
3308 | spin_lock_irqsave(&rdev->ih.lock, flags); | 3311 | spin_lock_irqsave(&rdev->ih.lock, flags); |
3309 | 3312 | ||
3310 | if (rptr == wptr) { | 3313 | if (rptr == wptr) { |
3311 | spin_unlock_irqrestore(&rdev->ih.lock, flags); | 3314 | spin_unlock_irqrestore(&rdev->ih.lock, flags); |
3312 | return IRQ_NONE; | 3315 | return IRQ_NONE; |
3313 | } | 3316 | } |
3314 | if (rdev->shutdown) { | ||
3315 | spin_unlock_irqrestore(&rdev->ih.lock, flags); | ||
3316 | return IRQ_NONE; | ||
3317 | } | ||
3318 | 3317 | ||
3319 | restart_ih: | 3318 | restart_ih: |
3320 | /* display interrupts */ | 3319 | /* display interrupts */ |