diff options
| -rw-r--r-- | drivers/gpu/drm/nouveau/nv50_instmem.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nv50_vm.c | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index ea0041810ae3..e57caa2a00e3 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
| @@ -403,16 +403,24 @@ nv50_instmem_unmap(struct nouveau_gpuobj *gpuobj) | |||
| 403 | void | 403 | void |
| 404 | nv50_instmem_flush(struct drm_device *dev) | 404 | nv50_instmem_flush(struct drm_device *dev) |
| 405 | { | 405 | { |
| 406 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 407 | |||
| 408 | spin_lock(&dev_priv->ramin_lock); | ||
| 406 | nv_wr32(dev, 0x00330c, 0x00000001); | 409 | nv_wr32(dev, 0x00330c, 0x00000001); |
| 407 | if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) | 410 | if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) |
| 408 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 411 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
| 412 | spin_unlock(&dev_priv->ramin_lock); | ||
| 409 | } | 413 | } |
| 410 | 414 | ||
| 411 | void | 415 | void |
| 412 | nv84_instmem_flush(struct drm_device *dev) | 416 | nv84_instmem_flush(struct drm_device *dev) |
| 413 | { | 417 | { |
| 418 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 419 | |||
| 420 | spin_lock(&dev_priv->ramin_lock); | ||
| 414 | nv_wr32(dev, 0x070000, 0x00000001); | 421 | nv_wr32(dev, 0x070000, 0x00000001); |
| 415 | if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) | 422 | if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) |
| 416 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 423 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
| 424 | spin_unlock(&dev_priv->ramin_lock); | ||
| 417 | } | 425 | } |
| 418 | 426 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c index 459ff08241e5..6144156f255a 100644 --- a/drivers/gpu/drm/nouveau/nv50_vm.c +++ b/drivers/gpu/drm/nouveau/nv50_vm.c | |||
| @@ -169,7 +169,11 @@ nv50_vm_flush(struct nouveau_vm *vm) | |||
| 169 | void | 169 | void |
| 170 | nv50_vm_flush_engine(struct drm_device *dev, int engine) | 170 | nv50_vm_flush_engine(struct drm_device *dev, int engine) |
| 171 | { | 171 | { |
| 172 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 173 | |||
| 174 | spin_lock(&dev_priv->ramin_lock); | ||
| 172 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); | 175 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); |
| 173 | if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) | 176 | if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) |
| 174 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); | 177 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); |
| 178 | spin_unlock(&dev_priv->ramin_lock); | ||
| 175 | } | 179 | } |
