aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-06-05 23:56:50 -0400
committerAlex Deucher <alexander.deucher@amd.com>2014-06-09 22:06:54 -0400
commit4510fb985d3c3c5dae4d66af0fbbf95cc0662f35 (patch)
tree6bd9b76c16c5879d79125ef402a7b2507f12f0b0 /drivers/gpu/drm/radeon/radeon_device.c
parentc1c4413258e46aef9c27696052a5b7110bdf2941 (diff)
downloadlinux-stericsson-4510fb985d3c3c5dae4d66af0fbbf95cc0662f35.tar.gz
drm/radeon: make vm_block_size a module parameter
Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 3f1e3060377c..03686fab842d 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1073,6 +1073,22 @@ static void radeon_check_arguments(struct radeon_device *rdev)
radeon_vm_size);
radeon_vm_size = 4096;
}
+
+ /* defines number of bits in page table versus page directory,
+ * a page is 4KB so we have 12 bits offset, minimum 9 bits in the
+ * page table and the remaining bits are in the page directory */
+ if (radeon_vm_block_size < 9) {
+ dev_warn(rdev->dev, "VM page table size (%d) to small\n",
+ radeon_vm_block_size);
+ radeon_vm_block_size = 9;
+ }
+
+ if (radeon_vm_block_size > 24 ||
+ radeon_vm_size < (1ull << radeon_vm_block_size)) {
+ dev_warn(rdev->dev, "VM page table size (%d) to large\n",
+ radeon_vm_block_size);
+ radeon_vm_block_size = 9;
+ }
}
/**