summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cace71b)
raw | patch | inline | side by side (parent: cace71b)
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | |
Mon, 25 Apr 2011 20:01:46 +0000 (20:01 +0000) | ||
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | |
Mon, 25 Apr 2011 20:01:46 +0000 (20:01 +0000) |
The current code might result in trying to remap 512MB video ram on
a 32 bit system which is quite likely to fail.
This patch tries to map less of it down to 8MB as this should still
be enough to get a reasonably well working framebuffer. This should
make viafb work for many people without requiring them to manually
allocate more space.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
a 32 bit system which is quite likely to fail.
This patch tries to map less of it down to 8MB as this should still
be enough to get a reasonably well working framebuffer. This should
make viafb work for many people without requiring them to manually
allocate more space.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/via/via-core.c | patch | blob | history |
index 5b0129b42d8a25edeae5e3cb54c6cf3cdac08ef2..eb112b62173565984c28e68b400b40f798b1877e 100644 (file)
ret = vdev->fbmem_len = viafb_get_fb_size_from_pci(vdev->chip_type);
if (ret < 0)
goto out_unmap;
- vdev->fbmem = ioremap_wc(vdev->fbmem_start, vdev->fbmem_len);
+
+ /* try to map less memory on failure, 8 MB should be still enough */
+ for (; vdev->fbmem_len >= 8 << 20; vdev->fbmem_len /= 2) {
+ vdev->fbmem = ioremap_wc(vdev->fbmem_start, vdev->fbmem_len);
+ if (vdev->fbmem)
+ break;
+ }
+
if (vdev->fbmem == NULL) {
ret = -ENOMEM;
goto out_unmap;