Lines Matching full:fb

64 #include <linux/fb.h>
156 #define READ_BYTE(fb,reg) gsc_readb((fb)->info.fix.mmio_start + (reg)) argument
157 #define READ_WORD(fb,reg) gsc_readl((fb)->info.fix.mmio_start + (reg)) argument
163 # define WRITE_BYTE(value,fb,reg) gsc_writeb((value),(fb)->info.fix.mmio_start + (reg)) argument
164 # define WRITE_WORD(value,fb,reg) gsc_writel((value),(fb)->info.fix.mmio_start + (reg)) argument
169 # define WRITE_BYTE(value,fb,reg) do { if (debug_on) \ argument
171 __func__, reg, value, READ_BYTE(fb,reg)); \
172 gsc_writeb((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
173 # define WRITE_WORD(value,fb,reg) do { if (debug_on) \ argument
175 __func__, reg, value, READ_WORD(fb,reg)); \
176 gsc_writel((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
187 SETUP_HW(struct stifb_info *fb) in SETUP_HW() argument
192 stat = READ_BYTE(fb, REG_15b0); in SETUP_HW()
194 stat = READ_BYTE(fb, REG_15b0); in SETUP_HW()
200 SETUP_FB(struct stifb_info *fb) in SETUP_FB() argument
204 SETUP_HW(fb); in SETUP_FB()
205 switch (fb->id) in SETUP_FB()
213 if (fb->info.var.bits_per_pixel == 32) in SETUP_FB()
219 if (fb->info.var.bits_per_pixel == 32) in SETUP_FB()
230 WRITE_WORD(reg10_value, fb, REG_10); in SETUP_FB()
231 WRITE_WORD(0x83000300, fb, REG_14); in SETUP_FB()
232 SETUP_HW(fb); in SETUP_FB()
233 WRITE_BYTE(1, fb, REG_16b1); in SETUP_FB()
237 START_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb) in START_IMAGE_COLORMAP_ACCESS() argument
239 SETUP_HW(fb); in START_IMAGE_COLORMAP_ACCESS()
240 WRITE_WORD(0xBBE0F000, fb, REG_10); in START_IMAGE_COLORMAP_ACCESS()
241 WRITE_WORD(0x03000300, fb, REG_14); in START_IMAGE_COLORMAP_ACCESS()
242 WRITE_WORD(~0, fb, REG_13); in START_IMAGE_COLORMAP_ACCESS()
246 WRITE_IMAGE_COLOR(struct stifb_info *fb, int index, int color) in WRITE_IMAGE_COLOR() argument
248 SETUP_HW(fb); in WRITE_IMAGE_COLOR()
249 WRITE_WORD(((0x100+index)<<2), fb, REG_3); in WRITE_IMAGE_COLOR()
250 WRITE_WORD(color, fb, REG_4); in WRITE_IMAGE_COLOR()
254 FINISH_IMAGE_COLORMAP_ACCESS(struct stifb_info *fb) in FINISH_IMAGE_COLORMAP_ACCESS() argument
256 WRITE_WORD(0x400, fb, REG_2); in FINISH_IMAGE_COLORMAP_ACCESS()
257 if (fb->info.var.bits_per_pixel == 32) { in FINISH_IMAGE_COLORMAP_ACCESS()
258 WRITE_WORD(0x83000100, fb, REG_1); in FINISH_IMAGE_COLORMAP_ACCESS()
260 if (fb->id == S9000_ID_ARTIST || fb->id == CRT_ID_VISUALIZE_EG) in FINISH_IMAGE_COLORMAP_ACCESS()
261 WRITE_WORD(0x80000100, fb, REG_26); in FINISH_IMAGE_COLORMAP_ACCESS()
263 WRITE_WORD(0x80000100, fb, REG_1); in FINISH_IMAGE_COLORMAP_ACCESS()
265 SETUP_FB(fb); in FINISH_IMAGE_COLORMAP_ACCESS()
269 SETUP_RAMDAC(struct stifb_info *fb) in SETUP_RAMDAC() argument
271 SETUP_HW(fb); in SETUP_RAMDAC()
272 WRITE_WORD(0x04000000, fb, 0x1020); in SETUP_RAMDAC()
273 WRITE_WORD(0xff000000, fb, 0x1028); in SETUP_RAMDAC()
277 CRX24_SETUP_RAMDAC(struct stifb_info *fb) in CRX24_SETUP_RAMDAC() argument
279 SETUP_HW(fb); in CRX24_SETUP_RAMDAC()
280 WRITE_WORD(0x04000000, fb, 0x1000); in CRX24_SETUP_RAMDAC()
281 WRITE_WORD(0x02000000, fb, 0x1004); in CRX24_SETUP_RAMDAC()
282 WRITE_WORD(0xff000000, fb, 0x1008); in CRX24_SETUP_RAMDAC()
283 WRITE_WORD(0x05000000, fb, 0x1000); in CRX24_SETUP_RAMDAC()
284 WRITE_WORD(0x02000000, fb, 0x1004); in CRX24_SETUP_RAMDAC()
285 WRITE_WORD(0x03000000, fb, 0x1008); in CRX24_SETUP_RAMDAC()
290 HCRX_SETUP_RAMDAC(struct stifb_info *fb)
292 WRITE_WORD(0xffffffff, fb, REG_32);
297 CRX24_SET_OVLY_MASK(struct stifb_info *fb) in CRX24_SET_OVLY_MASK() argument
299 SETUP_HW(fb); in CRX24_SET_OVLY_MASK()
300 WRITE_WORD(0x13a02000, fb, REG_11); in CRX24_SET_OVLY_MASK()
301 WRITE_WORD(0x03000300, fb, REG_14); in CRX24_SET_OVLY_MASK()
302 WRITE_WORD(0x000017f0, fb, REG_3); in CRX24_SET_OVLY_MASK()
303 WRITE_WORD(0xffffffff, fb, REG_13); in CRX24_SET_OVLY_MASK()
304 WRITE_WORD(0xffffffff, fb, REG_22); in CRX24_SET_OVLY_MASK()
305 WRITE_WORD(0x00000000, fb, REG_23); in CRX24_SET_OVLY_MASK()
309 ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) in ENABLE_DISABLE_DISPLAY() argument
312 SETUP_HW(fb); in ENABLE_DISABLE_DISPLAY()
313 WRITE_WORD(0x06000000, fb, 0x1030); in ENABLE_DISABLE_DISPLAY()
314 WRITE_WORD(value, fb, 0x1038); in ENABLE_DISABLE_DISPLAY()
318 CRX24_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) in CRX24_ENABLE_DISABLE_DISPLAY() argument
321 SETUP_HW(fb); in CRX24_ENABLE_DISABLE_DISPLAY()
322 WRITE_WORD(0x01000000, fb, 0x1000); in CRX24_ENABLE_DISABLE_DISPLAY()
323 WRITE_WORD(0x02000000, fb, 0x1004); in CRX24_ENABLE_DISABLE_DISPLAY()
324 WRITE_WORD(value, fb, 0x1008); in CRX24_ENABLE_DISABLE_DISPLAY()
328 ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) in ARTIST_ENABLE_DISABLE_DISPLAY() argument
333 SETUP_HW(fb); in ARTIST_ENABLE_DISABLE_DISPLAY()
335 WRITE_WORD(READ_WORD(fb, DregsMiscVideo) | 0x0A000000, fb, DregsMiscVideo); in ARTIST_ENABLE_DISABLE_DISPLAY()
336 WRITE_WORD(READ_WORD(fb, DregsMiscCtl) | 0x00800000, fb, DregsMiscCtl); in ARTIST_ENABLE_DISABLE_DISPLAY()
338 WRITE_WORD(READ_WORD(fb, DregsMiscVideo) & ~0x0A000000, fb, DregsMiscVideo); in ARTIST_ENABLE_DISABLE_DISPLAY()
339 WRITE_WORD(READ_WORD(fb, DregsMiscCtl) & ~0x00800000, fb, DregsMiscCtl); in ARTIST_ENABLE_DISABLE_DISPLAY()
343 #define GET_ROMTABLE_INDEX(fb) \ argument
344 (READ_BYTE(fb, REG_16b3) - 1)
348 #define IS_24_DEVICE(fb) \ argument
349 (fb->deviceSpecificConfig & HYPER_CONFIG_PLANES_24)
351 #define IS_888_DEVICE(fb) \ argument
352 (!(IS_24_DEVICE(fb)))
354 #define GET_FIFO_SLOTS(fb, cnt, numslots) \ argument
356 cnt = READ_WORD(fb, REG_34); \
365 #define AddrLong 5 /* FB address is Long aligned (pixel) */
391 #define NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, val) \ argument
392 WRITE_WORD(val, fb, REG_14)
394 #define NGLE_QUICK_SET_DST_BM_ACCESS(fb, val) \ argument
395 WRITE_WORD(val, fb, REG_11)
397 #define NGLE_QUICK_SET_CTL_PLN_REG(fb, val) \ argument
398 WRITE_WORD(val, fb, REG_12)
400 #define NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, plnmsk32) \ argument
401 WRITE_WORD(plnmsk32, fb, REG_13)
403 #define NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, fg32) \ argument
404 WRITE_WORD(fg32, fb, REG_35)
406 #define NGLE_SET_TRANSFERDATA(fb, val) \ argument
407 WRITE_WORD(val, fb, REG_8)
409 #define NGLE_SET_DSTXY(fb, val) \ argument
410 WRITE_WORD(val, fb, REG_6)
418 #define NGLE_BINC_SET_DSTADDR(fb, addr) \ argument
419 WRITE_WORD(addr, fb, REG_3)
421 #define NGLE_BINC_SET_SRCADDR(fb, addr) \ argument
422 WRITE_WORD(addr, fb, REG_2)
424 #define NGLE_BINC_SET_DSTMASK(fb, mask) \ argument
425 WRITE_WORD(mask, fb, REG_22)
427 #define NGLE_BINC_WRITE32(fb, data32) \ argument
428 WRITE_WORD(data32, fb, REG_23)
430 #define START_COLORMAPLOAD(fb, cmapBltCtlData32) \ argument
431 WRITE_WORD((cmapBltCtlData32), fb, REG_38)
433 #define SET_LENXY_START_RECFILL(fb, lenxy) \ argument
434 WRITE_WORD(lenxy, fb, REG_9)
436 #define SETUP_COPYAREA(fb) \ argument
437 WRITE_BYTE(0, fb, REG_16b1)
440 HYPER_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) in HYPER_ENABLE_DISABLE_DISPLAY() argument
444 SETUP_HW(fb); in HYPER_ENABLE_DISABLE_DISPLAY()
445 value = READ_WORD(fb, DregsHypMiscVideo); in HYPER_ENABLE_DISABLE_DISPLAY()
450 WRITE_WORD(value, fb, DregsHypMiscVideo); in HYPER_ENABLE_DISABLE_DISPLAY()
463 SETUP_ATTR_ACCESS(struct stifb_info *fb, unsigned BufferNumber) in SETUP_ATTR_ACCESS() argument
465 SETUP_HW(fb); in SETUP_ATTR_ACCESS()
466 WRITE_WORD(0x2EA0D000, fb, REG_11); in SETUP_ATTR_ACCESS()
467 WRITE_WORD(0x23000302, fb, REG_14); in SETUP_ATTR_ACCESS()
468 WRITE_WORD(BufferNumber, fb, REG_12); in SETUP_ATTR_ACCESS()
469 WRITE_WORD(0xffffffff, fb, REG_8); in SETUP_ATTR_ACCESS()
473 SET_ATTR_SIZE(struct stifb_info *fb, int width, int height) in SET_ATTR_SIZE() argument
482 WRITE_WORD(0x00000000, fb, REG_6); in SET_ATTR_SIZE()
483 WRITE_WORD((width<<16) | height, fb, REG_9); in SET_ATTR_SIZE()
484 WRITE_WORD(0x05000000, fb, REG_6); in SET_ATTR_SIZE()
485 WRITE_WORD(0x00040001, fb, REG_9); in SET_ATTR_SIZE()
489 FINISH_ATTR_ACCESS(struct stifb_info *fb) in FINISH_ATTR_ACCESS() argument
491 SETUP_HW(fb); in FINISH_ATTR_ACCESS()
492 WRITE_WORD(0x00000000, fb, REG_12); in FINISH_ATTR_ACCESS()
496 elkSetupPlanes(struct stifb_info *fb) in elkSetupPlanes() argument
498 SETUP_RAMDAC(fb); in elkSetupPlanes()
499 SETUP_FB(fb); in elkSetupPlanes()
503 ngleSetupAttrPlanes(struct stifb_info *fb, int BufferNumber) in ngleSetupAttrPlanes() argument
505 SETUP_ATTR_ACCESS(fb, BufferNumber); in ngleSetupAttrPlanes()
506 SET_ATTR_SIZE(fb, fb->info.var.xres, fb->info.var.yres); in ngleSetupAttrPlanes()
507 FINISH_ATTR_ACCESS(fb); in ngleSetupAttrPlanes()
508 SETUP_FB(fb); in ngleSetupAttrPlanes()
513 rattlerSetupPlanes(struct stifb_info *fb) in rattlerSetupPlanes() argument
521 CRX24_SETUP_RAMDAC(fb); in rattlerSetupPlanes()
523 /* change fb->id temporarily to fool SETUP_FB() */ in rattlerSetupPlanes()
524 saved_id = fb->id; in rattlerSetupPlanes()
525 fb->id = CRX24_OVERLAY_PLANES; in rattlerSetupPlanes()
526 SETUP_FB(fb); in rattlerSetupPlanes()
527 fb->id = saved_id; in rattlerSetupPlanes()
529 for (y = 0; y < fb->info.var.yres; ++y) in rattlerSetupPlanes()
530 fb_memset(fb->info.screen_base + y * fb->info.fix.line_length, in rattlerSetupPlanes()
531 0xff, fb->info.var.xres * fb->info.var.bits_per_pixel/8); in rattlerSetupPlanes()
533 CRX24_SET_OVLY_MASK(fb); in rattlerSetupPlanes()
534 SETUP_FB(fb); in rattlerSetupPlanes()
560 setNgleLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length)
568 switch (fb->id)
571 if (fb->var.bits_per_pixel == 8) {
599 setHyperLutBltCtl(struct stifb_info *fb, int offsetWithinLut, int length) in setHyperLutBltCtl() argument
610 if (fb->info.var.bits_per_pixel == 8) in setHyperLutBltCtl()
622 static void hyperUndoITE(struct stifb_info *fb) in hyperUndoITE() argument
627 NGLE_LOCK(fb); in hyperUndoITE()
629 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 1); in hyperUndoITE()
630 WRITE_WORD(0xffffffff, fb, REG_32); in hyperUndoITE()
635 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7); in hyperUndoITE()
636 NGLE_QUICK_SET_DST_BM_ACCESS(fb, in hyperUndoITE()
639 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, in hyperUndoITE()
646 NGLE_BINC_SET_DSTADDR(fb, fbAddr); in hyperUndoITE()
647 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xffffff); in hyperUndoITE()
648 NGLE_BINC_SET_DSTMASK(fb, 0xffffffff); in hyperUndoITE()
651 NGLE_BINC_WRITE32(fb, 0); in hyperUndoITE()
653 NGLE_UNLOCK(fb); in hyperUndoITE()
657 ngleDepth8_ClearImagePlanes(struct stifb_info *fb) in ngleDepth8_ClearImagePlanes() argument
663 ngleDepth24_ClearImagePlanes(struct stifb_info *fb) in ngleDepth24_ClearImagePlanes() argument
669 ngleResetAttrPlanes(struct stifb_info *fb, unsigned int ctlPlaneReg) in ngleResetAttrPlanes() argument
675 NGLE_LOCK(fb); in ngleResetAttrPlanes()
677 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 4); in ngleResetAttrPlanes()
678 NGLE_QUICK_SET_DST_BM_ACCESS(fb, in ngleResetAttrPlanes()
682 NGLE_QUICK_SET_CTL_PLN_REG(fb, ctlPlaneReg); in ngleResetAttrPlanes()
683 NGLE_SET_TRANSFERDATA(fb, 0xffffffff); in ngleResetAttrPlanes()
685 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, in ngleResetAttrPlanes()
691 packed_len = (fb->info.var.xres << 16) | fb->info.var.yres; in ngleResetAttrPlanes()
692 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 2); in ngleResetAttrPlanes()
693 NGLE_SET_DSTXY(fb, packed_dst); in ngleResetAttrPlanes()
694 SET_LENXY_START_RECFILL(fb, packed_len); in ngleResetAttrPlanes()
704 if (fb->id == S9000_ID_A1659A) { /* ELK_DEVICE_ID */ in ngleResetAttrPlanes()
707 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 2); in ngleResetAttrPlanes()
708 NGLE_SET_DSTXY(fb, packed_dst); in ngleResetAttrPlanes()
710 SET_LENXY_START_RECFILL(fb, packed_len); in ngleResetAttrPlanes()
714 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 1); in ngleResetAttrPlanes()
715 NGLE_QUICK_SET_CTL_PLN_REG(fb, 0); in ngleResetAttrPlanes()
717 NGLE_UNLOCK(fb); in ngleResetAttrPlanes()
721 ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data) in ngleClearOverlayPlanes() argument
727 NGLE_LOCK(fb); in ngleClearOverlayPlanes()
730 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 8); in ngleClearOverlayPlanes()
731 NGLE_QUICK_SET_DST_BM_ACCESS(fb, in ngleClearOverlayPlanes()
735 NGLE_SET_TRANSFERDATA(fb, 0xffffffff); /* Write foreground color */ in ngleClearOverlayPlanes()
737 NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, data); in ngleClearOverlayPlanes()
738 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, mask); in ngleClearOverlayPlanes()
741 packed_len = (fb->info.var.xres << 16) | fb->info.var.yres; in ngleClearOverlayPlanes()
742 NGLE_SET_DSTXY(fb, packed_dst); in ngleClearOverlayPlanes()
745 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, in ngleClearOverlayPlanes()
750 SET_LENXY_START_RECFILL(fb, packed_len); in ngleClearOverlayPlanes()
752 NGLE_UNLOCK(fb); in ngleClearOverlayPlanes()
756 hyperResetPlanes(struct stifb_info *fb, int enable) in hyperResetPlanes() argument
760 NGLE_LOCK(fb); in hyperResetPlanes()
762 if (IS_24_DEVICE(fb)) in hyperResetPlanes()
763 if (fb->info.var.bits_per_pixel == 32) in hyperResetPlanes()
773 if (IS_24_DEVICE(fb)) in hyperResetPlanes()
774 ngleDepth24_ClearImagePlanes(fb); in hyperResetPlanes()
776 ngleDepth8_ClearImagePlanes(fb); in hyperResetPlanes()
780 ngleResetAttrPlanes(fb, controlPlaneReg); in hyperResetPlanes()
783 ngleClearOverlayPlanes(fb, 0xff, 255); in hyperResetPlanes()
788 hyperUndoITE(fb); in hyperResetPlanes()
793 if (IS_24_DEVICE(fb)) in hyperResetPlanes()
794 ngleDepth24_ClearImagePlanes(fb); in hyperResetPlanes()
796 ngleDepth8_ClearImagePlanes(fb); in hyperResetPlanes()
797 ngleResetAttrPlanes(fb, controlPlaneReg); in hyperResetPlanes()
798 ngleClearOverlayPlanes(fb, 0xff, 0); in hyperResetPlanes()
802 hyperUndoITE(fb); in hyperResetPlanes()
803 ngleResetAttrPlanes(fb, controlPlaneReg); in hyperResetPlanes()
807 NGLE_UNLOCK(fb); in hyperResetPlanes()
813 ngleGetDeviceRomData(struct stifb_info *fb) in ngleGetDeviceRomData() argument
827 pPackedDevRomData = fb->ngle_rom; in ngleGetDeviceRomData()
829 SETUP_HW(fb); in ngleGetDeviceRomData()
830 if (fb->id == S9000_ID_ARTIST) { in ngleGetDeviceRomData()
835 pBytePerLongDevDepData = fb->sti->regions[NGLEDEVDEPROM_CRT_REGION]; in ngleGetDeviceRomData()
838 if (fb->id == S9000_ID_TOMCAT) in ngleGetDeviceRomData()
869 SETUP_FB(fb); in ngleGetDeviceRomData()
881 SETUP_HCRX(struct stifb_info *fb) in SETUP_HCRX() argument
886 if (fb->id != S9000_ID_HCRX) in SETUP_HCRX()
890 GET_FIFO_SLOTS(fb, nFreeFifoSlots, 7); in SETUP_HCRX()
892 if (IS_24_DEVICE(fb)) { in SETUP_HCRX()
893 hyperbowl = (fb->info.var.bits_per_pixel == 32) ? in SETUP_HCRX()
898 WRITE_WORD(hyperbowl, fb, REG_40); in SETUP_HCRX()
899 WRITE_WORD(hyperbowl, fb, REG_40); in SETUP_HCRX()
901 WRITE_WORD(HYPERBOWL_MODE2_8_24, fb, REG_39); in SETUP_HCRX()
903 WRITE_WORD(0x014c0148, fb, REG_42); /* Set lut 0 to be the direct color */ in SETUP_HCRX()
904 WRITE_WORD(0x404c4048, fb, REG_43); in SETUP_HCRX()
905 WRITE_WORD(0x034c0348, fb, REG_44); in SETUP_HCRX()
906 WRITE_WORD(0x444c4448, fb, REG_45); in SETUP_HCRX()
911 WRITE_WORD(hyperbowl, fb, REG_40); in SETUP_HCRX()
912 WRITE_WORD(hyperbowl, fb, REG_40); in SETUP_HCRX()
914 WRITE_WORD(0x00000000, fb, REG_42); in SETUP_HCRX()
915 WRITE_WORD(0x00000000, fb, REG_43); in SETUP_HCRX()
916 WRITE_WORD(0x00000000, fb, REG_44); in SETUP_HCRX()
917 WRITE_WORD(0x444c4048, fb, REG_45); in SETUP_HCRX()
928 struct stifb_info *fb = container_of(info, struct stifb_info, info); in stifb_setcolreg() local
940 START_IMAGE_COLORMAP_ACCESS(fb); in stifb_setcolreg()
942 if (unlikely(fb->info.var.grayscale)) { in stifb_setcolreg()
953 if (fb->info.fix.visual == FB_VISUAL_DIRECTCOLOR) { in stifb_setcolreg()
954 struct fb_var_screeninfo *var = &fb->info.var; in stifb_setcolreg()
956 ((u32 *)fb->info.pseudo_palette)[regno] = in stifb_setcolreg()
962 WRITE_IMAGE_COLOR(fb, regno, color); in stifb_setcolreg()
964 if (fb->id == S9000_ID_HCRX) { in stifb_setcolreg()
967 lutBltCtl = setHyperLutBltCtl(fb, in stifb_setcolreg()
970 NGLE_BINC_SET_SRCADDR(fb, in stifb_setcolreg()
973 START_COLORMAPLOAD(fb, lutBltCtl.all); in stifb_setcolreg()
974 SETUP_FB(fb); in stifb_setcolreg()
977 FINISH_IMAGE_COLORMAP_ACCESS(fb); in stifb_setcolreg()
988 struct stifb_info *fb = container_of(info, struct stifb_info, info); in stifb_blank() local
991 switch (fb->id) { in stifb_blank()
993 CRX24_ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
997 ARTIST_ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1000 HYPER_ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1006 ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1010 SETUP_FB(fb); in stifb_blank()
1017 struct stifb_info *fb = container_of(info, struct stifb_info, info); in stifb_copyarea() local
1019 SETUP_COPYAREA(fb); in stifb_copyarea()
1021 SETUP_HW(fb); in stifb_copyarea()
1022 if (fb->info.var.bits_per_pixel == 32) { in stifb_copyarea()
1023 WRITE_WORD(0xBBA0A000, fb, REG_10); in stifb_copyarea()
1025 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xffffffff); in stifb_copyarea()
1027 WRITE_WORD(fb->id == S9000_ID_HCRX ? 0x13a02000 : 0x13a01000, fb, REG_10); in stifb_copyarea()
1029 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xff); in stifb_copyarea()
1032 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, in stifb_copyarea()
1037 WRITE_WORD(((area->sx << 16) | area->sy), fb, REG_24); in stifb_copyarea()
1038 WRITE_WORD(((area->width << 16) | area->height), fb, REG_7); in stifb_copyarea()
1039 WRITE_WORD(((area->dx << 16) | area->dy), fb, REG_25); in stifb_copyarea()
1041 SETUP_FB(fb); in stifb_copyarea()
1045 stifb_init_display(struct stifb_info *fb) in stifb_init_display() argument
1047 int id = fb->id; in stifb_init_display()
1049 SETUP_FB(fb); in stifb_init_display()
1052 SETUP_HCRX(fb); in stifb_init_display()
1056 hyperInitSprite(fb); in stifb_init_display()
1058 ngleInitSprite(fb); in stifb_init_display()
1064 hyperResetPlanes(fb, ENABLE); in stifb_init_display()
1067 rattlerSetupPlanes(fb); in stifb_init_display()
1072 elkSetupPlanes(fb); in stifb_init_display()
1080 if (fb->info.var.bits_per_pixel == 32) in stifb_init_display()
1081 ngleSetupAttrPlanes(fb, BUFF1_CMAP3); in stifb_init_display()
1083 ngleSetupAttrPlanes(fb, BUFF1_CMAP0); in stifb_init_display()
1086 ngleClearOverlayPlanes(fb, 0xff, 0); in stifb_init_display()
1090 if (fb->info.var.bits_per_pixel == 32) in stifb_init_display()
1091 ngleSetupAttrPlanes(fb, BUFF1_CMAP3); in stifb_init_display()
1093 ngleSetupAttrPlanes(fb, ARTIST_CMAP0); in stifb_init_display()
1097 stifb_blank(0, (struct fb_info *)fb); /* 0=enable screen */ in stifb_init_display()
1099 SETUP_FB(fb); in stifb_init_display()
1122 struct stifb_info *fb; in stifb_init_fb() local
1128 fb = kzalloc(sizeof(*fb), GFP_ATOMIC); in stifb_init_fb()
1129 if (!fb) in stifb_init_fb()
1132 info = &fb->info; in stifb_init_fb()
1138 fb->sti = sti; in stifb_init_fb()
1141 fb->id = fb->sti->graphics_id[0]; in stifb_init_fb()
1144 switch (fb->id) { in stifb_init_fb()
1169 dev_name, fb->id); in stifb_init_fb()
1175 xres = sti_onscreen_x(fb->sti); in stifb_init_fb()
1176 yres = sti_onscreen_y(fb->sti); in stifb_init_fb()
1178 ngleGetDeviceRomData(fb); in stifb_init_fb()
1181 fix->mmio_start = REGION_BASE(fb,2); in stifb_init_fb()
1185 switch (fb->id) { in stifb_init_fb()
1190 fb->id = S9000_ID_A1659A; in stifb_init_fb()
1200 * fb.iobase = REGION_BASE(fb_info,3); in stifb_init_fb()
1201 * fb.screen_base = ioremap(REGION_BASE(fb_info,2),xxx); in stifb_init_fb()
1203 xres = fb->ngle_rom.x_size_visible; in stifb_init_fb()
1204 yres = fb->ngle_rom.y_size_visible; in stifb_init_fb()
1205 fb->id = S9000_ID_A1659A; in stifb_init_fb()
1211 memset(&fb->ngle_rom, 0, sizeof(fb->ngle_rom)); in stifb_init_fb()
1212 if ((fb->sti->regions_phys[0] & 0xfc000000) == in stifb_init_fb()
1213 (fb->sti->regions_phys[2] & 0xfc000000)) in stifb_init_fb()
1214 sti_rom_address = F_EXTEND(fb->sti->regions_phys[0]); in stifb_init_fb()
1216 sti_rom_address = F_EXTEND(fb->sti->regions_phys[1]); in stifb_init_fb()
1218 fb->deviceSpecificConfig = gsc_readl(sti_rom_address); in stifb_init_fb()
1219 if (IS_24_DEVICE(fb)) { in stifb_init_fb()
1226 READ_WORD(fb, REG_15); in stifb_init_fb()
1227 SETUP_HW(fb); in stifb_init_fb()
1237 fb->id); in stifb_init_fb()
1244 fb->id); in stifb_init_fb()
1251 fix->smem_start = F_EXTEND(fb->sti->regions_phys[1]); in stifb_init_fb()
1252 fix->smem_len = fb->sti->regions[1].region_desc.length * 4096; in stifb_init_fb()
1254 fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8; in stifb_init_fb()
1294 info->screen_base = ioremap(REGION_BASE(fb,1), fix->smem_len); in stifb_init_fb()
1301 info->pseudo_palette = &fb->pseudo_palette; in stifb_init_fb()
1306 stifb_init_display(fb); in stifb_init_fb()
1308 if (!request_mem_region(fix->smem_start, fix->smem_len, "stifb fb")) { in stifb_init_fb()
1309 printk(KERN_ERR "stifb: cannot reserve fb region 0x%04lx-0x%04lx\n", in stifb_init_fb()
1320 if (register_framebuffer(&fb->info) < 0) in stifb_init_fb()
1325 fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n", in stifb_init_fb()
1331 fb->id, in stifb_init_fb()
1346 kfree(fb); in stifb_init_fb()