linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Framebuffer Console
@ 2003-07-28 20:10 Sven Schnelle
  2003-07-29  7:19 ` Gábor Lénárt
  2003-07-29 17:46 ` James Simmons
  0 siblings, 2 replies; 3+ messages in thread
From: Sven Schnelle @ 2003-07-28 20:10 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]

Hi,

while testing linux-2.6.0-test2 I have some strange framebuffer(rivafb,
but maybe this appears on other card's too)
behaviour:

1) Screen is not restored after switching from X11 back to textmode
2) Cursor shows wrong characters


This patch solve the problems for me:

-------------------------------------8<--------------------------------
diff -ur linux-2.6.0-test2/drivers/video/console/fbcon.c linux-2.6.0-test2-sv/drivers/video/console/fbcon.c
--- linux-2.6.0-test2/drivers/video/console/fbcon.c	2003-07-27 19:05:15.000000000 +0200
+++ linux-2.6.0-test2-sv/drivers/video/console/fbcon.c	2003-07-28 10:40:38.000000000 +0200
@@ -1056,7 +1056,7 @@
 			cursor.set |= FB_CUR_SETHOT;
 		}
 
-		if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
+		if ((cursor.set & FB_CUR_SETSIZE) || (cursor.set & FB_CUR_SETCUR) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
 			char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
 			int cur_height, size, i = 0;
 
@@ -1704,8 +1704,13 @@
 	if (blank < 0)		/* Entering graphics mode */
 		return 0;
 
+	/* FIXME: Dirty Hack */
+	info->cursor.image.height = 0;	/* Need to set cursor size */
+	info->cursor.image.width = 0;
 	fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
 
+	fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols);
+	update_screen(vc->vc_num);
 	if (!info->fbops->fb_blank) {
 		if (blank) {
 			unsigned short oldc;
-----------------------------------8<--------------------------------------

don't know if this is the right way, but it works...

Regards,
-- 
Sven Schnelle, <schnelle@kabelleipzig.de>
-----------------------------------------

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Framebuffer Console
  2003-07-28 20:10 Framebuffer Console Sven Schnelle
@ 2003-07-29  7:19 ` Gábor Lénárt
  2003-07-29 17:46 ` James Simmons
  1 sibling, 0 replies; 3+ messages in thread
From: Gábor Lénárt @ 2003-07-29  7:19 UTC (permalink / raw)
  To: Sven Schnelle; +Cc: linux-kernel

Though I did not check this patch below, with 2.6.0-test1 kernel MGA
framebuffer console is totally unusable. Eg scrolling and major screen
update tasks corrupt the screen heavily with vertical lines everywhere
and other even "funnier" effects occured. With plain text consol there is
no problem however I NEED framebuffer console (eg playing video on the
console without X). It as a Matrox G400 card.

On Mon, Jul 28, 2003 at 10:10:06PM +0200, Sven Schnelle wrote:
> Hi,
> 
> while testing linux-2.6.0-test2 I have some strange framebuffer(rivafb,
> but maybe this appears on other card's too)
> behaviour:
> 
> 1) Screen is not restored after switching from X11 back to textmode
> 2) Cursor shows wrong characters
> 
> 
> This patch solve the problems for me:
> 
> -------------------------------------8<--------------------------------
> diff -ur linux-2.6.0-test2/drivers/video/console/fbcon.c linux-2.6.0-test2-sv/drivers/video/console/fbcon.c
> --- linux-2.6.0-test2/drivers/video/console/fbcon.c	2003-07-27 19:05:15.000000000 +0200
> +++ linux-2.6.0-test2-sv/drivers/video/console/fbcon.c	2003-07-28 10:40:38.000000000 +0200
> @@ -1056,7 +1056,7 @@
>  			cursor.set |= FB_CUR_SETHOT;
>  		}
>  
> -		if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
> +		if ((cursor.set & FB_CUR_SETSIZE) || (cursor.set & FB_CUR_SETCUR) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
>  			char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
>  			int cur_height, size, i = 0;
>  
> @@ -1704,8 +1704,13 @@
>  	if (blank < 0)		/* Entering graphics mode */
>  		return 0;
>  
> +	/* FIXME: Dirty Hack */
> +	info->cursor.image.height = 0;	/* Need to set cursor size */
> +	info->cursor.image.width = 0;
>  	fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
>  
> +	fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols);
> +	update_screen(vc->vc_num);
>  	if (!info->fbops->fb_blank) {
>  		if (blank) {
>  			unsigned short oldc;
> -----------------------------------8<--------------------------------------
> 
> don't know if this is the right way, but it works...
> 
> Regards,
> -- 
> Sven Schnelle, <schnelle@kabelleipzig.de>
> -----------------------------------------



-- 
- Gábor (larta'H)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Framebuffer Console
  2003-07-28 20:10 Framebuffer Console Sven Schnelle
  2003-07-29  7:19 ` Gábor Lénárt
@ 2003-07-29 17:46 ` James Simmons
  1 sibling, 0 replies; 3+ messages in thread
From: James Simmons @ 2003-07-29 17:46 UTC (permalink / raw)
  To: Sven Schnelle; +Cc: linux-kernel


> while testing linux-2.6.0-test2 I have some strange framebuffer(rivafb,
> but maybe this appears on other card's too)
> behaviour:
> 
> 1) Screen is not restored after switching from X11 back to textmode

Try adding UseFBDev "true" to your XF86Config file. 

> 2) Cursor shows wrong characters

> This patch solve the problems for me:
> 
> -------------------------------------8<--------------------------------
> diff -ur linux-2.6.0-test2/drivers/video/console/fbcon.c linux-2.6.0-test2-sv/drivers/video/console/fbcon.c
> --- linux-2.6.0-test2/drivers/video/console/fbcon.c	2003-07-27 19:05:15.000000000 +0200
> +++ linux-2.6.0-test2-sv/drivers/video/console/fbcon.c	2003-07-28 10:40:38.000000000 +0200
> @@ -1056,7 +1056,7 @@
>  			cursor.set |= FB_CUR_SETHOT;
>  		}
>  
> -		if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
> +		if ((cursor.set & FB_CUR_SETSIZE) || (cursor.set & FB_CUR_SETCUR) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
>  			char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
>  			int cur_height, size, i = 0;

This is wrong. FB_CUR_SETCUR is used only by the userland cursor 
interface. We use it to turn the cursor on and off via userland this way.
Internal to the kernel we just toggle the enable flag.

> @@ -1704,8 +1704,13 @@
>  	if (blank < 0)		/* Entering graphics mode */
>  		return 0;
>  
> +	/* FIXME: Dirty Hack */
> +	info->cursor.image.height = 0;	/* Need to set cursor size */
> +	info->cursor.image.width = 0;
>  	fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
>  
> +	fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols);
> +	update_screen(vc->vc_num);
>  	if (!info->fbops->fb_blank) {
>  		if (blank) {
>  			unsigned short oldc;

This is a fluke that it helps. The cursor shows wrong characters because
the code logic is wrong. I'm working on the new code.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-29 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-28 20:10 Framebuffer Console Sven Schnelle
2003-07-29  7:19 ` Gábor Lénárt
2003-07-29 17:46 ` James Simmons

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).