aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-09-11 10:09:59 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-09-20 13:10:42 -0400
commitca19f21ece0ad96c77f45a01c43f3bb582f1a35c (patch)
tree0b0f5da266221d6a06b87c5affb8ed471b474aff /drivers
parent96a5844f90a6d3b1c0cabfe4870e62e7b1cc4640 (diff)
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: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c6
3 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index d48bd3045db6..55f17f9bc095 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -123,6 +123,7 @@ extern int radeon_lockup_timeout;
123#define CAYMAN_RING_TYPE_CP2_INDEX 2 123#define CAYMAN_RING_TYPE_CP2_INDEX 2
124 124
125/* hardcode those limit for now */ 125/* hardcode those limit for now */
126#define RADEON_VA_IB_OFFSET (1 << 20)
126#define RADEON_VA_RESERVED_SIZE (8 << 20) 127#define RADEON_VA_RESERVED_SIZE (8 << 20)
127#define RADEON_IB_VM_MAX_SIZE (64 << 10) 128#define RADEON_IB_VM_MAX_SIZE (64 << 10)
128 129
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index 5694421b7c67..1b1c001e269a 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -980,7 +980,7 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
980 /* map the ib pool buffer at 0 in virtual address space, set 980 /* map the ib pool buffer at 0 in virtual address space, set
981 * read only 981 * read only
982 */ 982 */
983 r = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo, 0, 983 r = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo, RADEON_VA_IB_OFFSET,
984 RADEON_VM_PAGE_READABLE | RADEON_VM_PAGE_SNOOPED); 984 RADEON_VM_PAGE_READABLE | RADEON_VM_PAGE_SNOOPED);
985 return r; 985 return r;
986} 986}
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 993cf712074f..d90b0bc6f072 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -79,10 +79,10 @@ int radeon_ib_get(struct radeon_device *rdev, int ring,
79 ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo); 79 ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo);
80 ib->vm = vm; 80 ib->vm = vm;
81 if (vm) { 81 if (vm) {
82 /* ib pool is bind at 0 in virtual address space, 82 /* ib pool is bound at RADEON_VA_IB_OFFSET in virtual address
83 * so gpu_addr is the offset inside the pool bo 83 * space and soffset is the offset inside the pool bo
84 */ 84 */
85 ib->gpu_addr = ib->sa_bo->soffset; 85 ib->gpu_addr = ib->sa_bo->soffset + RADEON_VA_IB_OFFSET;
86 } else { 86 } else {
87 ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo); 87 ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo);
88 } 88 }