From: Matthias Hopf <[email protected]>

---
 src/radeon_driver.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 867e836..6b084b8 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3262,6 +3262,21 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
     if (!RADEONPreInitControllers(pScrn))
        goto fail;
 
+    /* Unless we're able to shrink/enlarge FB on the fly (GEM etc.), allocate
+     * large enough (TM) virtual size */
+    if (!pScrn->display->virtualX || !pScrn->display->virtualY) {
+       /* Have at least enough space for double buffering and z Buffer + some 
textures */
+       if (2 * 1920*1920 * (pScrn->bitsPerPixel/8) <= pScrn->videoRam / 4 * 
1024) {
+           /* Fits on 128MB and up */
+           pScrn->display->virtualX = 2 * 1920;
+           pScrn->display->virtualY = 1920;
+       } else if (2 * 1680*1280 * (pScrn->bitsPerPixel/8) <= pScrn->videoRam / 
4 * 1024) {
+           /* Fits on 64MB and up */
+           pScrn->display->virtualX = 2 * 1680;
+           pScrn->display->virtualY = 1280;
+       }
+    }
+
     if (!xf86InitialConfiguration (pScrn, FALSE))
    {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
-- 
1.7.7

_______________________________________________
xorg-driver-ati mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-driver-ati

Reply via email to