Commit 26ce92c6 authored by James Simmons's avatar James Simmons

[FBDEV] Accelerated functions pass in const structs.

[ATY128 FBDEV] Gcc compile issue fixes.
parent 1ea48bea
...@@ -1799,6 +1799,7 @@ static void * __init aty128_map_ROM(struct pci_dev *dev) ...@@ -1799,6 +1799,7 @@ static void * __init aty128_map_ROM(struct pci_dev *dev)
// no need to search for the ROM, just ask the card where it is. // no need to search for the ROM, just ask the card where it is.
struct resource *r = &dev->resource[PCI_ROM_RESOURCE]; struct resource *r = &dev->resource[PCI_ROM_RESOURCE];
unsigned char *addr;
// assign the ROM an address if it doesn't have one // assign the ROM an address if it doesn't have one
if (r->start == 0) if (r->start == 0)
...@@ -1808,7 +1809,7 @@ static void * __init aty128_map_ROM(struct pci_dev *dev) ...@@ -1808,7 +1809,7 @@ static void * __init aty128_map_ROM(struct pci_dev *dev)
if (!(r->flags & PCI_ROM_ADDRESS_ENABLE)) if (!(r->flags & PCI_ROM_ADDRESS_ENABLE))
pci_write_config_dword(dev, dev->rom_base_reg, r->start | PCI_ROM_ADDRESS_ENABLE); pci_write_config_dword(dev, dev->rom_base_reg, r->start | PCI_ROM_ADDRESS_ENABLE);
unsigned char *addr = ioremap(r->start, r->end - r->start + 1); addr = ioremap(r->start, r->end - r->start + 1);
// Very simple test to make sure it appeared // Very simple test to make sure it appeared
if (addr && (*addr != 0x55)) { if (addr && (*addr != 0x55)) {
...@@ -1821,15 +1822,15 @@ static void * __init aty128_map_ROM(struct pci_dev *dev) ...@@ -1821,15 +1822,15 @@ static void * __init aty128_map_ROM(struct pci_dev *dev)
static void __init aty128_unmap_ROM(struct pci_dev *dev, void * rom) static void __init aty128_unmap_ROM(struct pci_dev *dev, void * rom)
{ {
iounmap(rom);
// leave it disabled and unassigned // leave it disabled and unassigned
struct resource *r = &dev->resource[PCI_ROM_RESOURCE]; struct resource *r = &dev->resource[PCI_ROM_RESOURCE];
iounmap(rom);
r->flags &= !PCI_ROM_ADDRESS_ENABLE; r->flags &= !PCI_ROM_ADDRESS_ENABLE;
r->end -= r->start; r->end -= r->start;
r->start = 0; r->start = 0;
pci_write_config_dword(dev, dev->rom_base_reg, 0); pci_write_config_dword(dev, dev->rom_base_reg, 0);
} }
static void __init static void __init
......
...@@ -35,8 +35,8 @@ static int cg6_setcolreg(unsigned, unsigned, unsigned, unsigned, ...@@ -35,8 +35,8 @@ static int cg6_setcolreg(unsigned, unsigned, unsigned, unsigned,
unsigned, struct fb_info *); unsigned, struct fb_info *);
static int cg6_blank(int, struct fb_info *); static int cg6_blank(int, struct fb_info *);
static void cg6_imageblit(struct fb_info *, struct fb_image *); static void cg6_imageblit(struct fb_info *, const struct fb_image *);
static void cg6_fillrect(struct fb_info *, struct fb_fillrect *); static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *);
static int cg6_sync(struct fb_info *); static int cg6_sync(struct fb_info *);
static int cg6_mmap(struct fb_info *, struct file *, struct vm_area_struct *); static int cg6_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
...@@ -290,7 +290,7 @@ static int cg6_sync(struct fb_info *info) ...@@ -290,7 +290,7 @@ static int cg6_sync(struct fb_info *info)
* @info: frame buffer structure that represents a single frame buffer * @info: frame buffer structure that represents a single frame buffer
* @rect: structure defining the rectagle and operation. * @rect: structure defining the rectagle and operation.
*/ */
static void cg6_fillrect(struct fb_info *info, struct fb_fillrect *rect) static void cg6_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct cg6_par *par = (struct cg6_par *) info->par; struct cg6_par *par = (struct cg6_par *) info->par;
struct cg6_fbc *fbc = par->fbc; struct cg6_fbc *fbc = par->fbc;
...@@ -325,7 +325,7 @@ static void cg6_fillrect(struct fb_info *info, struct fb_fillrect *rect) ...@@ -325,7 +325,7 @@ static void cg6_fillrect(struct fb_info *info, struct fb_fillrect *rect)
* @info: frame buffer structure that represents a single frame buffer * @info: frame buffer structure that represents a single frame buffer
* @image: structure defining the image. * @image: structure defining the image.
*/ */
static void cg6_imageblit(struct fb_info *info, struct fb_image *image) static void cg6_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
struct cg6_par *par = (struct cg6_par *) info->par; struct cg6_par *par = (struct cg6_par *) info->par;
struct cg6_fbc *fbc = par->fbc; struct cg6_fbc *fbc = par->fbc;
......
...@@ -113,7 +113,7 @@ static struct fb_info fb_info; ...@@ -113,7 +113,7 @@ static struct fb_info fb_info;
/* frame buffer operations */ /* frame buffer operations */
static int dnfb_blank(int blank, struct fb_info *info); static int dnfb_blank(int blank, struct fb_info *info);
static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area); static void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
static struct fb_ops dn_fb_ops = { static struct fb_ops dn_fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -154,18 +154,17 @@ static int dnfb_blank(int blank, struct fb_info *info) ...@@ -154,18 +154,17 @@ static int dnfb_blank(int blank, struct fb_info *info)
} }
static static
void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area) void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
int incr, y_delta, pre_read = 0, x_end, x_word_count; int incr, y_delta, pre_read = 0, x_end, x_word_count;
ushort *src, dummy;
uint start_mask, end_mask, dest; uint start_mask, end_mask, dest;
ushort *src, dummy;
short i, j; short i, j;
incr = (area->dy <= area->sy) ? 1 : -1; incr = (area->dy <= area->sy) ? 1 : -1;
src = src = (ushort *)(info->screen_base + area->sy * info->fix.line_length +
(ushort *) (info->screen_base + area->sy * info->fix.line_length +
(area->sx >> 4)); (area->sx >> 4));
dest = area->dy * (info->fix.line_length >> 1) + (area->dx >> 4); dest = area->dy * (info->fix.line_length >> 1) + (area->dx >> 4);
......
...@@ -34,9 +34,9 @@ static int ffb_setcolreg(unsigned, unsigned, unsigned, unsigned, ...@@ -34,9 +34,9 @@ static int ffb_setcolreg(unsigned, unsigned, unsigned, unsigned,
static int ffb_blank(int, struct fb_info *); static int ffb_blank(int, struct fb_info *);
static void ffb_init_fix(struct fb_info *); static void ffb_init_fix(struct fb_info *);
static void ffb_imageblit(struct fb_info *, struct fb_image *); static void ffb_imageblit(struct fb_info *, const struct fb_image *);
static void ffb_fillrect(struct fb_info *, struct fb_fillrect *); static void ffb_fillrect(struct fb_info *, const struct fb_fillrect *);
static void ffb_copyarea(struct fb_info *, struct fb_copyarea *); static void ffb_copyarea(struct fb_info *, const struct fb_copyarea *);
static int ffb_sync(struct fb_info *); static int ffb_sync(struct fb_info *);
static int ffb_mmap(struct fb_info *, struct file *, struct vm_area_struct *); static int ffb_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
...@@ -491,7 +491,7 @@ static void ffb_switch_from_graph(struct ffb_par *par) ...@@ -491,7 +491,7 @@ static void ffb_switch_from_graph(struct ffb_par *par)
* @info: frame buffer structure that represents a single frame buffer * @info: frame buffer structure that represents a single frame buffer
* @rect: structure defining the rectagle and operation. * @rect: structure defining the rectagle and operation.
*/ */
static void ffb_fillrect(struct fb_info *info, struct fb_fillrect *rect) static void ffb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct ffb_par *par = (struct ffb_par *) info->par; struct ffb_par *par = (struct ffb_par *) info->par;
struct ffb_fbc *fbc = par->fbc; struct ffb_fbc *fbc = par->fbc;
...@@ -540,7 +540,7 @@ static void ffb_fillrect(struct fb_info *info, struct fb_fillrect *rect) ...@@ -540,7 +540,7 @@ static void ffb_fillrect(struct fb_info *info, struct fb_fillrect *rect)
*/ */
static void static void
ffb_copyarea(struct fb_info *info, struct fb_copyarea *area) ffb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
struct ffb_par *par = (struct ffb_par *) info->par; struct ffb_par *par = (struct ffb_par *) info->par;
struct ffb_fbc *fbc = par->fbc; struct ffb_fbc *fbc = par->fbc;
...@@ -576,7 +576,7 @@ ffb_copyarea(struct fb_info *info, struct fb_copyarea *area) ...@@ -576,7 +576,7 @@ ffb_copyarea(struct fb_info *info, struct fb_copyarea *area)
* @info: frame buffer structure that represents a single frame buffer * @info: frame buffer structure that represents a single frame buffer
* @image: structure defining the image. * @image: structure defining the image.
*/ */
static void ffb_imageblit(struct fb_info *info, struct fb_image *image) static void ffb_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
struct ffb_par *par = (struct ffb_par *) info->par; struct ffb_par *par = (struct ffb_par *) info->par;
struct ffb_fbc *fbc = par->fbc; struct ffb_fbc *fbc = par->fbc;
......
...@@ -468,7 +468,7 @@ static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -468,7 +468,7 @@ static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
} }
} }
static void hgafb_copyarea(struct fb_info *info, struct fb_copyarea *area) static void hgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
u_int rows, y1, y2; u_int rows, y1, y2;
u8 *src, *dest; u8 *src, *dest;
...@@ -498,9 +498,9 @@ static void hgafb_copyarea(struct fb_info *info, struct fb_copyarea *area) ...@@ -498,9 +498,9 @@ static void hgafb_copyarea(struct fb_info *info, struct fb_copyarea *area)
} }
} }
static void hgafb_imageblit(struct fb_info *info, struct fb_image *image) static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
u8 *dest, *cdat = image->data; u8 *dest, *cdat = (u8 *) image->data;
u_int rows, y = image->dy; u_int rows, y = image->dy;
u8 d; u8 d;
......
...@@ -86,7 +86,7 @@ static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -86,7 +86,7 @@ static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green,
return 0; return 0;
} }
void hpfb_copyarea(struct fb_info *info, struct fb_copyarea *area) void hpfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
while (in_8(fb_regs + BUSY) & fb_bitmask); while (in_8(fb_regs + BUSY) & fb_bitmask);
out_8(fb_regs + WMRR, 0x3); out_8(fb_regs + WMRR, 0x3);
......
...@@ -1359,33 +1359,30 @@ neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -1359,33 +1359,30 @@ neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
} }
static void static void
neo2200_copyarea(struct fb_info *info, struct fb_copyarea *area) neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = (struct neofb_par *) info->par;
u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy;
u_long src, dst, bltCntl; u_long src, dst, bltCntl;
bltCntl = NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0C0000; bltCntl = NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0C0000;
if (area->sy < area->dy) { if (sy < dy) {
area->sy += (area->height - 1); sy += (area->height - 1);
area->dy += (area->height - 1); dy += (area->height - 1);
bltCntl |= NEO_BC0_DST_Y_DEC | NEO_BC0_SRC_Y_DEC; bltCntl |= NEO_BC0_DST_Y_DEC | NEO_BC0_SRC_Y_DEC;
} }
if (area->sx < area->dx) { if (area->sx < area->dx) {
area->sx += (area->width - 1); sx += (area->width - 1);
area->dx += (area->width - 1); dx += (area->width - 1);
bltCntl |= NEO_BC0_X_DEC; bltCntl |= NEO_BC0_X_DEC;
} }
src = src = sx * (info->var.bits_per_pixel >> 3) + sy*info->fix.line_length;
area->sx * (info->var.bits_per_pixel >> 3) + dst = dx * (info->var.bits_per_pixel >> 3) + dy*info->fix.line_length;
area->sy * info->fix.line_length;
dst =
area->dx * (info->var.bits_per_pixel >> 3) +
area->dy * info->fix.line_length;
neo2200_wait_fifo(info, 4); neo2200_wait_fifo(info, 4);
...@@ -1399,7 +1396,7 @@ neo2200_copyarea(struct fb_info *info, struct fb_copyarea *area) ...@@ -1399,7 +1396,7 @@ neo2200_copyarea(struct fb_info *info, struct fb_copyarea *area)
} }
static void static void
neo2200_imageblit(struct fb_info *info, struct fb_image *image) neo2200_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
struct neofb_par *par = (struct neofb_par *) info->par; struct neofb_par *par = (struct neofb_par *) info->par;
...@@ -1452,7 +1449,7 @@ neofb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -1452,7 +1449,7 @@ neofb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
} }
static void static void
neofb_copyarea(struct fb_info *info, struct fb_copyarea *area) neofb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
switch (info->fix.accel) { switch (info->fix.accel) {
case FB_ACCEL_NEOMAGIC_NM2200: case FB_ACCEL_NEOMAGIC_NM2200:
...@@ -1468,7 +1465,7 @@ neofb_copyarea(struct fb_info *info, struct fb_copyarea *area) ...@@ -1468,7 +1465,7 @@ neofb_copyarea(struct fb_info *info, struct fb_copyarea *area)
} }
static void static void
neofb_imageblit(struct fb_info *info, struct fb_image *image) neofb_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
switch (info->fix.accel) { switch (info->fix.accel) {
case FB_ACCEL_NEOMAGIC_NM2200: case FB_ACCEL_NEOMAGIC_NM2200:
...@@ -1483,7 +1480,7 @@ neofb_imageblit(struct fb_info *info, struct fb_image *image) ...@@ -1483,7 +1480,7 @@ neofb_imageblit(struct fb_info *info, struct fb_image *image)
} }
} }
static void static int
neofb_sync(struct fb_info *info) neofb_sync(struct fb_info *info)
{ {
switch (info->fix.accel) { switch (info->fix.accel) {
...@@ -1495,7 +1492,8 @@ neofb_sync(struct fb_info *info) ...@@ -1495,7 +1492,8 @@ neofb_sync(struct fb_info *info)
break; break;
default: default:
break; break;
} }
return 0;
} }
static struct fb_ops neofb_ops = { static struct fb_ops neofb_ops = {
......
...@@ -289,7 +289,7 @@ int sisfb_initaccel(void) ...@@ -289,7 +289,7 @@ int sisfb_initaccel(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34) /* --- KERNEL 2.5.34 and later --- */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34) /* --- KERNEL 2.5.34 and later --- */
void fbcon_sis_fillrect(struct fb_info *info, struct fb_fillrect *rect) void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
CRITFLAGS CRITFLAGS
...@@ -312,7 +312,7 @@ void fbcon_sis_fillrect(struct fb_info *info, struct fb_fillrect *rect) ...@@ -312,7 +312,7 @@ void fbcon_sis_fillrect(struct fb_info *info, struct fb_fillrect *rect)
} }
void fbcon_sis_copyarea(struct fb_info *info, struct fb_copyarea *area) void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
int xdir, ydir; int xdir, ydir;
CRITFLAGS CRITFLAGS
......
...@@ -833,7 +833,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file, ...@@ -833,7 +833,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file,
* Screen-to-Screen BitBlt 2D command (for the bmove fb op.) - Voodoo2 only * Screen-to-Screen BitBlt 2D command (for the bmove fb op.) - Voodoo2 only
*/ */
#if 0 #if 0
static void sstfb_copyarea(struct fb_info *info, struct fb_copyarea *area) static void sstfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
struct sstfb_par *par = (struct sstfb_par *) info->par; struct sstfb_par *par = (struct sstfb_par *) info->par;
u32 stride = info->fix.line_length; u32 stride = info->fix.line_length;
......
...@@ -163,8 +163,8 @@ static int tdfxfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -163,8 +163,8 @@ static int tdfxfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static int tdfxfb_blank(int blank, struct fb_info *info); static int tdfxfb_blank(int blank, struct fb_info *info);
static int tdfxfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); static int tdfxfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
static void tdfxfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); static void tdfxfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
static void tdfxfb_copyarea(struct fb_info *info, struct fb_copyarea *area); static void tdfxfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
static void tdfxfb_imageblit(struct fb_info *info, struct fb_image *image); static void tdfxfb_imageblit(struct fb_info *info, const struct fb_image *image);
static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor); static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor);
static int banshee_wait_idle(struct fb_info *info); static int banshee_wait_idle(struct fb_info *info);
...@@ -897,25 +897,26 @@ static void tdfxfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect ...@@ -897,25 +897,26 @@ static void tdfxfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect
/* /*
* Screen-to-Screen BitBlt 2D command (for the bmove fb op.) * Screen-to-Screen BitBlt 2D command (for the bmove fb op.)
*/ */
static void tdfxfb_copyarea(struct fb_info *info, struct fb_copyarea *area) static void tdfxfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
struct tdfx_par *par = (struct tdfx_par *) info->par; struct tdfx_par *par = (struct tdfx_par *) info->par;
u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy;
u32 bpp = info->var.bits_per_pixel; u32 bpp = info->var.bits_per_pixel;
u32 stride = info->fix.line_length; u32 stride = info->fix.line_length;
u32 blitcmd = COMMAND_2D_S2S_BITBLT | (TDFX_ROP_COPY << 24); u32 blitcmd = COMMAND_2D_S2S_BITBLT | (TDFX_ROP_COPY << 24);
u32 fmt = stride | ((bpp+((bpp==8) ? 0 : 8)) << 13); u32 fmt = stride | ((bpp+((bpp==8) ? 0 : 8)) << 13);
if (area->sx <= area->dx) { if (area->sx <= area->dx) {
//-X //-X
blitcmd |= BIT(14); blitcmd |= BIT(14);
area->sx += area->width - 1; sx += area->width - 1;
area->dx += area->width - 1; dx += area->width - 1;
} }
if (area->sy <= area->dy) { if (area->sy <= area->dy) {
//-Y //-Y
blitcmd |= BIT(15); blitcmd |= BIT(15);
area->sy += area->height - 1; sy += area->height - 1;
area->dy += area->height - 1; dy += area->height - 1;
} }
banshee_make_room(par, 6); banshee_make_room(par, 6);
...@@ -924,12 +925,12 @@ static void tdfxfb_copyarea(struct fb_info *info, struct fb_copyarea *area) ...@@ -924,12 +925,12 @@ static void tdfxfb_copyarea(struct fb_info *info, struct fb_copyarea *area)
tdfx_outl(par, DSTFORMAT, fmt); tdfx_outl(par, DSTFORMAT, fmt);
tdfx_outl(par, COMMAND_2D, blitcmd); tdfx_outl(par, COMMAND_2D, blitcmd);
tdfx_outl(par, DSTSIZE, area->width | (area->height << 16)); tdfx_outl(par, DSTSIZE, area->width | (area->height << 16));
tdfx_outl(par, DSTXY, area->dx | (area->dy << 16)); tdfx_outl(par, DSTXY, dx | (dy << 16));
tdfx_outl(par, LAUNCH_2D, area->sx | (area->sy << 16)); tdfx_outl(par, LAUNCH_2D, sx | (sy << 16));
banshee_wait_idle(info); banshee_wait_idle(info);
} }
static void tdfxfb_imageblit(struct fb_info *info, struct fb_image *pixmap) static void tdfxfb_imageblit(struct fb_info *info, const struct fb_image *pixmap)
{ {
struct tdfx_par *par = (struct tdfx_par *) info->par; struct tdfx_par *par = (struct tdfx_par *) info->par;
int size = pixmap->height*((pixmap->width*pixmap->depth + 7)>>3); int size = pixmap->height*((pixmap->width*pixmap->depth + 7)>>3);
...@@ -1069,7 +1070,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1069,7 +1070,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
* the two monochrome patterns. * the two monochrome patterns.
*/ */
u8 *cursorbase = (u8 *) info->cursor.image.data; u8 *cursorbase = (u8 *) info->cursor.image.data;
char *bitmap = cursor->image.data; char *bitmap = (char *)cursor->image.data;
char *mask = cursor->mask; char *mask = cursor->mask;
int i, j, k, h = 0; int i, j, k, h = 0;
......
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/selection.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/io.h> #include <asm/io.h>
#include <video/tgafb.h> #include <video/tgafb.h>
/* /*
* Local functions. * Local functions.
*/ */
...@@ -40,9 +38,9 @@ static int tgafb_setcolreg(unsigned, unsigned, unsigned, unsigned, ...@@ -40,9 +38,9 @@ static int tgafb_setcolreg(unsigned, unsigned, unsigned, unsigned,
static int tgafb_blank(int, struct fb_info *); static int tgafb_blank(int, struct fb_info *);
static void tgafb_init_fix(struct fb_info *); static void tgafb_init_fix(struct fb_info *);
static void tgafb_imageblit(struct fb_info *, struct fb_image *); static void tgafb_imageblit(struct fb_info *, const struct fb_image *);
static void tgafb_fillrect(struct fb_info *, struct fb_fillrect *); static void tgafb_fillrect(struct fb_info *, const struct fb_fillrect *);
static void tgafb_copyarea(struct fb_info *, struct fb_copyarea *); static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *); static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *);
#ifdef MODULE #ifdef MODULE
...@@ -520,7 +518,7 @@ tgafb_blank(int blank, struct fb_info *info) ...@@ -520,7 +518,7 @@ tgafb_blank(int blank, struct fb_info *info)
* @image: structure defining the image. * @image: structure defining the image.
*/ */
static void static void
tgafb_imageblit(struct fb_info *info, struct fb_image *image) tgafb_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
static unsigned char const bitrev[256] = { static unsigned char const bitrev[256] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
...@@ -779,7 +777,7 @@ tgafb_imageblit(struct fb_info *info, struct fb_image *image) ...@@ -779,7 +777,7 @@ tgafb_imageblit(struct fb_info *info, struct fb_image *image)
* @rect: structure defining the rectagle and operation. * @rect: structure defining the rectagle and operation.
*/ */
static void static void
tgafb_fillrect(struct fb_info *info, struct fb_fillrect *rect) tgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct tga_par *par = (struct tga_par *) info->par; struct tga_par *par = (struct tga_par *) info->par;
int is8bpp = info->var.bits_per_pixel == 8; int is8bpp = info->var.bits_per_pixel == 8;
...@@ -1162,7 +1160,7 @@ copyarea_foreward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, ...@@ -1162,7 +1160,7 @@ copyarea_foreward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy,
static inline void static inline void
copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy,
u32 height, u32 width, u32 line_length, u32 height, u32 width, u32 line_length,
struct fb_copyarea *area) const struct fb_copyarea *area)
{ {
struct tga_par *par = (struct tga_par *) info->par; struct tga_par *par = (struct tga_par *) info->par;
unsigned long i, left, yincr; unsigned long i, left, yincr;
...@@ -1261,7 +1259,7 @@ copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy, ...@@ -1261,7 +1259,7 @@ copyarea_backward_8bpp(struct fb_info *info, u32 dx, u32 dy, u32 sx, u32 sy,
} }
static void static void
tgafb_copyarea(struct fb_info *info, struct fb_copyarea *area) tgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{ {
unsigned long dx, dy, width, height, sx, sy, vxres, vyres; unsigned long dx, dy, width, height, sx, sy, vxres, vyres;
unsigned long line_length, bpp; unsigned long line_length, bpp;
......
...@@ -468,7 +468,7 @@ static void tridentfb_fillrect(struct fb_info * info, const struct fb_fillrect * ...@@ -468,7 +468,7 @@ static void tridentfb_fillrect(struct fb_info * info, const struct fb_fillrect *
acc->fill_rect(fr->dx, fr->dy, fr->width, fr->height, col, fr->rop); acc->fill_rect(fr->dx, fr->dy, fr->width, fr->height, col, fr->rop);
acc->wait_engine(); acc->wait_engine();
} }
static void tridentfb_copyarea(struct fb_info *info, struct fb_copyarea *ca) static void tridentfb_copyarea(struct fb_info *info, const struct fb_copyarea *ca)
{ {
acc->copy_rect(ca->sx,ca->sy,ca->dx,ca->dy,ca->width,ca->height); acc->copy_rect(ca->sx,ca->sy,ca->dx,ca->dy,ca->width,ca->height);
acc->wait_engine(); acc->wait_engine();
......
...@@ -1165,7 +1165,7 @@ static unsigned int transl_l[] = ...@@ -1165,7 +1165,7 @@ static unsigned int transl_l[] =
#endif #endif
#endif #endif
void vga_8planes_imageblit(struct fb_info *info, struct fb_image *image) void vga_8planes_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
char oldindex = getindex(); char oldindex = getindex();
char oldmode = setmode(0x40); char oldmode = setmode(0x40);
...@@ -1196,7 +1196,7 @@ void vga_8planes_imageblit(struct fb_info *info, struct fb_image *image) ...@@ -1196,7 +1196,7 @@ void vga_8planes_imageblit(struct fb_info *info, struct fb_image *image)
setindex(oldindex); setindex(oldindex);
} }
void vga_imageblit_expand(struct fb_info *info, struct fb_image *image) void vga_imageblit_expand(struct fb_info *info, const struct fb_image *image)
{ {
char *where = info->screen_base + (image->dx/8) + char *where = info->screen_base + (image->dx/8) +
image->dy * info->fix.line_length; image->dy * info->fix.line_length;
...@@ -1259,7 +1259,7 @@ void vga_imageblit_expand(struct fb_info *info, struct fb_image *image) ...@@ -1259,7 +1259,7 @@ void vga_imageblit_expand(struct fb_info *info, struct fb_image *image)
} }
} }
void vga_imageblit_color(struct fb_info *info, struct fb_image *image) void vga_imageblit_color(struct fb_info *info, const struct fb_image *image)
{ {
/* /*
* Draw logo * Draw logo
...@@ -1302,14 +1302,12 @@ void vga_imageblit_color(struct fb_info *info, struct fb_image *image) ...@@ -1302,14 +1302,12 @@ void vga_imageblit_color(struct fb_info *info, struct fb_image *image)
} }
} }
void vga16fb_imageblit(struct fb_info *info, const struct fb_image *img) void vga16fb_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
struct fb_image image = *img; if (image->depth == 0)
vga_imageblit_expand(info, image);
if (image.depth == 0) else if (image->depth == info->var.bits_per_pixel)
vga_imageblit_expand(info, &image); vga_imageblit_color(info, image);
else if (image.depth == info->var.bits_per_pixel)
vga_imageblit_color(info, &image);
} }
static struct fb_ops vga16fb_ops = { static struct fb_ops vga16fb_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment