diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 98ea597bc76d..12d2fdc52414 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -88,7 +88,8 @@ u32 evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | |||
88 | /* get temperature in millidegrees */ | 88 | /* get temperature in millidegrees */ |
89 | int evergreen_get_temp(struct radeon_device *rdev) | 89 | int evergreen_get_temp(struct radeon_device *rdev) |
90 | { | 90 | { |
91 | u32 temp, toffset, actual_temp = 0; | 91 | u32 temp, toffset; |
92 | int actual_temp = 0; | ||
92 | 93 | ||
93 | if (rdev->family == CHIP_JUNIPER) { | 94 | if (rdev->family == CHIP_JUNIPER) { |
94 | toffset = (RREG32(CG_THERMAL_CTRL) & TOFFSET_MASK) >> | 95 | toffset = (RREG32(CG_THERMAL_CTRL) & TOFFSET_MASK) >> |
@@ -139,11 +140,17 @@ void evergreen_pm_misc(struct radeon_device *rdev) | |||
139 | struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage; | 140 | struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage; |
140 | 141 | ||
141 | if (voltage->type == VOLTAGE_SW) { | 142 | if (voltage->type == VOLTAGE_SW) { |
143 | /* 0xff01 is a flag rather then an actual voltage */ | ||
144 | if (voltage->voltage == 0xff01) | ||
145 | return; | ||
142 | if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) { | 146 | if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) { |
143 | radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC); | 147 | radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC); |
144 | rdev->pm.current_vddc = voltage->voltage; | 148 | rdev->pm.current_vddc = voltage->voltage; |
145 | DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage); | 149 | DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage); |
146 | } | 150 | } |
151 | /* 0xff01 is a flag rather then an actual voltage */ | ||
152 | if (voltage->vddci == 0xff01) | ||
153 | return; | ||
147 | if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) { | 154 | if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) { |
148 | radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI); | 155 | radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI); |
149 | rdev->pm.current_vddci = voltage->vddci; | 156 | rdev->pm.current_vddci = voltage->vddci; |
@@ -2006,9 +2013,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
2006 | rdev->config.evergreen.tile_config |= (3 << 0); | 2013 | rdev->config.evergreen.tile_config |= (3 << 0); |
2007 | break; | 2014 | break; |
2008 | } | 2015 | } |
2009 | /* num banks is 8 on all fusion asics */ | 2016 | /* num banks is 8 on all fusion asics. 0 = 4, 1 = 8, 2 = 16 */ |
2010 | if (rdev->flags & RADEON_IS_IGP) | 2017 | if (rdev->flags & RADEON_IS_IGP) |
2011 | rdev->config.evergreen.tile_config |= 8 << 4; | 2018 | rdev->config.evergreen.tile_config |= 1 << 4; |
2012 | else | 2019 | else |
2013 | rdev->config.evergreen.tile_config |= | 2020 | rdev->config.evergreen.tile_config |= |
2014 | ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4; | 2021 | ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4; |
@@ -2694,28 +2701,25 @@ static inline u32 evergreen_get_ih_wptr(struct radeon_device *rdev) | |||
2694 | 2701 | ||
2695 | int evergreen_irq_process(struct radeon_device *rdev) | 2702 | int evergreen_irq_process(struct radeon_device *rdev) |
2696 | { | 2703 | { |
2697 | u32 wptr = evergreen_get_ih_wptr(rdev); | 2704 | u32 wptr; |
2698 | u32 rptr = rdev->ih.rptr; | 2705 | u32 rptr; |
2699 | u32 src_id, src_data; | 2706 | u32 src_id, src_data; |
2700 | u32 ring_index; | 2707 | u32 ring_index; |
2701 | unsigned long flags; | 2708 | unsigned long flags; |
2702 | bool queue_hotplug = false; | 2709 | bool queue_hotplug = false; |
2703 | 2710 | ||
2704 | DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); | 2711 | if (!rdev->ih.enabled || rdev->shutdown) |
2705 | if (!rdev->ih.enabled) | ||
2706 | return IRQ_NONE; | 2712 | return IRQ_NONE; |
2707 | 2713 | ||
2708 | spin_lock_irqsave(&rdev->ih.lock, flags); | 2714 | wptr = evergreen_get_ih_wptr(rdev); |
2715 | rptr = rdev->ih.rptr; | ||
2716 | DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); | ||
2709 | 2717 | ||
2718 | spin_lock_irqsave(&rdev->ih.lock, flags); | ||
2710 | if (rptr == wptr) { | 2719 | if (rptr == wptr) { |
2711 | spin_unlock_irqrestore(&rdev->ih.lock, flags); | 2720 | spin_unlock_irqrestore(&rdev->ih.lock, flags); |
2712 | return IRQ_NONE; | 2721 | return IRQ_NONE; |
2713 | } | 2722 | } |
2714 | if (rdev->shutdown) { | ||
2715 | spin_unlock_irqrestore(&rdev->ih.lock, flags); | ||
2716 | return IRQ_NONE; | ||
2717 | } | ||
2718 | |||
2719 | restart_ih: | 2723 | restart_ih: |
2720 | /* display interrupts */ | 2724 | /* display interrupts */ |
2721 | evergreen_irq_ack(rdev); | 2725 | evergreen_irq_ack(rdev); |
@@ -2944,7 +2948,7 @@ restart_ih: | |||
2944 | radeon_fence_process(rdev); | 2948 | radeon_fence_process(rdev); |
2945 | break; | 2949 | break; |
2946 | case 233: /* GUI IDLE */ | 2950 | case 233: /* GUI IDLE */ |
2947 | DRM_DEBUG("IH: CP EOP\n"); | 2951 | DRM_DEBUG("IH: GUI idle\n"); |
2948 | rdev->pm.gui_idle = true; | 2952 | rdev->pm.gui_idle = true; |
2949 | wake_up(&rdev->irq.idle_queue); | 2953 | wake_up(&rdev->irq.idle_queue); |
2950 | break; | 2954 | break; |