summaryrefslogtreecommitdiff
path: root/XFree86-tdfx-disable-dri-on-16Mb-cards-in-hires.patch
blob: aa2203c6d65859cd17c7e512e677cf51b5e2699b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c.tdfx-disable-dri-on-16Mb-cards-in-hires	Mon May 21 17:43:55 2001
+++ xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c	Sun Mar 10 20:50:46 2002
@@ -293,6 +293,22 @@
     return FALSE;
   }
 
+  /* Disable DRI if using a 16Mb card with virtual resolution higher than
+   * 1024x768 because DRI does not have enough memory available for textures
+   * at higher resolutions, and will not operate correctly.
+   */
+  xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] VideoRAM = %d, VirtualXres = %d, VirtualYres= %d,\n",
+             pScrn->videoRam, pScrn->virtualX, pScrn->virtualY);
+
+  if ( (pTDFX->ChipType == PCI_CHIP_VOODOO3) || (pTDFX->ChipType == PCI_CHIP_BANSHEE) ) {
+    if (pScrn->videoRam <= 16384 && ((pScrn->virtualX * pScrn->virtualY) > (1024 * 768)) ) {
+      xf86DrvMsg(pScreen->myNum, X_WARNING,
+        "[dri] To use DRI, with a 16Mb Voodoo 3 or Banshee card, you must\n"
+        "\tinvoke the server using a maximum resolution of 1024x768 or lower.\n");
+      return FALSE;
+    }
+  }
+  
     /* Check that the GLX, DRI, and DRM modules have been loaded by testing
        for canonical symbols in each module. */
     if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) return FALSE;