aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_gem.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-06-06 21:12:39 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-06-23 01:59:49 -0400
commita3fcd0a975c4ae272c3e5db0632479633cef19ef (patch)
tree44b76992b46e9aef573f1bd150fd1747d2774716 /drivers/gpu/drm/nouveau/nouveau_gem.c
parent180cc30637b47dafa26e3202a41964b5ebdab365 (diff)
drm/nv50-nvc0: completely disable relocs
GPU virtual addresses are constant now so this should never be getting hit anyway and userspace shouldn't break from them being ignored. This is being done in preference to teaching the code how to deal with BOs that exist at different virtual addresses within separate VMs. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_gem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index d314f34f39d6..2d1de2427bc3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -333,6 +333,7 @@ static int
333validate_list(struct nouveau_channel *chan, struct list_head *list, 333validate_list(struct nouveau_channel *chan, struct list_head *list,
334 struct drm_nouveau_gem_pushbuf_bo *pbbo, uint64_t user_pbbo_ptr) 334 struct drm_nouveau_gem_pushbuf_bo *pbbo, uint64_t user_pbbo_ptr)
335{ 335{
336 struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
336 struct drm_nouveau_gem_pushbuf_bo __user *upbbo = 337 struct drm_nouveau_gem_pushbuf_bo __user *upbbo =
337 (void __force __user *)(uintptr_t)user_pbbo_ptr; 338 (void __force __user *)(uintptr_t)user_pbbo_ptr;
338 struct drm_device *dev = chan->dev; 339 struct drm_device *dev = chan->dev;
@@ -371,24 +372,26 @@ validate_list(struct nouveau_channel *chan, struct list_head *list,
371 return ret; 372 return ret;
372 } 373 }
373 374
374 if (nvbo->bo.offset == b->presumed.offset && 375 if (dev_priv->card_type < NV_50) {
375 ((nvbo->bo.mem.mem_type == TTM_PL_VRAM && 376 if (nvbo->bo.offset == b->presumed.offset &&
376 b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) || 377 ((nvbo->bo.mem.mem_type == TTM_PL_VRAM &&
377 (nvbo->bo.mem.mem_type == TTM_PL_TT && 378 b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) ||
378 b->presumed.domain & NOUVEAU_GEM_DOMAIN_GART))) 379 (nvbo->bo.mem.mem_type == TTM_PL_TT &&
379 continue; 380 b->presumed.domain & NOUVEAU_GEM_DOMAIN_GART)))
381 continue;
380 382
381 if (nvbo->bo.mem.mem_type == TTM_PL_TT) 383 if (nvbo->bo.mem.mem_type == TTM_PL_TT)
382 b->presumed.domain = NOUVEAU_GEM_DOMAIN_GART; 384 b->presumed.domain = NOUVEAU_GEM_DOMAIN_GART;
383 else 385 else
384 b->presumed.domain = NOUVEAU_GEM_DOMAIN_VRAM; 386 b->presumed.domain = NOUVEAU_GEM_DOMAIN_VRAM;
385 b->presumed.offset = nvbo->bo.offset; 387 b->presumed.offset = nvbo->bo.offset;
386 b->presumed.valid = 0; 388 b->presumed.valid = 0;
387 relocs++; 389 relocs++;
388 390
389 if (DRM_COPY_TO_USER(&upbbo[nvbo->pbbo_index].presumed, 391 if (DRM_COPY_TO_USER(&upbbo[nvbo->pbbo_index].presumed,
390 &b->presumed, sizeof(b->presumed))) 392 &b->presumed, sizeof(b->presumed)))
391 return -EFAULT; 393 return -EFAULT;
394 }
392 } 395 }
393 396
394 return relocs; 397 return relocs;