summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonk.liu <monk.liu@amd.com>2015-08-25 16:53:07 +0800
committerMarek Olšák <marek.olsak@amd.com>2016-01-20 02:14:46 +0100
commit50386e09dbdc6fd70d02efd1371d9ad061c8d447 (patch)
treed2b6b445e8412b11f7b78db746b5df762291cd84
parent5198f2b2e658651d9cb81d67998ba7b2c39e12d7 (diff)
downloaddrm-50386e09dbdc6fd70d02efd1371d9ad061c8d447.tar.gz
amdgpu: drop address patching logics
we don't support non-page-aligned cpu pointer anymore Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
-rw-r--r--amdgpu/amdgpu_bo.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index 1a5a4011..2ae1c188 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -537,17 +537,8 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
int r;
struct amdgpu_bo *bo;
struct drm_amdgpu_gem_userptr args;
- uintptr_t cpu0;
- uint32_t ps, off;
- memset(&args, 0, sizeof(args));
- ps = getpagesize();
-
- cpu0 = ROUND_DOWN((uintptr_t)cpu, ps);
- off = (uintptr_t)cpu - cpu0;
- size = ROUND_UP(size + off, ps);
-
- args.addr = cpu0;
+ args.addr = (uintptr_t)cpu;
args.flags = AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_REGISTER;
args.size = size;
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_USERPTR,