patch-2.1.124 linux/drivers/video/S3triofb.c
Next file: linux/drivers/video/acornfb.c
Previous file: linux/drivers/video/Makefile
Back to the patch index
Back to the overall index
- Lines: 134
- Date:
Thu Oct 1 10:02:21 1998
- Orig file:
v2.1.123/linux/drivers/video/S3triofb.c
- Orig date:
Sun Jul 26 11:57:17 1998
diff -u --recursive --new-file v2.1.123/linux/drivers/video/S3triofb.c linux/drivers/video/S3triofb.c
@@ -45,9 +45,9 @@
#include <asm/vc_ioctl.h>
#endif
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "s3blit.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/s3blit.h>
#define mem_in8(addr) in_8((void *)(addr))
@@ -250,8 +250,7 @@
struct fb_info *info)
{
if (con == currcon) /* current console? */
- return fb_get_cmap(cmap, &fb_display[con].var, kspc, s3trio_getcolreg,
- info);
+ return fb_get_cmap(cmap, kspc, s3trio_getcolreg, info);
else if (fb_display[con].cmap.len) /* non default colormap? */
fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
else
@@ -276,8 +275,7 @@
return err;
}
if (con == currcon) /* current console? */
- return fb_set_cmap(cmap, &fb_display[con].var, kspc, s3trio_setcolreg,
- info);
+ return fb_set_cmap(cmap, kspc, s3trio_setcolreg, info);
else
fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
return 0;
@@ -574,7 +572,7 @@
else
disp.dispsw = &fbcon_cfb8;
#else
- disp.dispsw = NULL;
+ disp.dispsw = &fbcon_dummy;
#endif
disp.scrollmode = fb_var.accel_flags & FB_ACCELF_TEXT ? 0 : SCROLL_YREDRAW;
@@ -612,6 +610,7 @@
}
#endif /* CONFIG_FB_COMPAT_XPMAC) */
+ fb_info.flags = FBINFO_FLAG_DEFAULT;
if (register_framebuffer(&fb_info) < 0)
return;
@@ -624,8 +623,7 @@
{
/* Do we have to save the colormap? */
if (fb_display[currcon].cmap.len)
- fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
- s3trio_getcolreg, info);
+ fb_get_cmap(&fb_display[currcon].cmap, 1, s3trio_getcolreg, info);
currcon = con;
/* Install new colormap */
@@ -678,17 +676,16 @@
{
if (regno > 255)
return 1;
- *red = palette[regno].red;
- *green = palette[regno].green;
- *blue = palette[regno].blue;
+ *red = (palette[regno].red << 8) | palette[regno].red;
+ *green = (palette[regno].green << 8) | palette[regno].green;
+ *blue = (palette[regno].blue << 8) | palette[regno].blue;
+ *transp = 0;
return 0;
}
/*
- * Set a single color register. The values supplied are already
- * rounded down to the hardware's capabilities (according to the
- * entries in the var structure). Return != 0 for invalid regno.
+ * Set a single color register. Return != 0 for invalid regno.
*/
static int s3trio_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
@@ -696,6 +693,10 @@
{
if (regno > 255)
return 1;
+
+ red >>= 8;
+ green >>= 8;
+ blue >>= 8;
palette[regno].red = red;
palette[regno].green = green;
palette[regno].blue = blue;
@@ -714,11 +715,10 @@
if (con != currcon)
return;
if (fb_display[con].cmap.len)
- fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
- s3trio_setcolreg, &fb_info);
+ fb_set_cmap(&fb_display[con].cmap, 1, s3trio_setcolreg, &fb_info);
else
- fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel),
- &fb_display[con].var, 1, s3trio_setcolreg, &fb_info);
+ fb_set_cmap(fb_default_cmap(fb_display[con].var.bits_per_pixel), 1,
+ s3trio_setcolreg, &fb_info);
}
void s3triofb_setup(char *options, int *ints) {
@@ -837,9 +837,9 @@
int dx, int height, int width)
{
sx *= 8; dx *= 8; width *= 8;
- Trio_BitBLT((u_short)sx, (u_short)(sy*p->fontheight), (u_short)dx,
- (u_short)(dy*p->fontheight), (u_short)width,
- (u_short)(height*p->fontheight), (u_short)S3_NEW);
+ Trio_BitBLT((u_short)sx, (u_short)(sy*fontheight(p)), (u_short)dx,
+ (u_short)(dy*fontheight(p)), (u_short)width,
+ (u_short)(height*fontheight(p)), (u_short)S3_NEW);
}
static void fbcon_trio8_clear(struct vc_data *conp, struct display *p, int sy,
@@ -850,9 +850,9 @@
sx *= 8; width *= 8;
bg = attr_bgcol_ec(p,conp);
Trio_RectFill((u_short)sx,
- (u_short)(sy*p->fontheight),
+ (u_short)(sy*fontheight(p)),
(u_short)width,
- (u_short)(height*p->fontheight),
+ (u_short)(height*fontheight(p)),
(u_short)S3_NEW,
(u_short)bg);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov