You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
(1) |
Apr
(104) |
May
(81) |
Jun
(248) |
Jul
(133) |
Aug
(33) |
Sep
(53) |
Oct
(82) |
Nov
(166) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(121) |
Feb
(42) |
Mar
(39) |
Apr
(84) |
May
(87) |
Jun
(58) |
Jul
(97) |
Aug
(130) |
Sep
(32) |
Oct
(139) |
Nov
(108) |
Dec
(216) |
| 2003 |
Jan
(299) |
Feb
(136) |
Mar
(392) |
Apr
(141) |
May
(137) |
Jun
(107) |
Jul
(94) |
Aug
(262) |
Sep
(300) |
Oct
(216) |
Nov
(72) |
Dec
(94) |
| 2004 |
Jan
(174) |
Feb
(192) |
Mar
(215) |
Apr
(314) |
May
(319) |
Jun
(293) |
Jul
(205) |
Aug
(161) |
Sep
(192) |
Oct
(226) |
Nov
(308) |
Dec
(89) |
| 2005 |
Jan
(127) |
Feb
(269) |
Mar
(588) |
Apr
(106) |
May
(77) |
Jun
(77) |
Jul
(161) |
Aug
(239) |
Sep
(86) |
Oct
(112) |
Nov
(153) |
Dec
(145) |
| 2006 |
Jan
(87) |
Feb
(57) |
Mar
(129) |
Apr
(109) |
May
(102) |
Jun
(232) |
Jul
(97) |
Aug
(69) |
Sep
(67) |
Oct
(69) |
Nov
(214) |
Dec
(82) |
| 2007 |
Jan
(133) |
Feb
(307) |
Mar
(121) |
Apr
(171) |
May
(229) |
Jun
(156) |
Jul
(185) |
Aug
(160) |
Sep
(122) |
Oct
(130) |
Nov
(78) |
Dec
(27) |
| 2008 |
Jan
(105) |
Feb
(137) |
Mar
(146) |
Apr
(148) |
May
(239) |
Jun
(208) |
Jul
(157) |
Aug
(244) |
Sep
(119) |
Oct
(125) |
Nov
(189) |
Dec
(225) |
| 2009 |
Jan
(157) |
Feb
(139) |
Mar
(106) |
Apr
(130) |
May
(246) |
Jun
(189) |
Jul
(128) |
Aug
(127) |
Sep
(88) |
Oct
(86) |
Nov
(216) |
Dec
(9) |
| 2010 |
Jan
(5) |
Feb
|
Mar
(11) |
Apr
(31) |
May
(3) |
Jun
|
Jul
(7) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Geert U. <ge...@li...> - 2002-09-09 14:36:17
|
On 9 Sep 2002, Antonino Daplas wrote:
> cfbcopyarea.c is just a 'copy 'n paste' of Geert's version I leached
> from fbutils (I hope this is okay with you, Geert :) The only changes
> are using FB_WRITEL and FB_READL where appropriate.
Of course (actually that was my intention ;-)
Did you measure any noticeable differences (performance-wise) with the old
routines?
BTW, expect a fillrect() for arbitrary bitdepths soon...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Antonino D. <ad...@po...> - 2002-09-09 14:23:15
|
On Mon, 2002-09-09 at 00:39, Linux PPC wrote: > > If the display is 8 bit, then it would require only > a byte to represent the value of the pixel. If it were 24 bit, > then it would require 3 bytes, and so > on. Is that right? What would happen, to the size required for the > buffer, if the display > requires, say 12 bits per pixel, or 18 bits? Just pad the pitch/line_length/stride of the buffer to the next byte alignment your hardware is capable of. It is acceptable to have excess bits/bytes which theoretically your hardware will ignore. Then the framebuffer size is line_length*yres_virtual. > > So, if I were to set all the bytes after screen_base > uptil screen_base + (hres*vres*bits_per_pixel/8) to > zeros, then I would get a black screen. Is that right? > For static pseudocolor and truecolor, that is true, since 0 is hardwired to black. For pseudocolor and directcolor, that depends on how the DAC/palette is loaded. In most cases, it will produce a black screen. Tony |
|
From: Antonino D. <ad...@po...> - 2002-09-09 14:22:36
|
The patch (fbset_rotate.diff), which is against fbset-2.1, adds 3 new
options to set the rotation:
fbset -{cw|ccw|ud} {true|false}
Try this with the modified vesafb.
Tony
<<------------------------------------------------------------------>>
diff -Naur fbset-orig/fb.h fbset-2.1/fb.h
--- fbset-orig/fb.h Wed Jun 23 22:09:48 1999
+++ fbset-2.1/fb.h Sat Sep 7 11:28:41 2002
@@ -137,6 +137,11 @@
#define FB_VMODE_DOUBLE 2 /* double scan */
#define FB_VMODE_MASK 255
+#define FB_VMODE_ROTATE_CW 0x010000
+#define FB_VMODE_ROTATE_CCW 0x020000
+#define FB_VMODE_ROTATE_UD 0x040000
+#define FB_ROTATE_MASK 0xFF0000
+
#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
diff -Naur fbset-orig/fbset.c fbset-2.1/fbset.c
--- fbset-orig/fbset.c Wed Jun 23 22:11:46 1999
+++ fbset-2.1/fbset.c Sun Sep 8 09:44:19 2002
@@ -89,6 +89,9 @@
static const char *Opt_bcast = NULL;
static const char *Opt_laced = NULL;
static const char *Opt_double = NULL;
+static const char *Opt_cw = NULL;
+static const char *Opt_ccw = NULL;
+static const char *Opt_ud = NULL;
static const char *Opt_move = NULL;
static const char *Opt_step = NULL;
static const char *Opt_modename = NULL;
@@ -126,6 +129,9 @@
{ "-bcast", &Opt_bcast, 1 },
{ "-laced", &Opt_laced, 1 },
{ "-double", &Opt_double, 1 },
+ { "-cw", &Opt_cw, 1 },
+ { "-ccw", &Opt_ccw, 1 },
+ { "-ud", &Opt_ud, 1 },
{ "-move", &Opt_move, 1 },
{ "-step", &Opt_step, 1 },
{ "-rgba", &Opt_rgba, 1 },
@@ -354,6 +360,15 @@
var->vmode = FB_VMODE_DOUBLE;
else
var->vmode = FB_VMODE_NONINTERLACED;
+
+ var->vmode &= ~FB_ROTATE_MASK;
+ if (vmode->cw == TRUE)
+ var->vmode |= FB_VMODE_ROTATE_CW;
+ else if (vmode->ccw == TRUE)
+ var->vmode |= FB_VMODE_ROTATE_CCW;
+ else if (vmode->ud == TRUE)
+ var->vmode |= FB_VMODE_ROTATE_UD;
+
var->vmode |= FB_VMODE_CONUPDATE;
var->red.length = vmode->red.length;
var->red.offset = vmode->red.offset;
@@ -402,6 +417,21 @@
vmode->dblscan = TRUE;
break;
}
+
+ vmode->cw = FALSE;
+ vmode->ccw = FALSE;
+ vmode->ud = FALSE;
+ switch (var->vmode & FB_ROTATE_MASK) {
+ case FB_VMODE_ROTATE_CW:
+ vmode->cw = TRUE;
+ break;
+ case FB_VMODE_ROTATE_CCW:
+ vmode->ccw = TRUE;
+ break;
+ case FB_VMODE_ROTATE_UD:
+ vmode->ud = TRUE;
+ break;
+ }
vmode->red.length = var->red.length;
vmode->red.offset = var->red.offset;
vmode->green.length = var->green.length;
@@ -567,6 +597,12 @@
vmode->laced = atoboolean(Opt_laced);
if (Opt_double)
vmode->dblscan = atoboolean(Opt_double);
+ if (Opt_cw)
+ vmode->cw = atoboolean(Opt_cw);
+ if (Opt_ccw)
+ vmode->ccw = atoboolean(Opt_ccw);
+ if (Opt_ud)
+ vmode->ud = atoboolean(Opt_ud);
if (Opt_grayscale)
vmode->grayscale = atoboolean(Opt_grayscale);
if (Opt_step)
@@ -643,6 +679,12 @@
puts(" laced true");
if (vmode->dblscan)
puts(" double true");
+ if (vmode->cw)
+ puts(" cw true");
+ if (vmode->ccw)
+ puts(" ccw true");
+ if (vmode->ud)
+ puts(" ud true");
if (vmode->nonstd)
printf(" nonstd %u\n", vmode->nonstd);
if (vmode->accel_flags)
@@ -677,6 +719,12 @@
printf(" \"Interlace\"");
if (vmode->dblscan)
printf(" \"DoubleScan\"");
+ if (vmode->cw)
+ printf(" \"Clockwise Rotation\"");
+ if (vmode->ccw)
+ printf(" \"CounterClockwise Rotation\"");
+ if (vmode->ud)
+ printf(" \"180 degree Rotation\"");
if (vmode->hsync)
printf(" \"+HSync\"");
else
@@ -879,6 +927,9 @@
" -bcast <value> : broadcast enable (false or true)\n"
" -laced <value> : interlace enable (false or true)\n"
" -double <value> : doublescan enable (false or true)\n"
+ " -cw <value> : rotate clockwise (false or true)\n"
+ " -ccw <value> : rotate counter clockwise (false or true)\n"
+ " -ud <value> : rotate 180 degrees (false or true)\n"
" -rgba <r,g,b,a> : recommended length of color entries\n"
" -grayscale <value> : grayscale enable (false or true)\n"
" Display positioning:\n"
diff -Naur fbset-orig/fbset.h fbset-2.1/fbset.h
--- fbset-orig/fbset.h Wed Jun 23 22:12:28 1999
+++ fbset-2.1/fbset.h Sat Sep 7 10:39:28 2002
@@ -62,6 +62,9 @@
unsigned extsync : 1;
unsigned bcast : 1;
unsigned laced : 1;
+ unsigned cw : 1;
+ unsigned ccw : 1;
+ unsigned ud : 1;
unsigned dblscan : 1;
unsigned grayscale : 1;
/* scanrates */
diff -Naur fbset-orig/modes.l fbset-2.1/modes.l
--- fbset-orig/modes.l Wed Jun 23 22:09:48 1999
+++ fbset-2.1/modes.l Sat Sep 7 11:37:09 2002
@@ -41,6 +41,9 @@
{ "bcast", BCAST, 0 },
{ "laced", LACED, 0 },
{ "double", DOUBLE, 0 },
+ { "cw", CW, 0 },
+ { "ccw", CCW, 0 },
+ { "ud", UD, 0 },
{ "rgba", RGBA, 0 },
{ "nonstd", NONSTD, 0 },
{ "accel", ACCEL, 0 },
diff -Naur fbset-orig/modes.y fbset-2.1/modes.y
--- fbset-orig/modes.y Wed Jun 23 22:09:48 1999
+++ fbset-2.1/modes.y Sat Sep 7 11:34:39 2002
@@ -41,7 +41,7 @@
%start file
%token MODE GEOMETRY TIMINGS HSYNC VSYNC CSYNC GSYNC EXTSYNC BCAST LACED DOUBLE
- RGBA NONSTD ACCEL GRAYSCALE
+ CW CCW UD RGBA NONSTD ACCEL GRAYSCALE
ENDMODE POLARITY BOOLEAN STRING NUMBER
%%
@@ -94,6 +94,9 @@
| options bcast
| options laced
| options double
+ | options cw
+ | options ccw
+ | options ud
| options rgba
| options nonstd
| options accel
@@ -145,6 +148,24 @@
double : DOUBLE BOOLEAN
{
VideoMode.dblscan = $2;
+ }
+ ;
+
+cw : DOUBLE CW
+ {
+ VideoMode.cw = $2;
+ }
+ ;
+
+ccw : DOUBLE CCW
+ {
+ VideoMode.ccw = $2;
+ }
+ ;
+
+ud : DOUBLE UD
+ {
+ VideoMode.ud = $2;
}
;
|
|
From: Antonino D. <ad...@po...> - 2002-09-09 14:22:02
|
The patch (vesafb_rotate.diff) adds console rotation support to vesafb.
The main change is addition of vesafb_check_var to check for the flags,
and swapping xres, yres, etc where appropriate.
ypan should work okay, I'm not so sure about ywrap.
Tony
<<------------------------------------------------------------------------>>
diff -Naur linux-2.5.33/drivers/video/Config.in linux/drivers/video/Config.in
--- linux-2.5.33/drivers/video/Config.in Sun Sep 8 19:47:38 2002
+++ linux/drivers/video/Config.in Sun Sep 8 19:50:38 2002
@@ -370,6 +370,13 @@
define_tristate CONFIG_FBCON_ACCEL m
fi
fi
+ if [ "$CONFIG_FB_VESA" = "y" ]; then
+ define_tristate CONFIG_FBCON_ROTATE y
+ else
+ if [ "$CONFIG_FB_VESA" = "m" ]; then
+ define_tristate CONFIG_FBCON_ROTATE m
+ fi
+ fi
if [ "$CONFIG_FB_AMIGA" = "y" ]; then
define_tristate CONFIG_FBCON_AFB y
define_tristate CONFIG_FBCON_ILBM y
diff -Naur linux-2.5.33/drivers/video/vesafb.c linux/drivers/video/vesafb.c
--- linux-2.5.33/drivers/video/vesafb.c Sun Sep 8 19:34:40 2002
+++ linux/drivers/video/vesafb.c Sun Sep 8 19:49:11 2002
@@ -27,6 +27,8 @@
#include <video/fbcon.h>
+#include "fbcon-rotate.h"
+
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
@@ -62,12 +64,18 @@
static void (*pmi_start)(void);
static void (*pmi_pal)(void);
+#ifdef FBCON_HAS_ROTATE
+static u32 xres;
+static u32 yres;
+static u32 vxres;
+static u32 vyres;
+#endif
/* --------------------------------------------------------------------- */
static int vesafb_pan_display(struct fb_var_screeninfo *var, int con,
struct fb_info *info)
{
- int offset;
+ int offset, depth = (var->bits_per_pixel + 7)/8;
if (!ypan)
return -EINVAL;
@@ -78,7 +86,19 @@
if ((ypan==1) && var->yoffset+var->yres > var->yres_virtual)
return -EINVAL;
- offset = (var->yoffset * info->fix.line_length + var->xoffset) / 4;
+#ifdef FBCON_HAS_ROTATE
+ if (var->vmode & FB_VMODE_ROTATE_CW)
+ offset = ((var->xoffset * info->fix.line_length) +
+ ((var->yres_virtual - (var->yoffset + var->yres))) * depth) / 4;
+ else if (var->vmode & FB_VMODE_ROTATE_CCW)
+ offset = (((var->xres_virtual - (var->xoffset + var->xres)) * info->fix.line_length) +
+ (var->yoffset * depth)) / 4;
+ else if (var->vmode & FB_VMODE_ROTATE_UD)
+ offset = (((var->yres_virtual - (var->yoffset + var->yres)) * info->fix.line_length) +
+ ((var->xres_virtual - (var->xoffset + var->xres))) * depth) / 4;
+ else
+#endif
+ offset = (var->yoffset * info->fix.line_length + var->xoffset) / 4;
__asm__ __volatile__(
"call *(%%edi)"
@@ -173,11 +193,43 @@
return 0;
}
+static int vesafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
+{
+#ifdef FBCON_HAS_ROTATE
+ u32 vmode;
+
+ vmode = var->vmode;
+ *var = info->var;
+ if (vmode & (FB_VMODE_ROTATE_CW | FB_VMODE_ROTATE_CCW)) {
+ var->xres = yres;
+ var->yres = xres;
+ var->xres_virtual = vyres;
+ var->yres_virtual = vxres;
+ }
+ else {
+ var->xres = xres;
+ var->yres = yres;
+ var->xres_virtual = vxres;
+ var->yres_virtual = vyres;
+ }
+ vmode &= FB_ROTATE_MASK;
+ vmode |= info->var.vmode & ~FB_ROTATE_MASK;
+ var->vmode = vmode;
+#else
+ *var = info->var;
+#endif
+
+ var->xoffset = 0;
+ var->yoffset = 0;
+ return 0;
+}
+
static struct fb_ops vesafb_ops = {
.owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
+ .fb_check_var = vesafb_check_var,
.fb_setcolreg = vesafb_setcolreg,
.fb_pan_display = vesafb_pan_display,
.fb_fillrect = cfb_fillrect,
@@ -300,6 +352,19 @@
ypan = 0;
}
+#ifdef FBCON_HAS_ROTATE
+ xres = vesafb_defined.xres;
+ yres = vesafb_defined.yres;
+ vxres = vesafb_defined.xres_virtual;
+ vyres = vesafb_defined.yres_virtual;
+ if (vesafb_defined.vmode & (FB_VMODE_ROTATE_CW | FB_VMODE_ROTATE_CCW)) {
+ vesafb_defined.xres = yres;
+ vesafb_defined.yres = xres;
+ vesafb_defined.xres_virtual = vyres;
+ vesafb_defined.yres_virtual = vxres;
+ }
+#endif
+
/* some dummy values for timing to make fbset happy */
vesafb_defined.pixclock = 10000000 / vesafb_defined.xres * 1000 / vesafb_defined.yres;
vesafb_defined.left_margin = (vesafb_defined.xres / 8) & 0xf8;
|
|
From: Antonino D. <ad...@po...> - 2002-09-09 14:21:28
|
The patch (fb_drawing.diff) is an optional replacement to cfbimgblt.c,
cfbfillrect.c and cfbcopyarea.c. Rotating the display CW or CCW will
expose some of the limitations (alignment and access) of the current
drawing functions because fontheight is very variable. This also fixes
software clipping.
cfbcopyarea.c is just a 'copy 'n paste' of Geert's version I leached
from fbutils (I hope this is okay with you, Geert :) The only changes
are using FB_WRITEL and FB_READL where appropriate.
Tony
<<------------------------------------------------------------------->>
diff -Naur linux-2.5.33/drivers/video/cfbcopyarea.c linux/drivers/video/cfbcopyarea.c
--- linux-2.5.33/drivers/video/cfbcopyarea.c Sun Sep 8 19:34:36 2002
+++ linux/drivers/video/cfbcopyarea.c Sun Sep 8 19:48:05 2002
@@ -28,22 +28,319 @@
#include <asm/io.h>
#include <video/fbcon.h>
+#include "fbcon-rotate.h"
+
+#define LONG_MASK (BITS_PER_LONG - 1)
+
#if BITS_PER_LONG == 32
-#define FB_READ fb_readl
-#define FB_WRITE fb_writel
+#define FB_WRITEL fb_writel
+#define FB_READL fb_readl
+#define SHIFT_PER_LONG 5
+#define BYTES_PER_LONG 4
#else
-#define FB_READ fb_readq
-#define FB_WRITE fb_writeq
+#define FB_WRITEL fb_writeq
+#define FB_READL fb_readq(x)
+#define SHIFT_PER_LONG 6
+#define BYTES_PER_LONG 8
#endif
+static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
+ int src_idx, unsigned long n)
+{
+ unsigned long first, last;
+ int shift = dst_idx-src_idx, left, right;
+ unsigned long d0, d1;
+ int m;
+
+ if (!n)
+ return;
+
+ shift = dst_idx-src_idx;
+ first = ~0UL >> dst_idx;
+ last = ~(~0UL >> ((dst_idx+n) % BITS_PER_LONG));
+
+ if (!shift) {
+ // Same alignment for source and dest
+
+ if (dst_idx+n <= BITS_PER_LONG) {
+ // Single word
+ if (last)
+ first &= last;
+ FB_WRITEL((*src & first) | (FB_READL(dst) & ~first), dst);
+ } else {
+ // Multiple destination words
+ // Leading bits
+ if (first) {
+
+ FB_WRITEL((*src & first) | (FB_READL(dst) & ~first), dst);
+ dst++;
+ src++;
+ n -= BITS_PER_LONG-dst_idx;
+ }
+
+ // Main chunk
+ n /= BITS_PER_LONG;
+ while (n >= 8) {
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ FB_WRITEL(*src++, dst++);
+ n -= 8;
+ }
+ while (n--)
+ FB_WRITEL(*src++, dst++);
+ // Trailing bits
+ if (last)
+ FB_WRITEL((*src & last) | (FB_READL(dst) & ~last), dst);
+ }
+ } else {
+ // Different alignment for source and dest
+
+ right = shift & (BITS_PER_LONG-1);
+ left = -shift & (BITS_PER_LONG-1);
+
+ if (dst_idx+n <= BITS_PER_LONG) {
+ // Single destination word
+ if (last)
+ first &= last;
+ if (shift > 0) {
+ // Single source word
+ FB_WRITEL(((*src >> right) & first) | (FB_READL(dst) & ~first), dst);
+ } else if (src_idx+n <= BITS_PER_LONG) {
+ // Single source word
+ FB_WRITEL(((*src << left) & first) | (FB_READL(dst) & ~first), dst);
+ } else {
+ // 2 source words
+ d0 = *src++;
+ d1 = *src;
+ FB_WRITEL(((d0 << left | d1 >> right) & first) | (FB_READL(dst) & ~first), dst);
+ }
+ } else {
+ // Multiple destination words
+ d0 = *src++;
+ // Leading bits
+ if (shift > 0) {
+ // Single source word
+ FB_WRITEL(((d0 >> right) & first) | (FB_READL(dst) & ~first), dst);
+ dst++;
+ n -= BITS_PER_LONG-dst_idx;
+ } else {
+ // 2 source words
+ d1 = *src++;
+ FB_WRITEL(((d0 << left | d1 >> right) & first) | (FB_READL(dst) & ~first), dst);
+ d0 = d1;
+ dst++;
+ n -= BITS_PER_LONG-dst_idx;
+ }
+
+ // Main chunk
+ m = n % BITS_PER_LONG;
+ n /= BITS_PER_LONG;
+ while (n >= 4) {
+ d1 = *src++;
+ FB_WRITEL(d0 << left | d1 >> right, dst++);
+ d0 = d1;
+ d1 = *src++;
+ FB_WRITEL(d0 << left | d1 >> right, dst++);
+ d0 = d1;
+ d1 = *src++;
+ FB_WRITEL(d0 << left | d1 >> right, dst++);
+ d0 = d1;
+ d1 = *src++;
+ FB_WRITEL(d0 << left | d1 >> right, dst++);
+ d0 = d1;
+ n -= 4;
+ }
+ while (n--) {
+ d1 = *src++;
+ FB_WRITEL(d0 << left | d1 >> right, dst++);
+ d0 = d1;
+ }
+
+ // Trailing bits
+ if (last) {
+ if (m <= right) {
+ // Single source word
+ FB_WRITEL(((d0 << left) & last) | (FB_READL(dst) & ~last), dst);
+ } else {
+ // 2 source words
+ d1 = *src;
+ FB_WRITEL(((d0 << left | d1 >> right) & last) | (FB_READL(dst) & ~last), dst);
+ }
+ }
+ }
+ }
+}
+
+static void bitcpy_rev(unsigned long *dst, int dst_idx,
+ const unsigned long *src, int src_idx, unsigned long n)
+{
+ unsigned long first, last;
+ int shift = dst_idx-src_idx, left, right;
+ unsigned long d0, d1;
+ int m;
+
+ if (!n)
+ return;
+
+ dst += (n-1)/BITS_PER_LONG;
+ src += (n-1)/BITS_PER_LONG;
+ if ((n-1) % BITS_PER_LONG) {
+ dst_idx += (n-1) % BITS_PER_LONG;
+ dst += dst_idx >> SHIFT_PER_LONG;
+ dst_idx &= BITS_PER_LONG-1;
+ src_idx += (n-1) % BITS_PER_LONG;
+ src += src_idx >> SHIFT_PER_LONG;
+ src_idx &= BITS_PER_LONG-1;
+ }
+
+ shift = dst_idx-src_idx;
+ first = ~0UL << (BITS_PER_LONG-1-dst_idx);
+ last = ~(~0UL << (BITS_PER_LONG-1-((dst_idx-n) % BITS_PER_LONG)));
+
+ if (!shift) {
+ // Same alignment for source and dest
+
+ if ((unsigned long)dst_idx+1 >= n) {
+ // Single word
+ if (last)
+ first &= last;
+ FB_WRITEL((*src & first) | (FB_READL(dst) & ~first), dst);
+ } else {
+ // Multiple destination words
+ // Leading bits
+ if (first) {
+ FB_WRITEL((*src & first) | (FB_READL(dst) & ~first), dst);
+ dst--;
+ src--;
+ n -= dst_idx+1;
+ }
+
+ // Main chunk
+ n /= BITS_PER_LONG;
+ while (n >= 8) {
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ FB_WRITEL(*src--, dst--);
+ n -= 8;
+ }
+ while (n--)
+ FB_WRITEL(*src--, dst--);
+
+ // Trailing bits
+ if (last)
+ FB_WRITEL((*src & last) | (FB_READL(dst) & ~last), dst);
+ }
+ } else {
+ // Different alignment for source and dest
+
+ right = shift & (BITS_PER_LONG-1);
+ left = -shift & (BITS_PER_LONG-1);
+
+ if ((unsigned long)dst_idx+1 >= n) {
+ // Single destination word
+ if (last)
+ first &= last;
+ if (shift < 0) {
+ // Single source word
+ FB_WRITEL((*src << left & first) | (FB_READL(dst) & ~first), dst);
+ } else if (1+(unsigned long)src_idx >= n) {
+ // Single source word
+ FB_WRITEL(((*src >> right) & first) | (FB_READL(dst) & ~first), dst);
+ } else {
+ // 2 source words
+ d0 = *src--;
+ d1 = *src;
+ FB_WRITEL(((d0 >> right | d1 << left) & first) | (FB_READL(dst) & ~first), dst);
+ }
+ } else {
+ // Multiple destination words
+ d0 = *src--;
+ // Leading bits
+ if (shift < 0) {
+ // Single source word
+ FB_WRITEL(((d0 << left) & first) | (FB_READL(dst) & ~first), dst);
+ dst--;
+ n -= dst_idx+1;
+ } else {
+ // 2 source words
+ d1 = *src--;
+ FB_WRITEL(((d0 >> right | d1 << left) & first) | (FB_READL(dst) & ~first), dst);
+ d0 = d1;
+ dst--;
+ n -= dst_idx+1;
+ }
+
+ // Main chunk
+ m = n % BITS_PER_LONG;
+ n /= BITS_PER_LONG;
+ while (n >= 4) {
+ d1 = *src--;
+ FB_WRITEL(d0 >> right | d1 << left, dst--);
+ d0 = d1;
+ d1 = *src--;
+ FB_WRITEL(d0 >> right | d1 << left, dst--);
+ d0 = d1;
+ d1 = *src--;
+ FB_WRITEL(d0 >> right | d1 << left, dst--);
+ d0 = d1;
+ d1 = *src--;
+ FB_WRITEL(d0 >> right | d1 << left, dst--);
+ d0 = d1;
+ n -= 4;
+ }
+ while (n--) {
+ d1 = *src--;
+ FB_WRITEL(d0 >> right | d1 << left, dst--);
+ d0 = d1;
+ }
+
+ // Trailing bits
+ if (last) {
+ if (m <= left) {
+ // Single source word
+ FB_WRITEL(((d0 >> right) & last) | (FB_READL(dst) & ~last), dst);
+ } else {
+ // 2 source words
+ d1 = *src;
+ FB_WRITEL(((d0 >> right | d1 << left) & last) |
+ (FB_READL(dst) & ~last), dst);
+ }
+ }
+ }
+ }
+}
+
void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
{
- int x2, y2, lineincr, shift, shift_right, shift_left, old_dx, old_dy;
- int j, linesize = p->fix.line_length, bpl = sizeof(unsigned long);
- unsigned long start_index, end_index, start_mask, end_mask, last;
+ int x2, y2, old_dx, old_dy, vxres, vyres;
+ unsigned long next_line = p->fix.line_length;
+ int dst_idx = 0, src_idx = 0, rev_copy = 0;
unsigned long *dst = NULL, *src = NULL;
- char *src1, *dst1;
- int tmp, height;
+
+ vxres = p->var.xres_virtual;
+ vyres = p->var.yres_virtual;
+#ifdef FBCON_HAS_ROTATE
+ if (p->var.vmode & (FB_VMODE_ROTATE_CW | FB_VMODE_ROTATE_CCW)) {
+ vxres = p->var.yres_virtual;
+ vyres = p->var.xres_virtual;
+ }
+#endif
+
+ if (area->dx > vxres ||
+ area->sx > vxres ||
+ area->dy > vyres ||
+ area->sy > vyres)
+ return;
/* clip the destination */
old_dx = area->dx;
@@ -57,8 +354,8 @@
y2 = area->dy + area->height;
area->dx = area->dx > 0 ? area->dx : 0;
area->dy = area->dy > 0 ? area->dy : 0;
- x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
- y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
+ x2 = x2 < vxres ? x2 : vxres;
+ y2 = y2 < vyres ? y2 : vyres;
area->width = x2 - area->dx;
area->height = y2 - area->dy;
@@ -66,165 +363,45 @@
area->sx += (area->dx - old_dx);
area->sy += (area->dy - old_dy);
- height = area->height;
-
/* the source must be completely inside the virtual screen */
if (area->sx < 0 || area->sy < 0 ||
- (area->sx + area->width) > p->var.xres_virtual ||
- (area->sy + area->height) > p->var.yres_virtual)
+ (area->sx + area->width) > vxres ||
+ (area->sy + area->height) > vyres)
return;
- if (area->dy < area->sy
- || (area->dy == area->sy && area->dx < area->sx)) {
- /* start at the top */
- src1 = p->screen_base + area->sy * linesize +
- ((area->sx * p->var.bits_per_pixel) >> 3);
- dst1 = p->screen_base + area->dy * linesize +
- ((area->dx * p->var.bits_per_pixel) >> 3);
- lineincr = linesize;
- } else {
- /* start at the bottom */
- src1 = p->screen_base + (area->sy + area->height-1) * linesize
- + (((area->sx + area->width - 1) * p->var.bits_per_pixel) >> 3);
- dst1 = p->screen_base + (area->dy + area->height-1) * linesize
- + (((area->dx + area->width - 1) * p->var.bits_per_pixel) >> 3);
- lineincr = -linesize;
+ if (area->dy > area->sy || (area->dy == area->sy && area->dx > area->sx)) {
+ area->dy += area->height;
+ area->sy += area->height;
+ rev_copy = 1;
}
-
- if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) {
- int ppw = BITS_PER_LONG / p->var.bits_per_pixel;
- int n = ((area->width * p->var.bits_per_pixel) >> 3);
-
- start_index = ((unsigned long) src1 & (bpl - 1));
- end_index = ((unsigned long) (src1 + n) & (bpl - 1));
- shift = ((unsigned long) dst1 & (bpl - 1)) -
- ((unsigned long) src1 & (bpl - 1));
- start_mask = end_mask = 0;
-
- if (start_index) {
- start_mask = -1 >> (start_index << 3);
- n -= (bpl - start_index);
+
+ dst = src = (unsigned long *)((unsigned long)p->screen_base & ~(BYTES_PER_LONG-1));
+ dst_idx = src_idx = (unsigned long)p->screen_base & (BYTES_PER_LONG-1);
+ dst_idx += area->dy*next_line*8+area->dx*p->var.bits_per_pixel;
+ src_idx += area->sy*next_line*8+area->sx*p->var.bits_per_pixel;
+
+ if (rev_copy) {
+ while (area->height--) {
+ dst_idx -= next_line*8;
+ src_idx -= next_line*8;
+ dst += dst_idx >> SHIFT_PER_LONG;
+ dst_idx &= (BYTES_PER_LONG-1);
+ src += src_idx >> SHIFT_PER_LONG;
+ src_idx &= (BYTES_PER_LONG-1);
+ bitcpy_rev((unsigned long *)dst, dst_idx, (unsigned long *)src,
+ src_idx, area->width*p->var.bits_per_pixel);
}
-
- if (end_index) {
- end_mask = -1 << ((bpl - end_index) << 3);
- n -= end_index;
- }
- n /= bpl;
-
- if (n <= 0) {
- if (start_mask) {
- if (end_mask)
- end_mask &= start_mask;
- else
- end_mask = start_mask;
- start_mask = 0;
- }
- n = 0;
- }
-
- if (shift) {
- if (shift > 0) {
- /* dest is over to right more */
- shift_right =
- shift * p->var.bits_per_pixel;
- shift_left =
- (ppw - shift) * p->var.bits_per_pixel;
- } else {
- /* source is to the right more */
- shift_right =
- (ppw + shift) * p->var.bits_per_pixel;
- shift_left =
- -shift * p->var.bits_per_pixel;
- }
- /* general case, positive increment */
- if (lineincr > 0) {
- if (shift < 0)
- n++;
- do {
- dst = (unsigned long *) dst1;
- src = (unsigned long *) src1;
-
- last = (FB_READ(src) & start_mask);
-
- if (shift > 0)
- FB_WRITE(FB_READ(dst) | (last >> shift_right), dst);
- for (j = 0; j < n; j++) {
- dst++;
- tmp = FB_READ(src);
- src++;
- FB_WRITE((last << shift_left) | (tmp >> shift_right), dst);
- last = tmp;
- src++;
- }
- FB_WRITE(FB_READ(dst) | (last << shift_left), dst);
- src1 += lineincr;
- dst1 += lineincr;
- } while (--height);
- } else {
- /* general case, negative increment */
- if (shift > 0)
- n++;
- do {
- dst = (unsigned long *) dst1;
- src = (unsigned long *) src1;
-
- last = (FB_READ(src) & end_mask);
-
- if (shift < 0)
- FB_WRITE(FB_READ(dst) | (last >> shift_right), dst);
- for (j = 0; j < n; j++) {
- dst--;
- tmp = FB_READ(src);
- src--;
- FB_WRITE((tmp << shift_left) | (last >> shift_right), dst);
- last = tmp;
- src--;
- }
- FB_WRITE(FB_READ(dst) | (last >> shift_right), dst);
- src1 += lineincr;
- dst1 += lineincr;
- } while (--height);
- }
- } else {
- /* no shift needed */
- if (lineincr > 0) {
- /* positive increment */
- do {
- dst = (unsigned long *) (dst1 - start_index);
- src = (unsigned long *) (src1 - start_index);
-
- if (start_mask)
- FB_WRITE(FB_READ(src) | start_mask, dst);
-
- for (j = 0; j < n; j++) {
- FB_WRITE(FB_READ(src), dst);
- dst++;
- src++;
- }
-
- if (end_mask)
- FB_WRITE(FB_READ(src) | end_mask, dst);
- src1 += lineincr;
- dst1 += lineincr;
- } while (--height);
- } else {
- /* negative increment */
- do {
- dst = (unsigned long *) dst1;
- src = (unsigned long *) src1;
-
- if (start_mask)
- FB_WRITE(FB_READ(src) | start_mask, dst);
- for (j = 0; j < n; j++) {
- FB_WRITE(FB_READ(src), dst);
- dst--;
- src--;
- }
- src1 += lineincr;
- dst1 += lineincr;
- } while (--height);
- }
+ }
+ else {
+ while (area->height--) {
+ dst += dst_idx >> SHIFT_PER_LONG;
+ dst_idx &= (BYTES_PER_LONG-1);
+ src += src_idx >> SHIFT_PER_LONG;
+ src_idx &= (BYTES_PER_LONG-1);
+ bitcpy((unsigned long *)dst, dst_idx, (unsigned long *)src,
+ src_idx, area->width*p->var.bits_per_pixel);
+ dst_idx += next_line*8;
+ src_idx += next_line*8;
}
}
-}
+}
diff -Naur linux-2.5.33/drivers/video/cfbfillrect.c linux/drivers/video/cfbfillrect.c
--- linux-2.5.33/drivers/video/cfbfillrect.c Sun Sep 8 19:34:36 2002
+++ linux/drivers/video/cfbfillrect.c Sun Sep 8 19:47:59 2002
@@ -22,168 +22,167 @@
#include <asm/types.h>
#include <video/fbcon.h>
+#include "fbcon-rotate.h"
+
#if BITS_PER_LONG == 32
-#define FB_READ fb_readl
-#define FB_WRITE fb_writel
+#define FB_WRITEL fb_writel
+#define FB_READL fb_readl
#else
-#define FB_READ fb_readq
-#define FB_WRITE fb_writeq
+#define FB_WRITEL fb_writeq
+#define FB_READL fb_readq
+#endif
+
+#if defined (__BIG_ENDIAN)
+#define SHIFT_HIGH(val, bits) ((val) >> (bits))
+#define SHIFT_LOW(val, bits) ((val) << (bits))
+#else
+#define SHIFT_HIGH(val, bits) ((val) << (bits))
+#define SHIFT_LOW(val, bits) ((val) >> (bits))
#endif
void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
{
- unsigned long start_index, end_index, start_mask = 0, end_mask = 0;
- unsigned long height, ppw, fg, fgcolor;
- int i, n, x2, y2, linesize = p->fix.line_length;
- int bpl = sizeof(unsigned long);
- unsigned long *dst;
- char *dst1;
+ unsigned long start_index, pitch_index;
+ unsigned long height, fg, bitstart, shift, color;
+ unsigned long bpp = p->var.bits_per_pixel;
+ unsigned long null_bits = BITS_PER_LONG - bpp;
+ unsigned long n, x2, y2, vxres, vyres, linesize = p->fix.line_length;
+ unsigned long bpl = sizeof(unsigned long);
+ unsigned long *dst = NULL;
+ char *dst1, *dst2;
+
+ vxres = p->var.xres_virtual;
+ vyres = p->var.yres_virtual;
+#ifdef FBCON_HAS_ROTATE
+ if (p->var.vmode & (FB_VMODE_ROTATE_CW | FB_VMODE_ROTATE_CCW)) {
+ vxres = p->var.yres_virtual;
+ vyres = p->var.xres_virtual;
+ }
+#endif
- if (!rect->width || !rect->height)
+ if (!rect->width || !rect->height ||
+ rect->dx > vxres ||
+ rect->dy > vyres)
return;
/* We could use hardware clipping but on many cards you get around
* hardware clipping by writing to framebuffer directly. */
+
x2 = rect->dx + rect->width;
y2 = rect->dy + rect->height;
- x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
- y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
+ x2 = x2 < vxres ? x2 : vxres;
+ y2 = y2 < vyres ? y2 : vyres;
rect->width = x2 - rect->dx;
height = y2 - rect->dy;
- /* Size of the scanline in bytes */
- n = (rect->width * (p->var.bits_per_pixel >> 3));
- ppw = BITS_PER_LONG / p->var.bits_per_pixel;
-
- dst1 = p->screen_base + (rect->dy * linesize) +
- (rect->dx * (p->var.bits_per_pixel >> 3));
- start_index = ((unsigned long) dst1 & (bpl - 1));
- end_index = ((unsigned long) (dst1 + n) & (bpl - 1));
- if (p->fix.visual == FB_VISUAL_TRUECOLOR)
- fg = fgcolor = ((u32 *) (p->pseudo_palette))[rect->color];
+ if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
+ p->fix.visual == FB_VISUAL_DIRECTCOLOR )
+ fg = ((u32 *) (p->pseudo_palette))[rect->color];
else
- fg = fgcolor = rect->color;
-
- for (i = 0; i < ppw - 1; i++) {
- fg <<= p->var.bits_per_pixel;
- fg |= fgcolor;
- }
-
- if (start_index) {
- start_mask = fg << (start_index << 3);
- n -= (bpl - start_index);
- }
-
- if (end_index) {
- end_mask = fg >> ((bpl - end_index) << 3);
- n -= end_index;
- }
-
- n = n / bpl;
-
- if (n <= 0) {
- if (start_mask) {
- if (end_mask)
- end_mask &= start_mask;
- else
- end_mask = start_mask;
- start_mask = 0;
- }
- n = 0;
- }
-
- if ((BITS_PER_LONG % p->var.bits_per_pixel) == 0) {
- switch (rect->rop) {
- case ROP_COPY:
- do {
- /* Word align to increases performace :-) */
- dst = (unsigned long *) (dst1 - start_index);
-
- if (start_mask) {
- FB_WRITE(FB_READ(dst) |
- start_mask, dst);
- dst++;
- }
-
- for (i = 0; i < n; i++) {
- FB_WRITE(fg, dst);
- dst++;
- }
-
- if (end_mask)
- FB_WRITE(FB_READ(dst) | end_mask,
- dst);
- dst1 += linesize;
- } while (--height);
- break;
- case ROP_XOR:
- do {
- dst = (unsigned long *) (dst1 - start_index);
-
- if (start_mask) {
- FB_WRITE(FB_READ(dst) ^
- start_mask, dst);
- dst++;
- }
-
- for (i = 0; i < n; i++) {
- FB_WRITE(FB_READ(dst) ^ fg, dst);
- dst++;
- }
+ fg = rect->color;
- if (end_mask) {
- FB_WRITE(FB_READ(dst) ^ end_mask,
- dst);
- }
+ bitstart = (((rect->dy * linesize) * 8) +
+ rect->dx * bpp);
+
+ start_index = bitstart & (BITS_PER_LONG - 1);
+
+ /* line_length not a multiple of an unsigned long? */
+ pitch_index = (linesize & (bpl - 1)) * 8;
+
+ bitstart /= 8;
+ bitstart &= ~(bpl - 1);
+ dst1 = dst2 = p->screen_base + bitstart;
+
+ switch (rect->rop) {
+ case ROP_COPY:
+ do {
+ dst = (unsigned long *) dst1;
+ shift = 0;
+ color = 0;
+ n = rect->width;
+
+ /*
+ * read leading bits
+ */
+ if (start_index) {
+ unsigned long start_mask = ~(SHIFT_HIGH(~0UL, start_index));
+
+ color = FB_READL(dst) & start_mask;
+ shift = start_index;
+ }
+
+ while (n--) {
+ color |= SHIFT_HIGH(fg, shift);
+ if (shift >= null_bits) {
+ FB_WRITEL(color, dst++);
+ if (shift == null_bits)
+ color = 0;
+ else
+ color = SHIFT_LOW(color, BITS_PER_LONG - shift);
+ }
+ shift += bpp;
+ shift &= (BITS_PER_LONG - 1);
+ }
+
+ /*
+ * write trailing bits
+ */
+ if (shift) {
+ unsigned long end_mask = SHIFT_HIGH(~0UL, shift);
+
+ FB_WRITEL((FB_READL(dst) & end_mask) | color, dst);
+ }
+
+ if (!pitch_index) {
dst1 += linesize;
- } while (--height);
- break;
- }
- } else {
- /* Odd modes like 24 or 80 bits per pixel */
- start_mask = fg >> (start_index * p->var.bits_per_pixel);
- end_mask = fg << (end_index * p->var.bits_per_pixel);
- /* start_mask =& PFILL24(x1,fg);
- end_mask_or = end_mask & PFILL24(x1+width-1,fg); */
-
- n = (rect->width - start_index - end_index) / ppw;
-
- switch (rect->rop) {
- case ROP_COPY:
- do {
- dst = (unsigned long *) dst1;
- if (start_mask)
- *dst |= start_mask;
- if ((start_index + rect->width) > ppw)
- dst++;
+ }
+ else {
+ dst2 += linesize;
+ dst1 = dst2;
+ (unsigned long) dst1 &= ~(bpl - 1);
+ start_index += pitch_index;
+ start_index &= BITS_PER_LONG - 1;
+ }
+
+ } while (--height);
+ break;
+ case ROP_XOR:
+ do {
+ dst = (unsigned long *) dst1;
+ shift = start_index;
+ color = 0;
+ n = rect->width;
+
+ while (n--) {
+ color |= SHIFT_HIGH(fg, shift);
+ if (shift >= null_bits) {
+ FB_WRITEL(FB_READL(dst) ^ color, dst);
+ dst++;
+ if (shift == null_bits)
+ color = 0;
+ else
+ color = SHIFT_LOW(color, BITS_PER_LONG - shift);
+ }
+ shift += bpp;
+ shift &= (BITS_PER_LONG - 1);
+ }
+ if (shift)
+ FB_WRITEL(FB_READL(dst) ^ color, dst);
- /* XXX: slow */
- for (i = 0; i < n; i++) {
- *dst++ = fg;
- }
- if (end_mask)
- *dst |= end_mask;
- dst1 += linesize;
- } while (--height);
- break;
- case ROP_XOR:
- do {
- dst = (unsigned long *) dst1;
- if (start_mask)
- *dst ^= start_mask;
- if ((start_mask + rect->width) > ppw)
- dst++;
-
- for (i = 0; i < n; i++) {
- *dst++ ^= fg; /* PFILL24(fg,x1+i); */
- }
- if (end_mask)
- *dst ^= end_mask;
+ if (!pitch_index) {
dst1 += linesize;
- } while (--height);
- break;
- }
+ }
+ else {
+ dst2 += linesize;
+ dst1 = dst2;
+ (unsigned long) dst1 &= ~(bpl - 1);
+ start_index += pitch_index;
+ start_index &= BITS_PER_LONG - 1;
+ }
+ } while (--height);
+ break;
}
+
return;
}
diff -Naur linux-2.5.33/drivers/video/cfbimgblt.c linux/drivers/video/cfbimgblt.c
--- linux-2.5.33/drivers/video/cfbimgblt.c Sun Sep 8 19:31:34 2002
+++ linux/drivers/video/cfbimgblt.c Sun Sep 8 19:47:55 2002
@@ -22,6 +22,13 @@
* FIXME
* The code for 24 bit is horrible. It copies byte by byte size instead of
* longs like the other sizes. Needs to be optimized.
+ *
+ * Tony:
+ * Incorporate mask tables similar to fbcon-cfb*.c in 2.4 API. This speeds
+ * up the code significantly.
+ *
+ * Code for depths not multiples of BITS_PER_LONG is still kludgy, which is
+ * still processed a bit at a time.
*
* Also need to add code to deal with cards endians that are different than
* the native cpu endians. I also need to deal with MSB position in the word.
@@ -32,6 +39,7 @@
#include <asm/types.h>
#include <video/fbcon.h>
+#include "fbcon-rotate.h"
#define DEBUG
@@ -41,91 +49,303 @@
#define DPRINTK(fmt, args...)
#endif
+static u32 cfb_tab8[] = {
+#if defined(__BIG_ENDIAN)
+ 0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
+ 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
+ 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
+ 0xffff0000,0xffff00ff,0xffffff00,0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+ 0x00000000,0xff000000,0x00ff0000,0xffff0000,
+ 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+ 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+ 0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
+};
+
+static u32 cfb_tab16[] = {
+#if defined(__BIG_ENDIAN)
+ 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
+#elif defined(__LITTLE_ENDIAN)
+ 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
+#else
+#error FIXME: No endianness??
+#endif
+};
+
+static u32 cfb_tab32[] = {
+ 0x00000000, 0xffffffff
+};
+
+#if BITS_PER_LONG == 32
+#define FB_WRITEL fb_writel
+#define FB_READL fb_readl
+#else
+#define FB_WRITEL fb_writeq
+#define FB_READL fb_readq
+#endif
+
+#if defined (__BIG_ENDIAN)
+#define LEFT_POS(bpp) (BITS_PER_LONG - bpp)
+#define NEXT_POS(pos, bpp) ((pos) -= (bpp))
+#define SHIFT_HIGH(val, bits) ((val) >> (bits))
+#define SHIFT_LOW(val, bits) ((val) << (bits))
+#else
+#define LEFT_POS(bpp) (0)
+#define NEXT_POS(pos, bpp) ((pos) += (bpp))
+#define SHIFT_HIGH(val, bits) ((val) << (bits))
+#define SHIFT_LOW(val, bits) ((val) >> (bits))
+#endif
+
+static inline void color_imageblit(struct fb_image *image, struct fb_info *p, u8 *dst1,
+ unsigned long start_index, unsigned long pitch_index)
+{
+ /* Draw the penguin */
+ int i, n;
+ unsigned long bitmask = SHIFT_LOW(~0UL, BITS_PER_LONG - p->var.bits_per_pixel);
+ unsigned long *palette = (unsigned long *) p->pseudo_palette;
+ unsigned long *dst, *dst2, color = 0, val, shift;
+ unsigned long null_bits = BITS_PER_LONG - p->var.bits_per_pixel;
+ u8 *src = image->data;
+
+ dst2 = (unsigned long *) dst1;
+ for (i = image->height; i--; ) {
+ n = image->width;
+ dst = (unsigned long *) dst1;
+ shift = 0;
+ val = 0;
+
+ if (start_index) {
+ unsigned long start_mask = ~(SHIFT_HIGH(~0UL, start_index));
+
+ val = FB_READL(dst) & start_mask;
+ shift = start_index;
+ }
+ while (n--) {
+ if (p->fix.visual == FB_VISUAL_PSEUDOCOLOR)
+ color = *src & bitmask;
+ if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
+ p->fix.visual == FB_VISUAL_DIRECTCOLOR )
+ color = palette[*src] & bitmask;
+ val |= SHIFT_HIGH(color, shift);
+ if (shift >= null_bits) {
+ FB_WRITEL(val, dst++);
+ if (shift == null_bits)
+ val = 0;
+ else
+ val = SHIFT_LOW(color, BITS_PER_LONG - shift);
+ }
+ shift += p->var.bits_per_pixel;
+ shift &= (BITS_PER_LONG - 1);
+ src++;
+ }
+ if (shift) {
+ unsigned long end_mask = SHIFT_HIGH(~0UL, shift);
+
+ FB_WRITEL((FB_READL(dst) & end_mask) | val, dst);
+ }
+ dst1 += p->fix.line_length;
+ if (pitch_index) {
+ dst2 += p->fix.line_length;
+ dst1 = (char *) dst2;
+ (unsigned long) dst1 &= ~(sizeof(unsigned long) - 1);
+
+ start_index += pitch_index;
+ start_index &= BITS_PER_LONG - 1;
+ }
+ }
+}
+
+static inline void slow_imageblit(struct fb_image *image, struct fb_info *p, u8 *dst1,
+ unsigned long fgcolor, unsigned long bgcolor,
+ unsigned long start_index, unsigned long pitch_index)
+{
+ unsigned long i, j, l = 8;
+ unsigned long shift, color, bpp = p->var.bits_per_pixel;
+ unsigned long *dst, *dst2, val, pitch = p->fix.line_length;
+ unsigned long null_bits = BITS_PER_LONG - bpp;
+ u8 *src = image->data;
+
+ dst2 = (unsigned long *) dst1;
+
+ for (i = image->height; i--; ) {
+ shift = 0;
+ val = 0;
+ j = image->width;
+ dst = (unsigned long *) dst1;
+
+ /* write start bits, if any */
+ if (start_index) {
+ unsigned long start_mask = ~(SHIFT_HIGH(~0UL, start_index));
+
+ val = FB_READL(dst) & start_mask;
+ shift = start_index;
+ }
+ while (j--) {
+ l--;
+ if (*src & (1 << l))
+ color = fgcolor;
+ else
+ color = bgcolor;
+ val |= SHIFT_HIGH(color, shift);
+
+ /* Did the bitshift spill bits to the next long? */
+ if (shift >= null_bits) {
+ FB_WRITEL(val, dst++);
+ if (shift == null_bits)
+ val = 0;
+ else
+ val = SHIFT_LOW(color, BITS_PER_LONG - shift);
+ }
+ shift += bpp;
+ shift &= (BITS_PER_LONG - 1);
+ if (!l) { l = 8; src++; };
+ }
+ /* write end bits, if any*/
+ if (shift) {
+ unsigned long end_mask = SHIFT_HIGH(~0UL, shift);
+
+ FB_WRITEL((FB_READL(dst) & end_mask) | val, dst);
+ }
+ dst1 += pitch;
+
+ if (pitch_index) {
+ dst2 += pitch;
+ dst1 = (char *) dst2;
+ (unsigned long) dst1 &= ~(sizeof(unsigned long) - 1);
+
+ start_index += pitch_index;
+ start_index &= BITS_PER_LONG - 1;
+ }
+
+ }
+}
+
+static inline void fast_imageblit(struct fb_image *image, struct fb_info *p, u8 *dst1,
+ unsigned long fgcolor, unsigned long bgcolor)
+{
+ int i, j, k, l = 8, n;
+ unsigned long bit_mask, end_mask, eorx;
+ unsigned long fgx = fgcolor, bgx = bgcolor, pad, bpp = p->var.bits_per_pixel;
+ unsigned long tmp = (1 << bpp) - 1;
+ unsigned long ppw = BITS_PER_LONG/bpp, ppos;
+ unsigned long *dst;
+ u32 *tab = NULL;
+ char *src = image->data;
+
+ switch (ppw) {
+ case 4:
+ tab = cfb_tab8;
+ break;
+ case 2:
+ tab = cfb_tab16;
+ break;
+ case 1:
+ tab = cfb_tab32;
+ break;
+ }
+
+ for (i = ppw-1; i--; ) {
+ fgx <<= bpp;
+ bgx <<= bpp;
+ fgx |= fgcolor;
+ bgx |= bgcolor;
+ }
+
+ n = ((image->width + 7) / 8);
+ pad = (n * 8) - image->width;
+ n = image->width % ppw;
+
+ bit_mask = (1 << ppw) - 1;
+ eorx = fgx ^ bgx;
+
+ k = image->width/ppw;
+
+ for (i = image->height; i--; ) {
+ dst = (unsigned long *) dst1;
+
+ for (j = k; j--; ) {
+ l -= ppw;
+ end_mask = tab[(*src >> l) & bit_mask];
+ FB_WRITEL((end_mask & eorx)^bgx, dst++);
+ if (!l) { l = 8; src++; }
+ }
+ if (n) {
+ end_mask = 0;
+ ppos = LEFT_POS(bpp);
+ for (j = n; j > 0; j--) {
+ l--;
+ if (*src & (1 << l))
+ end_mask |= tmp << ppos;
+ NEXT_POS(ppos, bpp);
+ if (!l) { l = 8; src++; }
+ }
+ FB_WRITEL((end_mask & eorx)^bgx, dst++);
+ }
+ l -= pad;
+ dst1 += p->fix.line_length;
+ }
+}
+
void cfb_imageblit(struct fb_info *p, struct fb_image *image)
{
- int pad, ppw;
- int x2, y2, n, i, j, k, l = 7;
- unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
- unsigned long fgx, bgx, fgcolor, bgcolor, eorx;
- unsigned long end_mask;
- unsigned long *dst = NULL;
+ int x2, y2, vxres, vyres;
+ unsigned long fgcolor, bgcolor, start_index, bitstart, pitch_index = 0;
+ unsigned long bpl = sizeof(unsigned long), bpp = p->var.bits_per_pixel;
u8 *dst1;
- u8 *src;
+
+ vxres = p->var.xres_virtual;
+ vyres = p->var.yres_virtual;
+#ifdef FBCON_HAS_ROTATE
+ if (p->var.vmode & (FB_VMODE_ROTATE_CW | FB_VMODE_ROTATE_CCW)) {
+ vxres = p->var.yres_virtual;
+ vyres = p->var.xres_virtual;
+ }
+#endif
/*
* We could use hardware clipping but on many cards you get around hardware
* clipping by writing to framebuffer directly like we are doing here.
*/
+ if (image->dx > vxres ||
+ image->dy > vyres)
+ return;
+
x2 = image->dx + image->width;
y2 = image->dy + image->height;
image->dx = image->dx > 0 ? image->dx : 0;
image->dy = image->dy > 0 ? image->dy : 0;
- x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
- y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
+ x2 = x2 < vxres ? x2 : vxres;
+ y2 = y2 < vyres ? y2 : vyres;
image->width = x2 - image->dx;
image->height = y2 - image->dy;
-
- dst1 = p->screen_base + image->dy * p->fix.line_length +
- ((image->dx * p->var.bits_per_pixel) >> 3);
-
- ppw = BITS_PER_LONG/p->var.bits_per_pixel;
- src = image->data;
+ bitstart = (image->dy * p->fix.line_length * 8) + (image->dx * bpp);
+ start_index = bitstart & (BITS_PER_LONG - 1);
+ pitch_index = (p->fix.line_length & (bpl - 1)) * 8;
- if (image->depth == 1) {
+ bitstart /= 8;
+ bitstart &= ~(bpl - 1);
+ dst1 = p->screen_base + bitstart;
- if (p->fix.visual == FB_VISUAL_TRUECOLOR) {
- fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color];
- bgx = bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color];
+ if (image->depth == 1) {
+ if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
+ p->fix.visual == FB_VISUAL_DIRECTCOLOR) {
+ fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color];
+ bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color];
} else {
- fgx = fgcolor = image->fg_color;
- bgx = bgcolor = image->bg_color;
+ fgcolor = image->fg_color;
+ bgcolor = image->bg_color;
}
-
- for (i = 0; i < ppw-1; i++) {
- fgx <<= p->var.bits_per_pixel;
- bgx <<= p->var.bits_per_pixel;
- fgx |= fgcolor;
- bgx |= bgcolor;
- }
- eorx = fgx ^ bgx;
- n = ((image->width + 7) >> 3);
- pad = (n << 3) - image->width;
- n = image->width % ppw;
- for (i = 0; i < image->height; i++) {
- dst = (unsigned long *) dst1;
-
- for (j = image->width/ppw; j > 0; j--) {
- end_mask = 0;
-
- for (k = ppw; k > 0; k--) {
- if (test_bit(l, (unsigned long *) src))
- end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
- l--;
- if (l < 0) { l = 7; src++; }
- }
- fb_writel((end_mask & eorx)^bgx, dst);
- dst++;
- }
-
- if (n) {
- end_mask = 0;
- for (j = n; j > 0; j--) {
- if (test_bit(l, (unsigned long *) src))
- end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
- l--;
- if (l < 0) { l = 7; src++; }
- }
- fb_writel((end_mask & eorx)^bgx, dst);
- dst++;
- }
- l -= pad;
- dst1 += p->fix.line_length;
- }
- } else {
- /* Draw the penguin */
- n = ((image->width * p->var.bits_per_pixel) >> 3);
- end_mask = 0;
+ if (BITS_PER_LONG % bpp == 0 && !start_index && !pitch_index &&
+ bpp >= 8 && bpp <= 32 && (image->width & 7) == 0)
+ fast_imageblit(image, p, dst1, fgcolor, bgcolor);
+ else
+ slow_imageblit(image, p, dst1, fgcolor, bgcolor, start_index, pitch_index);
}
+ else if (image->depth == bpp)
+ color_imageblit(image, p, dst1, start_index, pitch_index);
}
|
|
From: Antonino D. <ad...@po...> - 2002-09-09 14:20:50
|
The patch (fb_rotate.diff) adds console rotation support to the fb
framework. Console rotation wrappers are lumped in fbcon-rotate.h and
fbcon-rotate.c.
p->fontdata is pre-rotated during fbcon_xx_setup(), thus changing fonts
may corrupt the display until fbcon_setup() is called again.
Tony
<<----------------------------------------------------------------------->>
diff -Naur linux-2.5.33/drivers/video/Config.in linux/drivers/video/Config.in
--- linux-2.5.33/drivers/video/Config.in Sun Sep 8 19:38:45 2002
+++ linux/drivers/video/Config.in Sun Sep 8 19:45:59 2002
@@ -227,6 +227,7 @@
tristate ' 24 bpp packed pixels support' CONFIG_FBCON_CFB24
tristate ' 32 bpp packed pixels support' CONFIG_FBCON_CFB32
tristate ' Hardware acceleration support' CONFIG_FBCON_ACCEL
+ dep_tristate ' Console Display Rotation support' CONFIG_FBCON_ROTATE $CONFIG_FBCON_ACCEL
tristate ' Amiga bitplanes support' CONFIG_FBCON_AFB
tristate ' Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM
tristate ' Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
diff -Naur linux-2.5.33/drivers/video/Makefile linux/drivers/video/Makefile
--- linux-2.5.33/drivers/video/Makefile Sun Sep 8 19:38:45 2002
+++ linux/drivers/video/Makefile Sun Sep 8 19:45:59 2002
@@ -6,7 +6,7 @@
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \
- fbcon-afb.o fbcon-ilbm.o fbcon-accel.o \
+ fbcon-afb.o fbcon-ilbm.o fbcon-accel.o fbcon-rotate.o \
fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
@@ -118,6 +118,7 @@
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
+obj-$(CONFIG_FBCON_ROTATE) += fbcon-rotate.o
include $(TOPDIR)/Rules.make
diff -Naur linux-2.5.33/drivers/video/fbcon-rotate.c linux/drivers/video/fbcon-rotate.c
--- linux-2.5.33/drivers/video/fbcon-rotate.c Thu Jan 1 00:00:00 1970
+++ linux/drivers/video/fbcon-rotate.c Sun Sep 8 19:46:35 2002
@@ -0,0 +1,611 @@
+/*
+ * linux/drivers/video/fbcon-accel.c -- Framebuffer Display Rotation
+ *
+ * Created 20 Feb 2001 by James Simmons <jsi...@us...>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive for
+ * more details.
+ */
+
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/fb.h>
+
+#include <video/fbcon.h>
+#include "fbcon-rotate.h"
+
+#define FONTDATAMAX 4096
+
+static unsigned char fontcache[FONTDATAMAX];
+
+static int pattern_test_bit(u32 x, u32 y, u32 pitch, char *pat)
+{
+ u32 tmp = (y * pitch) + x;
+ u32 index = tmp / 8;
+ u32 bit = tmp % 8;
+
+#if defined (__LITTLE_ENDIAN)
+ return (pat[index] & (1 << (7 - bit)));
+#else
+ return (pat[index] & (1 >> bit));
+#endif
+}
+
+static void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
+{
+ u32 tmp = (y * pitch) + x;
+ u32 index = tmp/8;
+ u32 bit = tmp % 8;
+
+#if defined (__LITTLE_ENDIAN)
+ pat[index] |= 1 << (7 - bit);
+#else
+ pat[index] |= 1 >> bit;
+#endif
+}
+
+static void rotate_cw(char *in, char *out, u32 width, u32 height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++) {
+ if (pattern_test_bit(j, i, width, in))
+ pattern_set_bit(height - 1 - i, j, height, out);
+ }
+ }
+}
+
+static void rotate_ccw(char *in, char *out, u32 width, u32 height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++) {
+ if (pattern_test_bit(j, i, width, in))
+ pattern_set_bit(i, width - 1 - j, height, out);
+ }
+ }
+}
+
+static void rotate_ud(char *in, char *out, u32 width, u32 height)
+{
+ int i, j;
+
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++) {
+ if (pattern_test_bit(j, i, width, in))
+ pattern_set_bit(width - 1 - j, height - 1 - i, width, out);
+ }
+ }
+}
+
+/*
+ * Clockwise (90 degree) Rotation
+ */
+void fbcon_rr_setup(struct display *p)
+{
+ u32 i, cell_size;
+ char *src, *dst;
+
+ p->next_line = p->fb_info->fix.line_length;
+ p->next_plane = 0;
+
+ memset(fontcache, 0, FONTDATAMAX);
+
+ cell_size = (fontwidth(p) + 7)/ 8;
+ cell_size *= fontheight(p);
+ src = p->fontdata;
+ dst = fontcache;
+
+ for (i = FONTDATAMAX/cell_size; i--; ) {
+ rotate_cw(src, dst, fontwidth(p), fontheight(p));
+ src += cell_size;
+ dst += cell_size;
+ }
+}
+
+void fbcon_rr_bmove(struct display *p, int sy, int sx, int dy, int dx,
+ int height, int width)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_copyarea area;
+
+ area.sx = info->var.yres_virtual - ((sy + height) * fontheight(p));
+ area.sy = sx * fontwidth(p);
+ area.dx = info->var.yres_virtual - ((dy + height) * fontheight(p));
+ area.dy = dx * fontwidth(p);
+ area.width = height * fontheight(p);
+ area.height = width * fontwidth(p);
+
+ info->fbops->fb_copyarea(info, &area);
+}
+
+void fbcon_rr_clear(struct vc_data *vc, struct display *p, int sy, int sx,
+ int height, int width)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_fillrect region;
+
+ region.color = attr_bgcol_ec(p,vc);
+ region.dx = info->var.yres_virtual - ((sy + height) * fontheight(p));
+ region.dy = sx * fontwidth(p);
+ region.height = width * fontwidth(p);
+ region.width = height * fontheight(p);
+ region.rop = ROP_COPY;
+
+ info->fbops->fb_fillrect(info, ®ion);
+}
+
+void fbcon_rr_putc(struct vc_data *vc, struct display *p, int c, int yy,
+ int xx)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned short charmask = p->charmask;
+ unsigned int width = ((fontwidth(p)+7)>>3);
+ struct fb_image image;
+
+ image.fg_color = attr_fgcol(p, c);
+ image.bg_color = attr_bgcol(p, c);
+ image.dx = info->var.yres_virtual - ((yy * fontheight(p)) + fontheight(p));
+ image.dy = xx * fontwidth(p);
+ image.width = fontheight(p);
+ image.height = fontwidth(p);
+ image.data = fontcache + (c & charmask)*fontheight(p) * width;
+ image.depth = 1;
+ info->fbops->fb_imageblit(info, &image);
+}
+
+void fbcon_rr_putcs(struct vc_data *vc, struct display *p,
+ const unsigned short *s, int count, int yy, int xx)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned short charmask = p->charmask;
+ unsigned int width = ((fontwidth(p)+7)>>3);
+ unsigned int cell_size = width * fontheight(p);
+ struct fb_image image;
+
+ image.fg_color = attr_fgcol(p, *s);
+ image.bg_color = attr_bgcol(p, *s);
+ image.dx = info->var.yres_virtual - ((yy * fontheight(p)) + fontheight(p));
+ image.dy = xx * fontwidth(p);
+ image.width = fontheight(p);
+ image.height = fontwidth(p);
+ image.depth = 1;
+ while (count--) {
+ image.data = fontcache + (scr_readw(s++) & charmask) * cell_size;
+ info->fbops->fb_imageblit(info, &image);
+ image.dy += fontwidth(p);
+ }
+}
+
+void fbcon_rr_revc(struct display *p, int xx, int yy)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_fillrect region;
+
+ region.color = attr_fgcol_ec(p, p->conp);
+ region.dx = info->var.yres_virtual - ((yy * fontheight(p)) + fontheight(p));
+ region.dy = xx * fontwidth(p);
+ region.width = fontheight(p);
+ region.height = fontwidth(p);
+ region.rop = ROP_XOR;
+
+ info->fbops->fb_fillrect(info, ®ion);
+}
+
+void fbcon_rr_clear_margins(struct vc_data *vc, struct display *p,
+ int bottom_only)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned int cw = fontwidth(p);
+ unsigned int ch = fontheight(p);
+ unsigned int rw = info->var.xres % cw;
+ unsigned int bh = info->var.yres % ch;
+ unsigned int rs = info->var.xres - rw;
+ unsigned int bs = info->var.yres - bh;
+ struct fb_fillrect region;
+
+ region.color = attr_bgcol_ec(p,vc);
+ region.rop = ROP_COPY;
+
+ if (rw && !bottom_only) {
+ region.dx = 0;
+ region.dy = info->var.xoffset + rs;
+ region.height = rw;
+ region.width = info->var.yres_virtual;
+ info->fbops->fb_fillrect(info, ®ion);
+ }
+
+ if (bh) {
+ region.dx = info->var.yres_virtual - (info->var.yoffset + bs + bh);
+ region.dy = info->var.xoffset;
+ region.width = bh;
+ region.height = rs;
+ info->fbops->fb_fillrect(info, ®ion);
+ }
+}
+
+ /*
+ * `switch' for the low level operations
+ */
+
+struct display_switch fbcon_rr = {
+ setup: fbcon_rr_setup,
+ bmove: fbcon_rr_bmove,
+ clear: fbcon_rr_clear,
+ putc: fbcon_rr_putc,
+ putcs: fbcon_rr_putcs,
+ revc: fbcon_rr_revc,
+ clear_margins: fbcon_rr_clear_margins,
+ fontwidthmask: FONTWIDTHRANGE(1, 16)
+};
+
+/*
+ * Counterclockwise (270 degree) Rotation
+ */
+void fbcon_rl_setup(struct display *p)
+{
+ u32 i, cell_size;
+ char *src, *dst;
+
+ p->next_line = p->fb_info->fix.line_length;
+ p->next_plane = 0;
+
+ memset(fontcache, 0, FONTDATAMAX);
+
+ cell_size = (fontwidth(p) + 7)/ 8;
+ cell_size *= fontheight(p);
+ src = p->fontdata;
+ dst = fontcache;
+
+ for (i = FONTDATAMAX/cell_size; i--; ) {
+ rotate_ccw(src, dst, (fontwidth(p) + 7) & ~7, fontheight(p));
+ src += cell_size;
+ dst += cell_size;
+ }
+}
+
+void fbcon_rl_bmove(struct display *p, int sy, int sx, int dy, int dx,
+ int height, int width)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_copyarea area;
+
+ area.sx = sy * fontheight(p);
+ area.sy = info->var.xres_virtual - ((sx + width) * fontwidth(p));
+ area.dx = dy * fontheight(p);
+ area.dy = info->var.xres_virtual - ((dx + width) * fontwidth(p));
+ area.width = height * fontheight(p);
+ area.height = width * fontwidth(p);
+
+ info->fbops->fb_copyarea(info, &area);
+}
+
+void fbcon_rl_clear(struct vc_data *vc, struct display *p, int sy, int sx,
+ int height, int width)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_fillrect region;
+
+ region.color = attr_bgcol_ec(p,vc);
+ region.dx = sy * fontheight(p);
+ region.dy = info->var.xres_virtual - ((sx + width) * fontwidth(p));
+ region.height = width * fontwidth(p);
+ region.width = height * fontheight(p);
+ region.rop = ROP_COPY;
+
+ info->fbops->fb_fillrect(info, ®ion);
+}
+
+void fbcon_rl_putc(struct vc_data *vc, struct display *p, int c, int yy,
+ int xx)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned short charmask = p->charmask;
+ unsigned int width = ((fontwidth(p)+7)>>3);
+ struct fb_image image;
+
+ image.fg_color = attr_fgcol(p, c);
+ image.bg_color = attr_bgcol(p, c);
+ image.dx = yy * fontheight(p);
+ image.dy = info->var.xres_virtual - ((xx * fontwidth(p)) + fontwidth(p));
+ image.width = fontheight(p);
+ image.height = fontwidth(p);
+ image.data = fontcache + (c & charmask)*fontheight(p) * width;
+ image.depth = 1;
+ info->fbops->fb_imageblit(info, &image);
+}
+
+void fbcon_rl_putcs(struct vc_data *vc, struct display *p,
+ const unsigned short *s, int count, int yy, int xx)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned short charmask = p->charmask;
+ unsigned int width = ((fontwidth(p)+7)>>3);
+ unsigned int cell_size = width * fontheight(p);
+ struct fb_image image;
+
+ image.fg_color = attr_fgcol(p, *s);
+ image.bg_color = attr_bgcol(p, *s);
+ image.dx = yy * fontheight(p);
+ image.dy = info->var.xres_virtual - ((xx * fontwidth(p)) + fontwidth(p));
+ image.width = fontheight(p);
+ image.height = fontwidth(p);
+ image.depth = 1;
+ while (count--) {
+ image.data = fontcache + (scr_readw(s++) & charmask) * cell_size;
+ info->fbops->fb_imageblit(info, &image);
+ image.dy -= fontwidth(p);
+ }
+}
+
+void fbcon_rl_revc(struct display *p, int xx, int yy)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_fillrect region;
+
+ region.color = attr_fgcol_ec(p, p->conp);
+ region.dx = yy * fontheight(p);
+ region.dy = info->var.xres_virtual - ((xx * fontwidth(p)) + fontwidth(p));
+ region.width = fontheight(p);
+ region.height = fontwidth(p);
+ region.rop = ROP_XOR;
+
+ info->fbops->fb_fillrect(info, ®ion);
+}
+
+void fbcon_rl_clear_margins(struct vc_data *vc, struct display *p,
+ int bottom_only)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned int cw = fontwidth(p);
+ unsigned int ch = fontheight(p);
+ unsigned int rw = info->var.xres % cw;
+ unsigned int bh = info->var.yres % ch;
+ unsigned int rs = info->var.xres - rw;
+ unsigned int bs = info->var.yres - bh;
+ struct fb_fillrect region;
+
+ region.color = attr_bgcol_ec(p,vc);
+ region.rop = ROP_COPY;
+
+ if (rw && !bottom_only) {
+ region.dx = 0;
+ region.dy = info->var.xres_virtual - (info->var.xoffset + rs + rw);
+ region.height = rw;
+ region.width = info->var.yres_virtual;
+ info->fbops->fb_fillrect(info, ®ion);
+ }
+
+ if (bh) {
+ region.dx = info->var.yoffset + bs;
+ region.dy = info->var.xres_virtual - (info->var.xoffset + rs + rw);
+ region.width = bh;
+ region.height = rs;
+ info->fbops->fb_fillrect(info, ®ion);
+ }
+}
+
+ /*
+ * `switch' for the low level operations
+ */
+
+struct display_switch fbcon_rl = {
+ setup: fbcon_rl_setup,
+ bmove: fbcon_rl_bmove,
+ clear: fbcon_rl_clear,
+ putc: fbcon_rl_putc,
+ putcs: fbcon_rl_putcs,
+ revc: fbcon_rl_revc,
+ clear_margins: fbcon_rl_clear_margins,
+ fontwidthmask: FONTWIDTHRANGE(1, 16)
+};
+
+/*
+ * 180 degree Rotation
+ */
+void fbcon_ud_setup(struct display *p)
+{
+ u32 i, cell_size;
+ char *src, *dst;
+
+ p->next_line = p->fb_info->fix.line_length;
+ p->next_plane = 0;
+
+ memset(fontcache, 0, FONTDATAMAX);
+
+ cell_size = (fontwidth(p) + 7)/ 8;
+ cell_size *= fontheight(p);
+ src = p->fontdata;
+ dst = fontcache;
+
+ for (i = FONTDATAMAX/cell_size; i--; ) {
+ rotate_ud(src, dst, (fontwidth(p) + 7) & ~7, fontheight(p));
+ src += cell_size;
+ dst += cell_size;
+ }
+}
+
+void fbcon_ud_bmove(struct display *p, int sy, int sx, int dy, int dx,
+ int height, int width)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_copyarea area;
+
+ area.sy = info->var.yres_virtual - ((sy + height) * fontheight(p));
+ area.sx = info->var.xres_virtual - ((sx + width) * fontwidth(p));
+ area.dy = info->var.yres_virtual - ((dy + height) * fontheight(p));
+ area.dx = info->var.xres_virtual - ((dx + width) * fontwidth(p));
+ area.height = height * fontheight(p);
+ area.width = width * fontwidth(p);
+
+ info->fbops->fb_copyarea(info, &area);
+}
+
+void fbcon_ud_clear(struct vc_data *vc, struct display *p, int sy, int sx,
+ int height, int width)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_fillrect region;
+
+ region.color = attr_bgcol_ec(p,vc);
+ region.dy = info->var.yres_virtual - ((sy + height) * fontheight(p));
+ region.dx = info->var.xres_virtual - ((sx + width) * fontwidth(p));
+ region.width = width * fontwidth(p);
+ region.height = height * fontheight(p);
+ region.rop = ROP_COPY;
+
+ info->fbops->fb_fillrect(info, ®ion);
+}
+
+void fbcon_ud_putc(struct vc_data *vc, struct display *p, int c, int yy,
+ int xx)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned short charmask = p->charmask;
+ unsigned int width = ((fontwidth(p)+7)>>3);
+ struct fb_image image;
+
+ image.fg_color = attr_fgcol(p, c);
+ image.bg_color = attr_bgcol(p, c);
+ image.dy = info->var.yres_virtual - ((yy * fontheight(p)) + fontheight(p));
+ image.dx = info->var.xres_virtual - ((xx * fontwidth(p)) + fontwidth(p));
+ image.height = fontheight(p);
+ image.width = fontwidth(p);
+ image.depth = 1;
+ image.data = fontcache + (c & charmask)*fontheight(p) * width;
+ info->fbops->fb_imageblit(info, &image);
+}
+
+void fbcon_ud_putcs(struct vc_data *vc, struct display *p,
+ const unsigned short *s, int count, int yy, int xx)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned short charmask = p->charmask;
+ unsigned int width = ((fontwidth(p)+7)>>3);
+ unsigned int cell_size = width * fontheight(p);
+ struct fb_image image;
+
+ image.fg_color = attr_fgcol(p, *s);
+ image.bg_color = attr_bgcol(p, *s);
+ image.dy = info->var.yres_virtual - ((yy * fontheight(p)) + fontheight(p));
+ image.dx = info->var.xres_virtual - ((xx * fontwidth(p)) + fontwidth(p));
+ image.height = fontheight(p);
+ image.width = fontwidth(p);
+ image.depth = 1;
+ while (count--) {
+ image.data = fontcache + (scr_readw(s++) & charmask) * cell_size;
+ info->fbops->fb_imageblit(info, &image);
+ image.dx -= fontwidth(p);
+ }
+}
+
+void fbcon_ud_revc(struct display *p, int xx, int yy)
+{
+ struct fb_info *info = p->fb_info;
+ struct fb_fillrect region;
+
+ region.color = attr_fgcol_ec(p, p->conp);
+ region.dy = info->var.yres_virtual - ((yy * fontheight(p)) + fontheight(p));
+ region.dx = info->var.xres_virtual - ((xx * fontwidth(p)) + fontwidth(p));
+ region.height = fontheight(p);
+ region.width = fontwidth(p);
+ region.rop = ROP_XOR;
+
+ info->fbops->fb_fillrect(info, ®ion);
+}
+
+void fbcon_ud_clear_margins(struct vc_data *vc, struct display *p,
+ int bottom_only)
+{
+ struct fb_info *info = p->fb_info;
+ unsigned int cw = fontwidth(p);
+ unsigned int ch = fontheight(p);
+ unsigned int rw = info->var.xres % cw;
+ unsigned int bh = info->var.yres % ch;
+ unsigned int rs = info->var.xres - rw;
+ unsigned int bs = info->var.yres - bh;
+ struct fb_fillrect region;
+
+ region.color = attr_bgcol_ec(p,vc);
+ region.rop = ROP_COPY;
+
+ if (rw && !bottom_only) {
+ region.dy = 0;
+ region.dx = info->var.xres_virtual - (info->var.xoffset + rs + rw);
+ region.width = rw;
+ region.height = info->var.yres_virtual;
+ info->fbops->fb_fillrect(info, ®ion);
+ }
+
+ if (bh) {
+ region.dy = info->var.yres_virtual - (info->var.yoffset + bs + bh);
+ region.dx = info->var.xres_virtual - (info->var.xoffset + rs + rw);
+ region.height = bh;
+ region.width = rs;
+ info->fbops->fb_fillrect(info, ®ion);
+ }
+}
+
+ /*
+ * `switch' for the low level operations
+ */
+
+struct display_switch fbcon_ud = {
+ setup: fbcon_ud_setup,
+ bmove: fbcon_ud_bmove,
+ clear: fbcon_ud_clear,
+ putc: fbcon_ud_putc,
+ putcs: fbcon_ud_putcs,
+ revc: fbcon_ud_revc,
+ clear_margins: fbcon_ud_clear_margins,
+ fontwidthmask: FONTWIDTHRANGE(1, 16)
+};
+
+#ifdef MODULE
+MODULE_LICENSE("GPL");
+
+int init_module(void)
+{
+ return 0;
+}
+
+void cleanup_module(void)
+{}
+#endif /* MODULE */
+
+
+ /*
+ * Visible symbols for modules
+ */
+
+EXPORT_SYMBOL(fbcon_rr);
+EXPORT_SYMBOL(fbcon_rr_setup);
+EXPORT_SYMBOL(fbcon_rr_bmove);
+EXPORT_SYMBOL(fbcon_rr_clear);
+EXPORT_SYMBOL(fbcon_rr_putc);
+EXPORT_SYMBOL(fbcon_rr_putcs);
+EXPORT_SYMBOL(fbcon_rr_revc);
+EXPORT_SYMBOL(fbcon_rr_clear_margins);
+
+EXPORT_SYMBOL(fbcon_rl);
+EXPORT_SYMBOL(fbcon_rl_setup);
+EXPORT_SYMBOL(fbcon_rl_bmove);
+EXPORT_SYMBOL(fbcon_rl_clear);
+EXPORT_SYMBOL(fbcon_rl_putc);
+EXPORT_SYMBOL(fbcon_rl_putcs);
+EXPORT_SYMBOL(fbcon_rl_revc);
+EXPORT_SYMBOL(fbcon_rl_clear_margins);
+
+EXPORT_SYMBOL(fbcon_ud);
+EXPORT_SYMBOL(fbcon_ud_setup);
+EXPORT_SYMBOL(fbcon_ud_bmove);
+EXPORT_SYMBOL(fbcon_ud_clear);
+EXPORT_SYMBOL(fbcon_ud_putc);
+EXPORT_SYMBOL(fbcon_ud_putcs);
+EXPORT_SYMBOL(fbcon_ud_revc);
+EXPORT_SYMBOL(fbcon_ud_clear_margins);
diff -Naur linux-2.5.33/drivers/video/fbcon-rotate.h linux/drivers/video/fbcon-rotate.h
--- linux-2.5.33/drivers/video/fbcon-rotate.h Thu Jan 1 00:00:00 1970
+++ linux/drivers/video/fbcon-rotate.h Sun Sep 8 19:45:59 2002
@@ -0,0 +1,62 @@
+/*
+ * FBcon low-level driver wrapper for the display rotation.
+ */
+
+#ifndef _VIDEO_FBCON_ROTATE_H
+#define _VIDEO_FBCON_ROTATE_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_ROTATE) || defined(CONFIG_FBCON_ROTATE_MODULE)
+#define FBCON_HAS_ROTATE
+#endif
+#else
+#if defined(CONFIG_FBCON_ROTATE)
+#define FBCON_HAS_ROTATE
+#endif
+#endif
+
+extern struct display_switch fbcon_rr;
+extern void fbcon_rr_setup(struct display *p);
+extern void fbcon_rr_bmove(struct display *p, int sy, int sx, int dy,
+ int dx, int height, int width);
+extern void fbcon_rr_clear(struct vc_data *vc, struct display *p, int sy,
+ int sx, int height, int width);
+extern void fbcon_rr_putc(struct vc_data *vc, struct display *p, int c,
+ int yy, int xx);
+extern void fbcon_rr_putcs(struct vc_data *vc, struct display *p,
+ const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_rr_revc(struct display *p, int xx, int yy);
+extern void fbcon_rr_clear_margins(struct vc_data *vc, struct display *p,
+ int bottom_only);
+
+extern struct display_switch fbcon_rl;
+extern void fbcon_rl_setup(struct display *p);
+extern void fbcon_rl_bmove(struct display *p, int sy, int sx, int dy,
+ int dx, int height, int width);
+extern void fbcon_rl_clear(struct vc_data *vc, struct display *p, int sy,
+ int sx, int height, int width);
+extern void fbcon_rl_putc(struct vc_data *vc, struct display *p, int c,
+ int yy, int xx);
+extern void fbcon_rl_putcs(struct vc_data *vc, struct display *p,
+ const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_rl_revc(struct display *p, int xx, int yy);
+extern void fbcon_rl_clear_margins(struct vc_data *vc, struct display *p,
+ int bottom_only);
+
+extern struct display_switch fbcon_ud;
+extern void fbcon_ud_setup(struct display *p);
+extern void fbcon_ud_bmove(struct display *p, int sy, int sx, int dy,
+ int dx, int height, int width);
+extern void fbcon_ud_clear(struct vc_data *vc, struct display *p, int sy,
+ int sx, int height, int width);
+extern void fbcon_ud_putc(struct vc_data *vc, struct display *p, int c,
+ int yy, int xx);
+extern void fbcon_ud_putcs(struct vc_data *vc, struct display *p,
+ const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_ud_revc(struct display *p, int xx, int yy);
+extern void fbcon_ud_clear_margins(struct vc_data *vc, struct display *p,
+ int bottom_only);
+
+#endif /* _VIDEO_FBCON_ROTATE_H */
diff -Naur linux-2.5.33/drivers/video/fbgen.c linux/drivers/video/fbgen.c
--- linux-2.5.33/drivers/video/fbgen.c Sun Sep 8 19:38:45 2002
+++ linux/drivers/video/fbgen.c Sun Sep 8 19:45:59 2002
@@ -29,6 +29,7 @@
#include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h>
#include "fbcon-accel.h"
+#include "fbcon-rotate.h"
int gen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
@@ -156,10 +157,19 @@
#ifdef FBCON_HAS_ACCEL
display->scrollmode = SCROLL_YNOMOVE;
- display->dispsw = &fbcon_accel;
+#ifdef FBCON_HAS_ROTATE
+ if (info->var.vmode & FB_VMODE_ROTATE_CW)
+ display->dispsw = &fbcon_rr;
+ else if (info->var.vmode & FB_VMODE_ROTATE_CCW)
+ display->dispsw = &fbcon_rl;
+ else if (info->var.vmode & FB_VMODE_ROTATE_UD)
+ display->dispsw = &fbcon_ud;
+ else
+#endif /* FBCON_HAS_ROTATE */
+ display->dispsw = &fbcon_accel;
#else
display->dispsw = &fbcon_dummy;
-#endif
+#endif /* FBCON_HAS_ACCEL */
return;
}
diff -Naur linux-2.5.33/include/linux/fb.h linux/include/linux/fb.h
--- linux-2.5.33/include/linux/fb.h Sun Sep 8 19:45:40 2002
+++ linux/include/linux/fb.h Sun Sep 8 19:45:59 2002
@@ -166,6 +166,11 @@
#define FB_VMODE_DOUBLE 2 /* double scan */
#define FB_VMODE_MASK 255
+#define FB_VMODE_ROTATE_CW 0x010000 /* rotate console by 90 degrees */
+#define FB_VMODE_ROTATE_CCW 0x020000 /* rotate console by 270 degrees */
+#define FB_VMODE_ROTATE_UD 0x040000 /* rotate console by 180 degrees */
+#define FB_ROTATE_MASK 0xFF0000
+
#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
|
|
From: Antonino D. <ad...@po...> - 2002-09-09 14:20:10
|
Hi, Since Xfbdev is able to rotate the display, I guess it's also reasonable for the console to have the ability to rotate the display too. I have added 3 new flags to var->vmode: FB_VMODE_ROTATE_CW 0x010000 /* 90 degree rotation */ FB_VMODE_ROTATE_CCW 0x020000 /* 270 degree rotation */ FB_VMODE_ROTATE_UD 0x040000 /* 180 degree rotation */ FB_ROTATE_MASK 0xFF0000 Rotating the display is done using console wrappers similar to fbcon-accel. Depending on the rotation flag, dispsw is pointed to the appropriate wrapper in gen_set_disp. As for driver support, the minimum requirement is for the driver to recognize these flags, and set the var->xres, var->yres, var->xres_virtual, and var->yres_virtual fields to the appropriate logical values. Ie, if display is rotated CW or CCW, then logical xres is physical yres, etc. For drivers that support panning, the viewport and direction of the panning must be appropriate for the orientation. Ie, if display is rotated 180 degrees, the viewport must be flushed to the 'right' and 'bottom' edge of the framebuffer when xoffset and yoffset are zero. Then logical pan_down is physical pan_up, etc. The option is configurable under 'Advanced Low Level Driver Options', and is dependent on CONFIG_FB_ACCEL being set since the wrapper depends on xxximageblit, xxxfillrect and xxxcopyarea. As a testbed, I modified vesafb to support console rotation. The following patches will follow (against linux-2.5.33): a. fb_rotate.diff b. fb_drawing.diff c. vesafb_rotate.diff d. fbset_rotate.diff If the patches are mangled, please get them at: http://i810fb.sourceforge.net/fb_rotate.tar.gz Tony |
|
From: Linux P. <lin...@re...> - 2002-09-08 16:40:35
|
Hello there, I had some doubts regarding the framebuffer struct usage. As I understand, the buffer is at fb_info.screen_base and the size of the buffer is (hres * vres * bits_per_pixel )/8. The state of the pixel at location (x,y), would be represented by the value of byte at screen_base + ((y*hres + x) * bits_per_pixel)/8. If the display is 8 bit, then it would require only a byte to represent the value of the pixel. If it were 24 bit, then it would require 3 bytes, and so on. Is that right? What would happen, to the size required for the buffer, if the display requires, say 12 bits per pixel, or 18 bits? So, if I were to set all the bytes after screen_base uptil screen_base + (hres*vres*bits_per_pixel/8) to zeros, then I would get a black screen. Is that right? I'm asking cos, I'm workin on a framebuffer support for an LCD panel, and am making the above assumption which doesn't seem happening. - navin. __________________________________________________________ Give your Company an email address like ravi @ ravi-exports.com. Sign up for Rediffmail Pro today! Know more. http://www.rediffmailpro.com/signup/ |
|
From: Mrs m m. Sese-s. <ms...@sp...> - 2002-09-03 05:11:11
|
FROM=3AMRS=2E M SESE-SEKO DEAR FRIEND=2C I AM MRS=2E SESE-SEKO WIDOW OF LATE PRESIDENT MOBUTU SESE-SEKO OF ZAIRE=3F NOW KNOWN AS DEMOCRATIC REPUBLIC OF CONGO =28DRC=29=2E I AM MOVED TO WRITE YOU THIS LETTER=2C THIS WAS IN CONFIDENCE CONSIDERING MY PRESENT CIRCUMSTANCE AND SITUATION=2E I ESCAPED ALONG WITH MY HUSBAND AND TWO OF OUR SONS KONGOLO AND BASHER OUT OF DEMOCRATIC REPUBLIC OF CONGO =28DRC=29 TO ABIDJAN=2C COTE D'IVOIRE WHERE MY FAMILY AND I SETTLED=2C WHILE WE LATER MOVED TO SETTLED IN MORROCO WHERE MY HUSBAND LATER DIED OF CANCER DISEASE=2E HOWEVER DUE TO THIS SITUATION WE DECIDED TO CHANGED MOST OF MY HUSBAND'S BILLIONS OF DOLLARS DEPOSITED IN SWISS BANK AND OTHER COUNTRIES INTO OTHER FORMS OF MONEY CODED FOR SAFE PURPOSE BECAUSE THE NEW HEAD OF STATE OF =28DR=29 MR LAURENT KABILA HAS MADE ARRANGEMENT WITH THE SWISS GOVERNMENT AND OTHER EUROPEAN COUNTRIES TO FREEZE ALL MY LATE HUSBAND'S TREASURES DEPOSITED IN SOME EUROPEAN COUNTRIES=2E HENCE MY CHILDREN AND I DECIDED LAYING LOW IN AFRICA TO STUDY THE SITUATION TILL WHEN THINGS GETS BETTER=2C LIKE NOW THAT PRESIDENT KABILA IS DEAD AND THE SON TAKING OVER =28JOSEPH KABILA=29=2E ONE OF MY LATE HUSBAND'S CHATEAUX IN SOUTHERN FRANCE WAS CONFISCATED BY THE FRENCH GOVERNMENT=2C AND AS SUCH I HAD TO CHANGE MY IDENTITY SO THAT MY INVESTMENT WILL NOT BE TRACED AND CONFISCATED=2E I HAVE DEPOSITED THE SUM OF EIHGTEEN MLLION UNITED STATE DOLLARS=28US$18=2C000=2C000=2C00=2E=29 WITH A SECURITY COMPANY =2C FOR SAFEKEEPING=2E THE FUNDS ARE SECURITY CODED TO PREVENT THEM FROM KNOWING THE CONTENT=2E WHAT I WANT YOU TO DO IS TO INDICATE YOUR INTEREST THAT YOU WILL ASSIST US BY RECEIVING THE MONEY ON OUR BEHALF=2EACKNOWLEDGE THIS MESSAGE=2C SO THAT I CAN INTRODUCE YOU TO MY SON =28KONGOLO=29 WHO HAS THE OUT MODALITIES FOR THE CLAIM OF THE SAID FUNDS=2E I WANT YOU TO ASSIST IN INVESTING THIS MONEY=2C BUT I WILL NOT WANT MY IDENTITY REVEALED=2E I WILL ALSO WANT TO BUY PROPERTIES AND STOCK IN MULTI-NATIONAL COMPANIES AND TO ENGAGE IN OTHER SAFE AND NON-SPECULATIVE INVESTMENTS=2E MAY I AT THIS POINT EMPHASISE THE HIGH LEVEL OF CONFIDENTIALITY=2C WHICH THIS BUSINESS DEMANDS=2C AND HOPE YOU WILL NOT BETRAY THE TRUST AND CONFIDENCE=2C WHICH I REPOSE IN YOU=2E IN CONCLUSION=2C IF YOU WANT TO ASSIST US =2C MY SON SHALL PUT YOU IN THE PICTURE OF THE BUSINESS=2C TELL YOU WHERE THE FUNDS ARE CURRENTLY BEING MAINTAINED AND ALSO DISCUSS OTHER MODALITIES INCLUDING REMUNERATION FOR YOUR SERVICES=2E FOR THIS REASON KINDLY FURNISH US YOUR CONTACT INFORMATION=2C THAT IS YOUR PERSONAL TELEPHONE AND FAX NUMBER FOR CONFIDENTIAL PURPOSE AND ACKNOWLEDGE RECEIPT OF THIS MAIL USING THE ABOVE EMAIL ADDRESS=2E BEST REGARDS=2C MRS M=2E SESE SEKO |
|
From: Richard Z. <rz...@li...> - 2002-09-01 21:40:38
|
On Sun, Sep 01, 2002 at 11:24:57AM +0200, Geert Uytterhoeven wrote:
>
> Since fbcon_cfb16 is going to go away, what about using fbcon_accel and
> cfb{copyarea,fillrect,imgblt}.c instead?
it appears it oopsed because FBCON_HAS_ACCEL was not defined, the
name of the config option is slightly misleading.
Now the penguin is prefect, however text is unreadable and in some
strange blueish colour. Text background (empty lines etc) are filed
with some strange symbol.
Any ideas? This is still 2.5.31 if that matters.
Richard
|
|
From: Geert U. <ge...@li...> - 2002-09-01 09:25:51
|
On Sat, 31 Aug 2002, Richard Zidlicky wrote:
> I came around testing q40fb.c, fbcon_setup oopses because
> apparently dispsw isn't set anywhere.
>
> This patch seems to fix it although I had very little opportunity
> to test much further (it was good enough to display the next Oops
> though ;)
>
> --- linux-m68k-2.5.x/drivers/video/q40fb.c Tue Aug 13 21:30:36 2002
> +++ build-2.5/drivers/video/q40fb.c Sat Aug 31 14:33:11 2002
> @@ -29,6 +29,7 @@
> #include <asm/pgtable.h>
>
> #include <video/fbcon.h>
> +#include <video/fbcon-cfb16.h>
>
> #define Q40_PHYS_SCREEN_ADDR 0xFE800000
>
> @@ -125,6 +126,8 @@
> fb_info.switch_con = gen_switch;
> fb_info.updatevar = gen_update_var;
> fb_alloc_cmap(&fb_info.cmap, 16, 0);
> +
> + display.dispsw = &fbcon_cfb16;
>
> gen_set_disp(-1, &fb_info);
Since fbcon_cfb16 is going to go away, what about using fbcon_accel and
cfb{copyarea,fillrect,imgblt}.c instead?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Richard Z. <rz...@li...> - 2002-08-31 20:45:00
|
Hi,
I came around testing q40fb.c, fbcon_setup oopses because
apparently dispsw isn't set anywhere.
This patch seems to fix it although I had very little opportunity
to test much further (it was good enough to display the next Oops
though ;)
--- linux-m68k-2.5.x/drivers/video/q40fb.c Tue Aug 13 21:30:36 2002
+++ build-2.5/drivers/video/q40fb.c Sat Aug 31 14:33:11 2002
@@ -29,6 +29,7 @@
#include <asm/pgtable.h>
#include <video/fbcon.h>
+#include <video/fbcon-cfb16.h>
#define Q40_PHYS_SCREEN_ADDR 0xFE800000
@@ -125,6 +126,8 @@
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_alloc_cmap(&fb_info.cmap, 16, 0);
+
+ display.dispsw = &fbcon_cfb16;
gen_set_disp(-1, &fb_info);
Richard
|
|
From: James S. <jsi...@in...> - 2002-08-28 18:20:08
|
> James
> Should't gen_set_var set the var in info here as well? (when no check_var present)
No. The first test is to see if the passed in var is equal to the current
var in info. Note info->var is always set before we call gen_set_var. The
next set is check if xxfb_check_var is there. If this function is lacking
then we know the hardware supports a static mode. Then it just returns the
defualt var which is set before we call gen_set_var.
> BTW is gen_set_var going to stay in the new API or go away ?
It is to stay. It will be intergrated into fbmem.c once we are done.
> --- fbgen.c.orig Wed Aug 28 09:49:45 2002
> +++ fbgen.c Wed Aug 28 09:57:32 2002
> @@ -36,7 +36,7 @@
>
> if (con < 0 || (memcmp(&info->var, var, sizeof(struct fb_var_screeninfo)))) {
> if (!info->fbops->fb_check_var) {
> - *var = info->var;
> + info->var = *var;
> return 0;
> }
MS: (n) 1. A debilitating and surprisingly widespread affliction that
renders the sufferer barely able to perform the simplest task. 2. A disease.
James Simmons [jsi...@us...] ____/|
fbdev/console/gfx developer \ o.O|
http://www.linux-fbdev.org =(_)=
http://linuxgfx.sourceforge.net U
http://linuxconsole.sourceforge.net
|
|
From: Geert U. <ge...@li...> - 2002-08-28 09:20:09
|
On Wed, 28 Aug 2002, Jani Monoses wrote:
> so not having check_var implies we only support one video mode?
Yes. This is useful for e.g. handheld devices with LCDs, and for offb.
> > The original code is correct. It means the driver supports only 1 video
> > mode, which is the current one in info->var.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: Jani M. <ja...@iv...> - 2002-08-28 09:14:17
|
Thanks so not having check_var implies we only support one video mode? > > > > > The original code is correct. It means the driver supports only 1 video > mode, which is the current one in info->var. > > Tony > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Jabber - The world's fastest growing > real-time communications platform! Don't just IM. Build it in! > http://www.jabber.com/osdn/xim > _______________________________________________ > Linux-fbdev-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel |
|
From: Antonino D. <ad...@po...> - 2002-08-28 09:03:19
|
On Wed, 2002-08-28 at 18:00, Jani Monoses wrote:
> James
> Should't gen_set_var set the var in info here as well? (when no check_var present)
> BTW is gen_set_var going to stay in the new API or go away ?
>
> --- fbgen.c.orig Wed Aug 28 09:49:45 2002
> +++ fbgen.c Wed Aug 28 09:57:32 2002
> @@ -36,7 +36,7 @@
>
> if (con < 0 || (memcmp(&info->var, var, sizeof(struct fb_var_screeninfo)))) {
> if (!info->fbops->fb_check_var) {
> - *var = info->var;
> + info->var = *var;
> return 0;
> }
>
>
The original code is correct. It means the driver supports only 1 video
mode, which is the current one in info->var.
Tony
|
|
From: Jani M. <ja...@iv...> - 2002-08-28 06:58:22
|
James
Should't gen_set_var set the var in info here as well? (when no check_var present)
BTW is gen_set_var going to stay in the new API or go away ?
--- fbgen.c.orig Wed Aug 28 09:49:45 2002
+++ fbgen.c Wed Aug 28 09:57:32 2002
@@ -36,7 +36,7 @@
if (con < 0 || (memcmp(&info->var, var, sizeof(struct fb_var_screeninfo)))) {
if (!info->fbops->fb_check_var) {
- *var = info->var;
+ info->var = *var;
return 0;
}
|
|
From: James S. <jsi...@in...> - 2002-08-28 06:21:36
|
> This is with radeonfb compiled into the kernel. I'm not on the list, so please > CC any replies to me. > > radeonfb.c:605: unknown field `fb_get_fix' specified in initializer > radeonfb.c:605: warning: initialization from incompatible pointer type > radeonfb.c:606: unknown field `fb_get_var' specified in initializer > radeonfb.c:606: warning: initialization from incompatible pointer type > radeonfb.c: In function `radeon_set_dispsw': > radeonfb.c:1385: structure has no member named `type' > radeonfb.c:1386: structure has no member named `type_aux' > radeonfb.c:1387: structure has no member named `ypanstep' > radeonfb.c:1388: structure has no member named `ywrapstep' > radeonfb.c:1397: structure has no member named `visual' > radeonfb.c:1398: structure has no member named `line_length' > [snip repeats] > radeonfb.c:2487: warning: `fbcon_radeon8' defined but not used > radeonfb.c:598: warning: `radeon_read_OF' declared `static' but never defined > radeonfb.c:1710: warning: `radeonfb_set_cmap' defined but not used > make[2]: *** [radeonfb.o] Error 1 > make[1]: *** [video] Error 2 > make: *** [drivers] Error 2 This is normal. The framebuffer layer is moving to a new api. The next set of changes will finish the port over to this new api. Unfortunely it will break most drivers. It is up to the driver maintainters to update there drivers. MS: (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease. James Simmons [jsi...@us...] ____/| fbdev/console/gfx developer \ o.O| http://www.linux-fbdev.org =(_)= http://linuxgfx.sourceforge.net U http://linuxconsole.sourceforge.net |
|
From: Geert U. <ge...@li...> - 2002-08-25 15:19:20
|
On Mon, 19 Aug 2002, Geert Uytterhoeven wrote: > On Mon, 19 Aug 2002, Geert Uytterhoeven wrote: > > In cfb_copyarea(), `tmp' must be unsigned long because it is used to store > > unsigned long values (see patch at the end). > > > > cfb_copyarea() also doesn't clear the bits to modify in the first and last > > words of a line, e.g. it does > > > > | last = (FB_READ(src) & start_mask); > > | > > | if (shift > 0) > > | FB_WRITE(FB_READ(dst) | (last >> shift_right), dst); > > ^^^^^^^^^^^^ > > After this read, the bits to modify must be cleared first, before the OR! > > > > I'm working on a version of cfb_copyarea() that fixes this and handles _all_ > > possible values of var.bits_per_pixel (the current code assumes > > var.bits_per_pixel is a multiple of 8). Stay tuned! > ^^^^^^^^^^^^^^^ > Oops, actually 8, 16, or 32 only (and 24 after Antonino Daplas' patch). I also > plan on relaxing the current limitation that line_size must be a multiple of > sizeof(unsigned long). A very first version is available in fbtest (module `fbtest' in linux-fbdev's CVS at sourceforge.net). More optimizations (e.g. cached first/last masks) to be released later... Gr{oetje,eeting}s, Geert P.S. Yes, I work in userspace right know ;-) -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |
|
From: Antonino D. <ad...@po...> - 2002-08-24 22:59:12
|
On Sat, 2002-08-24 at 20:33, Paul Mackerras wrote: Hi Paul, > James Simmons writes: > > > Paul please test the code. > > (The new cfbimgblt.c, that is.) > Thanks for testing the code :) > It mostly seems to be fine, except there are some problems with the > cursor. I have only tested it with the standard 8x16 font so far > though. I had to add a #include <video/fbcon.h> near the top to get > the definitions of fb_readl and fb_writel. > Can you test it with a bit depth not a multiple of 32/64? Or just force the code to always call slow_imageblit? I'm concerned about slow_imageblit not correct with big endian machines. > It seems to be not erasing the cursor image when it should. So, if I > am logged in on the console and I type a few characters and then press > backspace a few times, it leaves those character positions entirely > white. Also, when I press return it leaves the cursor image on that > line as well as drawing the cursor after the shell prompt on the next > line. > It looks like a fillrect problem. > I just tried with the old cfbimgblt.c and it also does the same > thing. So it's not the new cfbimgblt.c that is doing this, it's > something else in your fbcon changes (or just possibly mine :). This > is with atyfb with my patches. > Paul. I'm also attaching cfbfillrect.c which hopefully addresses some of the problems which Geert mentioned before (access/pitch alignment, support for all bit depths, etc). Tony PS. Sorry about the attachment, my mailer mangles inline text. |
|
From: Paul M. <pa...@sa...> - 2002-08-24 12:36:59
|
James Simmons writes: > Paul please test the code. (The new cfbimgblt.c, that is.) It mostly seems to be fine, except there are some problems with the cursor. I have only tested it with the standard 8x16 font so far though. I had to add a #include <video/fbcon.h> near the top to get the definitions of fb_readl and fb_writel. It seems to be not erasing the cursor image when it should. So, if I am logged in on the console and I type a few characters and then press backspace a few times, it leaves those character positions entirely white. Also, when I press return it leaves the cursor image on that line as well as drawing the cursor after the shell prompt on the next line. I just tried with the old cfbimgblt.c and it also does the same thing. So it's not the new cfbimgblt.c that is doing this, it's something else in your fbcon changes (or just possibly mine :). This is with atyfb with my patches. Paul. |
|
From: James S. <jsi...@in...> - 2002-08-22 20:23:54
|
The removal of the console code from the low level drivers into fbcon.c. See skeletonfb.c in the latest 2.5.X kernel to see the changes. |
|
From: Stephane W. <ste...@be...> - 2002-08-22 19:48:07
|
i made many patches to change the framebuffer's logo in 2.4. i modified fblogo to put LOGO_W and LOGO_H in linux_logo.h :-) so, i have many problems with my patch, can you check it ? thanks here the URL : http://www.linux-mons.be/projets/framebuffer_logos/ -- Stephane Wirtel <ste...@be...> Web : www.linux-mons.be "Linux Is Not UniX !!!" |
|
From: Geert U. <ge...@li...> - 2002-08-22 19:37:21
|
On Thu, 22 Aug 2002, James Simmons wrote:
> > > Good question. Is there any reason why this is?
> > it's more easy to change the logo if it is in linux_logo.h
> >
> > i modified fblogo, to make a linux_logo.h with LOGO_W and LOGO_H.
>
> Geert how do you feel about thsi change?
For me that's OK.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
|
From: James S. <jsi...@in...> - 2002-08-22 19:33:21
|
> ok, i understood the problem with my patch of the logo. I patched fbcon.c to deal with displays with dimensions smaller than the logo. |