]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - xorg-x11-drv-nv/patches/nv-reserve-fbarea.patch
Move all packages to root.
[people/arne_f/ipfire-3.x.git] / xorg-x11-drv-nv / patches / nv-reserve-fbarea.patch
CommitLineData
147366a6
SS
1diff --git a/src/nv_driver.c b/src/nv_driver.c
2index 4bcc391..6252dd2 100644
3--- a/src/nv_driver.c
4+++ b/src/nv_driver.c
5@@ -32,6 +32,8 @@
6 #include "xf86int10.h"
7 #include "vbeModes.h"
8
9+#define NV_ALIGN(x,bytes) (((x) + ((bytes) - 1)) & ~((bytes) - 1))
10+
11 const OptionInfoRec * RivaAvailableOptions(int chipid, int busid);
12 Bool RivaGetScrnInfoRec(PciChipsets *chips, int chip);
13 Bool G80GetScrnInfoRec(PciChipsets *chips, int chip);
14@@ -2266,7 +2268,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
15 unsigned char *FBStart;
16 int width, height, displayWidth, offscreenHeight, shadowHeight;
17 BoxRec AvailFBArea;
18-
19+ FBAreaPtr fbarea;
20 /*
21 * First get the ScrnInfoRec
22 */
23@@ -2421,7 +2423,31 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
24 AvailFBArea.y1 = 0;
25 AvailFBArea.x2 = pScrn->displayWidth;
26 AvailFBArea.y2 = offscreenHeight;
27- xf86InitFBManager(pScreen, &AvailFBArea);
28+
29+
30+ if (!xf86InitFBManager(pScreen, &AvailFBArea)) {
31+ xf86DrvMsg(scrnIndex, X_ERROR,
32+ "Memory manager initialized to (%d,%d) (%d,%d) failed\n",
33+ AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2);
34+ return FALSE;
35+ }
36+
37+ xf86DrvMsg(scrnIndex, X_INFO,
38+ "Memory manager initialized to (%d,%d) (%d,%d)\n",
39+ AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2);
40+
41+ if ((fbarea = xf86AllocateOffscreenArea(pScreen,
42+ pScrn->displayWidth,
43+ NV_ALIGN(pScrn->virtualY, 64) -
44+ pScrn->virtualY + 2,
45+ 0, NULL, NULL, NULL))) {
46+ xf86DrvMsg(scrnIndex, X_INFO,
47+ "Reserved area from (%d,%d) to (%d,%d)\n",
48+ fbarea->box.x1, fbarea->box.y1,
49+ fbarea->box.x2, fbarea->box.y2);
50+ } else {
51+ xf86DrvMsg(scrnIndex, X_ERROR, "Unable to reserve area\n");
52+ }
53
54 if (!pNv->NoAccel)
55 NVAccelInit(pScreen);