62 static const int NVCopyROP[16] = {
67 static const int NVCopyROP_PM[16] = {
72 static inline void nvidiafb_safe_mode(
struct fb_info *
info)
77 info->
pixmap.scan_align = 1;
84 int count = 1000000000;
89 printk(
"nvidiafb: DMA Flush lockup\n");
90 nvidiafb_safe_mode(info);
94 static inline void NVSync(
struct fb_info *info)
97 int count = 1000000000;
102 printk(
"nvidiafb: DMA Sync lockup\n");
103 nvidiafb_safe_mode(info);
107 static void NVDmaKickoff(
struct nvidia_par *par)
115 static void NVDmaWait(
struct fb_info *info,
int size)
119 int count = 1000000000,
cnt;
125 if (par->
dmaPut >= dmaGet) {
129 if (dmaGet <=
SKIPS) {
137 printk(
"DMA Get lockup\n");
150 printk(
"nvidiafb: DMA Wait Lockup\n");
151 nvidiafb_safe_mode(info);
155 static void NVSetPattern(
struct fb_info *info,
u32 clr0,
u32 clr1,
167 static void NVSetRopSolid(
struct fb_info *info,
u32 rop,
u32 planemask)
171 if (planemask != ~0) {
172 NVSetPattern(info, 0, planemask, ~0, ~0);
180 NVSetPattern(info, ~0, ~0, ~0, ~0);
187 static void NVSetClippingRectangle(
struct fb_info *info,
int x1,
int y1,
202 u32 surfaceFormat, patternFormat, rectFormat, lineFormat;
205 pitch = info->
fix.line_length;
209 for (i = 0; i <
SKIPS; i++)
234 switch (info->
var.bits_per_pixel) {
274 NVSetClippingRectangle(info, 0, 0, info->
var.xres_virtual,
275 info->
var.yres_virtual);
329 if (info->
var.bits_per_pixel == 8)
335 NVSetRopSolid(info, rect->
rop, ~0);
350 static void nvidiafb_mono_color_expand(
struct fb_info *info,
354 u32 fg,
bg,
mask = ~(~0 >> (32 - info->
var.bits_per_pixel));
358 width = (image->
width + 31) & ~31;
359 dsize = (width * image->
height) >> 5;
361 if (info->
var.bits_per_pixel == 8) {
372 ((image->
dx + image->
width) & 0xffff));
395 for (j = dsize; j--;) {
413 nvidiafb_mono_color_expand(info, image);