Lines Matching +full:0 +full:x00280000
15 * 0.4.0 (neo)
27 * 0.3.0 (dok)
32 * 0.2.0 (dok)
63 #define SAVAGEFB_VERSION "0.4.0_2.6"
84 VGAwSEQ(0x00, 0x01, par); /* Synchronous Reset */ in vgaHWSeqReset()
86 VGAwSEQ(0x00, 0x03, par); /* End Reset */ in vgaHWSeqReset()
97 tmp = VGArSEQ(0x01, par); in vgaHWProtect()
100 VGAwSEQ(0x01, tmp | 0x20, par);/* disable the display */ in vgaHWProtect()
108 tmp = VGArSEQ(0x01, par); in vgaHWProtect()
110 VGAwSEQ(0x01, tmp & ~0x20, par);/* reenable display */ in vgaHWProtect()
111 vgaHWSeqReset(par, 0); /* clear synchronous reset */ in vgaHWProtect()
126 /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 or in vgaHWRestore()
128 VGAwCR(17, reg->CRTC[17] & ~0x80, par); in vgaHWRestore()
130 for (i = 0; i < 25; i++) in vgaHWRestore()
133 for (i = 0; i < 9; i++) in vgaHWRestore()
138 for (i = 0; i < 21; i++) in vgaHWRestore()
149 reg->MiscOutReg = 0x23; in vgaHWInit()
152 reg->MiscOutReg |= 0x40; in vgaHWInit()
155 reg->MiscOutReg |= 0x80; in vgaHWInit()
160 reg->Sequencer[0x00] = 0x00; in vgaHWInit()
161 reg->Sequencer[0x01] = 0x01; in vgaHWInit()
162 reg->Sequencer[0x02] = 0x0F; in vgaHWInit()
163 reg->Sequencer[0x03] = 0x00; /* Font select */ in vgaHWInit()
164 reg->Sequencer[0x04] = 0x0E; /* Misc */ in vgaHWInit()
169 reg->CRTC[0x00] = (timings->HTotal >> 3) - 5; in vgaHWInit()
170 reg->CRTC[0x01] = (timings->HDisplay >> 3) - 1; in vgaHWInit()
171 reg->CRTC[0x02] = (timings->HSyncStart >> 3) - 1; in vgaHWInit()
172 reg->CRTC[0x03] = (((timings->HSyncEnd >> 3) - 1) & 0x1f) | 0x80; in vgaHWInit()
173 reg->CRTC[0x04] = (timings->HSyncStart >> 3); in vgaHWInit()
174 reg->CRTC[0x05] = ((((timings->HSyncEnd >> 3) - 1) & 0x20) << 2) | in vgaHWInit()
175 (((timings->HSyncEnd >> 3)) & 0x1f); in vgaHWInit()
176 reg->CRTC[0x06] = (timings->VTotal - 2) & 0xFF; in vgaHWInit()
177 reg->CRTC[0x07] = (((timings->VTotal - 2) & 0x100) >> 8) | in vgaHWInit()
178 (((timings->VDisplay - 1) & 0x100) >> 7) | in vgaHWInit()
179 ((timings->VSyncStart & 0x100) >> 6) | in vgaHWInit()
180 (((timings->VSyncStart - 1) & 0x100) >> 5) | in vgaHWInit()
181 0x10 | in vgaHWInit()
182 (((timings->VTotal - 2) & 0x200) >> 4) | in vgaHWInit()
183 (((timings->VDisplay - 1) & 0x200) >> 3) | in vgaHWInit()
184 ((timings->VSyncStart & 0x200) >> 2); in vgaHWInit()
185 reg->CRTC[0x08] = 0x00; in vgaHWInit()
186 reg->CRTC[0x09] = (((timings->VSyncStart - 1) & 0x200) >> 4) | 0x40; in vgaHWInit()
189 reg->CRTC[0x09] |= 0x80; in vgaHWInit()
191 reg->CRTC[0x0a] = 0x00; in vgaHWInit()
192 reg->CRTC[0x0b] = 0x00; in vgaHWInit()
193 reg->CRTC[0x0c] = 0x00; in vgaHWInit()
194 reg->CRTC[0x0d] = 0x00; in vgaHWInit()
195 reg->CRTC[0x0e] = 0x00; in vgaHWInit()
196 reg->CRTC[0x0f] = 0x00; in vgaHWInit()
197 reg->CRTC[0x10] = timings->VSyncStart & 0xff; in vgaHWInit()
198 reg->CRTC[0x11] = (timings->VSyncEnd & 0x0f) | 0x20; in vgaHWInit()
199 reg->CRTC[0x12] = (timings->VDisplay - 1) & 0xff; in vgaHWInit()
200 reg->CRTC[0x13] = var->xres_virtual >> 4; in vgaHWInit()
201 reg->CRTC[0x14] = 0x00; in vgaHWInit()
202 reg->CRTC[0x15] = (timings->VSyncStart - 1) & 0xff; in vgaHWInit()
203 reg->CRTC[0x16] = (timings->VSyncEnd - 1) & 0xff; in vgaHWInit()
204 reg->CRTC[0x17] = 0xc3; in vgaHWInit()
205 reg->CRTC[0x18] = 0xff; in vgaHWInit()
209 * vgaHWHBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN|KGA_ENABLE_ON_ZERO); in vgaHWInit()
210 * vgaHWVBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN|KGA_ENABLE_ON_ZERO); in vgaHWInit()
216 reg->Graphics[0x00] = 0x00; in vgaHWInit()
217 reg->Graphics[0x01] = 0x00; in vgaHWInit()
218 reg->Graphics[0x02] = 0x00; in vgaHWInit()
219 reg->Graphics[0x03] = 0x00; in vgaHWInit()
220 reg->Graphics[0x04] = 0x00; in vgaHWInit()
221 reg->Graphics[0x05] = 0x40; in vgaHWInit()
222 reg->Graphics[0x06] = 0x05; /* only map 64k VGA memory !!!! */ in vgaHWInit()
223 reg->Graphics[0x07] = 0x0F; in vgaHWInit()
224 reg->Graphics[0x08] = 0xFF; in vgaHWInit()
227 reg->Attribute[0x00] = 0x00; /* standard colormap translation */ in vgaHWInit()
228 reg->Attribute[0x01] = 0x01; in vgaHWInit()
229 reg->Attribute[0x02] = 0x02; in vgaHWInit()
230 reg->Attribute[0x03] = 0x03; in vgaHWInit()
231 reg->Attribute[0x04] = 0x04; in vgaHWInit()
232 reg->Attribute[0x05] = 0x05; in vgaHWInit()
233 reg->Attribute[0x06] = 0x06; in vgaHWInit()
234 reg->Attribute[0x07] = 0x07; in vgaHWInit()
235 reg->Attribute[0x08] = 0x08; in vgaHWInit()
236 reg->Attribute[0x09] = 0x09; in vgaHWInit()
237 reg->Attribute[0x0a] = 0x0A; in vgaHWInit()
238 reg->Attribute[0x0b] = 0x0B; in vgaHWInit()
239 reg->Attribute[0x0c] = 0x0C; in vgaHWInit()
240 reg->Attribute[0x0d] = 0x0D; in vgaHWInit()
241 reg->Attribute[0x0e] = 0x0E; in vgaHWInit()
242 reg->Attribute[0x0f] = 0x0F; in vgaHWInit()
243 reg->Attribute[0x10] = 0x41; in vgaHWInit()
244 reg->Attribute[0x11] = 0xFF; in vgaHWInit()
245 reg->Attribute[0x12] = 0x0F; in vgaHWInit()
246 reg->Attribute[0x13] = 0x00; in vgaHWInit()
247 reg->Attribute[0x14] = 0x00; in vgaHWInit()
262 while ((savage_in32(0x48C00, par) & 0x0000ffff) > slots); in savage3D_waitfifo()
270 while ((savage_in32(0x48C60, par) & 0x001fffff) > slots); in savage4_waitfifo()
278 while ((savage_in32(0x48C60, par) & 0x0000ffff) > slots); in savage2000_waitfifo()
285 while ((savage_in32(0x48C00, par) & 0x0008ffff) != 0x80000); in savage3D_waitidle()
291 while ((savage_in32(0x48C60, par) & 0x00a00000) != 0x00a00000); in savage4_waitidle()
297 while ((savage_in32(0x48C60, par) & 0x009fffff)); in savage2000_waitidle()
314 savage_out32(0x48C18, savage_in32(0x48C18, par) & 0x3FF0, par); in SavageSetup2DEngine()
316 savage_out32(0x48C14, in SavageSetup2DEngine()
320 savage_out32(0x48C10, 0x78207220, par); in SavageSetup2DEngine()
321 savage_out32(0x48C0C, 0, par); in SavageSetup2DEngine()
323 savage_out32(0x48C18, savage_in32(0x48C18, par) | 0x0C, par); in SavageSetup2DEngine()
331 savage_out32(0x48C18, savage_in32(0x48C18, par) & 0x3FF0, par); in SavageSetup2DEngine()
333 savage_out32(0x48C10, 0x00700040, par); in SavageSetup2DEngine()
334 savage_out32(0x48C0C, 0, par); in SavageSetup2DEngine()
336 savage_out32(0x48C18, savage_in32(0x48C18, par) | 0x08, par); in SavageSetup2DEngine()
340 savage_out32(0x48C18, 0, par); in SavageSetup2DEngine()
342 savage_out32(0x48C18, in SavageSetup2DEngine()
346 savage_out32(0x48A30, 0, par); in SavageSetup2DEngine()
348 savage_out32(0x48C18, savage_in32(0x48C18, par) | 0x00280000, in SavageSetup2DEngine()
355 vga_out8(0x3d4, 0x31, par); in SavageSetup2DEngine()
356 vga_out8(0x3d5, 0x0c, par); in SavageSetup2DEngine()
359 vga_out8(0x3d4, 0x50, par); in SavageSetup2DEngine()
360 vga_out8(0x3d5, vga_in8(0x3d5, par) | 0xC1, par); in SavageSetup2DEngine()
363 vga_out8(0x3d4, 0x40, par); in SavageSetup2DEngine()
364 vga_out8(0x3d5, 0x01, par); in SavageSetup2DEngine()
366 savage_out32(MONO_PAT_0, ~0, par); in SavageSetup2DEngine()
367 savage_out32(MONO_PAT_1, ~0, par); in SavageSetup2DEngine()
370 savage_out32(0x8128, ~0, par); /* enable all write planes */ in SavageSetup2DEngine()
371 savage_out32(0x812C, ~0, par); /* enable all read planes */ in SavageSetup2DEngine()
372 savage_out16(0x8134, 0x27, par); in SavageSetup2DEngine()
373 savage_out16(0x8136, 0x07, par); in SavageSetup2DEngine()
376 par->bci_ptr = 0; in SavageSetup2DEngine()
380 BCI_SEND(0); in SavageSetup2DEngine()
389 par->bci_ptr = 0; in SavageSetup2DEngine()
393 BCI_SEND(0); in SavageSetup2DEngine()
404 par->bci_ptr = 0; in savagefb_set_clip()
407 BCI_SEND(BCI_CLIP_TL(0, 0)); in savagefb_set_clip()
408 BCI_SEND(BCI_CLIP_BR(0xfff, 0xfff)); in savagefb_set_clip()
445 if (diff < 0) in SavageCalcClock()
483 if (diff < 0) in common_calc_clock()
502 return 0; in common_calc_clock()
511 int vgaCRIndex = 0x3d4; in SavagePrintRegs()
512 int vgaCRReg = 0x3d5; in SavagePrintRegs()
517 for (i = 0; i < 0x70; i++) { in SavagePrintRegs()
520 vga_out8(0x3c4, i, par); in SavagePrintRegs()
521 printk(KERN_DEBUG " %02x", vga_in8(0x3c5, par)); in SavagePrintRegs()
527 for (i = 0; i < 0xB7; i++) { in SavagePrintRegs()
544 vga_out16(0x3d4, 0x4838, par); in savage_get_default_par()
545 vga_out16(0x3d4, 0xa039, par); in savage_get_default_par()
546 vga_out16(0x3c4, 0x0608, par); in savage_get_default_par()
548 vga_out8(0x3d4, 0x66, par); in savage_get_default_par()
549 cr66 = vga_in8(0x3d5, par); in savage_get_default_par()
550 vga_out8(0x3d5, cr66 | 0x80, par); in savage_get_default_par()
551 vga_out8(0x3d4, 0x3a, par); in savage_get_default_par()
552 cr3a = vga_in8(0x3d5, par); in savage_get_default_par()
553 vga_out8(0x3d5, cr3a | 0x80, par); in savage_get_default_par()
554 vga_out8(0x3d4, 0x53, par); in savage_get_default_par()
555 cr53 = vga_in8(0x3d5, par); in savage_get_default_par()
556 vga_out8(0x3d5, cr53 & 0x7f, par); in savage_get_default_par()
558 vga_out8(0x3d4, 0x66, par); in savage_get_default_par()
559 vga_out8(0x3d5, cr66, par); in savage_get_default_par()
560 vga_out8(0x3d4, 0x3a, par); in savage_get_default_par()
561 vga_out8(0x3d5, cr3a, par); in savage_get_default_par()
563 vga_out8(0x3d4, 0x66, par); in savage_get_default_par()
564 vga_out8(0x3d5, cr66, par); in savage_get_default_par()
565 vga_out8(0x3d4, 0x3a, par); in savage_get_default_par()
566 vga_out8(0x3d5, cr3a, par); in savage_get_default_par()
569 vga_out8(0x3c4, 0x08, par); in savage_get_default_par()
570 reg->SR08 = vga_in8(0x3c5, par); in savage_get_default_par()
571 vga_out8(0x3c5, 0x06, par); in savage_get_default_par()
574 vga_out8(0x3d4, 0x31, par); in savage_get_default_par()
575 reg->CR31 = vga_in8(0x3d5, par); in savage_get_default_par()
576 vga_out8(0x3d4, 0x32, par); in savage_get_default_par()
577 reg->CR32 = vga_in8(0x3d5, par); in savage_get_default_par()
578 vga_out8(0x3d4, 0x34, par); in savage_get_default_par()
579 reg->CR34 = vga_in8(0x3d5, par); in savage_get_default_par()
580 vga_out8(0x3d4, 0x36, par); in savage_get_default_par()
581 reg->CR36 = vga_in8(0x3d5, par); in savage_get_default_par()
582 vga_out8(0x3d4, 0x3a, par); in savage_get_default_par()
583 reg->CR3A = vga_in8(0x3d5, par); in savage_get_default_par()
584 vga_out8(0x3d4, 0x40, par); in savage_get_default_par()
585 reg->CR40 = vga_in8(0x3d5, par); in savage_get_default_par()
586 vga_out8(0x3d4, 0x42, par); in savage_get_default_par()
587 reg->CR42 = vga_in8(0x3d5, par); in savage_get_default_par()
588 vga_out8(0x3d4, 0x45, par); in savage_get_default_par()
589 reg->CR45 = vga_in8(0x3d5, par); in savage_get_default_par()
590 vga_out8(0x3d4, 0x50, par); in savage_get_default_par()
591 reg->CR50 = vga_in8(0x3d5, par); in savage_get_default_par()
592 vga_out8(0x3d4, 0x51, par); in savage_get_default_par()
593 reg->CR51 = vga_in8(0x3d5, par); in savage_get_default_par()
594 vga_out8(0x3d4, 0x53, par); in savage_get_default_par()
595 reg->CR53 = vga_in8(0x3d5, par); in savage_get_default_par()
596 vga_out8(0x3d4, 0x58, par); in savage_get_default_par()
597 reg->CR58 = vga_in8(0x3d5, par); in savage_get_default_par()
598 vga_out8(0x3d4, 0x60, par); in savage_get_default_par()
599 reg->CR60 = vga_in8(0x3d5, par); in savage_get_default_par()
600 vga_out8(0x3d4, 0x66, par); in savage_get_default_par()
601 reg->CR66 = vga_in8(0x3d5, par); in savage_get_default_par()
602 vga_out8(0x3d4, 0x67, par); in savage_get_default_par()
603 reg->CR67 = vga_in8(0x3d5, par); in savage_get_default_par()
604 vga_out8(0x3d4, 0x68, par); in savage_get_default_par()
605 reg->CR68 = vga_in8(0x3d5, par); in savage_get_default_par()
606 vga_out8(0x3d4, 0x69, par); in savage_get_default_par()
607 reg->CR69 = vga_in8(0x3d5, par); in savage_get_default_par()
608 vga_out8(0x3d4, 0x6f, par); in savage_get_default_par()
609 reg->CR6F = vga_in8(0x3d5, par); in savage_get_default_par()
611 vga_out8(0x3d4, 0x33, par); in savage_get_default_par()
612 reg->CR33 = vga_in8(0x3d5, par); in savage_get_default_par()
613 vga_out8(0x3d4, 0x86, par); in savage_get_default_par()
614 reg->CR86 = vga_in8(0x3d5, par); in savage_get_default_par()
615 vga_out8(0x3d4, 0x88, par); in savage_get_default_par()
616 reg->CR88 = vga_in8(0x3d5, par); in savage_get_default_par()
617 vga_out8(0x3d4, 0x90, par); in savage_get_default_par()
618 reg->CR90 = vga_in8(0x3d5, par); in savage_get_default_par()
619 vga_out8(0x3d4, 0x91, par); in savage_get_default_par()
620 reg->CR91 = vga_in8(0x3d5, par); in savage_get_default_par()
621 vga_out8(0x3d4, 0xb0, par); in savage_get_default_par()
622 reg->CRB0 = vga_in8(0x3d5, par) | 0x80; in savage_get_default_par()
625 vga_out8(0x3d4, 0x3b, par); in savage_get_default_par()
626 reg->CR3B = vga_in8(0x3d5, par); in savage_get_default_par()
627 vga_out8(0x3d4, 0x3c, par); in savage_get_default_par()
628 reg->CR3C = vga_in8(0x3d5, par); in savage_get_default_par()
629 vga_out8(0x3d4, 0x43, par); in savage_get_default_par()
630 reg->CR43 = vga_in8(0x3d5, par); in savage_get_default_par()
631 vga_out8(0x3d4, 0x5d, par); in savage_get_default_par()
632 reg->CR5D = vga_in8(0x3d5, par); in savage_get_default_par()
633 vga_out8(0x3d4, 0x5e, par); in savage_get_default_par()
634 reg->CR5E = vga_in8(0x3d5, par); in savage_get_default_par()
635 vga_out8(0x3d4, 0x65, par); in savage_get_default_par()
636 reg->CR65 = vga_in8(0x3d5, par); in savage_get_default_par()
639 vga_out8(0x3c4, 0x0e, par); in savage_get_default_par()
640 reg->SR0E = vga_in8(0x3c5, par); in savage_get_default_par()
641 vga_out8(0x3c4, 0x0f, par); in savage_get_default_par()
642 reg->SR0F = vga_in8(0x3c5, par); in savage_get_default_par()
643 vga_out8(0x3c4, 0x10, par); in savage_get_default_par()
644 reg->SR10 = vga_in8(0x3c5, par); in savage_get_default_par()
645 vga_out8(0x3c4, 0x11, par); in savage_get_default_par()
646 reg->SR11 = vga_in8(0x3c5, par); in savage_get_default_par()
647 vga_out8(0x3c4, 0x12, par); in savage_get_default_par()
648 reg->SR12 = vga_in8(0x3c5, par); in savage_get_default_par()
649 vga_out8(0x3c4, 0x13, par); in savage_get_default_par()
650 reg->SR13 = vga_in8(0x3c5, par); in savage_get_default_par()
651 vga_out8(0x3c4, 0x29, par); in savage_get_default_par()
652 reg->SR29 = vga_in8(0x3c5, par); in savage_get_default_par()
654 vga_out8(0x3c4, 0x15, par); in savage_get_default_par()
655 reg->SR15 = vga_in8(0x3c5, par); in savage_get_default_par()
656 vga_out8(0x3c4, 0x30, par); in savage_get_default_par()
657 reg->SR30 = vga_in8(0x3c5, par); in savage_get_default_par()
658 vga_out8(0x3c4, 0x18, par); in savage_get_default_par()
659 reg->SR18 = vga_in8(0x3c5, par); in savage_get_default_par()
665 for (i = 0; i < 8; i++) { in savage_get_default_par()
666 vga_out8(0x3c4, 0x54+i, par); in savage_get_default_par()
667 reg->SR54[i] = vga_in8(0x3c5, par); in savage_get_default_par()
671 vga_out8(0x3d4, 0x66, par); in savage_get_default_par()
672 cr66 = vga_in8(0x3d5, par); in savage_get_default_par()
673 vga_out8(0x3d5, cr66 | 0x80, par); in savage_get_default_par()
674 vga_out8(0x3d4, 0x3a, par); in savage_get_default_par()
675 cr3a = vga_in8(0x3d5, par); in savage_get_default_par()
676 vga_out8(0x3d5, cr3a | 0x80, par); in savage_get_default_par()
686 vga_out8(0x3d4, 0x3a, par); in savage_get_default_par()
687 vga_out8(0x3d5, cr3a, par); in savage_get_default_par()
688 vga_out8(0x3d4, 0x66, par); in savage_get_default_par()
689 vga_out8(0x3d5, cr66, par); in savage_get_default_par()
697 vga_out16(0x3d4, 0x4838, par); in savage_set_default_par()
698 vga_out16(0x3d4, 0xa039, par); in savage_set_default_par()
699 vga_out16(0x3c4, 0x0608, par); in savage_set_default_par()
701 vga_out8(0x3d4, 0x66, par); in savage_set_default_par()
702 cr66 = vga_in8(0x3d5, par); in savage_set_default_par()
703 vga_out8(0x3d5, cr66 | 0x80, par); in savage_set_default_par()
704 vga_out8(0x3d4, 0x3a, par); in savage_set_default_par()
705 cr3a = vga_in8(0x3d5, par); in savage_set_default_par()
706 vga_out8(0x3d5, cr3a | 0x80, par); in savage_set_default_par()
707 vga_out8(0x3d4, 0x53, par); in savage_set_default_par()
708 cr53 = vga_in8(0x3d5, par); in savage_set_default_par()
709 vga_out8(0x3d5, cr53 & 0x7f, par); in savage_set_default_par()
711 vga_out8(0x3d4, 0x66, par); in savage_set_default_par()
712 vga_out8(0x3d5, cr66, par); in savage_set_default_par()
713 vga_out8(0x3d4, 0x3a, par); in savage_set_default_par()
714 vga_out8(0x3d5, cr3a, par); in savage_set_default_par()
716 vga_out8(0x3d4, 0x66, par); in savage_set_default_par()
717 vga_out8(0x3d5, cr66, par); in savage_set_default_par()
718 vga_out8(0x3d4, 0x3a, par); in savage_set_default_par()
719 vga_out8(0x3d5, cr3a, par); in savage_set_default_par()
722 vga_out8(0x3c4, 0x08, par); in savage_set_default_par()
723 vga_out8(0x3c5, reg->SR08, par); in savage_set_default_par()
724 vga_out8(0x3c5, 0x06, par); in savage_set_default_par()
727 vga_out8(0x3d4, 0x31, par); in savage_set_default_par()
728 vga_out8(0x3d5, reg->CR31, par); in savage_set_default_par()
729 vga_out8(0x3d4, 0x32, par); in savage_set_default_par()
730 vga_out8(0x3d5, reg->CR32, par); in savage_set_default_par()
731 vga_out8(0x3d4, 0x34, par); in savage_set_default_par()
732 vga_out8(0x3d5, reg->CR34, par); in savage_set_default_par()
733 vga_out8(0x3d4, 0x36, par); in savage_set_default_par()
734 vga_out8(0x3d5,reg->CR36, par); in savage_set_default_par()
735 vga_out8(0x3d4, 0x3a, par); in savage_set_default_par()
736 vga_out8(0x3d5, reg->CR3A, par); in savage_set_default_par()
737 vga_out8(0x3d4, 0x40, par); in savage_set_default_par()
738 vga_out8(0x3d5, reg->CR40, par); in savage_set_default_par()
739 vga_out8(0x3d4, 0x42, par); in savage_set_default_par()
740 vga_out8(0x3d5, reg->CR42, par); in savage_set_default_par()
741 vga_out8(0x3d4, 0x45, par); in savage_set_default_par()
742 vga_out8(0x3d5, reg->CR45, par); in savage_set_default_par()
743 vga_out8(0x3d4, 0x50, par); in savage_set_default_par()
744 vga_out8(0x3d5, reg->CR50, par); in savage_set_default_par()
745 vga_out8(0x3d4, 0x51, par); in savage_set_default_par()
746 vga_out8(0x3d5, reg->CR51, par); in savage_set_default_par()
747 vga_out8(0x3d4, 0x53, par); in savage_set_default_par()
748 vga_out8(0x3d5, reg->CR53, par); in savage_set_default_par()
749 vga_out8(0x3d4, 0x58, par); in savage_set_default_par()
750 vga_out8(0x3d5, reg->CR58, par); in savage_set_default_par()
751 vga_out8(0x3d4, 0x60, par); in savage_set_default_par()
752 vga_out8(0x3d5, reg->CR60, par); in savage_set_default_par()
753 vga_out8(0x3d4, 0x66, par); in savage_set_default_par()
754 vga_out8(0x3d5, reg->CR66, par); in savage_set_default_par()
755 vga_out8(0x3d4, 0x67, par); in savage_set_default_par()
756 vga_out8(0x3d5, reg->CR67, par); in savage_set_default_par()
757 vga_out8(0x3d4, 0x68, par); in savage_set_default_par()
758 vga_out8(0x3d5, reg->CR68, par); in savage_set_default_par()
759 vga_out8(0x3d4, 0x69, par); in savage_set_default_par()
760 vga_out8(0x3d5, reg->CR69, par); in savage_set_default_par()
761 vga_out8(0x3d4, 0x6f, par); in savage_set_default_par()
762 vga_out8(0x3d5, reg->CR6F, par); in savage_set_default_par()
764 vga_out8(0x3d4, 0x33, par); in savage_set_default_par()
765 vga_out8(0x3d5, reg->CR33, par); in savage_set_default_par()
766 vga_out8(0x3d4, 0x86, par); in savage_set_default_par()
767 vga_out8(0x3d5, reg->CR86, par); in savage_set_default_par()
768 vga_out8(0x3d4, 0x88, par); in savage_set_default_par()
769 vga_out8(0x3d5, reg->CR88, par); in savage_set_default_par()
770 vga_out8(0x3d4, 0x90, par); in savage_set_default_par()
771 vga_out8(0x3d5, reg->CR90, par); in savage_set_default_par()
772 vga_out8(0x3d4, 0x91, par); in savage_set_default_par()
773 vga_out8(0x3d5, reg->CR91, par); in savage_set_default_par()
774 vga_out8(0x3d4, 0xb0, par); in savage_set_default_par()
775 vga_out8(0x3d5, reg->CRB0, par); in savage_set_default_par()
778 vga_out8(0x3d4, 0x3b, par); in savage_set_default_par()
779 vga_out8(0x3d5, reg->CR3B, par); in savage_set_default_par()
780 vga_out8(0x3d4, 0x3c, par); in savage_set_default_par()
781 vga_out8(0x3d5, reg->CR3C, par); in savage_set_default_par()
782 vga_out8(0x3d4, 0x43, par); in savage_set_default_par()
783 vga_out8(0x3d5, reg->CR43, par); in savage_set_default_par()
784 vga_out8(0x3d4, 0x5d, par); in savage_set_default_par()
785 vga_out8(0x3d5, reg->CR5D, par); in savage_set_default_par()
786 vga_out8(0x3d4, 0x5e, par); in savage_set_default_par()
787 vga_out8(0x3d5, reg->CR5E, par); in savage_set_default_par()
788 vga_out8(0x3d4, 0x65, par); in savage_set_default_par()
789 vga_out8(0x3d5, reg->CR65, par); in savage_set_default_par()
792 vga_out8(0x3c4, 0x0e, par); in savage_set_default_par()
793 vga_out8(0x3c5, reg->SR0E, par); in savage_set_default_par()
794 vga_out8(0x3c4, 0x0f, par); in savage_set_default_par()
795 vga_out8(0x3c5, reg->SR0F, par); in savage_set_default_par()
796 vga_out8(0x3c4, 0x10, par); in savage_set_default_par()
797 vga_out8(0x3c5, reg->SR10, par); in savage_set_default_par()
798 vga_out8(0x3c4, 0x11, par); in savage_set_default_par()
799 vga_out8(0x3c5, reg->SR11, par); in savage_set_default_par()
800 vga_out8(0x3c4, 0x12, par); in savage_set_default_par()
801 vga_out8(0x3c5, reg->SR12, par); in savage_set_default_par()
802 vga_out8(0x3c4, 0x13, par); in savage_set_default_par()
803 vga_out8(0x3c5, reg->SR13, par); in savage_set_default_par()
804 vga_out8(0x3c4, 0x29, par); in savage_set_default_par()
805 vga_out8(0x3c5, reg->SR29, par); in savage_set_default_par()
807 vga_out8(0x3c4, 0x15, par); in savage_set_default_par()
808 vga_out8(0x3c5, reg->SR15, par); in savage_set_default_par()
809 vga_out8(0x3c4, 0x30, par); in savage_set_default_par()
810 vga_out8(0x3c5, reg->SR30, par); in savage_set_default_par()
811 vga_out8(0x3c4, 0x18, par); in savage_set_default_par()
812 vga_out8(0x3c5, reg->SR18, par); in savage_set_default_par()
818 for (i = 0; i < 8; i++) { in savage_set_default_par()
819 vga_out8(0x3c4, 0x54+i, par); in savage_set_default_par()
820 vga_out8(0x3c5, reg->SR54[i], par); in savage_set_default_par()
824 vga_out8(0x3d4, 0x66, par); in savage_set_default_par()
825 cr66 = vga_in8(0x3d5, par); in savage_set_default_par()
826 vga_out8(0x3d5, cr66 | 0x80, par); in savage_set_default_par()
827 vga_out8(0x3d4, 0x3a, par); in savage_set_default_par()
828 cr3a = vga_in8(0x3d5, par); in savage_set_default_par()
829 vga_out8(0x3d5, cr3a | 0x80, par); in savage_set_default_par()
839 vga_out8(0x3d4, 0x3a, par); in savage_set_default_par()
840 vga_out8(0x3d5, cr3a, par); in savage_set_default_par()
841 vga_out8(0x3d4, 0x66, par); in savage_set_default_par()
842 vga_out8(0x3d5, cr66, par); in savage_set_default_par()
852 var->xoffset = var->yoffset = 0; in savage_update_var()
868 int memlen, vramlen, mode_valid = 0; in savagefb_check_var()
875 var->transp.offset = 0; in savagefb_check_var()
876 var->transp.length = 0; in savagefb_check_var()
880 var->blue.offset = 0; in savagefb_check_var()
889 var->blue.offset = 0; in savagefb_check_var()
899 var->blue.offset = 0; in savagefb_check_var()
913 if (!fb_get_mode(FB_MAXTIMINGS, 0, var, info)) in savagefb_check_var()
968 return 0; in savagefb_check_var()
979 unsigned char tmp = 0; in savagefb_decode_var()
984 memset(&timings, 0, sizeof(timings)); in savagefb_decode_var()
1021 reg->CR67 = 0x00; in savagefb_decode_var()
1026 reg->CR67 = 0x10; /* 8bpp, 2 pixels/clock */ in savagefb_decode_var()
1028 reg->CR67 = 0x00; /* 8bpp, 1 pixel/clock */ in savagefb_decode_var()
1033 reg->CR67 = 0x30; /* 15bpp, 2 pixel/clock */ in savagefb_decode_var()
1035 reg->CR67 = 0x20; /* 15bpp, 1 pixels/clock */ in savagefb_decode_var()
1040 reg->CR67 = 0x50; /* 16bpp, 2 pixel/clock */ in savagefb_decode_var()
1042 reg->CR67 = 0x40; /* 16bpp, 1 pixels/clock */ in savagefb_decode_var()
1045 reg->CR67 = 0x70; in savagefb_decode_var()
1048 reg->CR67 = 0xd0; in savagefb_decode_var()
1057 vga_out8(0x3d4, 0x3a, par); in savagefb_decode_var()
1058 tmp = vga_in8(0x3d5, par); in savagefb_decode_var()
1060 reg->CR3A = (tmp & 0x7f) | 0x15; in savagefb_decode_var()
1062 reg->CR3A = tmp | 0x95; in savagefb_decode_var()
1064 reg->CR53 = 0x00; in savagefb_decode_var()
1065 reg->CR31 = 0x8c; in savagefb_decode_var()
1066 reg->CR66 = 0x89; in savagefb_decode_var()
1068 vga_out8(0x3d4, 0x58, par); in savagefb_decode_var()
1069 reg->CR58 = vga_in8(0x3d5, par) & 0x80; in savagefb_decode_var()
1070 reg->CR58 |= 0x13; in savagefb_decode_var()
1072 reg->SR15 = 0x03 | 0x80; in savagefb_decode_var()
1073 reg->SR18 = 0x00; in savagefb_decode_var()
1074 reg->CR43 = reg->CR45 = reg->CR65 = 0x00; in savagefb_decode_var()
1076 vga_out8(0x3d4, 0x40, par); in savagefb_decode_var()
1077 reg->CR40 = vga_in8(0x3d5, par) & ~0x01; in savagefb_decode_var()
1079 reg->MMPR0 = 0x010400; in savagefb_decode_var()
1080 reg->MMPR1 = 0x00; in savagefb_decode_var()
1081 reg->MMPR2 = 0x0808; in savagefb_decode_var()
1082 reg->MMPR3 = 0x08080810; in savagefb_decode_var()
1084 SavageCalcClock(dclk, 1, 1, 127, 0, 4, 180000, 360000, &m, &n, &r); in savagefb_decode_var()
1087 if (par->MCLK <= 0) { in savagefb_decode_var()
1091 common_calc_clock(par->MCLK, 1, 1, 31, 0, 3, 135000, 270000, in savagefb_decode_var()
1097 reg->SR12 = (r << 6) | (n & 0x3f); in savagefb_decode_var()
1098 reg->SR13 = m & 0xff; in savagefb_decode_var()
1099 reg->SR29 = (r & 4) | (m & 0x100) >> 5 | (n & 0x40) >> 2; in savagefb_decode_var()
1102 reg->MMPR0 -= 0x8000; in savagefb_decode_var()
1104 reg->MMPR0 -= 0x4000; in savagefb_decode_var()
1107 reg->CR42 = 0x20; in savagefb_decode_var()
1109 reg->CR42 = 0x00; in savagefb_decode_var()
1111 reg->CR34 = 0x10; /* display fifo */ in savagefb_decode_var()
1113 i = ((((timings.HTotal >> 3) - 5) & 0x100) >> 8) | in savagefb_decode_var()
1114 ((((timings.HDisplay >> 3) - 1) & 0x100) >> 7) | in savagefb_decode_var()
1115 ((((timings.HSyncStart >> 3) - 1) & 0x100) >> 6) | in savagefb_decode_var()
1116 ((timings.HSyncStart & 0x800) >> 7); in savagefb_decode_var()
1119 i |= 0x08; in savagefb_decode_var()
1121 i |= 0x20; in savagefb_decode_var()
1123 j = (reg->CRTC[0] + ((i & 0x01) << 8) + in savagefb_decode_var()
1124 reg->CRTC[4] + ((i & 0x10) << 4) + 1) / 2; in savagefb_decode_var()
1126 if (j - (reg->CRTC[4] + ((i & 0x10) << 4)) < 4) { in savagefb_decode_var()
1127 if (reg->CRTC[4] + ((i & 0x10) << 4) + 4 <= in savagefb_decode_var()
1128 reg->CRTC[0] + ((i & 0x01) << 8)) in savagefb_decode_var()
1129 j = reg->CRTC[4] + ((i & 0x10) << 4) + 4; in savagefb_decode_var()
1131 j = reg->CRTC[0] + ((i & 0x01) << 8) + 1; in savagefb_decode_var()
1134 reg->CR3B = j & 0xff; in savagefb_decode_var()
1135 i |= (j & 0x100) >> 2; in savagefb_decode_var()
1136 reg->CR3C = (reg->CRTC[0] + ((i & 0x01) << 8)) / 2; in savagefb_decode_var()
1138 reg->CR5E = (((timings.VTotal - 2) & 0x400) >> 10) | in savagefb_decode_var()
1139 (((timings.VDisplay - 1) & 0x400) >> 9) | in savagefb_decode_var()
1140 (((timings.VSyncStart) & 0x400) >> 8) | in savagefb_decode_var()
1141 (((timings.VSyncStart) & 0x400) >> 6) | 0x40; in savagefb_decode_var()
1143 reg->CR91 = reg->CRTC[19] = 0xff & width; in savagefb_decode_var()
1144 reg->CR51 = (0x300 & width) >> 4; in savagefb_decode_var()
1145 reg->CR90 = 0x80 | (width >> 8); in savagefb_decode_var()
1146 reg->MiscOutReg |= 0x0c; in savagefb_decode_var()
1151 reg->CR50 = 0; in savagefb_decode_var()
1153 reg->CR50 = 0x10; in savagefb_decode_var()
1155 reg->CR50 = 0x30; in savagefb_decode_var()
1158 reg->CR50 |= 0x40; in savagefb_decode_var()
1160 reg->CR50 |= 0x80; in savagefb_decode_var()
1162 reg->CR50 |= 0x00; in savagefb_decode_var()
1164 reg->CR50 |= 0x01; in savagefb_decode_var()
1166 reg->CR50 |= 0xc0; in savagefb_decode_var()
1168 reg->CR50 |= 0x81; in savagefb_decode_var()
1170 reg->CR50 |= 0xc1; /* Use GBD */ in savagefb_decode_var()
1173 reg->CR33 = 0x08; in savagefb_decode_var()
1175 reg->CR33 = 0x20; in savagefb_decode_var()
1177 reg->CRTC[0x17] = 0xeb; in savagefb_decode_var()
1181 vga_out8(0x3d4, 0x36, par); in savagefb_decode_var()
1182 reg->CR36 = vga_in8(0x3d5, par); in savagefb_decode_var()
1183 vga_out8(0x3d4, 0x68, par); in savagefb_decode_var()
1184 reg->CR68 = vga_in8(0x3d5, par); in savagefb_decode_var()
1185 reg->CR69 = 0; in savagefb_decode_var()
1186 vga_out8(0x3d4, 0x6f, par); in savagefb_decode_var()
1187 reg->CR6F = vga_in8(0x3d5, par); in savagefb_decode_var()
1188 vga_out8(0x3d4, 0x86, par); in savagefb_decode_var()
1189 reg->CR86 = vga_in8(0x3d5, par); in savagefb_decode_var()
1190 vga_out8(0x3d4, 0x88, par); in savagefb_decode_var()
1191 reg->CR88 = vga_in8(0x3d5, par) | 0x08; in savagefb_decode_var()
1192 vga_out8(0x3d4, 0xb0, par); in savagefb_decode_var()
1193 reg->CRB0 = vga_in8(0x3d5, par) | 0x80; in savagefb_decode_var()
1195 return 0; in savagefb_decode_var()
1201 * Set a single color register. Return != 0 for invalid regno.
1222 vga_out8(0x3c8, regno, par); in savagefb_setcolreg()
1224 vga_out8(0x3c9, red >> 10, par); in savagefb_setcolreg()
1225 vga_out8(0x3c9, green >> 10, par); in savagefb_setcolreg()
1226 vga_out8(0x3c9, blue >> 10, par); in savagefb_setcolreg()
1232 ((red & 0xf800) ) | in savagefb_setcolreg()
1233 ((green & 0xfc00) >> 5) | in savagefb_setcolreg()
1234 ((blue & 0xf800) >> 11); in savagefb_setcolreg()
1240 ((red & 0xff00) << 8) | in savagefb_setcolreg()
1241 ((green & 0xff00) ) | in savagefb_setcolreg()
1242 ((blue & 0xff00) >> 8); in savagefb_setcolreg()
1247 ((transp & 0xff00) << 16) | in savagefb_setcolreg()
1248 ((red & 0xff00) << 8) | in savagefb_setcolreg()
1249 ((green & 0xff00) ) | in savagefb_setcolreg()
1250 ((blue & 0xff00) >> 8); in savagefb_setcolreg()
1257 return 0; in savagefb_setcolreg()
1268 vga_out8(0x3c2, 0x23, par); in savagefb_set_par_int()
1270 vga_out16(0x3d4, 0x4838, par); in savagefb_set_par_int()
1271 vga_out16(0x3d4, 0xa539, par); in savagefb_set_par_int()
1272 vga_out16(0x3c4, 0x0608, par); in savagefb_set_par_int()
1284 vga_out8(0x3d4, 0x67, par); in savagefb_set_par_int()
1285 cr67 = vga_in8(0x3d5, par); in savagefb_set_par_int()
1286 vga_out8(0x3d5, cr67/*par->CR67*/ & ~0x0c, par); /* no STREAMS yet */ in savagefb_set_par_int()
1288 vga_out8(0x3d4, 0x23, par); in savagefb_set_par_int()
1289 vga_out8(0x3d5, 0x00, par); in savagefb_set_par_int()
1290 vga_out8(0x3d4, 0x26, par); in savagefb_set_par_int()
1291 vga_out8(0x3d5, 0x00, par); in savagefb_set_par_int()
1294 vga_out8(0x3d4, 0x66, par); in savagefb_set_par_int()
1295 vga_out8(0x3d5, reg->CR66, par); in savagefb_set_par_int()
1296 vga_out8(0x3d4, 0x3a, par); in savagefb_set_par_int()
1297 vga_out8(0x3d5, reg->CR3A, par); in savagefb_set_par_int()
1298 vga_out8(0x3d4, 0x31, par); in savagefb_set_par_int()
1299 vga_out8(0x3d5, reg->CR31, par); in savagefb_set_par_int()
1300 vga_out8(0x3d4, 0x32, par); in savagefb_set_par_int()
1301 vga_out8(0x3d5, reg->CR32, par); in savagefb_set_par_int()
1302 vga_out8(0x3d4, 0x58, par); in savagefb_set_par_int()
1303 vga_out8(0x3d5, reg->CR58, par); in savagefb_set_par_int()
1304 vga_out8(0x3d4, 0x53, par); in savagefb_set_par_int()
1305 vga_out8(0x3d5, reg->CR53 & 0x7f, par); in savagefb_set_par_int()
1307 vga_out16(0x3c4, 0x0608, par); in savagefb_set_par_int()
1311 vga_out8(0x3c4, 0x0e, par); in savagefb_set_par_int()
1312 vga_out8(0x3c5, reg->SR0E, par); in savagefb_set_par_int()
1313 vga_out8(0x3c4, 0x0f, par); in savagefb_set_par_int()
1314 vga_out8(0x3c5, reg->SR0F, par); in savagefb_set_par_int()
1315 vga_out8(0x3c4, 0x29, par); in savagefb_set_par_int()
1316 vga_out8(0x3c5, reg->SR29, par); in savagefb_set_par_int()
1317 vga_out8(0x3c4, 0x15, par); in savagefb_set_par_int()
1318 vga_out8(0x3c5, reg->SR15, par); in savagefb_set_par_int()
1324 for (i = 0; i < 8; i++) { in savagefb_set_par_int()
1325 vga_out8(0x3c4, 0x54+i, par); in savagefb_set_par_int()
1326 vga_out8(0x3c5, reg->SR54[i], par); in savagefb_set_par_int()
1333 vga_out8(0x3d4, 0x53, par); in savagefb_set_par_int()
1334 vga_out8(0x3d5, reg->CR53, par); in savagefb_set_par_int()
1335 vga_out8(0x3d4, 0x5d, par); in savagefb_set_par_int()
1336 vga_out8(0x3d5, reg->CR5D, par); in savagefb_set_par_int()
1337 vga_out8(0x3d4, 0x5e, par); in savagefb_set_par_int()
1338 vga_out8(0x3d5, reg->CR5E, par); in savagefb_set_par_int()
1339 vga_out8(0x3d4, 0x3b, par); in savagefb_set_par_int()
1340 vga_out8(0x3d5, reg->CR3B, par); in savagefb_set_par_int()
1341 vga_out8(0x3d4, 0x3c, par); in savagefb_set_par_int()
1342 vga_out8(0x3d5, reg->CR3C, par); in savagefb_set_par_int()
1343 vga_out8(0x3d4, 0x43, par); in savagefb_set_par_int()
1344 vga_out8(0x3d5, reg->CR43, par); in savagefb_set_par_int()
1345 vga_out8(0x3d4, 0x65, par); in savagefb_set_par_int()
1346 vga_out8(0x3d5, reg->CR65, par); in savagefb_set_par_int()
1349 vga_out8(0x3d4, 0x67, par); in savagefb_set_par_int()
1351 cr67 = vga_in8(0x3d5, par) & 0xf; in savagefb_set_par_int()
1352 vga_out8(0x3d5, 0x50 | cr67, par); in savagefb_set_par_int()
1354 vga_out8(0x3d4, 0x67, par); in savagefb_set_par_int()
1356 vga_out8(0x3d5, reg->CR67 & ~0x0c, par); in savagefb_set_par_int()
1359 vga_out8(0x3d4, 0x34, par); in savagefb_set_par_int()
1360 vga_out8(0x3d5, reg->CR34, par); in savagefb_set_par_int()
1361 vga_out8(0x3d4, 0x40, par); in savagefb_set_par_int()
1362 vga_out8(0x3d5, reg->CR40, par); in savagefb_set_par_int()
1363 vga_out8(0x3d4, 0x42, par); in savagefb_set_par_int()
1364 vga_out8(0x3d5, reg->CR42, par); in savagefb_set_par_int()
1365 vga_out8(0x3d4, 0x45, par); in savagefb_set_par_int()
1366 vga_out8(0x3d5, reg->CR45, par); in savagefb_set_par_int()
1367 vga_out8(0x3d4, 0x50, par); in savagefb_set_par_int()
1368 vga_out8(0x3d5, reg->CR50, par); in savagefb_set_par_int()
1369 vga_out8(0x3d4, 0x51, par); in savagefb_set_par_int()
1370 vga_out8(0x3d5, reg->CR51, par); in savagefb_set_par_int()
1373 vga_out8(0x3d4, 0x36, par); in savagefb_set_par_int()
1374 vga_out8(0x3d5, reg->CR36, par); in savagefb_set_par_int()
1375 vga_out8(0x3d4, 0x60, par); in savagefb_set_par_int()
1376 vga_out8(0x3d5, reg->CR60, par); in savagefb_set_par_int()
1377 vga_out8(0x3d4, 0x68, par); in savagefb_set_par_int()
1378 vga_out8(0x3d5, reg->CR68, par); in savagefb_set_par_int()
1379 vga_out8(0x3d4, 0x69, par); in savagefb_set_par_int()
1380 vga_out8(0x3d5, reg->CR69, par); in savagefb_set_par_int()
1381 vga_out8(0x3d4, 0x6f, par); in savagefb_set_par_int()
1382 vga_out8(0x3d5, reg->CR6F, par); in savagefb_set_par_int()
1384 vga_out8(0x3d4, 0x33, par); in savagefb_set_par_int()
1385 vga_out8(0x3d5, reg->CR33, par); in savagefb_set_par_int()
1386 vga_out8(0x3d4, 0x86, par); in savagefb_set_par_int()
1387 vga_out8(0x3d5, reg->CR86, par); in savagefb_set_par_int()
1388 vga_out8(0x3d4, 0x88, par); in savagefb_set_par_int()
1389 vga_out8(0x3d5, reg->CR88, par); in savagefb_set_par_int()
1390 vga_out8(0x3d4, 0x90, par); in savagefb_set_par_int()
1391 vga_out8(0x3d5, reg->CR90, par); in savagefb_set_par_int()
1392 vga_out8(0x3d4, 0x91, par); in savagefb_set_par_int()
1393 vga_out8(0x3d5, reg->CR91, par); in savagefb_set_par_int()
1396 vga_out8(0x3d4, 0xb0, par); in savagefb_set_par_int()
1397 vga_out8(0x3d5, reg->CRB0, par); in savagefb_set_par_int()
1400 vga_out8(0x3d4, 0x32, par); in savagefb_set_par_int()
1401 vga_out8(0x3d5, reg->CR32, par); in savagefb_set_par_int()
1404 vga_out8(0x3c4, 0x08, par); in savagefb_set_par_int()
1405 vga_out8(0x3c5, 0x06, par); in savagefb_set_par_int()
1411 vga_out8(0x3c4, 0x10, par); in savagefb_set_par_int()
1412 vga_out8(0x3c5, reg->SR10, par); in savagefb_set_par_int()
1413 vga_out8(0x3c4, 0x11, par); in savagefb_set_par_int()
1414 vga_out8(0x3c5, reg->SR11, par); in savagefb_set_par_int()
1418 vga_out8(0x3c4, 0x0e, par); in savagefb_set_par_int()
1419 vga_out8(0x3c5, reg->SR0E, par); in savagefb_set_par_int()
1420 vga_out8(0x3c4, 0x0f, par); in savagefb_set_par_int()
1421 vga_out8(0x3c5, reg->SR0F, par); in savagefb_set_par_int()
1422 vga_out8(0x3c4, 0x12, par); in savagefb_set_par_int()
1423 vga_out8(0x3c5, reg->SR12, par); in savagefb_set_par_int()
1424 vga_out8(0x3c4, 0x13, par); in savagefb_set_par_int()
1425 vga_out8(0x3c5, reg->SR13, par); in savagefb_set_par_int()
1426 vga_out8(0x3c4, 0x29, par); in savagefb_set_par_int()
1427 vga_out8(0x3c5, reg->SR29, par); in savagefb_set_par_int()
1428 vga_out8(0x3c4, 0x18, par); in savagefb_set_par_int()
1429 vga_out8(0x3c5, reg->SR18, par); in savagefb_set_par_int()
1432 vga_out8(0x3c4, 0x15, par); in savagefb_set_par_int()
1433 tmp = vga_in8(0x3c5, par) & ~0x21; in savagefb_set_par_int()
1435 vga_out8(0x3c5, tmp | 0x03, par); in savagefb_set_par_int()
1436 vga_out8(0x3c5, tmp | 0x23, par); in savagefb_set_par_int()
1437 vga_out8(0x3c5, tmp | 0x03, par); in savagefb_set_par_int()
1438 vga_out8(0x3c5, reg->SR15, par); in savagefb_set_par_int()
1441 vga_out8(0x3c4, 0x30, par); in savagefb_set_par_int()
1442 vga_out8(0x3c5, reg->SR30, par); in savagefb_set_par_int()
1443 vga_out8(0x3c4, 0x08, par); in savagefb_set_par_int()
1444 vga_out8(0x3c5, reg->SR08, par); in savagefb_set_par_int()
1448 vga_out8(0x3d4, 0x67, par); in savagefb_set_par_int()
1449 vga_out8(0x3d5, reg->CR67, par); in savagefb_set_par_int()
1451 vga_out8(0x3d4, 0x66, par); in savagefb_set_par_int()
1452 cr66 = vga_in8(0x3d5, par); in savagefb_set_par_int()
1453 vga_out8(0x3d5, cr66 | 0x80, par); in savagefb_set_par_int()
1454 vga_out8(0x3d4, 0x3a, par); in savagefb_set_par_int()
1455 cr3a = vga_in8(0x3d5, par); in savagefb_set_par_int()
1456 vga_out8(0x3d5, cr3a | 0x80, par); in savagefb_set_par_int()
1469 vga_out8(0x3d4, 0x66, par); in savagefb_set_par_int()
1470 vga_out8(0x3d5, cr66, par); in savagefb_set_par_int()
1471 vga_out8(0x3d4, 0x3a, par); in savagefb_set_par_int()
1472 vga_out8(0x3d5, cr3a, par); in savagefb_set_par_int()
1475 vgaHWProtect(par, 0); in savagefb_set_par_int()
1481 vga_out16(0x3d4, (base & 0x00ff00) | 0x0c, par); in savagefb_update_start()
1482 vga_out16(0x3d4, ((base & 0x00ff) << 8) | 0x0d, par); in savagefb_update_start()
1483 vga_out8(0x3d4, 0x69, par); in savagefb_update_start()
1484 vga_out8(0x3d5, (base & 0x7f0000) >> 16, par); in savagefb_update_start()
1514 if (par->dacSpeedBpp <= 0) { in savagefb_set_par()
1522 par->dacSpeedBpp = par->clock[0]; in savagefb_set_par()
1535 return 0; in savagefb_set_par()
1551 return 0; in savagefb_pan_display()
1557 u8 sr8 = 0, srd = 0; in savagefb_blank()
1560 vga_out8(0x3c4, 0x08, par); in savagefb_blank()
1561 sr8 = vga_in8(0x3c5, par); in savagefb_blank()
1562 sr8 |= 0x06; in savagefb_blank()
1563 vga_out8(0x3c5, sr8, par); in savagefb_blank()
1564 vga_out8(0x3c4, 0x0d, par); in savagefb_blank()
1565 srd = vga_in8(0x3c5, par); in savagefb_blank()
1566 srd &= 0x50; in savagefb_blank()
1573 srd |= 0x10; in savagefb_blank()
1576 srd |= 0x40; in savagefb_blank()
1579 srd |= 0x50; in savagefb_blank()
1583 vga_out8(0x3c4, 0x0d, par); in savagefb_blank()
1584 vga_out8(0x3c5, srd, par); in savagefb_blank()
1592 vga_out8(0x3c4, 0x31, par); /* SR31 bit 4 - FP enable */ in savagefb_blank()
1593 vga_out8(0x3c5, vga_in8(0x3c5, par) | 0x10, par); in savagefb_blank()
1598 vga_out8(0x3c4, 0x31, par); /* SR31 bit 4 - FP enable */ in savagefb_blank()
1599 vga_out8(0x3c5, vga_in8(0x3c5, par) & ~0x10, par); in savagefb_blank()
1604 return (blank == FB_BLANK_NORMAL) ? 1 : 0; in savagefb_blank()
1614 memset(&par->vgastate, 0, sizeof(par->vgastate)); in savagefb_open()
1617 par->vgastate.vgabase = par->mmio.vbase + 0x8000; in savagefb_open()
1624 return 0; in savagefb_open()
1640 return 0; in savagefb_release()
1690 val = vga_in8(0x3c3, par); in savage_enable_mmio()
1691 vga_out8(0x3c3, val | 0x01, par); in savage_enable_mmio()
1692 val = vga_in8(0x3cc, par); in savage_enable_mmio()
1693 vga_out8(0x3c2, val | 0x01, par); in savage_enable_mmio()
1696 vga_out8(0x3d4, 0x40, par); in savage_enable_mmio()
1697 val = vga_in8(0x3d5, par); in savage_enable_mmio()
1698 vga_out8(0x3d5, val | 1, par); in savage_enable_mmio()
1710 vga_out8(0x3d4, 0x40, par); in savage_disable_mmio()
1711 val = vga_in8(0x3d5, par); in savage_disable_mmio()
1712 vga_out8(0x3d5, val | 1, par); in savage_disable_mmio()
1723 par->mmio.pbase = pci_resource_start(par->pcidev, 0) + in savage_map_mmio()
1726 par->mmio.pbase = pci_resource_start(par->pcidev, 0) + in savage_map_mmio()
1743 par->bci_ptr = 0; in savage_map_mmio()
1747 return 0; in savage_map_mmio()
1771 resource = 0; in savage_map_video()
1792 memset_io(par->video.vbase, 0, par->video.len); in savage_map_video()
1794 return 0; in savage_map_video()
1813 unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp; in savage_init_hw()
1818 static unsigned char RamSavageNB[] = { 0, 2, 4, 8, 16, 32, 2, 2 }; in savage_init_hw()
1823 /* unprotect CRTC[0-7] */ in savage_init_hw()
1824 vga_out8(0x3d4, 0x11, par); in savage_init_hw()
1825 tmp = vga_in8(0x3d5, par); in savage_init_hw()
1826 vga_out8(0x3d5, tmp & 0x7f, par); in savage_init_hw()
1829 vga_out16(0x3d4, 0x4838, par); in savage_init_hw()
1830 vga_out16(0x3d4, 0xa039, par); in savage_init_hw()
1831 vga_out16(0x3c4, 0x0608, par); in savage_init_hw()
1833 vga_out8(0x3d4, 0x40, par); in savage_init_hw()
1834 tmp = vga_in8(0x3d5, par); in savage_init_hw()
1835 vga_out8(0x3d5, tmp & ~0x01, par); in savage_init_hw()
1838 vga_out8(0x3d4, 0x38, par); in savage_init_hw()
1839 vga_out8(0x3d5, 0x48, par); in savage_init_hw()
1842 vga_out16(0x3d4, 0x4838, par); in savage_init_hw()
1846 vga_out8(0x3d4, 0x36, par); /* for register CR36 (CONFG_REG1), */ in savage_init_hw()
1847 config1 = vga_in8(0x3d5, par); /* get amount of vram installed */ in savage_init_hw()
1853 videoRam = RamSavage3D[(config1 & 0xC0) >> 6 ] * 1024; in savage_init_hw()
1863 vga_out8(0x3d4, 0x68, par); /* memory control 1 */ in savage_init_hw()
1864 if ((vga_in8(0x3d5, par) & 0xC0) == (0x01 << 6)) in savage_init_hw()
1869 videoRam = RamSavage4[(config1 & 0xE0) >> 5] * 1024; in savage_init_hw()
1874 videoRam = RamSavageMX[(config1 & 0x0E) >> 1] * 1024; in savage_init_hw()
1880 videoRam = RamSavageNB[(config1 & 0xE0) >> 5] * 1024; in savage_init_hw()
1885 videoRam = 0; in savage_init_hw()
1894 vga_out8(0x3d4, 0x66, par); in savage_init_hw()
1895 cr66 = vga_in8(0x3d5, par); in savage_init_hw()
1896 vga_out8(0x3d5, cr66 | 0x02, par); in savage_init_hw()
1899 vga_out8(0x3d4, 0x66, par); in savage_init_hw()
1900 vga_out8(0x3d5, cr66 & ~0x02, par); /* clear reset flag */ in savage_init_hw()
1908 vga_out8(0x3d4, 0x3f, par); in savage_init_hw()
1909 cr3f = vga_in8(0x3d5, par); in savage_init_hw()
1910 vga_out8(0x3d5, cr3f | 0x08, par); in savage_init_hw()
1913 vga_out8(0x3d4, 0x3f, par); in savage_init_hw()
1914 vga_out8(0x3d5, cr3f & ~0x08, par); /* clear reset flags */ in savage_init_hw()
1919 par->clock[0] = 250000; in savage_init_hw()
1925 vga_out8(0x3c4, 0x08, par); in savage_init_hw()
1926 sr8 = vga_in8(0x3c5, par); in savage_init_hw()
1927 vga_out8(0x3c5, 0x06, par); in savage_init_hw()
1928 vga_out8(0x3c4, 0x10, par); in savage_init_hw()
1929 n = vga_in8(0x3c5, par); in savage_init_hw()
1930 vga_out8(0x3c4, 0x11, par); in savage_init_hw()
1931 m = vga_in8(0x3c5, par); in savage_init_hw()
1932 vga_out8(0x3c4, 0x08, par); in savage_init_hw()
1933 vga_out8(0x3c5, sr8, par); in savage_init_hw()
1934 m &= 0x7f; in savage_init_hw()
1935 n1 = n & 0x1f; in savage_init_hw()
1936 n2 = (n >> 5) & 0x03; in savage_init_hw()
1942 dvi = 0; in savage_init_hw()
1945 unsigned char sr30 = 0x00; in savage_init_hw()
1947 vga_out8(0x3c4, 0x30, par); in savage_init_hw()
1949 vga_out8(0x3c5, vga_in8(0x3c5, par) & ~0x02, par); in savage_init_hw()
1950 sr30 = vga_in8(0x3c5, par); in savage_init_hw()
1951 if (sr30 & 0x02 /*0x04 */) { in savage_init_hw()
1968 unsigned char cr6b = VGArCR(0x6b, par); in savage_init_hw()
1970 int panelX = (VGArSEQ(0x61, par) + in savage_init_hw()
1971 ((VGArSEQ(0x66, par) & 0x02) << 7) + 1) * 8; in savage_init_hw()
1972 int panelY = (VGArSEQ(0x69, par) + in savage_init_hw()
1973 ((VGArSEQ(0x6e, par) & 0x70) << 4) + 1); in savage_init_hw()
1988 ActiveCRT = 0x01, in savage_init_hw()
1989 ActiveLCD = 0x02, in savage_init_hw()
1990 ActiveTV = 0x04, in savage_init_hw()
1991 ActiveCRT2 = 0x20, in savage_init_hw()
1992 ActiveDUO = 0x80 in savage_init_hw()
1995 if ((VGArSEQ(0x39, par) & 0x03) == 0) { in savage_init_hw()
1997 } else if ((VGArSEQ(0x30, par) & 0x01) == 0) { in savage_init_hw()
2032 par->cob_size = 0x8000 << par->cob_index; in savage_init_hw()
2038 par->cob_size = 0x400 << par->cob_index; in savage_init_hw()
2049 int err = 0; in savage_init_fb_info()
2054 info->fix.type_aux = 0; in savage_init_fb_info()
2056 info->fix.ywrapstep = 0; in savage_init_fb_info()
2134 info->var.nonstd = 0; in savage_init_fb_info()
2138 info->var.accel_flags = 0; in savage_init_fb_info()
2157 err = fb_alloc_cmap(&info->cmap, NR_PALETTE, 0); in savage_init_fb_info()
2211 if (video_len < 0) { in savagefb_probe()
2235 memset(&cvt_mode, 0, sizeof(cvt_mode)); in savagefb_probe()
2241 if (fb_find_mode_cvt(&cvt_mode, 0, 0)) in savagefb_probe()
2243 else if (fb_find_mode(&info->var, info, NULL, NULL, 0, in savagefb_probe()
2244 &cvt_mode, 0) != 3) in savagefb_probe()
2270 * The clipping coordinates are masked with 0xFFF, so limit our in savagefb_probe()
2273 if (info->var.yres_virtual > 0x1000) in savagefb_probe()
2274 info->var.yres_virtual = 0x1000; in savagefb_probe()
2276 if (info->var.xres_virtual > 0x1000) in savagefb_probe()
2277 info->var.xres_virtual = 0x1000; in savagefb_probe()
2309 if (err < 0) in savagefb_probe()
2320 return 0; in savagefb_probe()
2326 fb_alloc_cmap(&info->cmap, 0, 0); in savagefb_probe()
2352 fb_alloc_cmap(&info->cmap, 0, 0); in savagefb_remove()
2378 return 0; in savagefb_suspend_late()
2391 return 0; in savagefb_suspend_late()
2424 return 0; in savagefb_resume()
2431 fb_set_suspend(info, 0); in savagefb_resume()
2435 return 0; in savagefb_resume()
2451 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2454 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2457 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2460 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2463 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2466 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2469 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2472 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2475 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SUPERSAVAGE},
2478 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE4},
2481 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE3D},
2484 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE3D_MV},
2487 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE2000},
2490 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_MX_MV},
2493 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_MX},
2496 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_IX_MV},
2499 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_SAVAGE_IX},
2502 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_PM},
2505 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_KM},
2508 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_S3TWISTER_P},
2511 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_S3TWISTER_K},
2514 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_DDR},
2517 PCI_ANY_ID, PCI_ANY_ID, 0, 0, FB_ACCEL_PROSAVAGE_DDRK},
2519 {0, 0, 0, 0, 0, 0, 0}
2549 return 0; in savagefb_setup()
2555 return 0; in savagefb_setup()
2578 module_param(mode_option, charp, 0);