diff options
author | Wang Zhenyu <zhenyu.z.wang@intel.com> | 2007-02-13 16:18:15 +0800 |
---|---|---|
committer | Wang Zhenyu <zhenyu.z.wang@intel.com> | 2007-02-13 16:18:15 +0800 |
commit | 2a2d72623306de01e620485169721c790167d2b1 (patch) | |
tree | 44da708c7f0a6cc39d73bd81d3106c692f734e22 /linux-core/drm_drv.c | |
parent | 3234b290585235e3ce7db99dfeb1714ccc1f6697 (diff) | |
parent | 5bd13c5e15a14d34356f2363c55b1d4c7ca3269a (diff) |
Merge branch 'master' into crestline
Diffstat (limited to 'linux-core/drm_drv.c')
-rw-r--r-- | linux-core/drm_drv.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 45f563ff..ff9b29e7 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -148,10 +148,11 @@ int drm_lastclose(drm_device_t * dev) DRM_DEBUG("\n"); - if (drm_bo_driver_finish(dev)) { - DRM_ERROR("DRM memory manager still busy. " - "System is unstable. Please reboot.\n"); - } + /* + * We can't do much about this function failing. + */ + + drm_bo_driver_finish(dev); if (dev->driver->lastclose) dev->driver->lastclose(dev); @@ -450,9 +451,28 @@ static int __init drm_core_init(void) { int ret; struct sysinfo si; - + unsigned long avail_memctl_mem; + unsigned long max_memctl_mem; + si_meminfo(&si); - drm_init_memctl(si.totalram/2, si.totalram*3/4); + + /* + * AGP only allows low / DMA32 memory ATM. + */ + + avail_memctl_mem = si.totalram - si.totalhigh; + + /* + * Avoid overflows + */ + + max_memctl_mem = 1UL << (32 - PAGE_SHIFT); + max_memctl_mem = (max_memctl_mem / si.mem_unit) * PAGE_SIZE; + + if (avail_memctl_mem >= max_memctl_mem) + avail_memctl_mem = max_memctl_mem; + + drm_init_memctl(avail_memctl_mem/2, avail_memctl_mem*3/4, si.mem_unit); ret = -ENOMEM; drm_cards_limit = |