From: Antonino Daplas <adaplas@pol.net>
To: Linux Fbdev development list <linux-fbdev-devel@lists.sourceforge.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [TRIVIAL PATCH] FBDEV: Small impact patch for fbdev
Date: 11 Dec 2002 03:18:05 +0500 [thread overview]
Message-ID: <1039558622.1054.32.camel@localhost.localdomain> (raw)
Hi,
Here's a diff to correct several small things that escaped through the
cracks.
1. The YNOMOVE scrollmode for non-accelerated drivers is just very slow
because of a lot of block moves (leads to slow and jerky scrolling in
vesafb with ypanning enabled). Depending on var->accel_flags, set the
scrollmode to either YREDRAW or YNOMOVE. For drivers with hardware
acceleration, set var->accel_flags to nonzero for max speed.
2. fb_pan_display() always returns an error. User apps will complain.
3. case FBIO_GETCMAP in fb_ioctl does not return immediately. User
apps will complain.
4. vgastate.c is not saving the correct blocks.
5. logo drawing for monochrome displays is just incorrect.(alterations
were done by eyeballing only, no hardware for testing).
The above will only have a very small effect on the general state of
fbdev/fbcon. Patch is against 2.5.51.
Tony
diff -Naur linux-2.5.51/drivers/video/console/fbcon.c linux/drivers/video/console/fbcon.c
--- linux-2.5.51/drivers/video/console/fbcon.c 2002-12-10 21:55:41.000000000 +0000
+++ linux/drivers/video/console/fbcon.c 2002-12-10 21:44:46.000000000 +0000
@@ -291,7 +291,10 @@
struct display *display = fb_display + con;
display->can_soft_blank = info->fbops->fb_blank ? 1 : 0;
- display->scrollmode = SCROLL_YNOMOVE;
+ if (info->var.accel_flags)
+ display->scrollmode = SCROLL_YNOMOVE;
+ else
+ display->scrollmode = SCROLL_YREDRAW;
fbcon_changevar(con);
return;
}
@@ -2633,7 +2636,7 @@
default:
for (i = 0; i < (LOGO_W * LOGO_H)/8; i++)
for (j = 0; j < 8; j++)
- logo[i*2] = (linux_logo_bw[i] & (7 - j)) ?
+ logo[i*8+j] = (linux_logo_bw[i] & (7 - j)) ?
((needs_logo == 1) ? 1 : 0) :
((needs_logo == 1) ? 0 : 1);
diff -Naur linux-2.5.51/drivers/video/fbmem.c linux/drivers/video/fbmem.c
--- linux-2.5.51/drivers/video/fbmem.c 2002-12-10 21:55:15.000000000 +0000
+++ linux/drivers/video/fbmem.c 2002-12-10 21:47:22.000000000 +0000
@@ -471,11 +471,9 @@
yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL;
if (info->fbops->fb_pan_display) {
- if ((err = info->fbops->fb_pan_display(var, info)))
- return err;
- else
- return -EINVAL;
- }
+ err = info->fbops->fb_pan_display(var, info);
+ if (err) return err;
+ }
info->var.xoffset = var->xoffset;
info->var.yoffset = var->yoffset;
if (var->vmode & FB_VMODE_YWRAP)
@@ -571,6 +569,7 @@
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT;
fb_copy_cmap(&info->cmap, &cmap, 0);
+ return 0;
case FBIOPAN_DISPLAY:
if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT;
diff -Naur linux-2.5.51/drivers/video/vgastate.c linux/drivers/video/vgastate.c
--- linux-2.5.51/drivers/video/vgastate.c 2002-12-10 21:55:20.000000000 +0000
+++ linux/drivers/video/vgastate.c 2002-12-10 21:52:31.000000000 +0000
@@ -111,7 +111,7 @@
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
for (i = 0; i < 8192; i++)
- saved->vga_text[i] = vga_r(fbbase + 2 * 8192, i);
+ saved->vga_text[8192+i] = vga_r(fbbase, i);
}
/* restore regs */
@@ -184,7 +184,7 @@
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
- for (i = 0; i < 4 * 8192; i++)
+ for (i = 0; i < state->memsize; i++)
vga_w(fbbase, i, saved->vga_font1[i]);
}
@@ -204,8 +204,7 @@
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
for (i = 0; i < 8192; i++)
- vga_w(fbbase + 2 * 8192, i,
- saved->vga_text[i]);
+ vga_w(fbbase, i, saved->vga_text[8192+i]);
}
/* unblank screen */
next reply other threads:[~2002-12-10 22:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-10 22:18 Antonino Daplas [this message]
2002-12-11 5:59 ` [TRIVIAL PATCH] FBDEV: Small impact patch for fbdev James Simmons
2002-12-11 10:45 ` Antonino Daplas
-- strict thread matches above, loose matches on Subject: below --
2002-12-11 12:20 Petr Vandrovec
2002-12-11 14:36 ` James Simmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1039558622.1054.32.camel@localhost.localdomain \
--to=adaplas@pol.net \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).