summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-07-19 11:05:13 -0700
committerIan Romanick <idr@us.ibm.com>2007-07-19 11:05:13 -0700
commit2f53ce4af2f7db911d908ff382738f30be004e8b (patch)
tree6dd10a1e15c6dd1e6157b359d3c75331eff8961b /linux-core
parent5ba94c2ab8be350fee495e5cfe94afb8f663956a (diff)
Move MMIO drm_addmap (and code that depends on it) to xgi_bootstrap.
For reasons that I don't understand, the drm_addmap call would succeed in xgi_driver_load, but writes to the map later would oops. Moving it to xgi_bootstrap fixes this problem.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/xgi_drv.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/linux-core/xgi_drv.c b/linux-core/xgi_drv.c
index 3b9f4cb1..13e79169 100644
--- a/linux-core/xgi_drv.c
+++ b/linux-core/xgi_drv.c
@@ -188,7 +188,38 @@ int xgi_bootstrap(DRM_IOCTL_ARGS)
return 0;
}
+ err = drm_addmap(dev, info->mmio.base, info->mmio.size,
+ _DRM_REGISTERS, _DRM_KERNEL,
+ &info->mmio_map);
+ if (err) {
+ DRM_ERROR("Unable to map MMIO region: %d\n", err);
+ return err;
+ }
+
xgi_enable_mmio(info);
+ //xgi_enable_ge(info);
+
+ info->fb.size = IN3CFB(info->mmio_map, 0x54) * 8 * 1024 * 1024;
+
+ DRM_INFO("fb base: 0x%lx, size: 0x%x (probed)\n",
+ (unsigned long) info->fb.base, info->fb.size);
+
+
+ if ((info->fb.base == 0) || (info->fb.size == 0)) {
+ DRM_ERROR("frame buffer appears to be wrong: 0x%lx 0x%x\n",
+ (unsigned long) info->fb.base, info->fb.size);
+ return DRM_ERR(EINVAL);
+ }
+
+
+ /* Init the resource manager */
+ err = xgi_fb_heap_init(info);
+ if (err) {
+ DRM_ERROR("xgi_fb_heap_init() failed\n");
+ return err;
+ }
+
+
info->pcie.size = bs.gart_size * (1024 * 1024);
@@ -280,36 +311,12 @@ int xgi_driver_load(struct drm_device *dev, unsigned long flags)
}
- err = drm_addmap(dev, info->mmio.base, info->mmio.size,
- _DRM_REGISTERS, _DRM_KERNEL | _DRM_READ_ONLY,
- &info->mmio_map);
- if (err) {
- DRM_ERROR("Unable to map MMIO region: %d\n", err);
- return err;
- }
-
- xgi_enable_mmio(info);
- //xgi_enable_ge(info);
-
info->fb.base = drm_get_resource_start(dev, 0);
info->fb.size = drm_get_resource_len(dev, 0);
DRM_INFO("fb base: 0x%lx, size: 0x%x\n",
(unsigned long) info->fb.base, info->fb.size);
- info->fb.size = IN3CFB(info->mmio_map, 0x54) * 8 * 1024 * 1024;
-
- DRM_INFO("fb base: 0x%lx, size: 0x%x (probed)\n",
- (unsigned long) info->fb.base, info->fb.size);
-
-
- if ((info->fb.base == 0) || (info->fb.size == 0)) {
- DRM_ERROR("frame buffer appears to be wrong: 0x%lx 0x%x\n",
- (unsigned long) info->fb.base, info->fb.size);
- return DRM_ERR(EINVAL);
- }
-
-
xgi_mem_block_cache = kmem_cache_create("xgi_mem_block",
sizeof(struct xgi_mem_block),
@@ -321,13 +328,6 @@ int xgi_driver_load(struct drm_device *dev, unsigned long flags)
}
- /* Init the resource manager */
- err = xgi_fb_heap_init(info);
- if (err) {
- DRM_ERROR("xgi_fb_heap_init() failed\n");
- return err;
- }
-
return 0;
}