| @@ -60,26 +60,28 @@ | | | @@ -60,26 +60,28 @@ |
60 | | | 60 | |
61 | /* for visuals */ | | 61 | /* for visuals */ |
62 | #include "xf1bpp.h" | | 62 | #include "xf1bpp.h" |
63 | #include "xf4bpp.h" | | 63 | #include "xf4bpp.h" |
64 | #include "fb.h" | | 64 | #include "fb.h" |
65 | | | 65 | |
66 | #include "xf86Resources.h" | | 66 | #include "xf86Resources.h" |
67 | #include "xf86RAC.h" | | 67 | #include "xf86RAC.h" |
68 | | | 68 | |
69 | #ifdef XvExtension | | 69 | #ifdef XvExtension |
70 | #include "xf86xv.h" | | 70 | #include "xf86xv.h" |
71 | #endif | | 71 | #endif |
72 | | | 72 | |
| | | 73 | #include "wsfb.h" |
| | | 74 | |
73 | /* #include "wsconsio.h" */ | | 75 | /* #include "wsconsio.h" */ |
74 | | | 76 | |
75 | #ifndef XFree86LOADER | | 77 | #ifndef XFree86LOADER |
76 | #include <sys/mman.h> | | 78 | #include <sys/mman.h> |
77 | #endif | | 79 | #endif |
78 | | | 80 | |
79 | #ifdef USE_PRIVSEP | | 81 | #ifdef USE_PRIVSEP |
80 | extern int priv_open_device(const char *); | | 82 | extern int priv_open_device(const char *); |
81 | #else | | 83 | #else |
82 | #define priv_open_device(n) open(n,O_RDWR|O_NONBLOCK|O_EXCL) | | 84 | #define priv_open_device(n) open(n,O_RDWR|O_NONBLOCK|O_EXCL) |
83 | #endif | | 85 | #endif |
84 | | | 86 | |
85 | #if defined(__NetBSD__) | | 87 | #if defined(__NetBSD__) |
| @@ -165,51 +167,60 @@ _X_EXPORT DriverRec WSFB = { | | | @@ -165,51 +167,60 @@ _X_EXPORT DriverRec WSFB = { |
165 | 0, | | 167 | 0, |
166 | WsfbDriverFunc | | 168 | WsfbDriverFunc |
167 | }; | | 169 | }; |
168 | | | 170 | |
169 | /* Supported "chipsets" */ | | 171 | /* Supported "chipsets" */ |
170 | static SymTabRec WsfbChipsets[] = { | | 172 | static SymTabRec WsfbChipsets[] = { |
171 | { 0, "wsfb" }, | | 173 | { 0, "wsfb" }, |
172 | { -1, NULL } | | 174 | { -1, NULL } |
173 | }; | | 175 | }; |
174 | | | 176 | |
175 | /* Supported options */ | | 177 | /* Supported options */ |
176 | typedef enum { | | 178 | typedef enum { |
177 | OPTION_SHADOW_FB, | | 179 | OPTION_SHADOW_FB, |
178 | OPTION_ROTATE | | 180 | OPTION_ROTATE, |
| | | 181 | OPTION_HW_CURSOR, |
| | | 182 | OPTION_SW_CURSOR |
179 | } WsfbOpts; | | 183 | } WsfbOpts; |
180 | | | 184 | |
181 | static const OptionInfoRec WsfbOptions[] = { | | 185 | static const OptionInfoRec WsfbOptions[] = { |
182 | { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, | | 186 | { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, |
183 | { OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE}, | | 187 | { OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE}, |
184 | { -1, NULL, OPTV_NONE, {0}, FALSE} | | 188 | { -1, NULL, OPTV_NONE, {0}, FALSE} |
185 | }; | | 189 | }; |
186 | | | 190 | |
187 | /* Symbols needed from other modules */ | | 191 | /* Symbols needed from other modules */ |
188 | static const char *fbSymbols[] = { | | 192 | static const char *fbSymbols[] = { |
189 | "fbPictureInit", | | 193 | "fbPictureInit", |
190 | "fbScreenInit", | | 194 | "fbScreenInit", |
191 | NULL | | 195 | NULL |
192 | }; | | 196 | }; |
193 | static const char *shadowSymbols[] = { | | 197 | static const char *shadowSymbols[] = { |
194 | "shadowAdd", | | 198 | "shadowAdd", |
195 | "shadowSetup", | | 199 | "shadowSetup", |
196 | "shadowUpdatePacked", | | 200 | "shadowUpdatePacked", |
197 | "shadowUpdatePackedWeak", | | 201 | "shadowUpdatePackedWeak", |
198 | "shadowUpdateRotatePacked", | | 202 | "shadowUpdateRotatePacked", |
199 | "shadowUpdateRotatePackedWeak", | | 203 | "shadowUpdateRotatePackedWeak", |
200 | NULL | | 204 | NULL |
201 | }; | | 205 | }; |
202 | | | 206 | |
| | | 207 | static const char *ramdacSymbols[] = { |
| | | 208 | "xf86CreateCursorInfoRec", |
| | | 209 | "xf86DestroyCursorInfoRec", |
| | | 210 | "xf86InitCursor", |
| | | 211 | NULL |
| | | 212 | }; |
| | | 213 | |
203 | #ifdef XFree86LOADER | | 214 | #ifdef XFree86LOADER |
204 | static XF86ModuleVersionInfo WsfbVersRec = { | | 215 | static XF86ModuleVersionInfo WsfbVersRec = { |
205 | "wsfb", | | 216 | "wsfb", |
206 | MODULEVENDORSTRING, | | 217 | MODULEVENDORSTRING, |
207 | MODINFOSTRING1, | | 218 | MODINFOSTRING1, |
208 | MODINFOSTRING2, | | 219 | MODINFOSTRING2, |
209 | XORG_VERSION_CURRENT, | | 220 | XORG_VERSION_CURRENT, |
210 | PACKAGE_VERSION_MAJOR, | | 221 | PACKAGE_VERSION_MAJOR, |
211 | PACKAGE_VERSION_MINOR, | | 222 | PACKAGE_VERSION_MINOR, |
212 | PACKAGE_VERSION_PATCHLEVEL, | | 223 | PACKAGE_VERSION_PATCHLEVEL, |
213 | ABI_CLASS_VIDEODRV, | | 224 | ABI_CLASS_VIDEODRV, |
214 | ABI_VIDEODRV_VERSION, | | 225 | ABI_VIDEODRV_VERSION, |
215 | NULL, | | 226 | NULL, |
| @@ -227,63 +238,37 @@ WsfbSetup(pointer module, pointer opts, | | | @@ -227,63 +238,37 @@ WsfbSetup(pointer module, pointer opts, |
227 | /* Check that we're being loaded on a OpenBSD or NetBSD system */ | | 238 | /* Check that we're being loaded on a OpenBSD or NetBSD system */ |
228 | LoaderGetOS(&osname, NULL, NULL, NULL); | | 239 | LoaderGetOS(&osname, NULL, NULL, NULL); |
229 | if (!osname || (strcmp(osname, "openbsd") != 0 && | | 240 | if (!osname || (strcmp(osname, "openbsd") != 0 && |
230 | strcmp(osname, "netbsd") != 0)) { | | 241 | strcmp(osname, "netbsd") != 0)) { |
231 | if (errmaj) | | 242 | if (errmaj) |
232 | *errmaj = LDR_BADOS; | | 243 | *errmaj = LDR_BADOS; |
233 | if (errmin) | | 244 | if (errmin) |
234 | *errmin = 0; | | 245 | *errmin = 0; |
235 | return NULL; | | 246 | return NULL; |
236 | } | | 247 | } |
237 | if (!setupDone) { | | 248 | if (!setupDone) { |
238 | setupDone = TRUE; | | 249 | setupDone = TRUE; |
239 | xf86AddDriver(&WSFB, module, HaveDriverFuncs); | | 250 | xf86AddDriver(&WSFB, module, HaveDriverFuncs); |
240 | LoaderRefSymLists(fbSymbols, shadowSymbols, NULL); | | 251 | LoaderRefSymLists(fbSymbols, shadowSymbols, ramdacSymbols, |
| | | 252 | NULL); |
241 | return (pointer)1; | | 253 | return (pointer)1; |
242 | } else { | | 254 | } else { |
243 | if (errmaj != NULL) | | 255 | if (errmaj != NULL) |
244 | *errmaj = LDR_ONCEONLY; | | 256 | *errmaj = LDR_ONCEONLY; |
245 | return NULL; | | 257 | return NULL; |
246 | } | | 258 | } |
247 | } | | 259 | } |
248 | #endif /* XFree86LOADER */ | | 260 | #endif /* XFree86LOADER */ |
249 | | | 261 | |
250 | /* private data */ | | | |
251 | typedef struct { | | | |
252 | int fd; /* file descriptor of open device */ | | | |
253 | struct wsdisplay_fbinfo info; /* frame buffer characteristics */ | | | |
254 | int linebytes; /* number of bytes per row */ | | | |
255 | unsigned char* fbstart; | | | |
256 | unsigned char* fbmem; | | | |
257 | size_t fbmem_len; | | | |
258 | int rotate; | | | |
259 | Bool shadowFB; | | | |
260 | void * shadow; | | | |
261 | CloseScreenProcPtr CloseScreen; | | | |
262 | CreateScreenResourcesProcPtr CreateScreenResources; | | | |
263 | void (*PointerMoved)(int, int, int); | | | |
264 | EntityInfoPtr pEnt; | | | |
265 | struct wsdisplay_cmap saved_cmap; | | | |
266 | | | | |
267 | #ifdef XFreeXDGA | | | |
268 | /* DGA info */ | | | |
269 | DGAModePtr pDGAMode; | | | |
270 | int nDGAMode; | | | |
271 | #endif | | | |
272 | OptionInfoPtr Options; | | | |
273 | } WsfbRec, *WsfbPtr; | | | |
274 | | | | |
275 | #define WSFBPTR(p) ((WsfbPtr)((p)->driverPrivate)) | | | |
276 | | | | |
277 | static Bool | | 262 | static Bool |
278 | WsfbGetRec(ScrnInfoPtr pScrn) | | 263 | WsfbGetRec(ScrnInfoPtr pScrn) |
279 | { | | 264 | { |
280 | | | 265 | |
281 | if (pScrn->driverPrivate != NULL) | | 266 | if (pScrn->driverPrivate != NULL) |
282 | return TRUE; | | 267 | return TRUE; |
283 | | | 268 | |
284 | pScrn->driverPrivate = xnfcalloc(sizeof(WsfbRec), 1); | | 269 | pScrn->driverPrivate = xnfcalloc(sizeof(WsfbRec), 1); |
285 | return TRUE; | | 270 | return TRUE; |
286 | } | | 271 | } |
287 | | | 272 | |
288 | static void | | 273 | static void |
289 | WsfbFreeRec(ScrnInfoPtr pScrn) | | 274 | WsfbFreeRec(ScrnInfoPtr pScrn) |
| @@ -339,27 +324,27 @@ wsfb_mmap(size_t len, off_t off, int fd) | | | @@ -339,27 +324,27 @@ wsfb_mmap(size_t len, off_t off, int fd) |
339 | | | 324 | |
340 | pagemask = getpagesize() - 1; | | 325 | pagemask = getpagesize() - 1; |
341 | mapsize = ((int) len + pagemask) & ~pagemask; | | 326 | mapsize = ((int) len + pagemask) & ~pagemask; |
342 | addr = 0; | | 327 | addr = 0; |
343 | | | 328 | |
344 | /* | | 329 | /* |
345 | * try and make it private first, that way once we get it, an | | 330 | * try and make it private first, that way once we get it, an |
346 | * interloper, e.g. another server, can't get this frame buffer, | | 331 | * interloper, e.g. another server, can't get this frame buffer, |
347 | * and if another server already has it, this one won't. | | 332 | * and if another server already has it, this one won't. |
348 | */ | | 333 | */ |
349 | mapaddr = (pointer) mmap(addr, mapsize, | | 334 | mapaddr = (pointer) mmap(addr, mapsize, |
350 | PROT_READ | PROT_WRITE, MAP_SHARED, | | 335 | PROT_READ | PROT_WRITE, MAP_SHARED, |
351 | fd, off); | | 336 | fd, off); |
352 | if (mapaddr == (pointer) -1) { | | 337 | if (mapaddr == MAP_FAILED) { |
353 | mapaddr = NULL; | | 338 | mapaddr = NULL; |
354 | } | | 339 | } |
355 | #if DEBUG | | 340 | #if DEBUG |
356 | ErrorF("mmap returns: addr %p len 0x%x\n", mapaddr, mapsize); | | 341 | ErrorF("mmap returns: addr %p len 0x%x\n", mapaddr, mapsize); |
357 | #endif | | 342 | #endif |
358 | return mapaddr; | | 343 | return mapaddr; |
359 | } | | 344 | } |
360 | | | 345 | |
361 | static Bool | | 346 | static Bool |
362 | WsfbProbe(DriverPtr drv, int flags) | | 347 | WsfbProbe(DriverPtr drv, int flags) |
363 | { | | 348 | { |
364 | int i, fd, entity; | | 349 | int i, fd, entity; |
365 | GDevPtr *devSections; | | 350 | GDevPtr *devSections; |
| @@ -410,26 +395,27 @@ WsfbProbe(DriverPtr drv, int flags) | | | @@ -410,26 +395,27 @@ WsfbProbe(DriverPtr drv, int flags) |
410 | return foundScreen; | | 395 | return foundScreen; |
411 | } | | 396 | } |
412 | | | 397 | |
413 | static Bool | | 398 | static Bool |
414 | WsfbPreInit(ScrnInfoPtr pScrn, int flags) | | 399 | WsfbPreInit(ScrnInfoPtr pScrn, int flags) |
415 | { | | 400 | { |
416 | WsfbPtr fPtr; | | 401 | WsfbPtr fPtr; |
417 | int default_depth, wstype; | | 402 | int default_depth, wstype; |
418 | char *dev, *s; | | 403 | char *dev, *s; |
419 | char *mod = NULL; | | 404 | char *mod = NULL; |
420 | const char *reqSym = NULL; | | 405 | const char *reqSym = NULL; |
421 | Gamma zeros = {0.0, 0.0, 0.0}; | | 406 | Gamma zeros = {0.0, 0.0, 0.0}; |
422 | DisplayModePtr mode; | | 407 | DisplayModePtr mode; |
| | | 408 | MessageType from; |
423 | | | 409 | |
424 | if (flags & PROBE_DETECT) return FALSE; | | 410 | if (flags & PROBE_DETECT) return FALSE; |
425 | | | 411 | |
426 | TRACE_ENTER("PreInit"); | | 412 | TRACE_ENTER("PreInit"); |
427 | | | 413 | |
428 | if (pScrn->numEntities != 1) return FALSE; | | 414 | if (pScrn->numEntities != 1) return FALSE; |
429 | | | 415 | |
430 | pScrn->monitor = pScrn->confScreen->monitor; | | 416 | pScrn->monitor = pScrn->confScreen->monitor; |
431 | | | 417 | |
432 | WsfbGetRec(pScrn); | | 418 | WsfbGetRec(pScrn); |
433 | fPtr = WSFBPTR(pScrn); | | 419 | fPtr = WSFBPTR(pScrn); |
434 | | | 420 | |
435 | fPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); | | 421 | fPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); |
| @@ -630,56 +616,74 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags | | | @@ -630,56 +616,74 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags |
630 | mode->Flags = 0; | | 616 | mode->Flags = 0; |
631 | if (pScrn->modes != NULL) { | | 617 | if (pScrn->modes != NULL) { |
632 | xf86DrvMsg(pScrn->scrnIndex, X_INFO, | | 618 | xf86DrvMsg(pScrn->scrnIndex, X_INFO, |
633 | "Ignoring mode specification from screen section\n"); | | 619 | "Ignoring mode specification from screen section\n"); |
634 | } | | 620 | } |
635 | pScrn->currentMode = pScrn->modes = mode; | | 621 | pScrn->currentMode = pScrn->modes = mode; |
636 | pScrn->virtualX = fPtr->info.width; | | 622 | pScrn->virtualX = fPtr->info.width; |
637 | pScrn->virtualY = fPtr->info.height; | | 623 | pScrn->virtualY = fPtr->info.height; |
638 | pScrn->displayWidth = pScrn->virtualX; | | 624 | pScrn->displayWidth = pScrn->virtualX; |
639 | | | 625 | |
640 | /* Set the display resolution */ | | 626 | /* Set the display resolution */ |
641 | xf86SetDpi(pScrn, 0, 0); | | 627 | xf86SetDpi(pScrn, 0, 0); |
642 | | | 628 | |
| | | 629 | from = X_DEFAULT; |
| | | 630 | fPtr->HWCursor = TRUE; |
| | | 631 | if (xf86GetOptValBool(fPtr->Options, OPTION_HW_CURSOR, &fPtr->HWCursor)) |
| | | 632 | from = X_CONFIG; |
| | | 633 | if (xf86ReturnOptValBool(fPtr->Options, OPTION_SW_CURSOR, FALSE)) { |
| | | 634 | from = X_CONFIG; |
| | | 635 | fPtr->HWCursor = FALSE; |
| | | 636 | } |
| | | 637 | xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", |
| | | 638 | fPtr->HWCursor ? "HW" : "SW"); |
| | | 639 | |
643 | /* Load bpp-specific modules */ | | 640 | /* Load bpp-specific modules */ |
644 | switch(pScrn->bitsPerPixel) { | | 641 | switch(pScrn->bitsPerPixel) { |
645 | case 1: | | 642 | case 1: |
646 | mod = "xf1bpp"; | | 643 | mod = "xf1bpp"; |
647 | reqSym = "xf1bppScreenInit"; | | 644 | reqSym = "xf1bppScreenInit"; |
648 | break; | | 645 | break; |
649 | case 4: | | 646 | case 4: |
650 | mod = "xf4bpp"; | | 647 | mod = "xf4bpp"; |
651 | reqSym = "xf4bppScreenInit"; | | 648 | reqSym = "xf4bppScreenInit"; |
652 | break; | | 649 | break; |
653 | default: | | 650 | default: |
654 | mod = "fb"; | | 651 | mod = "fb"; |
655 | break; | | 652 | break; |
656 | } | | 653 | } |
657 | | | 654 | |
658 | | | 655 | |
659 | /* Load shadow if needed */ | | 656 | /* Load shadow if needed */ |
660 | if (fPtr->shadowFB) { | | 657 | if (fPtr->shadowFB) { |
661 | xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, | | 658 | xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, |
662 | "Using \"Shadow Framebuffer\"\n"); | | 659 | "Using \"Shadow Framebuffer\"\n"); |
663 | if (xf86LoadSubModule(pScrn, "shadow") == NULL) { | | 660 | if (xf86LoadSubModule(pScrn, "shadow") == NULL) { |
664 | WsfbFreeRec(pScrn); | | 661 | WsfbFreeRec(pScrn); |
665 | return FALSE; | | 662 | return FALSE; |
666 | } | | 663 | } |
667 | xf86LoaderReqSymLists(shadowSymbols, NULL); | | 664 | xf86LoaderReqSymLists(shadowSymbols, NULL); |
668 | } | | 665 | } |
| | | 666 | |
669 | if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { | | 667 | if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { |
670 | WsfbFreeRec(pScrn); | | 668 | WsfbFreeRec(pScrn); |
671 | return FALSE; | | 669 | return FALSE; |
672 | } | | 670 | } |
| | | 671 | |
| | | 672 | if (xf86LoadSubModule(pScrn, "ramdac") == NULL) { |
| | | 673 | WsfbFreeRec(pScrn); |
| | | 674 | return FALSE; |
| | | 675 | } |
| | | 676 | |
673 | if (mod) { | | 677 | if (mod) { |
674 | if (reqSym) { | | 678 | if (reqSym) { |
675 | xf86LoaderReqSymbols(reqSym, NULL); | | 679 | xf86LoaderReqSymbols(reqSym, NULL); |
676 | } else { | | 680 | } else { |
677 | xf86LoaderReqSymLists(fbSymbols, NULL); | | 681 | xf86LoaderReqSymLists(fbSymbols, NULL); |
678 | } | | 682 | } |
679 | } | | 683 | } |
680 | TRACE_EXIT("PreInit"); | | 684 | TRACE_EXIT("PreInit"); |
681 | return TRUE; | | 685 | return TRUE; |
682 | } | | 686 | } |
683 | | | 687 | |
684 | static Bool | | 688 | static Bool |
685 | WsfbCreateScreenResources(ScreenPtr pScreen) | | 689 | WsfbCreateScreenResources(ScreenPtr pScreen) |
| @@ -828,27 +832,27 @@ WsfbScreenInit(int scrnIndex, ScreenPtr | | | @@ -828,27 +832,27 @@ WsfbScreenInit(int scrnIndex, ScreenPtr |
828 | pScrn->displayWidth); | | 832 | pScrn->displayWidth); |
829 | break; | | 833 | break; |
830 | case 4: | | 834 | case 4: |
831 | ret = xf4bppScreenInit(pScreen, fPtr->fbstart, | | 835 | ret = xf4bppScreenInit(pScreen, fPtr->fbstart, |
832 | pScrn->virtualX, pScrn->virtualY, | | 836 | pScrn->virtualX, pScrn->virtualY, |
833 | pScrn->xDpi, pScrn->yDpi, | | 837 | pScrn->xDpi, pScrn->yDpi, |
834 | pScrn->displayWidth); | | 838 | pScrn->displayWidth); |
835 | break; | | 839 | break; |
836 | case 8: | | 840 | case 8: |
837 | case 16: | | 841 | case 16: |
838 | case 24: | | 842 | case 24: |
839 | case 32: | | 843 | case 32: |
840 | ret = fbScreenInit(pScreen, | | 844 | ret = fbScreenInit(pScreen, |
841 | fPtr->shadowFB ? fPtr->shadow : fPtr->fbstart, | | 845 | /*fPtr->shadowFB ? fPtr->shadow :*/ fPtr->fbstart, |
842 | pScrn->virtualX, pScrn->virtualY, | | 846 | pScrn->virtualX, pScrn->virtualY, |
843 | pScrn->xDpi, pScrn->yDpi, | | 847 | pScrn->xDpi, pScrn->yDpi, |
844 | pScrn->displayWidth, pScrn->bitsPerPixel); | | 848 | pScrn->displayWidth, pScrn->bitsPerPixel); |
845 | break; | | 849 | break; |
846 | default: | | 850 | default: |
847 | xf86DrvMsg(pScrn->scrnIndex, X_ERROR, | | 851 | xf86DrvMsg(pScrn->scrnIndex, X_ERROR, |
848 | "Unsupported bpp: %d", pScrn->bitsPerPixel); | | 852 | "Unsupported bpp: %d", pScrn->bitsPerPixel); |
849 | return FALSE; | | 853 | return FALSE; |
850 | } /* case */ | | 854 | } /* case */ |
851 | | | 855 | |
852 | if (!ret) | | 856 | if (!ret) |
853 | return FALSE; | | 857 | return FALSE; |
854 | | | 858 | |
| @@ -891,26 +895,30 @@ WsfbScreenInit(int scrnIndex, ScreenPtr | | | @@ -891,26 +895,30 @@ WsfbScreenInit(int scrnIndex, ScreenPtr |
891 | xf86DisableRandR(); | | 895 | xf86DisableRandR(); |
892 | if (pScrn->bitsPerPixel == 24) | | 896 | if (pScrn->bitsPerPixel == 24) |
893 | xf86DrvMsg(scrnIndex, X_WARNING, | | 897 | xf86DrvMsg(scrnIndex, X_WARNING, |
894 | "Rotation might be broken in 24 bpp\n"); | | 898 | "Rotation might be broken in 24 bpp\n"); |
895 | } | | 899 | } |
896 | | | 900 | |
897 | xf86SetBlackWhitePixels(pScreen); | | 901 | xf86SetBlackWhitePixels(pScreen); |
898 | miInitializeBackingStore(pScreen); | | 902 | miInitializeBackingStore(pScreen); |
899 | xf86SetBackingStore(pScreen); | | 903 | xf86SetBackingStore(pScreen); |
900 | | | 904 | |
901 | /* software cursor */ | | 905 | /* software cursor */ |
902 | miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); | | 906 | miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); |
903 | | | 907 | |
| | | 908 | /* check for hardware cursor support */ |
| | | 909 | if (fPtr->HWCursor) |
| | | 910 | WsfbSetupCursor(pScreen); |
| | | 911 | |
904 | /* colormap */ | | 912 | /* colormap */ |
905 | if (!miCreateDefColormap(pScreen)) | | 913 | if (!miCreateDefColormap(pScreen)) |
906 | return FALSE; | | 914 | return FALSE; |
907 | flags = CMAP_RELOAD_ON_MODE_SWITCH; | | 915 | flags = CMAP_RELOAD_ON_MODE_SWITCH; |
908 | ncolors = fPtr->info.cmsize; | | 916 | ncolors = fPtr->info.cmsize; |
909 | /* on StaticGray visuals, fake a 256 entries colormap */ | | 917 | /* on StaticGray visuals, fake a 256 entries colormap */ |
910 | if (ncolors == 0) | | 918 | if (ncolors == 0) |
911 | ncolors = 256; | | 919 | ncolors = 256; |
912 | if(!xf86HandleColormaps(pScreen, ncolors, 8, WsfbLoadPalette, | | 920 | if(!xf86HandleColormaps(pScreen, ncolors, 8, WsfbLoadPalette, |
913 | NULL, flags)) | | 921 | NULL, flags)) |
914 | return FALSE; | | 922 | return FALSE; |
915 | | | 923 | |
916 | pScreen->SaveScreen = WsfbSaveScreen; | | 924 | pScreen->SaveScreen = WsfbSaveScreen; |