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_io(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()
927 struct stifb_info *fb = info->par; in stifb_check_var() local
929 if (var->xres != fb->info->var.xres || in stifb_check_var()
930 var->yres != fb->info->var.yres || in stifb_check_var()
931 var->bits_per_pixel != fb->info->var.bits_per_pixel) in stifb_check_var()
938 var->grayscale = fb->info->var.grayscale; in stifb_check_var()
939 var->red.length = fb->info->var.red.length; in stifb_check_var()
940 var->green.length = fb->info->var.green.length; in stifb_check_var()
941 var->blue.length = fb->info->var.blue.length; in stifb_check_var()
950 struct stifb_info *fb = info->par; in stifb_setcolreg() local
962 START_IMAGE_COLORMAP_ACCESS(fb); in stifb_setcolreg()
964 if (unlikely(fb->info->var.grayscale)) { in stifb_setcolreg()
975 if (fb->info->fix.visual == FB_VISUAL_DIRECTCOLOR) { in stifb_setcolreg()
976 struct fb_var_screeninfo *var = &fb->info->var; in stifb_setcolreg()
978 ((u32 *)fb->info->pseudo_palette)[regno] = in stifb_setcolreg()
984 WRITE_IMAGE_COLOR(fb, regno, color); in stifb_setcolreg()
986 if (fb->id == S9000_ID_HCRX) { in stifb_setcolreg()
989 lutBltCtl = setHyperLutBltCtl(fb, in stifb_setcolreg()
992 NGLE_BINC_SET_SRCADDR(fb, in stifb_setcolreg()
995 START_COLORMAPLOAD(fb, lutBltCtl.all); in stifb_setcolreg()
996 SETUP_FB(fb); in stifb_setcolreg()
999 FINISH_IMAGE_COLORMAP_ACCESS(fb); in stifb_setcolreg()
1010 struct stifb_info *fb = info->par; in stifb_blank() local
1013 switch (fb->id) { in stifb_blank()
1015 CRX24_ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1019 ARTIST_ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1022 HYPER_ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1028 ENABLE_DISABLE_DISPLAY(fb, enable); in stifb_blank()
1032 SETUP_FB(fb); in stifb_blank()
1039 struct stifb_info *fb = info->par; in stifb_copyarea() local
1041 SETUP_COPYAREA(fb); in stifb_copyarea()
1043 SETUP_HW(fb); in stifb_copyarea()
1044 if (fb->info->var.bits_per_pixel == 32) { in stifb_copyarea()
1045 WRITE_WORD(0xBBA0A000, fb, REG_10); in stifb_copyarea()
1047 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xffffffff); in stifb_copyarea()
1049 WRITE_WORD(fb->id == S9000_ID_HCRX ? 0x13a02000 : 0x13a01000, fb, REG_10); in stifb_copyarea()
1051 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xff); in stifb_copyarea()
1054 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, in stifb_copyarea()
1059 WRITE_WORD(((area->sx << 16) | area->sy), fb, REG_24); in stifb_copyarea()
1060 WRITE_WORD(((area->width << 16) | area->height), fb, REG_7); in stifb_copyarea()
1061 WRITE_WORD(((area->dx << 16) | area->dy), fb, REG_25); in stifb_copyarea()
1063 SETUP_FB(fb); in stifb_copyarea()
1078 struct stifb_info *fb = info->par; in stifb_fillrect() local
1081 (fb->id == S9000_ID_HCRX && fb->info->var.bits_per_pixel == 32)) in stifb_fillrect()
1084 SETUP_HW(fb); in stifb_fillrect()
1086 if (fb->info->var.bits_per_pixel == 32) { in stifb_fillrect()
1087 WRITE_WORD(0xBBA0A000, fb, REG_10); in stifb_fillrect()
1089 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xffffffff); in stifb_fillrect()
1091 WRITE_WORD(fb->id == S9000_ID_HCRX ? 0x13a02000 : 0x13a01000, fb, REG_10); in stifb_fillrect()
1093 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xff); in stifb_fillrect()
1096 WRITE_WORD(0x03000300, fb, ARTIST_BITMAP_OP); in stifb_fillrect()
1097 WRITE_WORD(0x2ea01000, fb, ARTIST_SRC_BM_ACCESS); in stifb_fillrect()
1098 NGLE_QUICK_SET_DST_BM_ACCESS(fb, 0x2ea01000); in stifb_fillrect()
1099 NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, rect->color); in stifb_fillrect()
1100 WRITE_WORD(0, fb, ARTIST_BGCOLOR); in stifb_fillrect()
1102 NGLE_SET_DSTXY(fb, (rect->dx << 16) | (rect->dy)); in stifb_fillrect()
1103 SET_LENXY_START_RECFILL(fb, (rect->width << 16) | (rect->height)); in stifb_fillrect()
1105 SETUP_FB(fb); in stifb_fillrect()
1109 stifb_init_display(struct stifb_info *fb) in stifb_init_display() argument
1111 int id = fb->id; in stifb_init_display()
1113 SETUP_FB(fb); in stifb_init_display()
1116 SETUP_HCRX(fb); in stifb_init_display()
1120 hyperInitSprite(fb); in stifb_init_display()
1122 ngleInitSprite(fb); in stifb_init_display()
1128 hyperResetPlanes(fb, ENABLE); in stifb_init_display()
1131 rattlerSetupPlanes(fb); in stifb_init_display()
1136 elkSetupPlanes(fb); in stifb_init_display()
1144 if (fb->info->var.bits_per_pixel == 32) in stifb_init_display()
1145 ngleSetupAttrPlanes(fb, BUFF1_CMAP3); in stifb_init_display()
1147 ngleSetupAttrPlanes(fb, BUFF1_CMAP0); in stifb_init_display()
1150 ngleClearOverlayPlanes(fb, 0xff, 0); in stifb_init_display()
1154 if (fb->info->var.bits_per_pixel == 32) in stifb_init_display()
1155 ngleSetupAttrPlanes(fb, BUFF1_CMAP3); in stifb_init_display()
1157 ngleSetupAttrPlanes(fb, ARTIST_CMAP0); in stifb_init_display()
1161 stifb_blank(0, fb->info); /* 0=enable screen */ in stifb_init_display()
1163 SETUP_FB(fb); in stifb_init_display()
1189 struct stifb_info *fb; in stifb_init_fb() local
1196 info = framebuffer_alloc(sizeof(*fb), sti->dev); in stifb_init_fb()
1199 fb = info->par; in stifb_init_fb()
1200 fb->info = info; in stifb_init_fb()
1206 fb->sti = sti; in stifb_init_fb()
1209 fb->id = fb->sti->graphics_id[0]; in stifb_init_fb()
1212 switch (fb->id) { in stifb_init_fb()
1237 dev_name, fb->id); in stifb_init_fb()
1243 xres = sti_onscreen_x(fb->sti); in stifb_init_fb()
1244 yres = sti_onscreen_y(fb->sti); in stifb_init_fb()
1246 ngleGetDeviceRomData(fb); in stifb_init_fb()
1249 fix->mmio_start = REGION_BASE(fb,2); in stifb_init_fb()
1253 switch (fb->id) { in stifb_init_fb()
1258 fb->id = S9000_ID_A1659A; in stifb_init_fb()
1268 * fb.iobase = REGION_BASE(fb_info,3); in stifb_init_fb()
1269 * fb.screen_base = ioremap(REGION_BASE(fb_info,2),xxx); in stifb_init_fb()
1271 xres = fb->ngle_rom.x_size_visible; in stifb_init_fb()
1272 yres = fb->ngle_rom.y_size_visible; in stifb_init_fb()
1273 fb->id = S9000_ID_A1659A; in stifb_init_fb()
1279 memset(&fb->ngle_rom, 0, sizeof(fb->ngle_rom)); in stifb_init_fb()
1280 if ((fb->sti->regions_phys[0] & 0xfc000000) == in stifb_init_fb()
1281 (fb->sti->regions_phys[2] & 0xfc000000)) in stifb_init_fb()
1282 sti_rom_address = F_EXTEND(fb->sti->regions_phys[0]); in stifb_init_fb()
1284 sti_rom_address = F_EXTEND(fb->sti->regions_phys[1]); in stifb_init_fb()
1286 fb->deviceSpecificConfig = gsc_readl(sti_rom_address); in stifb_init_fb()
1287 if (IS_24_DEVICE(fb)) { in stifb_init_fb()
1294 READ_WORD(fb, REG_15); in stifb_init_fb()
1295 SETUP_HW(fb); in stifb_init_fb()
1305 fb->id); in stifb_init_fb()
1312 fb->id); in stifb_init_fb()
1319 fix->smem_start = F_EXTEND(fb->sti->regions_phys[1]); in stifb_init_fb()
1320 fix->smem_len = fb->sti->regions[1].region_desc.length * 4096; in stifb_init_fb()
1322 fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8; in stifb_init_fb()
1362 info->screen_base = ioremap(REGION_BASE(fb,1), fix->smem_len); in stifb_init_fb()
1369 info->pseudo_palette = &fb->pseudo_palette; in stifb_init_fb()
1377 stifb_init_display(fb); in stifb_init_fb()
1379 if (!request_mem_region(fix->smem_start, fix->smem_len, "stifb fb")) { in stifb_init_fb()
1380 printk(KERN_ERR "stifb: cannot reserve fb region 0x%04lx-0x%04lx\n", in stifb_init_fb()
1392 if (register_framebuffer(fb->info) < 0) in stifb_init_fb()
1395 fb_info(fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n", in stifb_init_fb()
1401 fb->id, in stifb_init_fb()