aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-05-10 06:17:56 -0400
committerAlex Deucher <alexander.deucher@amd.com>2014-06-02 10:25:03 -0400
commit1c89d27fb9f169003c5a82561ffeb8adb980ebfb (patch)
tree5d5541d1c768e6dd7ce4ce16e33109860fb734b7 /drivers/gpu/drm
parentec3dbbcbd7a6ee165ca7eeafec8dbc733901ab2f (diff)
drm/radeon: add proper support for RADEON_VM_BLOCK_SIZE v2
This patch makes it possible to decide how many address bits are spend on the page directory vs the page tables. v2: remove unintended change 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')
-rw-r--r--drivers/gpu/drm/radeon/cik.c1
-rw-r--r--drivers/gpu/drm/radeon/cikd.h1
-rw-r--r--drivers/gpu/drm/radeon/ni.c1
-rw-r--r--drivers/gpu/drm/radeon/nid.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_vm.c4
-rw-r--r--drivers/gpu/drm/radeon/si.c1
-rw-r--r--drivers/gpu/drm/radeon/sid.h1
7 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index dbb5b2e17c7c..8d0f1774efbc 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -5378,6 +5378,7 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev)
5378 (u32)(rdev->dummy_page.addr >> 12)); 5378 (u32)(rdev->dummy_page.addr >> 12));
5379 WREG32(VM_CONTEXT1_CNTL2, 4); 5379 WREG32(VM_CONTEXT1_CNTL2, 4);
5380 WREG32(VM_CONTEXT1_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(1) | 5380 WREG32(VM_CONTEXT1_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(1) |
5381 PAGE_TABLE_BLOCK_SIZE(RADEON_VM_BLOCK_SIZE - 9) |
5381 RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT | 5382 RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT |
5382 RANGE_PROTECTION_FAULT_ENABLE_DEFAULT | 5383 RANGE_PROTECTION_FAULT_ENABLE_DEFAULT |
5383 DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT | 5384 DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT |
diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h
index 213873270d5f..0b27ea08c299 100644
--- a/drivers/gpu/drm/radeon/cikd.h
+++ b/drivers/gpu/drm/radeon/cikd.h
@@ -482,6 +482,7 @@
482#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) 482#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16)
483#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) 483#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18)
484#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) 484#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19)
485#define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24)
485#define VM_CONTEXT1_CNTL 0x1414 486#define VM_CONTEXT1_CNTL 0x1414
486#define VM_CONTEXT0_CNTL2 0x1430 487#define VM_CONTEXT0_CNTL2 0x1430
487#define VM_CONTEXT1_CNTL2 0x1434 488#define VM_CONTEXT1_CNTL2 0x1434
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 5e8db9bccba1..1d3209ffbbdc 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1268,6 +1268,7 @@ static int cayman_pcie_gart_enable(struct radeon_device *rdev)
1268 (u32)(rdev->dummy_page.addr >> 12)); 1268 (u32)(rdev->dummy_page.addr >> 12));
1269 WREG32(VM_CONTEXT1_CNTL2, 4); 1269 WREG32(VM_CONTEXT1_CNTL2, 4);
1270 WREG32(VM_CONTEXT1_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(1) | 1270 WREG32(VM_CONTEXT1_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(1) |
1271 PAGE_TABLE_BLOCK_SIZE(RADEON_VM_BLOCK_SIZE - 9) |
1271 RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT | 1272 RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT |
1272 RANGE_PROTECTION_FAULT_ENABLE_DEFAULT | 1273 RANGE_PROTECTION_FAULT_ENABLE_DEFAULT |
1273 DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT | 1274 DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT |
diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h
index d996033c243e..2e12e4d69253 100644
--- a/drivers/gpu/drm/radeon/nid.h
+++ b/drivers/gpu/drm/radeon/nid.h
@@ -128,6 +128,7 @@
128#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) 128#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16)
129#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) 129#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18)
130#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) 130#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19)
131#define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24)
131#define VM_CONTEXT1_CNTL 0x1414 132#define VM_CONTEXT1_CNTL 0x1414
132#define VM_CONTEXT0_CNTL2 0x1430 133#define VM_CONTEXT0_CNTL2 0x1430
133#define VM_CONTEXT1_CNTL2 0x1434 134#define VM_CONTEXT1_CNTL2 0x1434
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index f8d5b65932e5..a128a4fd64b3 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -964,6 +964,8 @@ void radeon_vm_bo_invalidate(struct radeon_device *rdev,
964 */ 964 */
965int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) 965int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
966{ 966{
967 const unsigned align = min(RADEON_VM_PTB_ALIGN_SIZE,
968 RADEON_VM_PTE_COUNT * 8);
967 unsigned pd_size, pd_entries, pts_size; 969 unsigned pd_size, pd_entries, pts_size;
968 int r; 970 int r;
969 971
@@ -985,7 +987,7 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
985 return -ENOMEM; 987 return -ENOMEM;
986 } 988 }
987 989
988 r = radeon_bo_create(rdev, pd_size, RADEON_VM_PTB_ALIGN_SIZE, false, 990 r = radeon_bo_create(rdev, pd_size, align, false,
989 RADEON_GEM_DOMAIN_VRAM, NULL, 991 RADEON_GEM_DOMAIN_VRAM, NULL,
990 &vm->page_directory); 992 &vm->page_directory);
991 if (r) 993 if (r)
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 22ecbc07e9a6..9739d71cd0a2 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -4095,6 +4095,7 @@ static int si_pcie_gart_enable(struct radeon_device *rdev)
4095 (u32)(rdev->dummy_page.addr >> 12)); 4095 (u32)(rdev->dummy_page.addr >> 12));
4096 WREG32(VM_CONTEXT1_CNTL2, 4); 4096 WREG32(VM_CONTEXT1_CNTL2, 4);
4097 WREG32(VM_CONTEXT1_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(1) | 4097 WREG32(VM_CONTEXT1_CNTL, ENABLE_CONTEXT | PAGE_TABLE_DEPTH(1) |
4098 PAGE_TABLE_BLOCK_SIZE(RADEON_VM_BLOCK_SIZE - 9) |
4098 RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT | 4099 RANGE_PROTECTION_FAULT_ENABLE_INTERRUPT |
4099 RANGE_PROTECTION_FAULT_ENABLE_DEFAULT | 4100 RANGE_PROTECTION_FAULT_ENABLE_DEFAULT |
4100 DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT | 4101 DUMMY_PAGE_PROTECTION_FAULT_ENABLE_INTERRUPT |
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h
index 683532f84931..da8f8674a552 100644
--- a/drivers/gpu/drm/radeon/sid.h
+++ b/drivers/gpu/drm/radeon/sid.h
@@ -362,6 +362,7 @@
362#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16) 362#define READ_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 16)
363#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18) 363#define WRITE_PROTECTION_FAULT_ENABLE_INTERRUPT (1 << 18)
364#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19) 364#define WRITE_PROTECTION_FAULT_ENABLE_DEFAULT (1 << 19)
365#define PAGE_TABLE_BLOCK_SIZE(x) (((x) & 0xF) << 24)
365#define VM_CONTEXT1_CNTL 0x1414 366#define VM_CONTEXT1_CNTL 0x1414
366#define VM_CONTEXT0_CNTL2 0x1430 367#define VM_CONTEXT0_CNTL2 0x1430
367#define VM_CONTEXT1_CNTL2 0x1434 368#define VM_CONTEXT1_CNTL2 0x1434