linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fb: hide cursor in graphics mode
@ 2009-01-23 12:33 Risto Suominen
  2009-01-24  8:51 ` [Linux-fbdev-devel] " Geert Uytterhoeven
  0 siblings, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-01-23 12:33 UTC (permalink / raw)
  To: adaplas; +Cc: lkml, linux-fbdev-devel

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

Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
need the text mode cursor, it's a bit annoying to have it there sitting in a
corner. This patch disables the cursor even when in graphics mode.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- a/drivers/video/console/fbcon.c.org	2007-03-03 07:14:54.000000000 +0200
+++ b/drivers/video/console/fbcon.c	2009-01-23 12:42:14.000000000 +0200
@@ -1363,6 +1363,12 @@ static void fbcon_cursor(struct vc_data
 	int y;
  	int c = scr_readw((u16 *) vc->vc_pos);

+	if (mode == CM_ERASE && info->fbops->fb_cursor) {
+		/* Hide H/W-cursor unconditionally */
+		ops->cursor(vc, info, mode, 0, 0, 0);
+		return;
+	}
+
 	if (fbcon_is_inactive(vc, info))
 		return;

[-- Attachment #2: fbcon-graphics-nocursor.diff --]
[-- Type: text/x-diff, Size: 793 bytes --]

Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
need the text mode cursor, it's a bit annoying to have it there sitting in a
corner. This patch disables the cursor even when in graphics mode.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- a/drivers/video/console/fbcon.c.org	2007-03-03 07:14:54.000000000 +0200
+++ b/drivers/video/console/fbcon.c	2009-01-23 12:42:14.000000000 +0200
@@ -1363,6 +1363,12 @@ static void fbcon_cursor(struct vc_data 
 	int y;
  	int c = scr_readw((u16 *) vc->vc_pos);
 
+	if (mode == CM_ERASE && info->fbops->fb_cursor) {
+		/* Hide H/W-cursor unconditionally */
+		ops->cursor(vc, info, mode, 0, 0, 0);
+		return;
+	}
+
 	if (fbcon_is_inactive(vc, info))
 		return;
 

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-01-23 12:33 [PATCH] fb: hide cursor in graphics mode Risto Suominen
@ 2009-01-24  8:51 ` Geert Uytterhoeven
  2009-01-24  9:09   ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Geert Uytterhoeven @ 2009-01-24  8:51 UTC (permalink / raw)
  To: Risto Suominen; +Cc: adaplas, linux-fbdev-devel, lkml

On Fri, 23 Jan 2009, Risto Suominen wrote:
> Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
> need the text mode cursor, it's a bit annoying to have it there sitting in a
> corner. This patch disables the cursor even when in graphics mode.
> 
> Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
> ---
> The testing is done on kernel version 2.6.18.

Which is well... quite old.

Does it also (still) happen with 2.6.28?

