Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+19 -16
+19 -16
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 333 333 validate_list(struct nouveau_channel *chan, struct list_head *list, 334 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 337 struct drm_nouveau_gem_pushbuf_bo __user *upbbo = 337 338 (void __force __user *)(uintptr_t)user_pbbo_ptr; 338 339 struct drm_device *dev = chan->dev; ··· 372 371 return ret; 373 372 } 374 373 375 - if (nvbo->bo.offset == b->presumed.offset && 376 - ((nvbo->bo.mem.mem_type == TTM_PL_VRAM && 377 - b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) || 378 - (nvbo->bo.mem.mem_type == TTM_PL_TT && 379 - b->presumed.domain & NOUVEAU_GEM_DOMAIN_GART))) 380 - continue; 374 + if (dev_priv->card_type < NV_50) { 375 + if (nvbo->bo.offset == b->presumed.offset && 376 + ((nvbo->bo.mem.mem_type == TTM_PL_VRAM && 377 + b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) || 378 + (nvbo->bo.mem.mem_type == TTM_PL_TT && 379 + b->presumed.domain & NOUVEAU_GEM_DOMAIN_GART))) 380 + continue; 381 381 382 - if (nvbo->bo.mem.mem_type == TTM_PL_TT) 383 - b->presumed.domain = NOUVEAU_GEM_DOMAIN_GART; 384 - else 385 - b->presumed.domain = NOUVEAU_GEM_DOMAIN_VRAM; 386 - b->presumed.offset = nvbo->bo.offset; 387 - b->presumed.valid = 0; 388 - relocs++; 382 + if (nvbo->bo.mem.mem_type == TTM_PL_TT) 383 + b->presumed.domain = NOUVEAU_GEM_DOMAIN_GART; 384 + else 385 + b->presumed.domain = NOUVEAU_GEM_DOMAIN_VRAM; 386 + b->presumed.offset = nvbo->bo.offset; 387 + b->presumed.valid = 0; 388 + relocs++; 389 389 390 - if (DRM_COPY_TO_USER(&upbbo[nvbo->pbbo_index].presumed, 391 - &b->presumed, sizeof(b->presumed))) 392 - return -EFAULT; 390 + if (DRM_COPY_TO_USER(&upbbo[nvbo->pbbo_index].presumed, 391 + &b->presumed, sizeof(b->presumed))) 392 + return -EFAULT; 393 + } 393 394 } 394 395 395 396 return relocs;