29 #include <linux/slab.h>
41 switch (rdev->
mc.gtt_size/(1024*1024)) {
51 DRM_ERROR(
"Unable to use IGP GART size %uM\n",
52 (
unsigned)(rdev->
mc.gtt_size >> 20));
53 DRM_ERROR(
"Valid GART size for IGP are 32M,64M,128M,256M,512M,1G,2G\n");
54 DRM_ERROR(
"Forcing to 32M GART size\n");
55 rdev->
mc.gtt_size = 32 * 1024 * 1024;
72 }
while (timeout > 0);
81 WARN(1,
"RS400 GART already initialized\n");
85 switch(rdev->
mc.gtt_size / (1024 * 1024)) {
101 if (rs400_debugfs_pcie_gart_info_init(rdev))
102 DRM_ERROR(
"Failed to register debugfs file for RS400 GART !\n");
103 rdev->
gart.table_size = rdev->
gart.num_gpu_pages * 4;
117 switch(rdev->
mc.gtt_size / (1024 * 1024)) {
150 tmp =
REG_SET(RS690_MC_AGP_TOP, rdev->
mc.gtt_end >> 16);
151 tmp |=
REG_SET(RS690_MC_AGP_START, rdev->
mc.gtt_start >> 16);
162 tmp = (
u32)rdev->
gart.table_addr & 0xfffff000;
185 DRM_INFO(
"PCIE GART of %uM enabled (table at 0x%016llX).\n",
186 (
unsigned)(rdev->
mc.gtt_size >> 20),
187 (
unsigned long long)rdev->
gart.table_addr);
188 rdev->
gart.ready =
true;
209 #define RS400_PTE_WRITEABLE (1 << 2)
210 #define RS400_PTE_READABLE (1 << 3)
217 if (i < 0 || i > rdev->
gart.num_gpu_pages) {
262 rdev->
mc.vram_is_ddr =
true;
263 rdev->
mc.vram_width = 128;
267 rdev->
mc.gtt_base_align = rdev->
mc.gtt_size - 1;
289 #if defined(CONFIG_DEBUG_FS)
290 static int rs400_debugfs_gart_info(
struct seq_file *
m,
void *
data)
292 struct drm_info_node *
node = (
struct drm_info_node *) m->
private;
359 static struct drm_info_list rs400_gart_info_list[] = {
360 {
"rs400_gart_info", rs400_debugfs_gart_info, 0,
NULL},
364 static int rs400_debugfs_pcie_gart_info_init(
struct radeon_device *rdev)
366 #if defined(CONFIG_DEBUG_FS)
382 dev_warn(rdev->
dev,
"rs400: Wait MC idle timeout before updating MC.\n");
396 rs400_mc_program(rdev);
400 rs400_gpu_init(rdev);
415 dev_err(rdev->
dev,
"failed initializing CP fences (%d).\n", r);
425 dev_err(rdev->
dev,
"failed initializing CP (%d).\n", r);
431 dev_err(rdev->
dev,
"IB initialization failed (%d).\n", r);
447 rs400_mc_program(rdev);
450 dev_warn(rdev->
dev,
"GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n",
462 r = rs400_startup(rdev);
512 dev_err(rdev->
dev,
"Expecting combios for RS400/RS480 GPU\n");
522 "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n",
551 r = rs400_startup(rdev);
554 dev_err(rdev->
dev,
"Disabling GPU acceleration\n");