Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 1 | /************************************************************************** |
| 2 | * |
| 3 | * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA |
| 4 | * All Rights Reserved. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the |
| 8 | * "Software"), to deal in the Software without restriction, including |
| 9 | * without limitation the rights to use, copy, modify, merge, publish, |
| 10 | * distribute, sub license, and/or sell copies of the Software, and to |
| 11 | * permit persons to whom the Software is furnished to do so, subject to |
| 12 | * the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice (including the |
| 15 | * next paragraph) shall be included in all copies or substantial portions |
| 16 | * of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
| 21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, |
| 22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | * |
| 26 | **************************************************************************/ |
| 27 | |
David Howells | 760285e | 2012-10-02 18:01:07 +0100 | [diff] [blame] | 28 | #include <drm/drmP.h> |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 29 | #include "vmwgfx_drv.h" |
| 30 | |
| 31 | #define VMW_FENCE_WRAP (1 << 24) |
| 32 | |
Daniel Vetter | e9f0d76 | 2013-12-11 11:34:42 +0100 | [diff] [blame] | 33 | irqreturn_t vmw_irq_handler(int irq, void *arg) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 34 | { |
| 35 | struct drm_device *dev = (struct drm_device *)arg; |
| 36 | struct vmw_private *dev_priv = vmw_priv(dev); |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 37 | uint32_t status, masked_status; |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 38 | |
| 39 | spin_lock(&dev_priv->irq_lock); |
| 40 | status = inl(dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 41 | masked_status = status & dev_priv->irq_mask; |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 42 | spin_unlock(&dev_priv->irq_lock); |
| 43 | |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 44 | if (likely(status)) |
| 45 | outl(status, dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
Thomas Hellstrom | ae2a104 | 2011-09-01 20:18:44 +0000 | [diff] [blame] | 46 | |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 47 | if (!masked_status) |
| 48 | return IRQ_NONE; |
| 49 | |
| 50 | if (masked_status & (SVGA_IRQFLAG_ANY_FENCE | |
| 51 | SVGA_IRQFLAG_FENCE_GOAL)) { |
| 52 | vmw_fences_update(dev_priv->fman); |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 53 | wake_up_all(&dev_priv->fence_queue); |
Thomas Hellstrom | ae2a104 | 2011-09-01 20:18:44 +0000 | [diff] [blame] | 54 | } |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 55 | |
| 56 | if (masked_status & SVGA_IRQFLAG_FIFO_PROGRESS) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 57 | wake_up_all(&dev_priv->fifo_queue); |
| 58 | |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 59 | |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 60 | return IRQ_HANDLED; |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 61 | } |
| 62 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 63 | static bool vmw_fifo_idle(struct vmw_private *dev_priv, uint32_t seqno) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 64 | { |
| 65 | uint32_t busy; |
| 66 | |
| 67 | mutex_lock(&dev_priv->hw_mutex); |
| 68 | busy = vmw_read(dev_priv, SVGA_REG_BUSY); |
| 69 | mutex_unlock(&dev_priv->hw_mutex); |
| 70 | |
| 71 | return (busy == 0); |
| 72 | } |
| 73 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 74 | void vmw_update_seqno(struct vmw_private *dev_priv, |
Thomas Hellstrom | 1925d45 | 2010-05-28 11:21:57 +0200 | [diff] [blame] | 75 | struct vmw_fifo_state *fifo_state) |
| 76 | { |
| 77 | __le32 __iomem *fifo_mem = dev_priv->mmio_virt; |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 78 | uint32_t seqno = ioread32(fifo_mem + SVGA_FIFO_FENCE); |
Thomas Hellstrom | 1925d45 | 2010-05-28 11:21:57 +0200 | [diff] [blame] | 79 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 80 | if (dev_priv->last_read_seqno != seqno) { |
| 81 | dev_priv->last_read_seqno = seqno; |
| 82 | vmw_marker_pull(&fifo_state->marker_queue, seqno); |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 83 | vmw_fences_update(dev_priv->fman); |
Thomas Hellstrom | 1925d45 | 2010-05-28 11:21:57 +0200 | [diff] [blame] | 84 | } |
| 85 | } |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 86 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 87 | bool vmw_seqno_passed(struct vmw_private *dev_priv, |
| 88 | uint32_t seqno) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 89 | { |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 90 | struct vmw_fifo_state *fifo_state; |
| 91 | bool ret; |
| 92 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 93 | if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 94 | return true; |
| 95 | |
Thomas Hellstrom | 1925d45 | 2010-05-28 11:21:57 +0200 | [diff] [blame] | 96 | fifo_state = &dev_priv->fifo; |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 97 | vmw_update_seqno(dev_priv, fifo_state); |
| 98 | if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 99 | return true; |
| 100 | |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 101 | if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE) && |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 102 | vmw_fifo_idle(dev_priv, seqno)) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 103 | return true; |
| 104 | |
| 105 | /** |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 106 | * Then check if the seqno is higher than what we've actually |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 107 | * emitted. Then the fence is stale and signaled. |
| 108 | */ |
| 109 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 110 | ret = ((atomic_read(&dev_priv->marker_seq) - seqno) |
Thomas Hellstrom | 85b9e48 | 2010-02-08 09:57:25 +0000 | [diff] [blame] | 111 | > VMW_FENCE_WRAP); |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 112 | |
| 113 | return ret; |
| 114 | } |
| 115 | |
| 116 | int vmw_fallback_wait(struct vmw_private *dev_priv, |
| 117 | bool lazy, |
| 118 | bool fifo_idle, |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 119 | uint32_t seqno, |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 120 | bool interruptible, |
| 121 | unsigned long timeout) |
| 122 | { |
| 123 | struct vmw_fifo_state *fifo_state = &dev_priv->fifo; |
| 124 | |
| 125 | uint32_t count = 0; |
| 126 | uint32_t signal_seq; |
| 127 | int ret; |
| 128 | unsigned long end_jiffies = jiffies + timeout; |
| 129 | bool (*wait_condition)(struct vmw_private *, uint32_t); |
| 130 | DEFINE_WAIT(__wait); |
| 131 | |
| 132 | wait_condition = (fifo_idle) ? &vmw_fifo_idle : |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 133 | &vmw_seqno_passed; |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 134 | |
| 135 | /** |
| 136 | * Block command submission while waiting for idle. |
| 137 | */ |
| 138 | |
| 139 | if (fifo_idle) |
| 140 | down_read(&fifo_state->rwsem); |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 141 | signal_seq = atomic_read(&dev_priv->marker_seq); |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 142 | ret = 0; |
| 143 | |
| 144 | for (;;) { |
| 145 | prepare_to_wait(&dev_priv->fence_queue, &__wait, |
| 146 | (interruptible) ? |
| 147 | TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 148 | if (wait_condition(dev_priv, seqno)) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 149 | break; |
| 150 | if (time_after_eq(jiffies, end_jiffies)) { |
| 151 | DRM_ERROR("SVGA device lockup.\n"); |
| 152 | break; |
| 153 | } |
| 154 | if (lazy) |
| 155 | schedule_timeout(1); |
| 156 | else if ((++count & 0x0F) == 0) { |
| 157 | /** |
| 158 | * FIXME: Use schedule_hr_timeout here for |
| 159 | * newer kernels and lower CPU utilization. |
| 160 | */ |
| 161 | |
| 162 | __set_current_state(TASK_RUNNING); |
| 163 | schedule(); |
| 164 | __set_current_state((interruptible) ? |
| 165 | TASK_INTERRUPTIBLE : |
| 166 | TASK_UNINTERRUPTIBLE); |
| 167 | } |
| 168 | if (interruptible && signal_pending(current)) { |
Thomas Hellstrom | 3d3a5b3 | 2009-12-08 12:59:34 +0100 | [diff] [blame] | 169 | ret = -ERESTARTSYS; |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 170 | break; |
| 171 | } |
| 172 | } |
| 173 | finish_wait(&dev_priv->fence_queue, &__wait); |
| 174 | if (ret == 0 && fifo_idle) { |
| 175 | __le32 __iomem *fifo_mem = dev_priv->mmio_virt; |
| 176 | iowrite32(signal_seq, fifo_mem + SVGA_FIFO_FENCE); |
| 177 | } |
| 178 | wake_up_all(&dev_priv->fence_queue); |
| 179 | if (fifo_idle) |
| 180 | up_read(&fifo_state->rwsem); |
| 181 | |
| 182 | return ret; |
| 183 | } |
| 184 | |
Thomas Hellstrom | ae2a104 | 2011-09-01 20:18:44 +0000 | [diff] [blame] | 185 | void vmw_seqno_waiter_add(struct vmw_private *dev_priv) |
Thomas Hellstrom | 4f73a96 | 2011-09-01 20:18:43 +0000 | [diff] [blame] | 186 | { |
| 187 | mutex_lock(&dev_priv->hw_mutex); |
| 188 | if (dev_priv->fence_queue_waiters++ == 0) { |
| 189 | unsigned long irq_flags; |
| 190 | |
| 191 | spin_lock_irqsave(&dev_priv->irq_lock, irq_flags); |
| 192 | outl(SVGA_IRQFLAG_ANY_FENCE, |
| 193 | dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 194 | dev_priv->irq_mask |= SVGA_IRQFLAG_ANY_FENCE; |
| 195 | vmw_write(dev_priv, SVGA_REG_IRQMASK, dev_priv->irq_mask); |
Thomas Hellstrom | 4f73a96 | 2011-09-01 20:18:43 +0000 | [diff] [blame] | 196 | spin_unlock_irqrestore(&dev_priv->irq_lock, irq_flags); |
| 197 | } |
| 198 | mutex_unlock(&dev_priv->hw_mutex); |
| 199 | } |
| 200 | |
Thomas Hellstrom | ae2a104 | 2011-09-01 20:18:44 +0000 | [diff] [blame] | 201 | void vmw_seqno_waiter_remove(struct vmw_private *dev_priv) |
Thomas Hellstrom | 4f73a96 | 2011-09-01 20:18:43 +0000 | [diff] [blame] | 202 | { |
| 203 | mutex_lock(&dev_priv->hw_mutex); |
| 204 | if (--dev_priv->fence_queue_waiters == 0) { |
| 205 | unsigned long irq_flags; |
| 206 | |
| 207 | spin_lock_irqsave(&dev_priv->irq_lock, irq_flags); |
Thomas Hellstrom | 57c5ee7 | 2011-10-10 12:23:26 +0200 | [diff] [blame] | 208 | dev_priv->irq_mask &= ~SVGA_IRQFLAG_ANY_FENCE; |
| 209 | vmw_write(dev_priv, SVGA_REG_IRQMASK, dev_priv->irq_mask); |
| 210 | spin_unlock_irqrestore(&dev_priv->irq_lock, irq_flags); |
| 211 | } |
| 212 | mutex_unlock(&dev_priv->hw_mutex); |
| 213 | } |
| 214 | |
| 215 | |
| 216 | void vmw_goal_waiter_add(struct vmw_private *dev_priv) |
| 217 | { |
| 218 | mutex_lock(&dev_priv->hw_mutex); |
| 219 | if (dev_priv->goal_queue_waiters++ == 0) { |
| 220 | unsigned long irq_flags; |
| 221 | |
| 222 | spin_lock_irqsave(&dev_priv->irq_lock, irq_flags); |
| 223 | outl(SVGA_IRQFLAG_FENCE_GOAL, |
| 224 | dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
| 225 | dev_priv->irq_mask |= SVGA_IRQFLAG_FENCE_GOAL; |
| 226 | vmw_write(dev_priv, SVGA_REG_IRQMASK, dev_priv->irq_mask); |
| 227 | spin_unlock_irqrestore(&dev_priv->irq_lock, irq_flags); |
| 228 | } |
| 229 | mutex_unlock(&dev_priv->hw_mutex); |
| 230 | } |
| 231 | |
| 232 | void vmw_goal_waiter_remove(struct vmw_private *dev_priv) |
| 233 | { |
| 234 | mutex_lock(&dev_priv->hw_mutex); |
| 235 | if (--dev_priv->goal_queue_waiters == 0) { |
| 236 | unsigned long irq_flags; |
| 237 | |
| 238 | spin_lock_irqsave(&dev_priv->irq_lock, irq_flags); |
| 239 | dev_priv->irq_mask &= ~SVGA_IRQFLAG_FENCE_GOAL; |
| 240 | vmw_write(dev_priv, SVGA_REG_IRQMASK, dev_priv->irq_mask); |
Thomas Hellstrom | 4f73a96 | 2011-09-01 20:18:43 +0000 | [diff] [blame] | 241 | spin_unlock_irqrestore(&dev_priv->irq_lock, irq_flags); |
| 242 | } |
| 243 | mutex_unlock(&dev_priv->hw_mutex); |
| 244 | } |
| 245 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 246 | int vmw_wait_seqno(struct vmw_private *dev_priv, |
| 247 | bool lazy, uint32_t seqno, |
| 248 | bool interruptible, unsigned long timeout) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 249 | { |
| 250 | long ret; |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 251 | struct vmw_fifo_state *fifo = &dev_priv->fifo; |
| 252 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 253 | if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 254 | return 0; |
| 255 | |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 256 | if (likely(vmw_seqno_passed(dev_priv, seqno))) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 257 | return 0; |
| 258 | |
| 259 | vmw_fifo_ping_host(dev_priv, SVGA_SYNC_GENERIC); |
| 260 | |
| 261 | if (!(fifo->capabilities & SVGA_FIFO_CAP_FENCE)) |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 262 | return vmw_fallback_wait(dev_priv, lazy, true, seqno, |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 263 | interruptible, timeout); |
| 264 | |
| 265 | if (!(dev_priv->capabilities & SVGA_CAP_IRQMASK)) |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 266 | return vmw_fallback_wait(dev_priv, lazy, false, seqno, |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 267 | interruptible, timeout); |
| 268 | |
Thomas Hellstrom | 4f73a96 | 2011-09-01 20:18:43 +0000 | [diff] [blame] | 269 | vmw_seqno_waiter_add(dev_priv); |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 270 | |
| 271 | if (interruptible) |
| 272 | ret = wait_event_interruptible_timeout |
| 273 | (dev_priv->fence_queue, |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 274 | vmw_seqno_passed(dev_priv, seqno), |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 275 | timeout); |
| 276 | else |
| 277 | ret = wait_event_timeout |
| 278 | (dev_priv->fence_queue, |
Thomas Hellstrom | 6bcd8d3c | 2011-09-01 20:18:42 +0000 | [diff] [blame] | 279 | vmw_seqno_passed(dev_priv, seqno), |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 280 | timeout); |
| 281 | |
Thomas Hellstrom | 4f73a96 | 2011-09-01 20:18:43 +0000 | [diff] [blame] | 282 | vmw_seqno_waiter_remove(dev_priv); |
| 283 | |
Thomas Hellstrom | 3d3a5b3 | 2009-12-08 12:59:34 +0100 | [diff] [blame] | 284 | if (unlikely(ret == 0)) |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 285 | ret = -EBUSY; |
| 286 | else if (likely(ret > 0)) |
| 287 | ret = 0; |
| 288 | |
Jakob Bornecrantz | fb1d973 | 2009-12-10 00:19:58 +0000 | [diff] [blame] | 289 | return ret; |
| 290 | } |
| 291 | |
| 292 | void vmw_irq_preinstall(struct drm_device *dev) |
| 293 | { |
| 294 | struct vmw_private *dev_priv = vmw_priv(dev); |
| 295 | uint32_t status; |
| 296 | |
| 297 | if (!(dev_priv->capabilities & SVGA_CAP_IRQMASK)) |
| 298 | return; |
| 299 | |
| 300 | spin_lock_init(&dev_priv->irq_lock); |
| 301 | status = inl(dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
| 302 | outl(status, dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
| 303 | } |
| 304 | |
| 305 | int vmw_irq_postinstall(struct drm_device *dev) |
| 306 | { |
| 307 | return 0; |
| 308 | } |
| 309 | |
| 310 | void vmw_irq_uninstall(struct drm_device *dev) |
| 311 | { |
| 312 | struct vmw_private *dev_priv = vmw_priv(dev); |
| 313 | uint32_t status; |
| 314 | |
| 315 | if (!(dev_priv->capabilities & SVGA_CAP_IRQMASK)) |
| 316 | return; |
| 317 | |
| 318 | mutex_lock(&dev_priv->hw_mutex); |
| 319 | vmw_write(dev_priv, SVGA_REG_IRQMASK, 0); |
| 320 | mutex_unlock(&dev_priv->hw_mutex); |
| 321 | |
| 322 | status = inl(dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
| 323 | outl(status, dev_priv->io_start + VMWGFX_IRQSTATUS_PORT); |
| 324 | } |