> --- a/drivers/video/console/fbcon.c.org	2007-03-03 07:14:54.000000000 +0200
> +++ b/drivers/video/console/fbcon.c	2009-01-23 12:42:14.000000000 +0200
> @@ -1363,6 +1363,12 @@ static void fbcon_cursor(struct vc_data
>  	int y;
>   	int c = scr_readw((u16 *) vc->vc_pos);
> 
> +	if (mode == CM_ERASE && info->fbops->fb_cursor) {
> +		/* Hide H/W-cursor unconditionally */
> +		ops->cursor(vc, info, mode, 0, 0, 0);
> +		return;
> +	}
> +
>  	if (fbcon_is_inactive(vc, info))
>  		return;

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

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-01-24  8:51 ` [Linux-fbdev-devel] " Geert Uytterhoeven
@ 2009-01-24  9:09   ` Risto Suominen
  2009-01-24 13:26     ` Geert Uytterhoeven
  0 siblings, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-01-24  9:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: adaplas, linux-fbdev-devel, lkml

2009/1/24 Geert Uytterhoeven <geert@linux-m68k.org>:
> On Fri, 23 Jan 2009, Risto Suominen wrote:
>> Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
>> need the text mode cursor, it's a bit annoying to have it there sitting in a
>> corner. This patch disables the cursor even when in graphics mode.
>>
>> Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
>> ---
>> The testing is done on kernel version 2.6.18.
>
> Which is well... quite old.
>
> Does it also (still) happen with 2.6.28?
>
Well, I don't really know, but I assume it will: fbcon_is_inactive()
still returns true if vc->vc_mode != KD_TEXT, and thus hinders
fbcon_cursor() from doing anything in graphics mode.

Risto

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-01-24  9:09   ` Risto Suominen
@ 2009-01-24 13:26     ` Geert Uytterhoeven
  2009-01-24 14:49       ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Geert Uytterhoeven @ 2009-01-24 13:26 UTC (permalink / raw)
  To: Risto Suominen; +Cc: adaplas, linux-fbdev-devel, lkml

On Sat, 24 Jan 2009, Risto Suominen wrote:
> 2009/1/24 Geert Uytterhoeven <geert@linux-m68k.org>:
> > On Fri, 23 Jan 2009, Risto Suominen wrote:
> >> Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
> >> need the text mode cursor, it's a bit annoying to have it there sitting in a
> >> corner. This patch disables the cursor even when in graphics mode.
> >>
> >> Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
> >> ---
> >> The testing is done on kernel version 2.6.18.
> >
> > Which is well... quite old.
> >
> > Does it also (still) happen with 2.6.28?
> >
> Well, I don't really know, but I assume it will: fbcon_is_inactive()
> still returns true if vc->vc_mode != KD_TEXT, and thus hinders
> fbcon_cursor() from doing anything in graphics mode.

FYI, I've just seen the other patch you posted before.
I'm also wondering what's really going wrong, as I haven't ever noticed this
problem during the last 10 years.

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

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-01-24 13:26     ` Geert Uytterhoeven
@ 2009-01-24 14:49       ` Risto Suominen
  2009-02-10 21:37         ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-01-24 14:49 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: adaplas, linux-fbdev-devel, lkml

2009/1/24 Geert Uytterhoeven <geert@linux-m68k.org>:
>
> FYI, I've just seen the other patch you posted before.
> I'm also wondering what's really going wrong, as I haven't ever noticed this
> problem during the last 10 years.
>
Looks like the problem is connected to using HW-cursor, and not so
many framebuffer drivers do that, I've seen this only on atyfb.

Risto

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-01-24 14:49       ` Risto Suominen
@ 2009-02-10 21:37         ` Risto Suominen
  2009-02-10 21:50           ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-02-10 21:37 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: adaplas, linux-fbdev-devel, lkml

Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
need the text mode cursor, it's a bit annoying to have it there sitting in a
corner. This patch disables the cursor even when in graphics mode.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18. This version should be
applyable on 2.6.28.4.

--- a/drivers/video/console/fbcon.c.org 2007-03-03 07:14:54.000000000 +0200
+++ b/drivers/video/console/fbcon.c     2009-01-23 12:42:14.000000000 +0200
@@ -1363,6 +1363,12 @@ static void fbcon_cursor(struct vc_data
        int y;
        int c = scr_readw((u16 *) vc->vc_pos);

+       if (mode == CM_ERASE && info->fbops->fb_cursor) {
+               /* Hide H/W-cursor unconditionally */
+               ops->cursor(vc, info, mode, 0, 0, 0);
+               return;
+       }
+
        if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
                return;

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-10 21:37         ` Risto Suominen
@ 2009-02-10 21:50           ` Risto Suominen
  2009-02-11 12:35             ` Risto Suominen
  2009-02-11 22:24             ` Andrew Morton
  0 siblings, 2 replies; 20+ messages in thread
From: Risto Suominen @ 2009-02-10 21:50 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: adaplas, linux-fbdev-devel, lkml

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

The same as attachment, so the last line won't disappear.

Risto

[-- Attachment #2: fbcon-graphics-nocursor.diff --]
[-- Type: application/octet-stream, Size: 814 bytes --]

Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
need the text mode cursor, it's a bit annoying to have it there sitting in a
corner. This patch disables the cursor even when in graphics mode.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- a/drivers/video/console/fbcon.c.org	2007-03-03 07:14:54.000000000 +0200
+++ b/drivers/video/console/fbcon.c	2009-01-23 12:42:14.000000000 +0200
@@ -1363,6 +1363,12 @@ static void fbcon_cursor(struct vc_data 
 	int y;
  	int c = scr_readw((u16 *) vc->vc_pos);
 
+	if (mode == CM_ERASE && info->fbops->fb_cursor) {
+		/* Hide H/W-cursor unconditionally */
+		ops->cursor(vc, info, mode, 0, 0, 0);
+		return;
+	}
+
 	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
 		return;
 

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-10 21:50           ` Risto Suominen
@ 2009-02-11 12:35             ` Risto Suominen
  2009-02-11 22:24             ` Andrew Morton
  1 sibling, 0 replies; 20+ messages in thread
From: Risto Suominen @ 2009-02-11 12:35 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: adaplas, linux-fbdev-devel, lkml

I can now confirm that the problem exists in 2.6.24, and the same
patch corrects it.

Risto

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-10 21:50           ` Risto Suominen
  2009-02-11 12:35             ` Risto Suominen
@ 2009-02-11 22:24             ` Andrew Morton
  2009-02-12 21:12               ` Risto Suominen
  2009-03-17 21:02               ` [PATCH] fb: hide hardware cursor in graphics mode (Mach64) Krzysztof Helt
  1 sibling, 2 replies; 20+ messages in thread
From: Andrew Morton @ 2009-02-11 22:24 UTC (permalink / raw)
  To: Risto Suominen; +Cc: geert, adaplas, linux-fbdev-devel, linux-kernel

On Tue, 10 Feb 2009 23:50:08 +0200
Risto Suominen <risto.suominen@gmail.com> wrote:

> The same as attachment, so the last line won't disappear.
> 
> Risto
> 
> 
> [fbcon-graphics-nocursor.diff  application/octet-stream (814B)]

help.  My knowledge of fbcon is near zero.

> Xserver Xfbdev (kdrive) uses linux framebuffer in graphics mode. It doesn't
> need the text mode cursor, it's a bit annoying to have it there sitting in a
> corner. This patch disables the cursor even when in graphics mode.
> 
> Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
> ---
> The testing is done on kernel version 2.6.18.

That's a truly ancient kernel.  Is the patch needed on current kernels?
Does it work correctly in current kernels?

> --- a/drivers/video/console/fbcon.c.org	2007-03-03 07:14:54.000000000 +0200
> +++ b/drivers/video/console/fbcon.c	2009-01-23 12:42:14.000000000 +0200
> @@ -1363,6 +1363,12 @@ static void fbcon_cursor(struct vc_data 
>  	int y;
>   	int c = scr_readw((u16 *) vc->vc_pos);
>  
> +	if (mode == CM_ERASE && info->fbops->fb_cursor) {
> +		/* Hide H/W-cursor unconditionally */
> +		ops->cursor(vc, info, mode, 0, 0, 0);
> +		return;
> +	}
> +
>  	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
>  		return;
>  

How does the cursor get re-enabled?

Should we be calling ops->cursor() if fbcon_is_inactive() is true?

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-11 22:24             ` Andrew Morton
@ 2009-02-12 21:12               ` Risto Suominen
  2009-02-13 20:06                 ` Krzysztof Helt
  2009-03-17 21:02               ` [PATCH] fb: hide hardware cursor in graphics mode (Mach64) Krzysztof Helt
  1 sibling, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-02-12 21:12 UTC (permalink / raw)
  To: Andrew Morton
  Cc: geert, adaplas, linux-fbdev-devel, linux-kernel, Krzysztof Helt

2009/2/12 Andrew Morton <akpm@linux-foundation.org>:
>> ---
>> The testing is done on kernel version 2.6.18.
>
> That's a truly ancient kernel.  Is the patch needed on current kernels?
> Does it work correctly in current kernels?
>
It does not on 2.6.24. The patch works.

> How does the cursor get re-enabled?
>
I have not thought of that.

> Should we be calling ops->cursor() if fbcon_is_inactive() is true?
>
Maybe we shouldn't, but we must. The situation is that we are ordered
to enter graphics mode and the variable saying 'graphics' is already
set in vt_ioctl.c. fbcon_is_inactive() tests it and returns true.

The question is, whether this function is called later during normal
operation, and how often?

Risto

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-12 21:12               ` Risto Suominen
@ 2009-02-13 20:06                 ` Krzysztof Helt
  2009-02-22  7:15                   ` Krzysztof Helt
  0 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Helt @ 2009-02-13 20:06 UTC (permalink / raw)
  To: Risto Suominen
  Cc: Andrew Morton, geert, adaplas, linux-fbdev-devel, linux-kernel

On Thu, 12 Feb 2009 23:12:26 +0200
Risto Suominen <risto.suominen@gmail.com> wrote:

> 2009/2/12 Andrew Morton <akpm@linux-foundation.org>:
> >> ---
> >> The testing is done on kernel version 2.6.18.
> >
> > That's a truly ancient kernel.  Is the patch needed on current kernels?
> > Does it work correctly in current kernels?
> >
> It does not on 2.6.24. The patch works.
> 

I have tested two cards with the hardware cursor: 
Permedia 2 (pm2fb) and Voodoo-3 (tdfxfb).

Both cards use the hardware cursor and both does
not produce the bug you have described.
I have used the Xorg version 7.2 included in the
Slackware 12 and a current git version of the kernel
(updated two days ago).

I do not have the ATI Mach64 card to test it.
I will test my cards with the kernel 2.6.24.

Either, this bug is related only to the atyfb driver
or it was solved in the current kernel.
I looked into the atyfb driver code and I did not
 see anything suspicious there.

Kind regards,
Krzysztof


----------------------------------------------------------------------
Wyslij kartke walentynkowa
Kliknij >>> http://link.interia.pl/f205f


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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-13 20:06                 ` Krzysztof Helt
@ 2009-02-22  7:15                   ` Krzysztof Helt
  2009-02-22  9:25                     ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Helt @ 2009-02-22  7:15 UTC (permalink / raw)
  To: Krzysztof Helt
  Cc: Risto Suominen, adaplas, Andrew Morton, geert, linux-fbdev-devel,
	linux-kernel

On Fri, 13 Feb 2009 21:06:35 +0100
Krzysztof Helt <krzysztof.h1@poczta.fm> wrote:

> On Thu, 12 Feb 2009 23:12:26 +0200
> Risto Suominen <risto.suominen@gmail.com> wrote:
> 
> > 2009/2/12 Andrew Morton <akpm@linux-foundation.org>:
> > >> ---
> > >> The testing is done on kernel version 2.6.18.
> > >
> > > That's a truly ancient kernel.  Is the patch needed on current kernels?
> > > Does it work correctly in current kernels?
> > >
> > It does not on 2.6.24. The patch works.
> > 
> 
> I have tested two cards with the hardware cursor: 
> Permedia 2 (pm2fb) and Voodoo-3 (tdfxfb).
> 
> Both cards use the hardware cursor and both does
> not produce the bug you have described.
> I have used the Xorg version 7.2 included in the
> Slackware 12 and a current git version of the kernel
> (updated two days ago).
> 
> I do not have the ATI Mach64 card to test it.
> I will test my cards with the kernel 2.6.24.
> 
> Either, this bug is related only to the atyfb driver
> or it was solved in the current kernel.
> I looked into the atyfb driver code and I did not
>  see anything suspicious there.
> 

I have done more testing.

The pm2fb and tdfxfb work ok with Xorg 7.2 (xserver 1.3.0)
and kernel 2.6.24 (the same cards as above used).

I have build Xfbdev (kdrive) server for the same version of
Xorg (xserver 1.3.0). The Xfbdev works ok (no cursor left)
with both the pm2fb and tdfxfb.

I start wondering what is your version of Xfbdev and how
did you build it. I have build the Xfbdev with the following 
options:

./configure --enable-kdrive \
--disable-xvmc --disable-glx \
--disable-dri --disable-xinerama \
--enable-static --disable-xnest \
--disable-xvfb --disable-dmx \
--disable-xprint --disable-xsdl \
--disable-xorgcfg --disable-xorg

Either, my Xfbdev version is too new to reproduce the bug
(and then the problem is the Xfbdev regression) or the 
problem shows only with special build option.

Could you provide me with information how to build the
Xfbdev to reproduce the problem?
What is your platform (maybe it is not x86) and kernel
configuration?

Kind regards,
Krzysztof


----------------------------------------------------------------------
Zostan mistrzem parkowania w Bombaju!
Zagraj >> http://link.interia.pl/f204e 


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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-22  7:15                   ` Krzysztof Helt
@ 2009-02-22  9:25                     ` Risto Suominen
  2009-02-22 11:20                       ` Krzysztof Helt
       [not found]                       ` <20090222164052.dd5442c4.krzysztof.h1@poczta.fm>
  0 siblings, 2 replies; 20+ messages in thread
From: Risto Suominen @ 2009-02-22  9:25 UTC (permalink / raw)
  To: Krzysztof Helt
  Cc: adaplas, Andrew Morton, geert, linux-fbdev-devel, linux-kernel

Krzysztof, thank you for your efforts.

I've been using PowerMac platform with built-in ATI mach64 and Xorg
server 1.1.1. Kernel options related to frame buffers include:

CONFIG_FB=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_MACMODES=y
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

CONFIG_FB_ATY=y
CONFIG_FB_ATY_CT=y
CONFIG_FB_ATY_GENERIC_LCD=y
CONFIG_FB_ATY_GX=y
CONFIG_FB_ATY_BACKLIGHT=y

CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y

Xfbdev options include:

--disable-static \
--enable-xorg \
--enable-xtrap \
--enable-dmx \
--enable-vfb \
--enable-kdrive \
--enable-xephyr \
--disable-xsdl \
--disable-xfake \
--enable-xfbdev \
--disable-kdrive-vesa \
--disable-lbx \
--disable-xprint \
--disable-xorgconfig \
--disable-xorgcfg \
--disable-misc-utils

In my opinion, Xfbdev assumes that the cursor will disappear when
turning on graphics mode with ioctl(LinuxConsoleFd, KDSETMODE,
KD_GRAPHICS). It's obvious that fbcon is not doing anything to switch
the cursor off when it receives this ioctl, fbcon_is_inactive()
prevents it. The problem comes from that something has made it appear,
i.e. text mode frame buffer console. I have text consoles on VTs 1 to
6 and X on 7.

One maybe unusual property of atyfb is that the frame buffer is higher
than the screen. To make Xfbdev work correctly I needed the patch
below.

Risto

If virtual resolution is higher than the screen (as in atyfb), and yoffset
given by the framebuffer driver happens to be non-zero (fbcon changes it on-
the-fly), Xfbdev places its image starting above the displayed part of the
framebuffer. This patch makes sure that the whole picture is visible.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on version 1.1.1 and linux kernel version 2.6.18.

--- a/hw/kdrive/fbdev/fbdev.c.org       2006-07-05 21:31:39.000000000 +0300
+++ b/hw/kdrive/fbdev/fbdev.c   2009-01-18 15:42:06.000000000 +0200
@@ -215,6 +215,8 @@ fbdevScreenInitialize (KdScreenInfo *scr

     /* Now get the new screeninfo */
     ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
+    /* We can get anything into yoffset if fbcon is active */
+    priv->var.yoffset = 0;
     depth = priv->var.bits_per_pixel;
     gray = priv->var.grayscale;

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-22  9:25                     ` Risto Suominen
@ 2009-02-22 11:20                       ` Krzysztof Helt
       [not found]                       ` <20090222164052.dd5442c4.krzysztof.h1@poczta.fm>
  1 sibling, 0 replies; 20+ messages in thread
From: Krzysztof Helt @ 2009-02-22 11:20 UTC (permalink / raw)
  To: Risto Suominen
  Cc: adaplas, Andrew Morton, geert, linux-fbdev-devel, linux-kernel

On Sun, 22 Feb 2009 11:25:04 +0200
Risto Suominen <risto.suominen@gmail.com> wrote:

> Krzysztof, thank you for your efforts.
> 
> I've been using PowerMac platform with built-in ATI mach64 and Xorg
> server 1.1.1. 

I will try to reproduce the problem with Xorg 1.1.1 and your options.
I do not have the PowerMac and the ATI mach64 card.

> 
> In my opinion, Xfbdev assumes that the cursor will disappear when
> turning on graphics mode with ioctl(LinuxConsoleFd, KDSETMODE,
> KD_GRAPHICS). It's obvious that fbcon is not doing anything to switch
> the cursor off when it receives this ioctl, fbcon_is_inactive()
> prevents it. The problem comes from that something has made it appear,
> i.e. text mode frame buffer console. I have text consoles on VTs 1 to
> 6 and X on 7.
> 


> One maybe unusual property of atyfb is that the frame buffer is higher
> than the screen. To make Xfbdev work correctly I needed the patch
> below.
> 

The patch is not a correct fix. A simple workaround is to set a vyres = yres
and disable panning. I am able to reproduce this problem. A cause is
that Xfbdev prints some messages after it set up graphics mode, so
the screen got scrolled. I do not know what is an expected behaviour
(maybe with KD_GRAPHICS no messages should be printed).

Regards,
Krzysztof


----------------------------------------------------------------------
Zostan mistrzem parkowania w Bombaju!
Zagraj >> http://link.interia.pl/f204e 


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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
       [not found]                       ` <20090222164052.dd5442c4.krzysztof.h1@poczta.fm>
@ 2009-02-23  6:53                         ` Risto Suominen
  2009-02-28 18:51                           ` Krzysztof Helt
  0 siblings, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-02-23  6:53 UTC (permalink / raw)
  To: Krzysztof Helt
  Cc: adaplas, Andrew Morton, geert, linux-fbdev-devel, linux-kernel

Krzysztof, my patch is basically the same as yours. I already tried
to send it to Xorg mailing list, but did not receive any feedback.

Risto

If virtual resolution is higher than the screen (as in atyfb), and yoffset
given by the framebuffer driver happens to be non-zero (fbcon changes it on-
the-fly), Xfbdev places its image starting above the displayed part of the
framebuffer. This patch makes sure that the whole picture is visible.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on version 1.1.1 and linux kernel version 2.6.18.

--- a/hw/kdrive/fbdev/fbdev.c.org       2006-07-05 21:31:39.000000000 +0300
+++ b/hw/kdrive/fbdev/fbdev.c   2009-01-18 15:42:06.000000000 +0200
@@ -215,6 +215,8 @@ fbdevScreenInitialize (KdScreenInfo *scr

     /* Now get the new screeninfo */
     ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
+    /* We can get anything into yoffset if fbcon is active */
+    priv->var.yoffset = 0;
     depth = priv->var.bits_per_pixel;
     gray = priv->var.grayscale;

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-23  6:53                         ` Risto Suominen
@ 2009-02-28 18:51                           ` Krzysztof Helt
  2009-03-01 11:50                             ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Helt @ 2009-02-28 18:51 UTC (permalink / raw)
  To: Risto Suominen
  Cc: adaplas, Andrew Morton, geert, linux-fbdev-devel, linux-kernel

Hi Risto,

I ahve checked xorg server 1.1.1 with kernel 2.6.24
 and I cannot reproduce your problem (hw cursor
left in Xfbdev) with two drivers using the hw cursor
(pm2fb and tdfxfb). Tests were done on x86 (amd 
k6-2+ cpu).

Regards,
Krzysztof

----------------------------------------------------------------------
Dzien Kobiet dniem wolnym od pracy? Wypowiedz sie i wygraj nagrode! 
Sprawdz >> http://link.interia.pl/f2076 


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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-02-28 18:51                           ` Krzysztof Helt
@ 2009-03-01 11:50                             ` Risto Suominen
  2009-03-12 15:19                               ` Risto Suominen
  0 siblings, 1 reply; 20+ messages in thread
From: Risto Suominen @ 2009-03-01 11:50 UTC (permalink / raw)
  To: Krzysztof Helt
  Cc: adaplas, Andrew Morton, geert, linux-fbdev-devel, linux-kernel

I can confirm that the problem exists on x86 (Pentium III) platform,
too, with atyfb (3D RAGE IIC (Mach64 GZ, AGP) [0x475a rev 0x3a]),
kernel 2.6.26, and Xfbdev 1.5.99.902.

An interesting difference:

# setterm -cursor off > /dev/tty7

works on x86, but the opposite:

# setterm -cursor on > /dev/tty7

does not work on Mac (with my patch, so the cursor is off).

The setups, in my tests, on x86 and Mac, are not analogous. On x86,
atyfb is as a module, on Mac, it's linked in. On x86, I used fbset to
select the mode, on Mac, kernel command line has the mode selection.
But all this hardly matters...

Risto

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

* Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode
  2009-03-01 11:50                             ` Risto Suominen
@ 2009-03-12 15:19                               ` Risto Suominen
  0 siblings, 0 replies; 20+ messages in thread
From: Risto Suominen @ 2009-03-12 15:19 UTC (permalink / raw)
  To: Krzysztof Helt
  Cc: adaplas, Andrew Morton, geert, linux-fbdev-devel, linux-kernel

Now I have changed the graphics card on my PC to 3dfx voodoo 3
(tdfxfb), and indeed it made a difference: no cursor. So it begins to
look like the problem only exists on atyfb.

Risto

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

* [PATCH] fb: hide hardware cursor in graphics mode (Mach64)
  2009-02-11 22:24             ` Andrew Morton
  2009-02-12 21:12               ` Risto Suominen
@ 2009-03-17 21:02               ` Krzysztof Helt
  2009-03-21 22:01                 ` Risto Suominen
  1 sibling, 1 reply; 20+ messages in thread
From: Krzysztof Helt @ 2009-03-17 21:02 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: Risto Suominen, geert, linux-kernel, Andrew Morton

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=US-ASCII, Size: 1320 bytes --]

From: Krzysztof Helt <krzysztof.h1@wp.pl>

A hardware cursor is left enabled in
the fb_set_par() which is called when
a new console is created. This is
inconsistent with software cursor's
behaviour.

Also, this makes a hardware cursor
always visible in the Xfbdev
(Xorg kdrive) server.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
CC: Risto Suominen 
---
Finally, I acquired a Mach64GZ card and was able to 
solve this puzzle.

Risto, please test the patch. 

 drivers/video/aty/mach64_accel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/video/aty/mach64_accel.c b/drivers/video/aty/mach64_accel.c
index a8f60c3..0cc9724 100644
--- a/drivers/video/aty/mach64_accel.c
+++ b/drivers/video/aty/mach64_accel.c
@@ -39,7 +39,8 @@ void aty_reset_engine(const struct atyfb_par *par)
 {
 	/* reset engine */
 	aty_st_le32(GEN_TEST_CNTL,
-		aty_ld_le32(GEN_TEST_CNTL, par) & ~GUI_ENGINE_ENABLE, par);
+		aty_ld_le32(GEN_TEST_CNTL, par) &
+		~(GUI_ENGINE_ENABLE | HWCURSOR_ENABLE), par);
 	/* enable engine */
 	aty_st_le32(GEN_TEST_CNTL,
 		aty_ld_le32(GEN_TEST_CNTL, par) | GUI_ENGINE_ENABLE, par);
-- 
1.5.2.2


----------------------------------------------------------------------
Szukasz pieniedzy? Wez podwójny limit zad³u¿enia w koncie direct.
>> http://link.interia.pl/f20a3


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

* Re: [PATCH] fb: hide hardware cursor in graphics mode (Mach64)
  2009-03-17 21:02               ` [PATCH] fb: hide hardware cursor in graphics mode (Mach64) Krzysztof Helt
@ 2009-03-21 22:01                 ` Risto Suominen
  0 siblings, 0 replies; 20+ messages in thread
From: Risto Suominen @ 2009-03-21 22:01 UTC (permalink / raw)
  To: Krzysztof Helt; +Cc: linux-fbdev-devel, geert, linux-kernel, Andrew Morton

From: Krzysztof Helt <krzysztof.h1@wp.pl>

A hardware cursor is left enabled in
the fb_set_par() which is called when
a new console is created. This is
inconsistent with software cursor's
behaviour.

Also, this makes a hardware cursor
always visible in the Xfbdev
(Xorg kdrive) server.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Tested-by: Risto Suominen <Risto.Suominen@gmail.com>
---
Well done, Krzysztof. It solves the problem on my three computers
using the mach64 chip: PowerMac 5500, PowerMac G3 Beige, and a PC with
Mach64 GZ card.

 drivers/video/aty/mach64_accel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/video/aty/mach64_accel.c b/drivers/video/aty/mach64_accel.c
index a8f60c3..0cc9724 100644
--- a/drivers/video/aty/mach64_accel.c
+++ b/drivers/video/aty/mach64_accel.c
@@ -39,7 +39,8 @@ void aty_reset_engine(const struct atyfb_par *par)
 {
       /* reset engine */
       aty_st_le32(GEN_TEST_CNTL,
-               aty_ld_le32(GEN_TEST_CNTL, par) & ~GUI_ENGINE_ENABLE, par);
+               aty_ld_le32(GEN_TEST_CNTL, par) &
+               ~(GUI_ENGINE_ENABLE | HWCURSOR_ENABLE), par);
       /* enable engine */
       aty_st_le32(GEN_TEST_CNTL,
               aty_ld_le32(GEN_TEST_CNTL, par) | GUI_ENGINE_ENABLE, par);
--
1.5.2.2

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

end of thread, other threads:[~2009-03-21 22:01 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-23 12:33 [PATCH] fb: hide cursor in graphics mode Risto Suominen
2009-01-24  8:51 ` [Linux-fbdev-devel] " Geert Uytterhoeven
2009-01-24  9:09   ` Risto Suominen
2009-01-24 13:26     ` Geert Uytterhoeven
2009-01-24 14:49       ` Risto Suominen
2009-02-10 21:37         ` Risto Suominen
2009-02-10 21:50           ` Risto Suominen
2009-02-11 12:35             ` Risto Suominen
2009-02-11 22:24             ` Andrew Morton
2009-02-12 21:12               ` Risto Suominen
2009-02-13 20:06                 ` Krzysztof Helt
2009-02-22  7:15                   ` Krzysztof Helt
2009-02-22  9:25                     ` Risto Suominen
2009-02-22 11:20                       ` Krzysztof Helt
     [not found]                       ` <20090222164052.dd5442c4.krzysztof.h1@poczta.fm>
2009-02-23  6:53                         ` Risto Suominen
2009-02-28 18:51                           ` Krzysztof Helt
2009-03-01 11:50                             ` Risto Suominen
2009-03-12 15:19                               ` Risto Suominen
2009-03-17 21:02               ` [PATCH] fb: hide hardware cursor in graphics mode (Mach64) Krzysztof Helt
2009-03-21 22:01                 ` Risto Suominen

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