Commit ca19f21e authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/radeon: move IB pool to 1MB offset

Even GPUs can have a null pointer dereference, so move
the IB pool to another offset to catch those.
Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Reviewed-by: default avatarJerome Glisse <jglisse@redhat.com>
parent 96a5844f
...@@ -123,6 +123,7 @@ extern int radeon_lockup_timeout; ...@@ -123,6 +123,7 @@ extern int radeon_lockup_timeout;
#define CAYMAN_RING_TYPE_CP2_INDEX 2 #define CAYMAN_RING_TYPE_CP2_INDEX 2
/* hardcode those limit for now */ /* hardcode those limit for now */
#define RADEON_VA_IB_OFFSET (1 << 20)
#define RADEON_VA_RESERVED_SIZE (8 << 20) #define RADEON_VA_RESERVED_SIZE (8 << 20)
#define RADEON_IB_VM_MAX_SIZE (64 << 10) #define RADEON_IB_VM_MAX_SIZE (64 << 10)
......
...@@ -980,7 +980,7 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) ...@@ -980,7 +980,7 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
/* map the ib pool buffer at 0 in virtual address space, set /* map the ib pool buffer at 0 in virtual address space, set
* read only * read only
*/ */
r = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo, 0, r = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo, RADEON_VA_IB_OFFSET,
RADEON_VM_PAGE_READABLE | RADEON_VM_PAGE_SNOOPED); RADEON_VM_PAGE_READABLE | RADEON_VM_PAGE_SNOOPED);
return r; return r;
} }
......
...@@ -79,10 +79,10 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, ...@@ -79,10 +79,10 @@ int radeon_ib_get(struct radeon_device *rdev, int ring,
ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo); ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo);
ib->vm = vm; ib->vm = vm;
if (vm) { if (vm) {
/* ib pool is bind at 0 in virtual address space, /* ib pool is bound at RADEON_VA_IB_OFFSET in virtual address
* so gpu_addr is the offset inside the pool bo * space and soffset is the offset inside the pool bo
*/ */
ib->gpu_addr = ib->sa_bo->soffset; ib->gpu_addr = ib->sa_bo->soffset + RADEON_VA_IB_OFFSET;
} else { } else {
ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo); ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment