diff options
| author | Christian König <[email protected]> | 2016-02-08 10:08:35 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2016-02-10 19:17:16 +0000 |
| commit | cc325d1913475655b81c0417ba04c84f168ac78c (patch) | |
| tree | 6dcc586983e753988a4b2713678f78bbb49ded6e /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | drm/radeon: Avoid double gpu reset by adding a timeout on IB ring tests. (diff) | |
| download | kernel-cc325d1913475655b81c0417ba04c84f168ac78c.tar.gz kernel-cc325d1913475655b81c0417ba04c84f168ac78c.zip | |
drm/amdgpu: check userptrs mm earlier
Instead of when we try to bind it check the usermm when
we try to use it in the IOCTLs.
Signed-off-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 84e850f81f39..b1a611e79c94 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -310,7 +310,7 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp, return -ENOENT; } robj = gem_to_amdgpu_bo(gobj); - if (amdgpu_ttm_tt_has_userptr(robj->tbo.ttm) || + if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm) || (robj->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) { drm_gem_object_unreference_unlocked(gobj); return -EPERM; @@ -638,7 +638,7 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data, break; } case AMDGPU_GEM_OP_SET_PLACEMENT: - if (amdgpu_ttm_tt_has_userptr(robj->tbo.ttm)) { + if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm)) { r = -EPERM; amdgpu_bo_unreserve(robj); break; |
