aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;