2009-01-23 12:34:08

by Risto Suominen

[permalink] [raw]
Subject: [PATCH] fb: hide cursor in graphics mode

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 <[email protected]>
---
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;


Attachments:
fbcon-graphics-nocursor.diff (793.00 B)

2009-01-24 08:52:15

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode

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 <[email protected]>
> ---
> 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 -- [email protected]

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

2009-01-24 09:09:24

by Risto Suominen

[permalink] [raw]
Subject: Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode

2009/1/24 Geert Uytterhoeven <[email protected]>:
> 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 <[email protected]>
>> ---
>> 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

2009-01-24 13:26:56

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode

On Sat, 24 Jan 2009, Risto Suominen wrote:
> 2009/1/24 Geert Uytterhoeven <[email protected]>:
> > 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 <[email protected]>
> >> ---
> >> 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 -- [email protected]

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

2009-01-24 14:49:55

by Risto Suominen

[permalink] [raw]
Subject: Re: [Linux-fbdev-devel] [PATCH] fb: hide cursor in graphics mode

2009/1/24 Geert Uytterhoeven <[email protected]>:
>
> 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