patch-2.4.20 linux-2.4.20/drivers/video/macfb.c
Next file: linux-2.4.20/drivers/video/newport_con.c
Previous file: linux-2.4.20/drivers/video/hpfb.c
Back to the patch index
Back to the overall index
- Lines: 241
- Date:
Thu Nov 28 15:53:15 2002
- Orig file:
linux-2.4.19/drivers/video/macfb.c
- Orig date:
Wed Nov 14 14:52:20 2001
diff -urN linux-2.4.19/drivers/video/macfb.c linux-2.4.20/drivers/video/macfb.c
@@ -155,7 +155,7 @@
#define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */
-static char* video_base;
+static unsigned long video_base;
static int video_size;
static char* video_vbase; /* mapped */
@@ -351,15 +351,15 @@
cli();
/* tell clut which address to fill */
- writeb(regno, &valkyrie_cmap_regs->addr);
+ nubus_writeb(regno, &valkyrie_cmap_regs->addr);
nop();
/* send one color channel at a time */
- writeb(red, &valkyrie_cmap_regs->lut);
+ nubus_writeb(red, &valkyrie_cmap_regs->lut);
nop();
- writeb(green, &valkyrie_cmap_regs->lut);
+ nubus_writeb(green, &valkyrie_cmap_regs->lut);
nop();
- writeb(blue, &valkyrie_cmap_regs->lut);
+ nubus_writeb(blue, &valkyrie_cmap_regs->lut);
restore_flags(flags);
@@ -391,25 +391,25 @@
int i;
/* Stab in the dark trying to reset the CLUT pointer */
- writel(0, &dafb_cmap_regs->reset);
+ nubus_writel(0, &dafb_cmap_regs->reset);
nop();
/* Loop until we get to the register we want */
for (i = 0; i < regno; i++) {
- writeb(palette[i].red >> 8, &dafb_cmap_regs->lut);
+ nubus_writeb(palette[i].red >> 8, &dafb_cmap_regs->lut);
nop();
- writeb(palette[i].green >> 8, &dafb_cmap_regs->lut);
+ nubus_writeb(palette[i].green >> 8, &dafb_cmap_regs->lut);
nop();
- writeb(palette[i].blue >> 8, &dafb_cmap_regs->lut);
+ nubus_writeb(palette[i].blue >> 8, &dafb_cmap_regs->lut);
nop();
}
}
- writeb(red, &dafb_cmap_regs->lut);
+ nubus_writeb(red, &dafb_cmap_regs->lut);
nop();
- writeb(green, &dafb_cmap_regs->lut);
+ nubus_writeb(green, &dafb_cmap_regs->lut);
nop();
- writeb(blue, &dafb_cmap_regs->lut);
+ nubus_writeb(blue, &dafb_cmap_regs->lut);
restore_flags(flags);
@@ -441,12 +441,12 @@
In 2bpp, the regnos are 0x3f, 0x7f, 0xbf, 0xff */
_regno = (regno<<(8-video_bpp)) | (0xFF>>video_bpp);
- writeb(_regno, &v8_brazil_cmap_regs->addr); nop();
+ nubus_writeb(_regno, &v8_brazil_cmap_regs->addr); nop();
/* send one color channel at a time */
- writeb(_red, &v8_brazil_cmap_regs->lut); nop();
- writeb(_green, &v8_brazil_cmap_regs->lut); nop();
- writeb(_blue, &v8_brazil_cmap_regs->lut);
+ nubus_writeb(_red, &v8_brazil_cmap_regs->lut); nop();
+ nubus_writeb(_green, &v8_brazil_cmap_regs->lut); nop();
+ nubus_writeb(_blue, &v8_brazil_cmap_regs->lut);
restore_flags(flags);
@@ -475,15 +475,15 @@
_regno = regno + (256-(1<<video_bpp));
/* reset clut? (VideoToolbox sez "not necessary") */
- writeb(0xFF, &rbv_cmap_regs->cntl); nop();
+ nubus_writeb(0xFF, &rbv_cmap_regs->cntl); nop();
/* tell clut which address to use. */
- writeb(_regno, &rbv_cmap_regs->addr); nop();
+ nubus_writeb(_regno, &rbv_cmap_regs->addr); nop();
/* send one color channel at a time. */
- writeb(_red, &rbv_cmap_regs->lut); nop();
- writeb(_green, &rbv_cmap_regs->lut); nop();
- writeb(_blue, &rbv_cmap_regs->lut);
+ nubus_writeb(_red, &rbv_cmap_regs->lut); nop();
+ nubus_writeb(_green, &rbv_cmap_regs->lut); nop();
+ nubus_writeb(_blue, &rbv_cmap_regs->lut);
restore_flags(flags);
/* done. */
@@ -507,10 +507,10 @@
cli();
/* the nop's are there to order writes. */
- writeb(_regno, &cmap_regs->addr); nop();
- writeb(_red, &cmap_regs->lut); nop();
- writeb(_green, &cmap_regs->lut); nop();
- writeb(_blue, &cmap_regs->lut);
+ nubus_writeb(_regno, &cmap_regs->addr); nop();
+ nubus_writeb(_red, &cmap_regs->lut); nop();
+ nubus_writeb(_green, &cmap_regs->lut); nop();
+ nubus_writeb(_blue, &cmap_regs->lut);
restore_flags(flags);
return 0;
@@ -532,10 +532,10 @@
save_flags(flags);
cli();
- writeb(_regno, &cmap_regs->addr); nop();
- writeb(_red, &cmap_regs->lut); nop();
- writeb(_green, &cmap_regs->lut); nop();
- writeb(_blue, &cmap_regs->lut);
+ nubus_writeb(_regno, &cmap_regs->addr); nop();
+ nubus_writeb(_red, &cmap_regs->lut); nop();
+ nubus_writeb(_green, &cmap_regs->lut); nop();
+ nubus_writeb(_blue, &cmap_regs->lut);
restore_flags(flags);
return 0;
@@ -556,10 +556,10 @@
save_flags(flags);
cli();
- writeb(regno, &cmap_regs->addr); nop();
- writeb(_red, &cmap_regs->lut); nop();
- writeb(_green, &cmap_regs->lut); nop();
- writeb(_blue, &cmap_regs->lut);
+ nubus_writeb(regno, &cmap_regs->addr); nop();
+ nubus_writeb(_red, &cmap_regs->lut); nop();
+ nubus_writeb(_green, &cmap_regs->lut); nop();
+ nubus_writeb(_blue, &cmap_regs->lut);
restore_flags(flags);
return 0;
@@ -595,7 +595,7 @@
/*
* Set the register address
*/
- writeb(regno, &civic_cmap_regs->addr); nop();
+ nubus_writeb(regno, &civic_cmap_regs->addr); nop();
/*
* Wait for VBL interrupt here;
@@ -604,7 +604,7 @@
#if 0
{
#define CIVIC_VBL_OFFSET 0x120
- volatile unsigned long *vbl = readl(civic_cmap_regs->vbl_addr + CIVIC_VBL_OFFSET);
+ volatile unsigned long *vbl = nubus_readl(civic_cmap_regs->vbl_addr + CIVIC_VBL_OFFSET);
/* do interrupt setup stuff here? */
*vbl = 0L; nop(); /* clear */
*vbl = 1L; nop(); /* set */
@@ -620,42 +620,42 @@
* Grab a status word and do some checking;
* Then finally write the clut!
*/
- clut_status = readb(&civic_cmap_regs->status2);
+ clut_status = nubus_readb(&civic_cmap_regs->status2);
if ((clut_status & 0x0008) == 0)
{
#if 0
if ((clut_status & 0x000D) != 0)
{
- writeb(0x00, &civic_cmap_regs->lut); nop();
- writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
}
#endif
- writeb( red, &civic_cmap_regs->lut); nop();
- writeb(green, &civic_cmap_regs->lut); nop();
- writeb( blue, &civic_cmap_regs->lut); nop();
- writeb( 0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb( red, &civic_cmap_regs->lut); nop();
+ nubus_writeb(green, &civic_cmap_regs->lut); nop();
+ nubus_writeb( blue, &civic_cmap_regs->lut); nop();
+ nubus_writeb( 0x00, &civic_cmap_regs->lut); nop();
}
else
{
unsigned char junk;
- junk = readb(&civic_cmap_regs->lut); nop();
- junk = readb(&civic_cmap_regs->lut); nop();
- junk = readb(&civic_cmap_regs->lut); nop();
- junk = readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
+ junk = nubus_readb(&civic_cmap_regs->lut); nop();
if ((clut_status & 0x000D) != 0)
{
- writeb(0x00, &civic_cmap_regs->lut); nop();
- writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
+ nubus_writeb(0x00, &civic_cmap_regs->lut); nop();
}
- writeb( red, &civic_cmap_regs->lut); nop();
- writeb(green, &civic_cmap_regs->lut); nop();
- writeb( blue, &civic_cmap_regs->lut); nop();
- writeb( junk, &civic_cmap_regs->lut); nop();
+ nubus_writeb( red, &civic_cmap_regs->lut); nop();
+ nubus_writeb(green, &civic_cmap_regs->lut); nop();
+ nubus_writeb( blue, &civic_cmap_regs->lut); nop();
+ nubus_writeb( junk, &civic_cmap_regs->lut); nop();
}
restore_flags(flags);
@@ -896,7 +896,7 @@
video_linelength = mac_bi_data.videorow;
video_size = video_linelength * video_height;
/* Note: physical address (since 2.1.127) */
- video_base = (void*) mac_bi_data.videoaddr;
+ video_base = mac_bi_data.videoaddr;
/* This is actually redundant with the initial mappings.
However, there are some non-obvious aspects to the way
those mappings are set up, so this is in fact the safest
@@ -904,7 +904,7 @@
Mac */
video_vbase = ioremap(mac_bi_data.videoaddr, video_size);
- printk("macfb: framebuffer at 0x%p, mapped to 0x%p, size %dk\n",
+ printk("macfb: framebuffer at 0x%08lx, mapped to 0x%p, size %dk\n",
video_base, video_vbase, video_size/1024);
printk("macfb: mode is %dx%dx%d, linelength=%d\n",
video_width, video_height, video_bpp, video_linelength);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)