drm/amdgpu: allocate shared fence slot in VA IOCTL
authorChristian König <christian.koenig@amd.com>
Mon, 11 Jun 2018 13:10:02 +0000 (15:10 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Jun 2018 15:28:10 +0000 (10:28 -0500)
Per VM BOs share the reservation object with the PD and so need to
reserve a shared fence slot for the update.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 5fb156a01774ea5d245348f6e4341dfba5ca76aa..7f27cdb7afe2edb24b45088e8e62b54e751b5a7c 100644 (file)
@@ -612,7 +612,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
                        return -ENOENT;
                abo = gem_to_amdgpu_bo(gobj);
                tv.bo = &abo->tbo;
-               tv.shared = false;
+               tv.shared = !!(abo->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID);
                list_add(&tv.head, &list);
        } else {
                gobj = NULL;