1 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h.orig 2004-06-22 16:28:46.000000000 +0200
2 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h 2004-11-25 14:00:55.000000000 +0100
4 #define I810_MAX_SUBPICTURES 2
5 #define I810_TOTAL_SURFACES 9
7 +/* tony: i810 Framebuffer Driver - IOCTL's */
8 +#define I810FB_IOC_AREYOUTHERE 0x46FF
9 +#define I810FB_IOC_RELEASEGART 0x46FA
10 +#define I810FB_IOC_CLAIMGART 0x46F9
14 typedef struct _I810Rec *I810Ptr;
22 unsigned int bufferOffset; /* for I810SelectBuffer */
27 XAAInfoRecPtr AccelInfoRec;
29 xf86CursorInfoPtr CursorInfoRec;
30 CloseScreenProcPtr CloseScreen;
31 ScreenBlockHandlerProcPtr BlockHandler;
32 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c.orig 2004-07-30 22:30:52.000000000 +0200
33 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c 2004-11-25 14:01:22.000000000 +0100
35 pI810->AccelInfoRec = infoPtr = XAACreateInfoRec();
38 + pI810->AccelValid = 1;
40 pI810->bufferOffset = 0;
41 infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS;
46 + if (!pI810->AccelValid)
49 /* If your system hasn't moved the head pointer in 2 seconds, I'm going to
52 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c.orig 2004-08-25 02:30:41.000000000 +0200
53 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 2004-11-25 14:03:53.000000000 +0100
55 rgb defaultWeight = { 0, 0, 0 };
60 if (pScrn->numEntities != 1)
64 pI810 = I810PTR(pScrn);
66 + /* tony: try to open fb, then query if fb can release GART,
67 + finally, ask fb to release GART */
68 + pI810->FbGartClaimed = 0;
71 + sprintf(filename, "/dev/fb%d", i);
72 + if (-1 != (pI810->FbDescriptor = open(filename, O_RDONLY, 0))) {
73 + if (!ioctl(pI810->FbDescriptor, I810FB_IOC_AREYOUTHERE, 0))
76 + close(pI810->FbDescriptor);
77 + pI810->FbDescriptor = 0;
81 + pI810->FbDescriptor = 0;
85 + if (pI810->FbDescriptor && !pI810->FbGartClaimed) {
86 + if (ioctl(pI810->FbDescriptor, I810FB_IOC_CLAIMGART, 0)) {
87 + close(pI810->FbDescriptor);
88 + pI810->FbDescriptor = 0;
91 + pI810->FbGartClaimed = 1;
96 pI810->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
97 if (pI810->pEnt->location.type != BUS_PCI)
99 @@ -2379,13 +2410,18 @@
101 ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
104 I810Ptr pI810 = I810PTR(pScrn);
107 if (I810_DEBUG & DEBUG_VERBOSE_DRI)
108 ErrorF("\n\nENTER VT\n");
110 + /* tony: claim GART from fb */
111 + if (pI810->FbDescriptor && !pI810->FbGartClaimed) {
112 + if (ioctl(pI810->FbDescriptor, I810FB_IOC_CLAIMGART, 0))
114 + pI810->FbGartClaimed = 1;
117 if (!I810BindGARTMemory(pScrn)) {
120 @@ -2404,6 +2440,10 @@
121 if (!I810ModeInit(pScrn, pScrn->currentMode))
123 I810AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
125 + if (pI810->AccelInfoRec != NULL)
126 + pI810->AccelValid = 1;
131 @@ -2430,6 +2470,7 @@
132 I810RefreshRing(pScrn);
134 pI810->AccelInfoRec->NeedToSync = FALSE;
135 + pI810->AccelValid = 0;
139 @@ -2440,6 +2481,13 @@
143 + /* tony: give back GART to fb */
144 + if (pI810->FbDescriptor && pI810->FbGartClaimed) {
145 + if (ioctl(pI810->FbDescriptor, I810FB_IOC_RELEASEGART, 0))
147 + pI810->FbGartClaimed = 0;
153 @@ -2509,6 +2557,17 @@
155 pScrn->vtSema = FALSE;
156 pScreen->CloseScreen = pI810->CloseScreen;
158 + /* tony: give back GART to fb, close the fb device */
159 + if (pI810->FbDescriptor && pI810->FbGartClaimed) {
160 + if (ioctl(pI810->FbDescriptor, I810FB_IOC_RELEASEGART, 0))
162 + pI810->FbGartClaimed = 0;
164 + if (pI810->FbDescriptor) {
165 + close(pI810->FbDescriptor);
166 + pI810->FbDescriptor = 0;
168 return (*pScreen->CloseScreen) (scrnIndex, pScreen);