drm/nouveau/nouveau/hmm: fix migrate zero page to GPU
authorRalph Campbell <rcampbell@nvidia.com>
Wed, 20 May 2020 18:36:52 +0000 (11:36 -0700)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 22 May 2020 01:13:52 +0000 (11:13 +1000)
commit9d4296a7d4b329016e6b5b59a7fb3f8afa36ac05
tree034bc4d8011a378a2fef851939b74d4ae10352f6
parent1d7f940c3a16623adb25706b10d81f8b822d53f9
drm/nouveau/nouveau/hmm: fix migrate zero page to GPU

When calling OpenCL clEnqueueSVMMigrateMem() on a region of memory that
is backed by pte_none() or zero pages, migrate_vma_setup() will fill the
source PFN array with an entry indicating the source page is zero.
Use this to optimize migration to device private memory by allocating
GPU memory and zero filling it instead of failing to migrate the page.

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_dmem.c