1 diff -urN -X /home/jsimmons/dontdiff linus-2.6/drivers/video/logo/Kconfig fbdev-2.6/drivers/video/logo/Kconfig
2 --- linus-2.6/drivers/video/logo/Kconfig 2004-02-18 20:59:12.000000000 -0800
3 +++ fbdev-2.6/drivers/video/logo/Kconfig 2004-02-18 20:10:03.000000000 -0800
6 config LOGO_DEC_CLUT224
7 bool "224-color Digital Equipment Corporation Linux logo"
8 - depends on LOGO && DECSTATION
9 + depends on LOGO && (DECSTATION || ALPHA)
12 config LOGO_MAC_CLUT224
13 diff -urN -X /home/jsimmons/dontdiff linus-2.6/drivers/video/logo/logo.c fbdev-2.6/drivers/video/logo/logo.c
14 --- linus-2.6/drivers/video/logo/logo.c 2004-02-18 20:59:12.000000000 -0800
15 +++ fbdev-2.6/drivers/video/logo/logo.c 2004-02-18 20:10:04.000000000 -0800
17 logo = &logo_linux_clut224;
19 #ifdef CONFIG_LOGO_DEC_CLUT224
20 +# if defined(CONFIG_MIPS) || defined(CONFIG_MIPS64)
21 /* DEC Linux logo on MIPS/MIPS64 */
22 if (mips_machgroup == MACH_GROUP_DEC)
23 logo = &logo_dec_clut224;
25 + /* Assume DEC Linux logo on ALPHA */
26 + logo = &logo_dec_clut224;
29 #ifdef CONFIG_LOGO_MAC_CLUT224
30 /* Macintosh Linux logo on m68k */
31 diff -urN -X /home/jsimmons/dontdiff linus-2.6/drivers/video/tgafb.c fbdev-2.6/drivers/video/tgafb.c
32 --- linus-2.6/drivers/video/tgafb.c 2004-02-18 20:59:10.000000000 -0800
33 +++ fbdev-2.6/drivers/video/tgafb.c 2004-02-18 20:53:34.000000000 -0800
36 #include <linux/pci.h>
38 -#include <video/tgafb.h>
39 +#include <video/tga.h>
40 #include <linux/selection.h>
44 static void tgafb_imageblit(struct fb_info *, const struct fb_image *);
45 static void tgafb_fillrect(struct fb_info *, const struct fb_fillrect *);
46 static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
47 +static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
49 static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *);
53 static const char *mode_option = "640x480@60";
57 * Frame buffer operations
60 .fb_set_par = tgafb_set_par,
61 .fb_setcolreg = tgafb_setcolreg,
62 .fb_blank = tgafb_blank,
63 + .fb_pan_display = tgafb_pan_display,
64 .fb_fillrect = tgafb_fillrect,
65 .fb_copyarea = tgafb_copyarea,
66 .fb_imageblit = tgafb_imageblit,
68 tgafb_set_par(struct fb_info *info)
70 static unsigned int const deep_presets[4] = {
79 static unsigned int const rasterop_presets[4] = {
82 struct tga_par *par = (struct tga_par *) info->par;
83 u32 htimings, vtimings, pll_freq;
88 /* Encode video timings. */
89 htimings = (((info->var.xres/4) & TGA_HORIZ_ACT_LSB)
91 while (TGA_READ_REG(par, TGA_CMD_STAT_REG) & 1) /* wait for not busy */
94 - TGA_WRITE_REG(par, deep_presets[tga_type], TGA_DEEP_REG);
95 + TGA_WRITE_REG(par, deep_presets[tga_type] |
96 + (par->sync_on_green ? 0x0 : 0x00010000), TGA_DEEP_REG);
97 while (TGA_READ_REG(par, TGA_CMD_STAT_REG) & 1) /* wait for not busy */
100 @@ -225,37 +227,13 @@
101 BT485_WRITE(par, 0x20, BT485_CMD_2); /* cursor off, for now */
102 BT485_WRITE(par, 0xff, BT485_PIXEL_MASK);
104 - /* Fill palette registers. */
105 - BT485_WRITE(par, 0x00, BT485_ADDR_PAL_WRITE);
106 - TGA_WRITE_REG(par, BT485_DATA_PAL, TGA_RAMDAC_SETUP_REG);
108 - for (i = 0; i < 16; i++) {
109 - j = color_table[i];
110 - TGA_WRITE_REG(par, default_red[j]|(BT485_DATA_PAL<<8),
112 - TGA_WRITE_REG(par, default_grn[j]|(BT485_DATA_PAL<<8),
114 - TGA_WRITE_REG(par, default_blu[j]|(BT485_DATA_PAL<<8),
117 - for (i = 0; i < 240*3; i += 4) {
118 - TGA_WRITE_REG(par, 0x55|(BT485_DATA_PAL<<8),
120 - TGA_WRITE_REG(par, 0x00|(BT485_DATA_PAL<<8),
122 - TGA_WRITE_REG(par, 0x00|(BT485_DATA_PAL<<8),
124 - TGA_WRITE_REG(par, 0x00|(BT485_DATA_PAL<<8),
128 } else { /* 24-plane or 24plusZ */
130 /* Init BT463 registers. */
131 BT463_WRITE(par, BT463_REG_ACC, BT463_CMD_REG_0, 0x40);
132 BT463_WRITE(par, BT463_REG_ACC, BT463_CMD_REG_1, 0x08);
133 BT463_WRITE(par, BT463_REG_ACC, BT463_CMD_REG_2,
134 - (par->sync_on_green ? 0x80 : 0x40));
135 + (par->sync_on_green ? 0xc0 : 0x40));
137 BT463_WRITE(par, BT463_REG_ACC, BT463_READ_MASK_0, 0xff);
138 BT463_WRITE(par, BT463_REG_ACC, BT463_READ_MASK_1, 0xff);
140 BT463_WRITE(par, BT463_REG_ACC, BT463_BLINK_MASK_2, 0x00);
141 BT463_WRITE(par, BT463_REG_ACC, BT463_BLINK_MASK_3, 0x00);
143 - /* Fill the palette. */
144 - BT463_LOAD_ADDR(par, 0x0000);
145 - TGA_WRITE_REG(par, BT463_PALETTE<<2, TGA_RAMDAC_REG);
147 - for (i = 0; i < 16; i++) {
148 - j = color_table[i];
149 - TGA_WRITE_REG(par, default_red[j]|(BT463_PALETTE<<10),
151 - TGA_WRITE_REG(par, default_grn[j]|(BT463_PALETTE<<10),
153 - TGA_WRITE_REG(par, default_blu[j]|(BT463_PALETTE<<10),
156 - for (i = 0; i < 512*3; i += 4) {
157 - TGA_WRITE_REG(par, 0x55|(BT463_PALETTE<<10),
159 - TGA_WRITE_REG(par, 0x00|(BT463_PALETTE<<10),
161 - TGA_WRITE_REG(par, 0x00|(BT463_PALETTE<<10),
163 - TGA_WRITE_REG(par, 0x00|(BT463_PALETTE<<10),
167 /* Fill window type table after start of vertical retrace. */
168 while (!(TGA_READ_REG(par, TGA_INTR_STAT_REG) & 0x01))
174 + /* Init the palette. */
175 + fb_set_cmap(fb_default_cmap(16), 1, info);
177 /* Finally, enable video scan (and pray for the monitor... :-) */
178 TGA_WRITE_REG(par, TGA_VALID_VIDEO, TGA_VALID_REG);
185 - * tgafb_imageblit - REQUIRED function. Can use generic routines if
186 - * non acclerated hardware and packed pixel based.
187 - * Copies a image from system memory to the screen.
189 - * @info: frame buffer structure that represents a single frame buffer
190 - * @image: structure defining the image.
193 -tgafb_imageblit(struct fb_info *info, const struct fb_image *image)
194 +tgafb_mono_imageblit(struct fb_info *info, const struct fb_image *image)
196 static unsigned char const bitrev[256] = {
197 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
199 const unsigned char *data;
200 void *regs_base, *fb_base;
202 + is8bpp = info->var.bits_per_pixel == 8;
204 + /* For copies that aren't pixel expansion, there's little we
205 + can do better than the generic code. */
206 + /* ??? There is a DMA write mode; I wonder if that could be
207 + made to pull the data from the image buffer... */
208 + if (image->depth > 1) {
209 + cfb_imageblit(info, image);
215 width = image->width;
217 if (dy + height > vyres)
220 - /* For copies that aren't pixel expansion, there's little we
221 - can do better than the generic code. */
222 - /* ??? There is a DMA write mode; I wonder if that could be
223 - made to pull the data from the image buffer... */
224 - if (image->depth > 1) {
225 - cfb_imageblit(info, image);
229 regs_base = par->tga_regs_base;
230 fb_base = par->tga_fb_base;
231 - is8bpp = info->var.bits_per_pixel == 8;
233 /* Expand the color values to fill 32-bits. */
234 /* ??? Would be nice to notice colour changes elsewhere, so
236 regs_base + TGA_MODE_REG);
240 +tgafb_clut_imageblit(struct fb_info *info, const struct fb_image *image)
242 + struct tga_par *par = (struct tga_par *) info->par;
243 + u32 color, dx, dy, width, height, vxres, vyres;
244 + u32 *palette = ((u32 *)info->pseudo_palette);
245 + unsigned long pos, line_length;
246 + unsigned long i, j;
247 + const unsigned char *data;
248 + void *regs_base, *fb_base;
252 + width = image->width;
253 + height = image->height;
254 + vxres = info->var.xres_virtual;
255 + vyres = info->var.yres_virtual;
256 + line_length = info->fix.line_length;
258 + /* Crop the image to the screen. */
259 + if (dx > vxres || dy > vyres)
261 + if (dx + width > vxres)
262 + width = vxres - dx;
263 + if (dy + height > vyres)
264 + height = vyres - dy;
266 + regs_base = par->tga_regs_base;
267 + fb_base = par->tga_fb_base;
269 + pos = dy * line_length + (dx * 4);
270 + data = image->data;
272 + /* Now copy the image, color_expanding via the palette. */
273 + for (i = 0; i < height; i++) {
274 + for (j = 0; j < width; j++) {
275 + color = palette[*data++];
276 + __raw_writel(color, fb_base + pos + j*4);
278 + pos += line_length;
283 + * tgafb_imageblit - REQUIRED function. Can use generic routines if
284 + * non acclerated hardware and packed pixel based.
285 + * Copies a image from system memory to the screen.
287 + * @info: frame buffer structure that represents a single frame buffer
288 + * @image: structure defining the image.
291 +tgafb_imageblit(struct fb_info *info, const struct fb_image *image)
293 + unsigned int is8bpp = info->var.bits_per_pixel == 8;
295 + /* If a mono image, regardless of FB depth, go do it. */
296 + if (image->depth == 1) {
297 + tgafb_mono_imageblit(info, image);
301 + /* For copies that aren't pixel expansion, there's little we
302 + can do better than the generic code. */
303 + /* ??? There is a DMA write mode; I wonder if that could be
304 + made to pull the data from the image buffer... */
305 + if (image->depth == info->var.bits_per_pixel) {
306 + cfb_imageblit(info, image);
310 + /* If 24-plane FB and the image is 8-plane with CLUT, we can do it. */
311 + if (!is8bpp && image->depth == 8) {
312 + tgafb_clut_imageblit(info, image);
316 + /* Silently return... */
320 * tgafb_fillrect - REQUIRED function. Can use generic routines if
321 * non acclerated hardware and packed pixel based.
322 @@ -1360,6 +1390,31 @@
323 info->fix.ywrapstep = 0;
325 info->fix.accel = FB_ACCEL_DEC_TGA;
328 + * These are needed by fb_set_logo_truepalette(), so we
329 + * set them here for 24-plane cards.
331 + if (tga_type != TGA_TYPE_8PLANE) {
332 + info->var.red.length = 8;
333 + info->var.green.length = 8;
334 + info->var.blue.length = 8;
335 + info->var.red.offset = 16;
336 + info->var.green.offset = 8;
337 + info->var.blue.offset = 0;
341 +static int tgafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
343 + /* We just use this to catch switches out of
346 + tgafb_set_par(info); /* A bit of overkill for BASE_ADDR reset. */
348 + if (var->xoffset || var->yoffset || var->vmode)
354 @@ -1371,15 +1426,10 @@
356 TGA_24PLUSZ_FB_OFFSET
360 - struct fb_info info;
361 - struct tga_par par;
362 - u32 pseudo_palette[16];
366 unsigned long bar0_start, bar0_len;
367 + struct fb_info *info;
368 + struct tga_par *par;
373 @@ -1390,13 +1440,12 @@
376 /* Allocate the fb and par structures. */
377 - all = kmalloc(sizeof(*all), GFP_KERNEL);
379 + info = framebuffer_alloc(sizeof(struct tga_par), &pdev->dev);
381 printk(KERN_ERR "tgafb: Cannot allocate memory\n");
384 - memset(all, 0, sizeof(*all));
385 - pci_set_drvdata(pdev, all);
386 + pci_set_drvdata(pdev, info);
388 /* Request the mem regions. */
389 bar0_start = pci_resource_start(pdev, 0);
390 @@ -1416,24 +1465,22 @@
392 /* Grab info about the card. */
393 tga_type = (readl(mem_base) >> 12) & 0x0f;
394 - all->par.pdev = pdev;
395 - all->par.tga_mem_base = mem_base;
396 - all->par.tga_fb_base = mem_base + fb_offset_presets[tga_type];
397 - all->par.tga_regs_base = mem_base + TGA_REGS_OFFSET;
398 - all->par.tga_type = tga_type;
399 - pci_read_config_byte(pdev, PCI_REVISION_ID, &all->par.tga_chip_rev);
401 + par->tga_mem_base = mem_base;
402 + par->tga_fb_base = mem_base + fb_offset_presets[tga_type];
403 + par->tga_regs_base = mem_base + TGA_REGS_OFFSET;
404 + par->tga_type = tga_type;
405 + pci_read_config_byte(pdev, PCI_REVISION_ID, par->tga_chip_rev);
407 /* Setup framebuffer. */
408 - all->info.flags = FBINFO_FLAG_DEFAULT;
409 - all->info.fbops = &tgafb_ops;
410 - all->info.screen_base = (char *) all->par.tga_fb_base;
411 - all->info.currcon = -1;
412 - all->info.par = &all->par;
413 - all->info.pseudo_palette = all->pseudo_palette;
414 + info->flags = FBINFO_FLAG_DEFAULT;
415 + info->fbops = &tgafb_ops;
416 + info->screen_base = (char *) par->tga_fb_base;
417 + info->pseudo_palette = par->pseudo_palette;
419 /* This should give a reasonable default video mode. */
421 - ret = fb_find_mode(&all->info.var, &all->info, mode_option,
422 + ret = fb_find_mode(&info->var, info, mode_option,
424 tga_type == TGA_TYPE_8PLANE ? 8 : 32);
425 if (ret == 0 || ret == 4) {
426 @@ -1442,35 +1489,34 @@
430 - if (fb_alloc_cmap(&all->info.cmap, 256, 0)) {
431 + if (fb_alloc_cmap(&info->cmap, 256, 0)) {
432 printk(KERN_ERR "tgafb: Could not allocate color map\n");
437 - tgafb_set_par(&all->info);
438 - tgafb_init_fix(&all->info);
439 + tgafb_init_fix(info);
441 - if (register_framebuffer(&all->info) < 0) {
442 + if (register_framebuffer(info) < 0) {
443 printk(KERN_ERR "tgafb: Could not register framebuffer\n");
448 printk(KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n",
449 - all->par.tga_chip_rev);
450 + par->tga_chip_rev);
451 printk(KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
452 pdev->bus->number, PCI_SLOT(pdev->devfn),
453 PCI_FUNC(pdev->devfn));
454 printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n",
455 - all->info.node, all->info.fix.id, bar0_start);
456 + info->node, info->fix.id, bar0_start);
461 release_mem_region(bar0_start, bar0_len);
464 + framebuffer_release(info);
468 @@ -1493,7 +1539,7 @@
469 iounmap(par->tga_mem_base);
470 release_mem_region(pci_resource_start(pdev, 0),
471 pci_resource_len(pdev, 0));
473 + framebuffer_release(info);
477 diff -urN -X /home/jsimmons/dontdiff linus-2.6/include/video/tga.h fbdev-2.6/include/video/tga.h
478 --- linus-2.6/include/video/tga.h 1969-12-31 16:00:00.000000000 -0800
479 +++ fbdev-2.6/include/video/tga.h 2004-02-18 20:53:12.000000000 -0800
482 + * linux/drivers/video/tgafb.h -- DEC 21030 TGA frame buffer device
484 + * Copyright (C) 1999,2000 Martin Lucina, Tom Zerucha
488 + * This file is subject to the terms and conditions of the GNU General Public
489 + * License. See the file COPYING in the main directory of this archive for
497 + * TGA hardware description (minimal)
500 +#define TGA_TYPE_8PLANE 0
501 +#define TGA_TYPE_24PLANE 1
502 +#define TGA_TYPE_24PLUSZ 3
505 + * Offsets within Memory Space
508 +#define TGA_ROM_OFFSET 0x0000000
509 +#define TGA_REGS_OFFSET 0x0100000
510 +#define TGA_8PLANE_FB_OFFSET 0x0200000
511 +#define TGA_24PLANE_FB_OFFSET 0x0804000
512 +#define TGA_24PLUSZ_FB_OFFSET 0x1004000
514 +#define TGA_FOREGROUND_REG 0x0020
515 +#define TGA_BACKGROUND_REG 0x0024
516 +#define TGA_PLANEMASK_REG 0x0028
517 +#define TGA_PIXELMASK_ONESHOT_REG 0x002c
518 +#define TGA_MODE_REG 0x0030
519 +#define TGA_RASTEROP_REG 0x0034
520 +#define TGA_PIXELSHIFT_REG 0x0038
521 +#define TGA_DEEP_REG 0x0050
522 +#define TGA_PIXELMASK_REG 0x005c
523 +#define TGA_CURSOR_BASE_REG 0x0060
524 +#define TGA_HORIZ_REG 0x0064
525 +#define TGA_VERT_REG 0x0068
526 +#define TGA_BASE_ADDR_REG 0x006c
527 +#define TGA_VALID_REG 0x0070
528 +#define TGA_CURSOR_XY_REG 0x0074
529 +#define TGA_INTR_STAT_REG 0x007c
530 +#define TGA_DATA_REG 0x0080
531 +#define TGA_RAMDAC_SETUP_REG 0x00c0
532 +#define TGA_BLOCK_COLOR0_REG 0x0140
533 +#define TGA_BLOCK_COLOR1_REG 0x0144
534 +#define TGA_BLOCK_COLOR2_REG 0x0148
535 +#define TGA_BLOCK_COLOR3_REG 0x014c
536 +#define TGA_BLOCK_COLOR4_REG 0x0150
537 +#define TGA_BLOCK_COLOR5_REG 0x0154
538 +#define TGA_BLOCK_COLOR6_REG 0x0158
539 +#define TGA_BLOCK_COLOR7_REG 0x015c
540 +#define TGA_COPY64_SRC 0x0160
541 +#define TGA_COPY64_DST 0x0164
542 +#define TGA_CLOCK_REG 0x01e8
543 +#define TGA_RAMDAC_REG 0x01f0
544 +#define TGA_CMD_STAT_REG 0x01f8
548 + * Useful defines for managing the registers
551 +#define TGA_HORIZ_ODD 0x80000000
552 +#define TGA_HORIZ_POLARITY 0x40000000
553 +#define TGA_HORIZ_ACT_MSB 0x30000000
554 +#define TGA_HORIZ_BP 0x0fe00000
555 +#define TGA_HORIZ_SYNC 0x001fc000
556 +#define TGA_HORIZ_FP 0x00007c00
557 +#define TGA_HORIZ_ACT_LSB 0x000001ff
559 +#define TGA_VERT_SE 0x80000000
560 +#define TGA_VERT_POLARITY 0x40000000
561 +#define TGA_VERT_RESERVED 0x30000000
562 +#define TGA_VERT_BP 0x0fc00000
563 +#define TGA_VERT_SYNC 0x003f0000
564 +#define TGA_VERT_FP 0x0000f800
565 +#define TGA_VERT_ACTIVE 0x000007ff
567 +#define TGA_VALID_VIDEO 0x01
568 +#define TGA_VALID_BLANK 0x02
569 +#define TGA_VALID_CURSOR 0x04
571 +#define TGA_MODE_SBM_8BPP 0x000
572 +#define TGA_MODE_SBM_24BPP 0x300
574 +#define TGA_MODE_SIMPLE 0x00
575 +#define TGA_MODE_SIMPLEZ 0x10
576 +#define TGA_MODE_OPAQUE_STIPPLE 0x01
577 +#define TGA_MODE_OPAQUE_FILL 0x21
578 +#define TGA_MODE_TRANSPARENT_STIPPLE 0x03
579 +#define TGA_MODE_TRANSPARENT_FILL 0x23
580 +#define TGA_MODE_BLOCK_STIPPLE 0x0d
581 +#define TGA_MODE_BLOCK_FILL 0x2d
582 +#define TGA_MODE_COPY 0x07
583 +#define TGA_MODE_DMA_READ_COPY_ND 0x17
584 +#define TGA_MODE_DMA_READ_COPY_D 0x37
585 +#define TGA_MODE_DMA_WRITE_COPY 0x1f
589 + * Useful defines for managing the ICS1562 PLL clock
592 +#define TGA_PLL_BASE_FREQ 14318 /* .18 */
593 +#define TGA_PLL_MAX_FREQ 230000
597 + * Useful defines for managing the BT485 on the 8-plane TGA
600 +#define BT485_READ_BIT 0x01
601 +#define BT485_WRITE_BIT 0x00
603 +#define BT485_ADDR_PAL_WRITE 0x00
604 +#define BT485_DATA_PAL 0x02
605 +#define BT485_PIXEL_MASK 0x04
606 +#define BT485_ADDR_PAL_READ 0x06
607 +#define BT485_ADDR_CUR_WRITE 0x08
608 +#define BT485_DATA_CUR 0x0a
609 +#define BT485_CMD_0 0x0c
610 +#define BT485_ADDR_CUR_READ 0x0e
611 +#define BT485_CMD_1 0x10
612 +#define BT485_CMD_2 0x12
613 +#define BT485_STATUS 0x14
614 +#define BT485_CMD_3 0x14
615 +#define BT485_CUR_RAM 0x16
616 +#define BT485_CUR_LOW_X 0x18
617 +#define BT485_CUR_HIGH_X 0x1a
618 +#define BT485_CUR_LOW_Y 0x1c
619 +#define BT485_CUR_HIGH_Y 0x1e
623 + * Useful defines for managing the BT463 on the 24-plane TGAs
626 +#define BT463_ADDR_LO 0x0
627 +#define BT463_ADDR_HI 0x1
628 +#define BT463_REG_ACC 0x2
629 +#define BT463_PALETTE 0x3
631 +#define BT463_CUR_CLR_0 0x0100
632 +#define BT463_CUR_CLR_1 0x0101
634 +#define BT463_CMD_REG_0 0x0201
635 +#define BT463_CMD_REG_1 0x0202
636 +#define BT463_CMD_REG_2 0x0203
638 +#define BT463_READ_MASK_0 0x0205
639 +#define BT463_READ_MASK_1 0x0206
640 +#define BT463_READ_MASK_2 0x0207
641 +#define BT463_READ_MASK_3 0x0208
643 +#define BT463_BLINK_MASK_0 0x0209
644 +#define BT463_BLINK_MASK_1 0x020a
645 +#define BT463_BLINK_MASK_2 0x020b
646 +#define BT463_BLINK_MASK_3 0x020c
648 +#define BT463_WINDOW_TYPE_BASE 0x0300
653 + * The framebuffer driver private data.
658 + struct pci_dev *pdev;
660 + /* Device dependent information. */
661 + void *tga_mem_base;
663 + void *tga_regs_base;
664 + u8 tga_type; /* TGA_TYPE_XXX */
665 + u8 tga_chip_rev; /* dc21030 revision */
667 + /* Remember blank mode. */
670 + /* Define the video mode. */
671 + u32 xres, yres; /* resolution in pixels */
672 + u32 htimings; /* horizontal timing register */
673 + u32 vtimings; /* vertical timing register */
674 + u32 pll_freq; /* pixclock in mhz */
675 + u32 bits_per_pixel; /* bits per pixel */
676 + u32 sync_on_green; /* set if sync is on green */
681 + * Macros for reading/writing TGA and RAMDAC registers
685 +TGA_WRITE_REG(struct tga_par *par, u32 v, u32 r)
687 + writel(v, par->tga_regs_base +r);
691 +TGA_READ_REG(struct tga_par *par, u32 r)
693 + return readl(par->tga_regs_base +r);
697 +BT485_WRITE(struct tga_par *par, u8 v, u8 r)
699 + TGA_WRITE_REG(par, r, TGA_RAMDAC_SETUP_REG);
700 + TGA_WRITE_REG(par, v | (r << 8), TGA_RAMDAC_REG);
704 +BT463_LOAD_ADDR(struct tga_par *par, u16 a)
706 + TGA_WRITE_REG(par, BT463_ADDR_LO<<2, TGA_RAMDAC_SETUP_REG);
707 + TGA_WRITE_REG(par, (BT463_ADDR_LO<<10) | (a & 0xff), TGA_RAMDAC_REG);
708 + TGA_WRITE_REG(par, BT463_ADDR_HI<<2, TGA_RAMDAC_SETUP_REG);
709 + TGA_WRITE_REG(par, (BT463_ADDR_HI<<10) | (a >> 8), TGA_RAMDAC_REG);
713 +BT463_WRITE(struct tga_par *par, u32 m, u16 a, u8 v)
715 + BT463_LOAD_ADDR(par, a);
716 + TGA_WRITE_REG(par, m << 2, TGA_RAMDAC_SETUP_REG);
717 + TGA_WRITE_REG(par, m << 10 | v, TGA_RAMDAC_REG);
719 +#endif /* __KERNEL__ */
721 +#endif /* TGAFB_H */
722 diff -urN -X /home/jsimmons/dontdiff linus-2.6/include/video/tgafb.h fbdev-2.6/include/video/tgafb.h
723 --- linus-2.6/include/video/tgafb.h 2004-02-18 21:01:55.000000000 -0800
724 +++ fbdev-2.6/include/video/tgafb.h 1969-12-31 16:00:00.000000000 -0800
727 - * linux/drivers/video/tgafb.h -- DEC 21030 TGA frame buffer device
729 - * Copyright (C) 1999,2000 Martin Lucina, Tom Zerucha
733 - * This file is subject to the terms and conditions of the GNU General Public
734 - * License. See the file COPYING in the main directory of this archive for
742 - * TGA hardware description (minimal)
745 -#define TGA_TYPE_8PLANE 0
746 -#define TGA_TYPE_24PLANE 1
747 -#define TGA_TYPE_24PLUSZ 3
750 - * Offsets within Memory Space
753 -#define TGA_ROM_OFFSET 0x0000000
754 -#define TGA_REGS_OFFSET 0x0100000
755 -#define TGA_8PLANE_FB_OFFSET 0x0200000
756 -#define TGA_24PLANE_FB_OFFSET 0x0804000
757 -#define TGA_24PLUSZ_FB_OFFSET 0x1004000
759 -#define TGA_FOREGROUND_REG 0x0020
760 -#define TGA_BACKGROUND_REG 0x0024
761 -#define TGA_PLANEMASK_REG 0x0028
762 -#define TGA_PIXELMASK_ONESHOT_REG 0x002c
763 -#define TGA_MODE_REG 0x0030
764 -#define TGA_RASTEROP_REG 0x0034
765 -#define TGA_PIXELSHIFT_REG 0x0038
766 -#define TGA_DEEP_REG 0x0050
767 -#define TGA_PIXELMASK_REG 0x005c
768 -#define TGA_CURSOR_BASE_REG 0x0060
769 -#define TGA_HORIZ_REG 0x0064
770 -#define TGA_VERT_REG 0x0068
771 -#define TGA_BASE_ADDR_REG 0x006c
772 -#define TGA_VALID_REG 0x0070
773 -#define TGA_CURSOR_XY_REG 0x0074
774 -#define TGA_INTR_STAT_REG 0x007c
775 -#define TGA_DATA_REG 0x0080
776 -#define TGA_RAMDAC_SETUP_REG 0x00c0
777 -#define TGA_BLOCK_COLOR0_REG 0x0140
778 -#define TGA_BLOCK_COLOR1_REG 0x0144
779 -#define TGA_BLOCK_COLOR2_REG 0x0148
780 -#define TGA_BLOCK_COLOR3_REG 0x014c
781 -#define TGA_BLOCK_COLOR4_REG 0x0150
782 -#define TGA_BLOCK_COLOR5_REG 0x0154
783 -#define TGA_BLOCK_COLOR6_REG 0x0158
784 -#define TGA_BLOCK_COLOR7_REG 0x015c
785 -#define TGA_COPY64_SRC 0x0160
786 -#define TGA_COPY64_DST 0x0164
787 -#define TGA_CLOCK_REG 0x01e8
788 -#define TGA_RAMDAC_REG 0x01f0
789 -#define TGA_CMD_STAT_REG 0x01f8
793 - * Useful defines for managing the registers
796 -#define TGA_HORIZ_ODD 0x80000000
797 -#define TGA_HORIZ_POLARITY 0x40000000
798 -#define TGA_HORIZ_ACT_MSB 0x30000000
799 -#define TGA_HORIZ_BP 0x0fe00000
800 -#define TGA_HORIZ_SYNC 0x001fc000
801 -#define TGA_HORIZ_FP 0x00007c00
802 -#define TGA_HORIZ_ACT_LSB 0x000001ff
804 -#define TGA_VERT_SE 0x80000000
805 -#define TGA_VERT_POLARITY 0x40000000
806 -#define TGA_VERT_RESERVED 0x30000000
807 -#define TGA_VERT_BP 0x0fc00000
808 -#define TGA_VERT_SYNC 0x003f0000
809 -#define TGA_VERT_FP 0x0000f800
810 -#define TGA_VERT_ACTIVE 0x000007ff
812 -#define TGA_VALID_VIDEO 0x01
813 -#define TGA_VALID_BLANK 0x02
814 -#define TGA_VALID_CURSOR 0x04
816 -#define TGA_MODE_SBM_8BPP 0x000
817 -#define TGA_MODE_SBM_24BPP 0x300
819 -#define TGA_MODE_SIMPLE 0x00
820 -#define TGA_MODE_SIMPLEZ 0x10
821 -#define TGA_MODE_OPAQUE_STIPPLE 0x01
822 -#define TGA_MODE_OPAQUE_FILL 0x21
823 -#define TGA_MODE_TRANSPARENT_STIPPLE 0x03
824 -#define TGA_MODE_TRANSPARENT_FILL 0x23
825 -#define TGA_MODE_BLOCK_STIPPLE 0x0d
826 -#define TGA_MODE_BLOCK_FILL 0x2d
827 -#define TGA_MODE_COPY 0x07
828 -#define TGA_MODE_DMA_READ_COPY_ND 0x17
829 -#define TGA_MODE_DMA_READ_COPY_D 0x37
830 -#define TGA_MODE_DMA_WRITE_COPY 0x1f
834 - * Useful defines for managing the ICS1562 PLL clock
837 -#define TGA_PLL_BASE_FREQ 14318 /* .18 */
838 -#define TGA_PLL_MAX_FREQ 230000
842 - * Useful defines for managing the BT485 on the 8-plane TGA
845 -#define BT485_READ_BIT 0x01
846 -#define BT485_WRITE_BIT 0x00
848 -#define BT485_ADDR_PAL_WRITE 0x00
849 -#define BT485_DATA_PAL 0x02
850 -#define BT485_PIXEL_MASK 0x04
851 -#define BT485_ADDR_PAL_READ 0x06
852 -#define BT485_ADDR_CUR_WRITE 0x08
853 -#define BT485_DATA_CUR 0x0a
854 -#define BT485_CMD_0 0x0c
855 -#define BT485_ADDR_CUR_READ 0x0e
856 -#define BT485_CMD_1 0x10
857 -#define BT485_CMD_2 0x12
858 -#define BT485_STATUS 0x14
859 -#define BT485_CMD_3 0x14
860 -#define BT485_CUR_RAM 0x16
861 -#define BT485_CUR_LOW_X 0x18
862 -#define BT485_CUR_HIGH_X 0x1a
863 -#define BT485_CUR_LOW_Y 0x1c
864 -#define BT485_CUR_HIGH_Y 0x1e
868 - * Useful defines for managing the BT463 on the 24-plane TGAs
871 -#define BT463_ADDR_LO 0x0
872 -#define BT463_ADDR_HI 0x1
873 -#define BT463_REG_ACC 0x2
874 -#define BT463_PALETTE 0x3
876 -#define BT463_CUR_CLR_0 0x0100
877 -#define BT463_CUR_CLR_1 0x0101
879 -#define BT463_CMD_REG_0 0x0201
880 -#define BT463_CMD_REG_1 0x0202
881 -#define BT463_CMD_REG_2 0x0203
883 -#define BT463_READ_MASK_0 0x0205
884 -#define BT463_READ_MASK_1 0x0206
885 -#define BT463_READ_MASK_2 0x0207
886 -#define BT463_READ_MASK_3 0x0208
888 -#define BT463_BLINK_MASK_0 0x0209
889 -#define BT463_BLINK_MASK_1 0x020a
890 -#define BT463_BLINK_MASK_2 0x020b
891 -#define BT463_BLINK_MASK_3 0x020c
893 -#define BT463_WINDOW_TYPE_BASE 0x0300
896 - * The framebuffer driver private data.
901 - struct pci_dev *pdev;
903 - /* Device dependent information. */
904 - void *tga_mem_base;
906 - void *tga_regs_base;
907 - u8 tga_type; /* TGA_TYPE_XXX */
908 - u8 tga_chip_rev; /* dc21030 revision */
910 - /* Remember blank mode. */
913 - /* Define the video mode. */
914 - u32 xres, yres; /* resolution in pixels */
915 - u32 htimings; /* horizontal timing register */
916 - u32 vtimings; /* vertical timing register */
917 - u32 pll_freq; /* pixclock in mhz */
918 - u32 bits_per_pixel; /* bits per pixel */
919 - u32 sync_on_green; /* set if sync is on green */
924 - * Macros for reading/writing TGA and RAMDAC registers
928 -TGA_WRITE_REG(struct tga_par *par, u32 v, u32 r)
930 - writel(v, par->tga_regs_base +r);
934 -TGA_READ_REG(struct tga_par *par, u32 r)
936 - return readl(par->tga_regs_base +r);
940 -BT485_WRITE(struct tga_par *par, u8 v, u8 r)
942 - TGA_WRITE_REG(par, r, TGA_RAMDAC_SETUP_REG);
943 - TGA_WRITE_REG(par, v | (r << 8), TGA_RAMDAC_REG);
947 -BT463_LOAD_ADDR(struct tga_par *par, u16 a)
949 - TGA_WRITE_REG(par, BT463_ADDR_LO<<2, TGA_RAMDAC_SETUP_REG);
950 - TGA_WRITE_REG(par, (BT463_ADDR_LO<<10) | (a & 0xff), TGA_RAMDAC_REG);
951 - TGA_WRITE_REG(par, BT463_ADDR_HI<<2, TGA_RAMDAC_SETUP_REG);
952 - TGA_WRITE_REG(par, (BT463_ADDR_HI<<10) | (a >> 8), TGA_RAMDAC_REG);
956 -BT463_WRITE(struct tga_par *par, u32 m, u16 a, u8 v)
958 - BT463_LOAD_ADDR(par, a);
959 - TGA_WRITE_REG(par, m << 2, TGA_RAMDAC_SETUP_REG);
960 - TGA_WRITE_REG(par, m << 10 | v, TGA_RAMDAC_REG);
963 -#endif /* TGAFB_H */