* Much better framebuffer fixes.
@ 2003-03-27 0:18 James Simmons
2003-03-27 3:29 ` [Linux-fbdev-devel] " Antonino Daplas
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: James Simmons @ 2003-03-27 0:18 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: Linux Fbdev development list
Okay. Here are more framebuffer fixes. Please try these fixes and let me
know how they work out for you.
The diff is at
http://phoenix.infradead.org/~jsimmons/fbdev.diff.gz
Documentation/devices.txt | 7 -
arch/ppc/syslib/prom_init.c | 2
drivers/video/aty/aty128fb.c | 16 +-
drivers/video/cfbimgblt.c | 4
drivers/video/console/fbcon.c | 246 +++++++++++++++++++++-------------------
drivers/video/controlfb.c | 18 --
drivers/video/fbmem.c | 76 ++++--------
drivers/video/i810/i810.h | 6
drivers/video/i810/i810_accel.c | 140 +++++++++++-----------
drivers/video/i810/i810_dvt.c | 3
drivers/video/i810/i810_gtf.c | 7 -
drivers/video/i810/i810_main.c | 135 +++++++++------------
drivers/video/i810/i810_main.h | 4
drivers/video/logo/logo.c | 69 +++++------
drivers/video/platinumfb.c | 28 +---
drivers/video/radeonfb.c | 10 +
drivers/video/riva/fbdev.c | 2
drivers/video/softcursor.c | 95 ++++-----------
drivers/video/tdfxfb.c | 18 +-
drivers/video/tgafb.c | 2
drivers/video/vga16fb.c | 4
include/linux/fb.h | 4
include/linux/linux_logo.h | 2
23 files changed, 403 insertions(+), 495 deletions(-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Linux-fbdev-devel] Much better framebuffer fixes.
2003-03-27 0:18 Much better framebuffer fixes James Simmons
@ 2003-03-27 3:29 ` Antonino Daplas
2003-03-27 9:33 ` Helge Hafting
2003-03-27 9:18 ` Geert Uytterhoeven
2003-03-27 9:58 ` Helge Hafting
2 siblings, 1 reply; 9+ messages in thread
From: Antonino Daplas @ 2003-03-27 3:29 UTC (permalink / raw)
To: James Simmons; +Cc: Linux Kernel Mailing List, Linux Fbdev development list
On Thu, 2003-03-27 at 08:18, James Simmons wrote:
>
> Okay. Here are more framebuffer fixes. Please try these fixes and let me
> know how they work out for you.
>
This is a resend of the patch I previously sent. I see that you have
made changes to the logo drawing code targeted for monochrome logo
drawing to use mono expansion. You still need a few changes though,
image->bg_color and image->fg_color must be initialized correctly when
image->depth == 1.
Tony
diff -Naur linux-2.5.66-orig/drivers/video/cfbimgblt.c linux-2.5.66/drivers/video/cfbimgblt.c
--- linux-2.5.66-orig/drivers/video/cfbimgblt.c 2003-03-27 03:06:10.000000000 +0000
+++ linux-2.5.66/drivers/video/cfbimgblt.c 2003-03-27 03:09:09.000000000 +0000
@@ -346,7 +346,7 @@
else
slow_imageblit(image, p, dst1, fgcolor, bgcolor,
start_index, pitch_index);
- } else if (image->depth <= bpp)
+ } else
color_imageblit(image, p, dst1, start_index, pitch_index);
}
diff -Naur linux-2.5.66-orig/drivers/video/console/fbcon.c linux-2.5.66/drivers/video/console/fbcon.c
--- linux-2.5.66-orig/drivers/video/console/fbcon.c 2003-03-27 03:06:10.000000000 +0000
+++ linux-2.5.66/drivers/video/console/fbcon.c 2003-03-27 03:09:09.000000000 +0000
@@ -172,7 +172,7 @@
* Internal routines
*/
static void fbcon_set_display(struct vc_data *vc, int init, int logo);
-static void accel_cursor(struct vc_data *vc, struct fb_info *info,
+static void accel_cursor(struct vc_data *vc, struct fb_info *info,
struct fb_cursor *cursor, int yy);
static __inline__ int real_y(struct display *p, int ypos);
static __inline__ void updatescrollmode(struct display *p, struct vc_data *vc);
@@ -206,13 +206,13 @@
return;
if (vbl_cursor_cnt && --vbl_cursor_cnt == 0) {
- cursor.set = 0;
+ cursor.set = FB_CUR_SETFLASH;
if (!cursor_drawn)
cursor.set = FB_CUR_SETCUR;
accel_cursor(vc, info, &cursor, real_y(p, vc->vc_y));
cursor_drawn ^= 1;
- vbl_cursor_cnt = cursor_blink_rate;
+ vbl_cursor_cnt = cursor_blink_rate;
}
}
@@ -220,9 +220,9 @@
{
struct fb_info *info = dev_id;
- schedule_work(&info->queue);
+ schedule_work(&info->queue);
}
-
+
static void cursor_timer_handler(unsigned long dev_addr);
static struct timer_list cursor_timer =
@@ -232,7 +232,7 @@
{
struct fb_info *info = (struct fb_info *) dev_addr;
- schedule_work(&info->queue);
+ schedule_work(&info->queue);
cursor_timer.expires = jiffies + HZ / 50;
add_timer(&cursor_timer);
}
@@ -530,6 +530,7 @@
* Low Level Operations
*/
/* NOTE: fbcon cannot be __init: it may be called from take_over_console later */
+
static const char *fbcon_startup(void)
{
const char *display_desc = "frame buffer device";
@@ -593,9 +594,16 @@
return NULL;
}
+ /* Allocate private data */
+ info->fbcon_priv = kmalloc(sizeof(struct fbcon_private), GFP_KERNEL);
+ if (info->fbcon_priv == NULL) {
+ kfree(vc);
+ return NULL;
+ }
+
/* Initialize the work queue */
INIT_WORK(&info->queue, fb_callback, info);
-
+
/* Setup default font */
vc->vc_font.data = font->data;
vc->vc_font.width = font->width;
@@ -993,103 +1001,108 @@
accel_putcs(vc, info, s, count, real_y(p, ypos), xpos);
}
-static void accel_cursor(struct vc_data *vc, struct fb_info *info,
- struct fb_cursor *cursor, int yy)
+void accel_cursor(struct vc_data *vc, struct fb_info *info,
+ struct fb_cursor *cursor, int yy)
{
+ struct fbcon_private *priv = (struct fbcon_private *)info->fbcon_priv;
unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;
- static int fgcolor, bgcolor, shape, width, height;
- static char mask[64], image[64], *dest;
- char *font;
- int c;
+ int height, width, size, c;
+ int w, cur_height, i = 0;
+ u8 *font;
+
+ if (cursor->set & FB_CUR_SETCUR)
+ cursor->enable = 1;
+ else
+ cursor->enable = 0;
- if (cursor->set & FB_CUR_SETCUR)
- cursor->enable = 1;
- else
- cursor->enable = 0;
- cursor->set = FB_CUR_SETPOS;
+ height = priv->cursor.image.height;
+ width = priv->cursor.image.width;
+
+ if (width != vc->vc_font.width ||
+ height != vc->vc_font.height) {
+ priv->cursor.image.width = vc->vc_font.width;
+ priv->cursor.image.height = vc->vc_font.height;
+ height = priv->cursor.image.height;
+ width = priv->cursor.image.width;
+ cursor->set |= FB_CUR_SETSIZE;
+ }
+
+ if (priv->cursor.image.dx != vc->vc_x * width ||
+ priv->cursor.image.dy != yy * height) {
+ priv->cursor.image.dx = vc->vc_x * width;
+ priv->cursor.image.dy = yy * height;
+ cursor->set |= FB_CUR_SETPOS;
+ }
- if (width != vc->vc_font.width || height != vc->vc_font.height) {
- width = vc->vc_font.width;
- height = vc->vc_font.height;
- cursor->set |= FB_CUR_SETSIZE;
- }
+ size = ((width + 7) >> 3) * height;
- if ((vc->vc_cursor_type & 0x0f) != shape) {
- shape = vc->vc_cursor_type & 0x0f;
+ if (cursor->set & FB_CUR_SETSIZE) {
+ memset(priv->image, 0xff, size);
cursor->set |= FB_CUR_SETSHAPE;
- }
+ }
- c = scr_readw((u16 *) vc->vc_pos);
+ if (priv->shape != (vc->vc_cursor_type & 0x0f)) {
+ priv->shape = vc->vc_cursor_type & 0x0f;
+ cursor->set |= FB_CUR_SETSHAPE;
+ }
- if (fgcolor != (int) attr_fgcol(fgshift, c) ||
- bgcolor != (int) attr_bgcol(bgshift, c)) {
- fgcolor = (int) attr_fgcol(fgshift, c);
- bgcolor = (int) attr_bgcol(bgshift, c);
- cursor->set |= FB_CUR_SETCMAP;
- }
- c &= charmask;
- font = vc->vc_font.data + (c * ((width + 7) / 8) * height);
- if (font != dest) {
- dest = font;
- cursor->set |= FB_CUR_SETDEST;
- }
-
- if (cursor->set & FB_CUR_SETSIZE) {
- memset(image, 0xff, 64);
- cursor->set |= FB_CUR_SETSHAPE;
- }
+ c = scr_readw((u16 *) vc->vc_pos);
- if (cursor->set & FB_CUR_SETSHAPE) {
- int w, cur_height, size, i = 0;
+ if (priv->cursor.image.fg_color != attr_fgcol(fgshift, c) ||
+ priv->cursor.image.bg_color != attr_bgcol(bgshift, c)) {
+ priv->cursor.image.fg_color = attr_fgcol(fgshift, c);
+ priv->cursor.image.bg_color = attr_bgcol(bgshift, c);
+ priv->cursor.image.depth = 1;
+ cursor->set |= FB_CUR_SETCMAP;
+ }
+ font = vc->vc_font.data + ((c & charmask) * size);
+ if (font != priv->dest) {
+ priv->dest = font;
+ cursor->set |= FB_CUR_SETDEST;
+ }
- w = (width + 7) / 8;
+ w = (width + 7) >> 3;
- switch (shape) {
- case CUR_NONE:
- cur_height = 0;
- break;
- case CUR_UNDERLINE:
- cur_height = (height < 10) ? 1 : 2;
- break;
- case CUR_LOWER_THIRD:
- cur_height = height/3;
- break;
- case CUR_LOWER_HALF:
- cur_height = height/2;
- break;
- case CUR_TWO_THIRDS:
- cur_height = (height * 2)/3;
- break;
- case CUR_BLOCK:
- default:
- cur_height = height;
- break;
- }
- size = (height - cur_height) * w;
- while (size--)
- mask[i++] = 0;
- size = cur_height * w;
- while (size--)
- mask[i++] = 0xff;
- }
-
- cursor->image.width = width;
- cursor->image.height = height;
- cursor->image.dx = vc->vc_x * width;
- cursor->image.dy = yy * height;
- cursor->image.depth = 1;
- cursor->image.data = image;
- cursor->image.bg_color = bgcolor;
- cursor->image.fg_color = fgcolor;
- cursor->mask = mask;
- cursor->dest = dest;
- cursor->rop = ROP_XOR;
+ if (cursor->set & FB_CUR_SETSHAPE) {
+ switch (priv->shape) {
+ case CUR_NONE:
+ cur_height = 0;
+ break;
+ case CUR_UNDERLINE:
+ cur_height = (height < 10) ? 1 : 2;
+ break;
+ case CUR_LOWER_THIRD:
+ cur_height = height/3;
+ break;
+ case CUR_LOWER_HALF:
+ cur_height = height/2;
+ break;
+ case CUR_TWO_THIRDS:
+ cur_height = (height * 2)/3;
+ break;
+ case CUR_BLOCK:
+ default:
+ cur_height = height;
+ break;
+ }
- if (info->fbops->fb_cursor)
- info->fbops->fb_cursor(info, cursor);
+ size = (height - cur_height) * w;
+ while (size--)
+ priv->mask[i++] = 0;
+ size = cur_height * w;
+ while (size--)
+ priv->mask[i++] = 0xff;
+ }
+
+ cursor->image = priv->cursor.image;
+ cursor->image.data = priv->image;
+ cursor->dest = priv->dest;
+ cursor->mask = priv->mask;
+ cursor->rop = ROP_XOR;
+ info->fbops->fb_cursor(info, cursor);
}
static void fbcon_cursor(struct vc_data *vc, int mode)
@@ -1138,6 +1151,7 @@
}
}
+
static int scrollback_phys_max = 0;
static int scrollback_max = 0;
static int scrollback_current = 0;
diff -Naur linux-2.5.66-orig/drivers/video/console/fbcon.h linux-2.5.66/drivers/video/console/fbcon.h
--- linux-2.5.66-orig/drivers/video/console/fbcon.h 2003-03-26 02:25:01.000000000 +0000
+++ linux-2.5.66/drivers/video/console/fbcon.h 2003-03-27 03:09:09.000000000 +0000
@@ -36,6 +36,15 @@
};
/* drivers/video/console/fbcon.c */
+
+struct fbcon_private {
+ struct fb_cursor cursor;
+ __u8 image[64];
+ __u8 mask[64];
+ __u8 *dest;
+ __u32 shape;
+};
+
extern char con2fb_map[MAX_NR_CONSOLES];
extern void set_con2fb_map(int unit, int newidx);
diff -Naur linux-2.5.66-orig/drivers/video/fbmem.c linux-2.5.66/drivers/video/fbmem.c
--- linux-2.5.66-orig/drivers/video/fbmem.c 2003-03-27 03:06:10.000000000 +0000
+++ linux-2.5.66/drivers/video/fbmem.c 2003-03-27 03:25:41.000000000 +0000
@@ -456,8 +456,7 @@
u32 align = info->pixmap.buf_align - 1;
u32 offset, count = 1000;
- spin_lock_irqsave(&info->pixmap.lock,
- info->pixmap.lock_flags);
+ spin_lock(&info->pixmap.lock);
offset = info->pixmap.offset + align;
offset &= ~align;
if (offset + size > info->pixmap.size) {
@@ -472,8 +471,7 @@
atomic_inc(&info->pixmap.count);
smp_mb__after_atomic_inc();
- spin_unlock_irqrestore(&info->pixmap.lock,
- info->pixmap.lock_flags);
+ spin_unlock_irqrestore(&info->pixmap.lock);
return offset;
}
@@ -584,20 +582,6 @@
}
}
break;
- case ~1:
- xor = 0xff;
- case 1:
- for (i = 0; i < logo->height; i++) {
- shift = 7;
- d = *src++ ^ xor;
- for (j = 0; j < logo->width; j++) {
- *dst++ = (d >> shift) & 1;
- shift = (shift-1) & 7;
- if (shift == 7)
- d = *src++ ^ xor;
- }
- }
- break;
}
}
@@ -619,13 +603,13 @@
* The number of colors just matches the console colors, thus there is no need
* to set the DAC or the pseudo_palette. However, the bitmap is packed, ie,
* each byte contains color information for two pixels (upper and lower nibble).
- * To be consistent with fb_imageblit() usage, we therefore separate the two
- * nibbles into separate bytes. The "depth" flag will be set to 4.
+ * Each 4 bits are expanded to a byte. The "depth" flag will be set to 8.
*
* Case 3 - linux_logo_mono:
- * This is similar with Case 2. Each byte contains information for 8 pixels.
- * We isolate each bit and expand each into a byte. The "depth" flag will
- * be set to 1.
+ * Each byte contains information for 8 pixels. We just pass the data to
+ * fb_imageblit unchanged, using the monochrome expansion routine. In order for
+ * color expansion to work, image->fg_color and image->bg_color must
+ * be properly initialized. The "depth" flag will be set to 1.
*/
static struct logo_data {
int depth;
@@ -716,18 +700,32 @@
}
image.data = logo_new;
fb_set_logo(info, fb_logo.logo, logo_new, fb_logo.depth);
+ image.depth = 8;
}
image.width = fb_logo.logo->width;
image.height = fb_logo.logo->height;
image.dy = 0;
+ /*
+ * Monochrome expansion and logo drawing functions are the same if
+ * fb_logo.needs_logo == 1.
+ */
+ switch (info->fix.visual) {
+ case FB_VISUAL_MONO10:
+ image.fg_color = (u32) (~(~0UL << fb_logo.depth));
+ image.bg_color = 0;
+ break;
+ case FB_VISUAL_MONO01:
+ image.bg_color = (u32) (~(~0UL << fb_logo.depth));
+ image.fg_color = 0;
+ break;
+ }
+
for (x = 0; x < num_online_cpus() * (fb_logo.logo->width + 8) &&
x <= info->var.xres-fb_logo.logo->width; x += (fb_logo.logo->width + 8)) {
image.dx = x;
info->fbops->fb_imageblit(info, &image);
- atomic_dec(&info->pixmap.count);
- smp_mb__after_atomic_dec();
}
if (palette != NULL)
diff -Naur linux-2.5.66-orig/drivers/video/softcursor.c linux-2.5.66/drivers/video/softcursor.c
--- linux-2.5.66-orig/drivers/video/softcursor.c 2003-03-27 03:06:10.000000000 +0000
+++ linux-2.5.66/drivers/video/softcursor.c 2003-03-27 03:09:09.000000000 +0000
@@ -19,46 +19,53 @@
int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
{
- int i, size = ((cursor->image.width + 7) / 8) * cursor->image.height;
struct fb_image image;
- static char data[64];
+ unsigned int scan_align = info->pixmap.scan_align - 1;
+ unsigned int buf_align = info->pixmap.buf_align - 1;
+ unsigned int i, size, dsize, s_pitch, d_pitch;
+ u8 *dst, src[64];
+
+ s_pitch = (cursor->image.width + 7) >> 3;
+ dsize = s_pitch * cursor->image.height;
+ d_pitch = (s_pitch + scan_align) & ~scan_align;
+ size = d_pitch * cursor->image.height + buf_align;
+ size &= ~buf_align;
+ dst = info->pixmap.addr + fb_get_buffer_offset(info, size);
if (cursor->enable) {
switch (cursor->rop) {
case ROP_XOR:
- for (i = 0; i < size; i++)
- data[i] = (cursor->image.data[i] &
- cursor->mask[i]) ^
- cursor->dest[i];
+ for (i = 0; i < dsize; i++) {
+ src[i] = (cursor->image.data[i] &
+ cursor->mask[i]) ^
+ cursor->dest[i];
+ }
break;
case ROP_COPY:
default:
- for (i = 0; i < size; i++)
- data[i] =
- cursor->image.data[i] & cursor->mask[i];
+ for (i = 0; i < dsize; i++) {
+ src[i] = cursor->image.data[i] &
+ cursor->mask[i];
+ }
break;
}
- } else
- memcpy(data, cursor->dest, size);
-
- image.bg_color = cursor->image.bg_color;
- image.fg_color = cursor->image.fg_color;
- image.dx = cursor->image.dx;
- image.dy = cursor->image.dy;
- image.width = cursor->image.width;
- image.height = cursor->image.height;
- image.depth = cursor->image.depth;
- image.data = data;
-
- if (info->fbops->fb_imageblit)
- info->fbops->fb_imageblit(info, &image);
+ move_buf_aligned(info, dst, src, d_pitch, s_pitch,
+ cursor->image.height);
+ } else {
+ move_buf_aligned(info, dst, cursor->dest, d_pitch, s_pitch,
+ cursor->image.height);
+ }
+ image = cursor->image;
+ image.data = dst;
+ info->fbops->fb_imageblit(info, &image);
atomic_dec(&info->pixmap.count);
- smp_mb__after_atomic_dec();
+ smp_mb__after_atomic_dec();
+
return 0;
}
EXPORT_SYMBOL(soft_cursor);
-
+
MODULE_AUTHOR("James Simmons <jsimmons@users.sf.net>");
MODULE_DESCRIPTION("Generic software cursor");
MODULE_LICENSE("GPL");
diff -Naur linux-2.5.66-orig/include/linux/fb.h linux-2.5.66/include/linux/fb.h
--- linux-2.5.66-orig/include/linux/fb.h 2003-03-27 03:06:10.000000000 +0000
+++ linux-2.5.66/include/linux/fb.h 2003-03-27 03:09:09.000000000 +0000
@@ -312,8 +312,8 @@
#define FB_CUR_SETSHAPE 0x10
#define FB_CUR_SETSIZE 0x20
#define FB_CUR_SETDEST 0x40
+#define FB_CUR_SETFLASH 0x80
#define FB_CUR_SETALL 0xFF
-
struct fbcurpos {
__u16 x, y;
};
@@ -342,8 +342,7 @@
__u32 flags; /* see FB_PIXMAP_* */
void (*outbuf)(u8 dst, u8 *addr); /* access methods */
u8 (*inbuf) (u8 *addr);
- unsigned long lock_flags; /* flags for locking */
- spinlock_t lock; /* spinlock */
+ spinlock_t lock;
atomic_t count;
};
#ifdef __KERNEL__
@@ -406,15 +405,15 @@
struct fb_var_screeninfo var; /* Current var */
struct fb_fix_screeninfo fix; /* Current fix */
struct fb_monspecs monspecs; /* Current Monitor specs */
- struct fb_cursor cursor; /* Current cursor */
- struct work_struct queue; /* Framebuffer event queue */
- struct fb_pixmap pixmap; /* Current pixmap */
struct fb_cmap cmap; /* Current cmap */
+ struct work_struct queue; /* Framebuffer event queue */
+ struct fb_pixmap pixmap; /* Current pixmap */
struct fb_ops *fbops;
char *screen_base; /* Virtual address */
struct vc_data *display_fg; /* Console visible on this display */
int currcon; /* Current VC. */
void *pseudo_palette; /* Fake palette of 16 colors */
+ void *fbcon_priv; /* console-related private structure */
/* From here on everything is device dependent */
void *par;
};
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 0:18 Much better framebuffer fixes James Simmons
2003-03-27 3:29 ` [Linux-fbdev-devel] " Antonino Daplas
@ 2003-03-27 9:18 ` Geert Uytterhoeven
2003-03-27 19:15 ` Antonino Daplas
2003-03-27 9:58 ` Helge Hafting
2 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2003-03-27 9:18 UTC (permalink / raw)
To: James Simmons; +Cc: Linux Kernel Mailing List, Linux Fbdev development list
On Thu, 27 Mar 2003, James Simmons wrote:
> drivers/video/logo/logo.c | 69 +++++------
Are you sure the change from logo type to logo depth in (fb_)find_logo() won't
have any side effects? After this change, you may receive a different type of
logo than you requested.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 3:29 ` [Linux-fbdev-devel] " Antonino Daplas
@ 2003-03-27 9:33 ` Helge Hafting
2003-03-27 17:16 ` Thomas Schlichter
0 siblings, 1 reply; 9+ messages in thread
From: Helge Hafting @ 2003-03-27 9:33 UTC (permalink / raw)
To: Antonino Daplas
Cc: James Simmons, Linux Kernel Mailing List,
Linux Fbdev development list
Antonino Daplas wrote:
> On Thu, 2003-03-27 at 08:18, James Simmons wrote:
>
>>Okay. Here are more framebuffer fixes. Please try these fixes and let me
>>know how they work out for you.
>>
>
>
> This is a resend of the patch I previously sent. I see that you have
> made changes to the logo drawing code targeted for monochrome logo
> drawing to use mono expansion. You still need a few changes though,
> image->bg_color and image->fg_color must be initialized correctly when
> image->depth == 1.
This applied on top of James Simmons' patch, but didn't compile.
spin_lock_irqsave was "unknown".
Helge Hafting
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 0:18 Much better framebuffer fixes James Simmons
2003-03-27 3:29 ` [Linux-fbdev-devel] " Antonino Daplas
2003-03-27 9:18 ` Geert Uytterhoeven
@ 2003-03-27 9:58 ` Helge Hafting
2003-03-27 15:58 ` Thomas Molina
2 siblings, 1 reply; 9+ messages in thread
From: Helge Hafting @ 2003-03-27 9:58 UTC (permalink / raw)
To: James Simmons; +Cc: Linux Kernel Mailing List, Linux Fbdev development list
James Simmons wrote:
> Okay. Here are more framebuffer fixes. Please try these fixes and let me
> know how they work out for you.
>
The cursor line on radeonfb now is solid, instead of the broken line
in 2.5.66. It is still impossible to set the resolution.
The lilo approach:
append="video=radeonfb:1280x1024-24@60"
This seems to do nothing. I get the same low resolution as
plain 2.5.66, which looks bad as it don't match the flat screen resolution.
The stty approach:
stty rows 64 cols 160 gives me an odd error message about
stdin being wrong. Forcing it with -F /dev/tty
gives me lots of random colored text on the screen and the
scrolling is wrong afterwards. Resolution don't change though.
I run devfs if that matters.
stty rows 25 cols 80 brought things back to normal, or so it seemed.
I switched back to X and noticed that most programs except ls
wouldn't run, they all segfaulted. Something was wrong, and
a shutdown ended in a BUG in slab.c line 1557 and a hang.
A new thing with this patch is that I get a lot of junk displayed
to the side of the boot penguin. (Random colored letters).
The junk disappear after a little while though.
Helge Hafting
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 9:58 ` Helge Hafting
@ 2003-03-27 15:58 ` Thomas Molina
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Molina @ 2003-03-27 15:58 UTC (permalink / raw)
To: Helge Hafting
Cc: James Simmons, Linux Kernel Mailing List,
Linux Fbdev development list
On Thu, 27 Mar 2003, Helge Hafting wrote:
> James Simmons wrote:
> > Okay. Here are more framebuffer fixes. Please try these fixes and let me
> > know how they work out for you.
> >
>
> The cursor line on radeonfb now is solid, instead of the broken line
> in 2.5.66. It is still impossible to set the resolution.
>
> The lilo approach:
> append="video=radeonfb:1280x1024-24@60"
> This seems to do nothing. I get the same low resolution as
> plain 2.5.66, which looks bad as it don't match the flat screen resolution.
The framebuffer behaviour is back to "normal". I'm not having the
resolution problems, but I'm not using the same parameters. My append
line simply says vga=792.
Any idea of what will go to Linus and when it might make it into mainline?
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 9:33 ` Helge Hafting
@ 2003-03-27 17:16 ` Thomas Schlichter
2003-03-27 19:15 ` Antonino Daplas
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Schlichter @ 2003-03-27 17:16 UTC (permalink / raw)
To: Helge Hafting, Antonino Daplas
Cc: James Simmons, Linux Kernel Mailing List,
Linux Fbdev development list
[-- Attachment #1.1: body text --]
[-- Type: text/plain, Size: 1062 bytes --]
Helge Hafting wrote:
> Antonino Daplas wrote:
> > On Thu, 2003-03-27 at 08:18, James Simmons wrote:
> >
> >>Okay. Here are more framebuffer fixes. Please try these fixes and let me
> >>know how they work out for you.
> >>
> >
> >
> > This is a resend of the patch I previously sent. I see that you have
> > made changes to the logo drawing code targeted for monochrome logo
> > drawing to use mono expansion. You still need a few changes though,
> > image->bg_color and image->fg_color must be initialized correctly when
> > image->depth == 1.
>
> This applied on top of James Simmons' patch, but didn't compile.
> spin_lock_irqsave was "unknown".
I had that problem, too, so I changed some code to make it compile, remove
some warnings and even fix a possible memory leak... A patch is attached and
applies after applying the patches fom James Simmons and Antonino Daplas.
With these changes my framebuffer works correctly again, I don't even have any
problem with a misshaped cursor anymore...
Regards
Thomas Schlichter
[-- Attachment #1.2: fbcon.diff --]
[-- Type: text/x-diff, Size: 2093 bytes --]
diff -ur linux-2.5.66/drivers/video/console/fbcon.c linux-2.5.66-bk2/drivers/video/console/fbcon.c
--- linux-2.5.66/drivers/video/console/fbcon.c Thu Mar 27 17:56:12 2003
+++ linux-2.5.66-bk2/drivers/video/console/fbcon.c Thu Mar 27 16:06:04 2003
@@ -216,12 +216,14 @@
}
}
+#if defined(CONFIG_ATARI) || defined(CONFIG_MAC) || ( defined(__arm__) && defined(IRQ_VSYNCPULSE) )
static void fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp)
{
struct fb_info *info = dev_id;
schedule_work(&info->queue);
}
+#endif
static void cursor_timer_handler(unsigned long dev_addr);
@@ -586,7 +588,7 @@
font = get_default_font(info->var.xres, info->var.yres);
- vc = (struct vc_data *) kmalloc(sizeof(struct vc_data), GFP_ATOMIC);
+ vc = (struct vc_data *) kmalloc(sizeof(struct vc_data), GFP_KERNEL);
if (!vc) {
if (softback_buf)
@@ -597,6 +599,8 @@
/* Allocate private data */
info->fbcon_priv = kmalloc(sizeof(struct fbcon_private), GFP_KERNEL);
if (info->fbcon_priv == NULL) {
+ if (softback_buf)
+ kfree((void *) softback_buf);
kfree(vc);
return NULL;
}
diff -ur linux-2.5.66/drivers/video/fbmem.c linux-2.5.66-bk2/drivers/video/fbmem.c
--- linux-2.5.66/drivers/video/fbmem.c Thu Mar 27 17:56:12 2003
+++ linux-2.5.66-bk2/drivers/video/fbmem.c Thu Mar 27 14:40:04 2003
@@ -471,7 +471,7 @@
atomic_inc(&info->pixmap.count);
smp_mb__after_atomic_inc();
- spin_unlock_irqrestore(&info->pixmap.lock);
+ spin_unlock(&info->pixmap.lock);
return offset;
}
@@ -566,9 +566,8 @@
const struct linux_logo *logo, u8 *dst,
int depth)
{
- int i, j, shift;
+ int i, j;
const u8 *src = logo->data;
- u8 d, xor = 0;
switch (depth) {
case 4:
@@ -649,7 +648,7 @@
/* What depth we asked for might be different from what we get */
if (fb_logo.logo->type == LINUX_LOGO_CLUT224)
fb_logo.depth = 8;
- else if (fb_logo.logo->type = LINUX_LOGO_VGA16)
+ else if (fb_logo.logo->type == LINUX_LOGO_VGA16)
fb_logo.depth = 4;
else
fb_logo.depth = 1;
[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 9:18 ` Geert Uytterhoeven
@ 2003-03-27 19:15 ` Antonino Daplas
0 siblings, 0 replies; 9+ messages in thread
From: Antonino Daplas @ 2003-03-27 19:15 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: James Simmons, Linux Kernel Mailing List,
Linux Fbdev development list
On Thu, 2003-03-27 at 17:18, Geert Uytterhoeven wrote:
> On Thu, 27 Mar 2003, James Simmons wrote:
> > drivers/video/logo/logo.c | 69 +++++------
>
> Are you sure the change from logo type to logo depth in (fb_)find_logo() won't
> have any side effects? After this change, you may receive a different type of
> logo than you requested.
>
I agree. Take the case of Directcolor. At 16-bpp, it needs
linux_logo_vga16, not linux_logo_clut224. Also, monochrome at 8bpp needs
linux_logo_mono, certainly not linux_logo_clut224. There are obviously
other similar cases.
I think the original logo code in both logo.c and fbmem.c, though a bit
more confusing, provides better ways of choosing the correct logo.
Tony
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Much better framebuffer fixes.
2003-03-27 17:16 ` Thomas Schlichter
@ 2003-03-27 19:15 ` Antonino Daplas
0 siblings, 0 replies; 9+ messages in thread
From: Antonino Daplas @ 2003-03-27 19:15 UTC (permalink / raw)
To: Thomas Schlichter
Cc: Helge Hafting, James Simmons, Linux Kernel Mailing List,
Linux Fbdev development list
On Fri, 2003-03-28 at 01:16, Thomas Schlichter wrote:
> I had that problem, too, so I changed some code to make it compile, remove
> some warnings and even fix a possible memory leak... A patch is attached and
> applies after applying the patches fom James Simmons and Antonino Daplas.
Thanks :-)
Tony
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-03-27 19:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-27 0:18 Much better framebuffer fixes James Simmons
2003-03-27 3:29 ` [Linux-fbdev-devel] " Antonino Daplas
2003-03-27 9:33 ` Helge Hafting
2003-03-27 17:16 ` Thomas Schlichter
2003-03-27 19:15 ` Antonino Daplas
2003-03-27 9:18 ` Geert Uytterhoeven
2003-03-27 19:15 ` Antonino Daplas
2003-03-27 9:58 ` Helge Hafting
2003-03-27 15:58 ` Thomas Molina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).