Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-14 Thread Felipe Alfaro Solana
- Original Message -
From: Keith Packard <[EMAIL PROTECTED]>
Date: Thu, 13 Feb 2003 17:26:33 -0800
To: Michel Dänzer <[EMAIL PROTECTED]>
Subject: Re: [XFree86] Hardware mouse cursor visual glitches 

> Around 1 o'clock on Feb 14, Michel =?ISO-8859-1?Q?D=E4nzer?= wrote:
> 
> > This patch still actually disables the cursor instead of only
> making it fully transparent, is that really an issue?
> 
> Yes, the issue is that disabling and enabling the cursor causes
> "glitches" on the screen, while erasing the image to transparent
> does not.  That's what Marc's fix does for all of the ATI chipsets.

It seems to me there are two sets of cursors: B&W cursors and ARGB
cursors. Now the question is, does Mach64 support ARGB hardware cursor
or simply reverts to software cursors?

I have noticed that my mouse cursor blinks when text or graphics
pass it by under (for example, when scrolling)... Is this the
consequence of having ARGB software cursors? Can I choose to use only
B&W cursors instead of ARGB cursors?

Sincerely, I prefer a hardware mouse cursor to a software one.

Thanks!

   Felipe

-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Felipe Alfaro Solana
- Original Message -
From: Marc Aurele La France <[EMAIL PROTECTED]>
Date: Thu, 13 Feb 2003 16:12:43 -0700 (MST)
To: <[EMAIL PROTECTED]>
Subject: Re: [XFree86] Hardware mouse cursor visual glitches

> On Thu, 13 Feb 2003, Felipe Alfaro Solana wrote:
> 
> > Do you know what CVS/snapshot version will integrate your fix?
> > I'm currently using the XFree86 packages from RedHat Rawhide,
> > to be exact, those from 2003-02-11... I can't wait for the fixes :-)
> 
> I don't do rpm's.  So I can't answer your question.

I was talking about when the fix would be integrated into the XFree86 CVS tree. 
Anyways, I have received a response from a RedHat engineer and said an RPM package 
with your fix should be available in 12 hours.

Thanks!

   Felipe

-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Felipe Alfaro Solana
- Original Message -
From: Marc Aurele La France <[EMAIL PROTECTED]>
Date: Thu, 13 Feb 2003 16:12:43 -0700 (MST)
To: <[EMAIL PROTECTED]>
Subject: Re: [XFree86] Hardware mouse cursor visual glitches

> On Thu, 13 Feb 2003, Felipe Alfaro Solana wrote:
> 
> > Do you know what CVS/snapshot version will integrate your fix?
> > I'm currently using the XFree86 packages from RedHat Rawhide,
> > to be exact, those from 2003-02-11... I can't wait for the fixes :-)
> 
> I don't do rpm's.  So I can't answer your question.

I was talking about when the fix would be integrated into the XFree86 CVS tree. 
Anyways, I have received a response from a RedHat engineer and said an RPM package 
with your fix should be available in 12 hours.

Thanks!

   Felipe

-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Keith Packard
Around 1 o'clock on Feb 14, Michel =?ISO-8859-1?Q?D=E4nzer?= wrote:

> This patch still actually disables the cursor instead of only making it
> fully transparent, is that really an issue?

Yes, the issue is that disabling and enabling the cursor causes "glitches"
on the screen, while erasing the image to transparent does not.  That's 
what Marc's fix does for all of the ATI chipsets.

-keith


___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Keith Packard
Around 16 o'clock on Feb 13, Marc Aurele La France wrote:

> > Daniel Stone built a patch, and I hacked it a bit.  Taking that along with
> > Marc's idea of disabling cursors by turning them transparent should leave
> > us with Radeon cursor support that doesn't have any issues with mode
> > switching.
> 
> > Would such a patch make sense for 4.3?
> 
> Well, would such a patch essentially force software cursors for the
> majority of hardware that doesn't support ARGB cursors?

No, this patch is Radeon specific; it just uses the ARGB hardware for all 
cursors instead of switching back and forth between 2-bit and 32-bit 
cursors.

The core->ARGB conversion is done within the Radeon cursor code in a tiny 
loop.  A future extension could push this conversion into the cursor code 
permitting any ARGB-capable hardware of easily doing the same thing.

-keith


___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Michel Dänzer
On Don, 2003-02-13 at 22:54, Keith Packard wrote:
> Around 13 o'clock on Feb 13, Marc Aurele La France wrote:
> 
> > The problem was that the switching back-and-forth between the new "cutesy"
> > cursors and the standard ones tickles a hardware bug in Mach64, Rage 128
> > and Radeon variants.
> 
> The Radeon is slightly different in that it has hardware support for ARGB 
> cursors, hence switching on that chip is different.
> 
> I suggested that one fix for this is to simply always use the ARGB style 
> hardware cursors and map core cursors to that model, rather than 
> attempting to switch back and forth.
> 
> Daniel Stone built a patch, and I hacked it a bit.  

Fredrik Höglund (CC'd in case he's not subscribed here) has also written
such a patch, and I've fixed it for big endian machines. The result is
attached.

> Taking that along with Marc's idea of disabling cursors by turning them 
> transparent should leave us with Radeon cursor support that doesn't have 
> any issues with mode switching.

This patch still actually disables the cursor instead of only making it
fully transparent, is that really an issue?

> Would such a patch make sense for 4.3?

IMHO yes, the question is if Kevin agrees and if he'll make it.


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast

Index: radeon_cursor.c
===
RCS file: /cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_cursor.c,v
retrieving revision 1.20
diff -p -u -r1.20 radeon_cursor.c
--- radeon_cursor.c	2003/01/29 18:06:06	1.20
+++ radeon_cursor.c	2003/02/09 01:25:15
@@ -52,22 +52,56 @@
 /* X and server generic header files */
 #include "xf86.h"
 
+#define WIDTH 64
+#define HEIGHT 64
 
+/* Mono ARGB cursor colors (premultiplied) */
+static const CARD32 color[] = {
+	0x, /* White, fully transparent */
+	0x, /* Black, fully transparent */
+	0x, /* White, fully opaque */
+	0xff00, /* Black, fully opaque */
+};
+
 /* Set cursor foreground and background colors */
 static void RADEONSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
 {
 RADEONInfoPtr  info   = RADEONPTR(pScrn);
+CARD32*pixels = (CARD32 *)(pointer)(info->FB + info->cursor_start);
+CARD32 pixel, i;
+#if X_BYTE_ORDER == X_BIG_ENDIAN
 unsigned char *RADEONMMIO = info->MMIO;
+CARD32 surface_cntl = INREG(RADEON_SURFACE_CNTL);
+#endif
 
-if (info->IsSecondary || info->Clone) {
-	OUTREG(RADEON_CUR2_CLR0, bg);
-	OUTREG(RADEON_CUR2_CLR1, fg);
-}
+#ifdef ARGB_CURSOR
+/* Don't recolor cursors set with SetCursorARGB. */
+if (info->cursor_argb)
+	return;
+#endif
 
-if (!info->IsSecondary) {
-	OUTREG(RADEON_CUR_CLR0, bg);
-	OUTREG(RADEON_CUR_CLR1, fg);
-}
+/* Don't recolor the image if we don't have to */
+if (bg == 0x00ff && fg == 0)
+	return;
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+OUTREG(RADEON_SURFACE_CNTL, (surface_cntl | RADEON_NONSURF_AP0_SWP_32BPP)
+& ~RADEON_NONSURF_AP0_SWP_16BPP	);
+#endif
+
+/* Note: We assume that the pixels are either fully opaque or fully
+ *   transparent so we won't premultiply them. We also know that
+ *   the image is black & white since LoadCursorImage is called
+ *   before SetCursorColors.
+ */
+for (i = 0; i < WIDTH * HEIGHT; i++, pixels++)
+	if ((pixel = *pixels))
+	*pixels = (pixel & 0x00ff ? bg : fg) | 0xff00;
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+/* restore byte swapping */
+OUTREG(RADEON_SURFACE_CNTL, surface_cntl);
+#endif
 }
 
 
@@ -78,23 +112,19 @@ static void RADEONSetCursorPosition(Scrn
 {
 RADEONInfoPtr  info   = RADEONPTR(pScrn);
 unsigned char *RADEONMMIO = info->MMIO;
-xf86CursorInfoPtr  cursor = info->cursor;
 intxorigin= 0;
 intyorigin= 0;
 inttotal_y= pScrn->frameY1 - pScrn->frameY0;
 intX2 = pScrn->frameX0 + x;
 intY2 = pScrn->frameY0 + y;
-int		   stride = 16;
+int		   stride = 256;
 
-#ifdef ARGB_CURSOR
-if (info->cursor_argb) stride = 256;
-#endif
 if (x < 0)xorigin = -x+1;
 if (y < 0)yorigin = -y+1;
 if (y > total_y)  y   = total_y;
 if (info->Flags & V_DBLSCAN)  y   *= 2;
-if (xorigin >= cursor->MaxWidth)  xorigin = cursor->MaxWidth - 1;
-if (yorigin >= cursor->MaxHeight) yorigin = cursor->MaxHeight - 1;
+if (xorigin >= WIDTH) xorigin = WIDTH - 1;
+if (yorigin >= HEIGHT)yorigin = HEIGHT - 1;
 
 if (info->Clone) {
 	int X0 = 0;
@@ -171,8 +201,8 @@ static void RADEONSetCursorPosition(Scrn
 	yorigin = 0;
 	if (X2 < 0) xorigin = -X2 + 1;
 	if (Y2 < 0) yorigin = -Y2 + 1;
-	if (xorigin >= cursor->MaxWidth

Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Marc Aurele La France
On Thu, 13 Feb 2003, Felipe Alfaro Solana wrote:

> > > > Yes.  This a known issue.  I've started looking into this, but
> > > > have so far been unable to duplicate the problem.  I'll keep
> > > > trying.  With any luck, this'll be fixed in 4.3.

> > > OK, Marc... Please, don't hesitate to contact with me for anything
> > > you need: patching, latest CVS, testing scenarios, hardware
> > > description... Whatever! :-)

> > You can go for "b)", after cvsup has had a chance to catch up with
> > what I've just committed to fix this.

> > The problem was that the switching back-and-forth between the new
> > "cutesy" cursors and the standard ones tickles a hardware bug in
> > Mach64, Rage 128 and Radeon variants.

> Those are good notices :-)

> Do you know what CVS/snapshot version will integrate your fix?
> I'm currently using the XFree86 packages from RedHat Rawhide,
> to be exact, those from 2003-02-11... I can't wait for the fixes :-)

I don't do rpm's.  So I can't answer your question.

Marc.

+--+---+
|  Marc Aurele La France   |  work:   1-780-492-9310   |
|  Computing and Network Services  |  fax:1-780-492-1729   |
|  352 General Services Building   |  email:  [EMAIL PROTECTED]  |
|  University of Alberta   +---+
|  Edmonton, Alberta   |   |
|  T6G 2H1 | Standard disclaimers apply|
|  CANADA  |   |
+--+---+
XFree86 Core Team member.  ATI driver and X server internals.

___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Marc Aurele La France
On Thu, 13 Feb 2003, Keith Packard wrote:

> > The problem was that the switching back-and-forth between the new "cutesy"
> > cursors and the standard ones tickles a hardware bug in Mach64, Rage 128
> > and Radeon variants.

> The Radeon is slightly different in that it has hardware support for ARGB
> cursors, hence switching on that chip is different.

> I suggested that one fix for this is to simply always use the ARGB style
> hardware cursors and map core cursors to that model, rather than
> attempting to switch back and forth.

> Daniel Stone built a patch, and I hacked it a bit.  Taking that along with
> Marc's idea of disabling cursors by turning them transparent should leave
> us with Radeon cursor support that doesn't have any issues with mode
> switching.

> Would such a patch make sense for 4.3?

Well, would such a patch essentially force software cursors for the
majority of hardware that doesn't support ARGB cursors?  Currently, only
the ramdac module knows the difference between hardware and software
cursors, but it seems to me you'd need a hook in Render to convert the
core cursors to ARGB.  That kind of interface could get ugly.

I think it's best to leave something like this until after 4.3.

Marc.

+--+---+
|  Marc Aurele La France   |  work:   1-780-492-9310   |
|  Computing and Network Services  |  fax:1-780-492-1729   |
|  352 General Services Building   |  email:  [EMAIL PROTECTED]  |
|  University of Alberta   +---+
|  Edmonton, Alberta   |   |
|  T6G 2H1 | Standard disclaimers apply|
|  CANADA  |   |
+--+---+
XFree86 Core Team member.  ATI driver and X server internals.

___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Keith Packard
Around 13 o'clock on Feb 13, Marc Aurele La France wrote:

> The problem was that the switching back-and-forth between the new "cutesy"
> cursors and the standard ones tickles a hardware bug in Mach64, Rage 128
> and Radeon variants.

The Radeon is slightly different in that it has hardware support for ARGB 
cursors, hence switching on that chip is different.

I suggested that one fix for this is to simply always use the ARGB style 
hardware cursors and map core cursors to that model, rather than 
attempting to switch back and forth.

Daniel Stone built a patch, and I hacked it a bit.  Taking that along with 
Marc's idea of disabling cursors by turning them transparent should leave 
us with Radeon cursor support that doesn't have any issues with mode 
switching.

Would such a patch make sense for 4.3?

-keith


___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Felipe Alfaro Solana
- Original Message -
From: Marc Aurele La France <[EMAIL PROTECTED]>
Date: Thu, 13 Feb 2003 13:41:30 -0700 (MST)
To: <[EMAIL PROTECTED]>
Subject: Re: [XFree86] Hardware mouse cursor visual glitches

> On Wed, 12 Feb 2003, Felipe Alfaro Solana wrote:
> 
> > > Yes.  This a known issue.  I've started looking into this, but
> > > have so far been unable to duplicate the problem.  I'll keep
> > > trying.  With any luck, this'll be fixed in 4.3.
> 
> > OK, Marc... Please, don't hesitate to contact with me for anything
> > you need: patching, latest CVS, testing scenarios, hardware
> > description... Whatever! :-)
> 
> You can go for "b)", after cvsup has had a chance to catch up with
> what I've just committed to fix this.
> 
> The problem was that the switching back-and-forth between the new
> "cutesy" cursors and the standard ones tickles a hardware bug in
> Mach64, Rage 128 and Radeon variants.

Those are good notices :-)

Do you know what CVS/snapshot version will integrate your fix?
I'm currently using the XFree86 packages from RedHat Rawhide,
to be exact, those from 2003-02-11... I can't wait for the fixes :-)

Thanks!

   Felipe
-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-13 Thread Marc Aurele La France
On Wed, 12 Feb 2003, Felipe Alfaro Solana wrote:

> > > I have a laptop with an ATI RAGE Mobility M1 AGP 8MB video card
> > > (Mach64-based) which is running Red Hat Phoebe2 beta distro (8.0.93),
> > > based on XFree86 4.2.99.901 latest snapshot (Feb, 6th 2003).

> > > I'm experiencing hardware mouse cursor visual glitches when the mouse
> > > cursor shape is changed from, let's say, the standard black arrow
> > > pointer, to another one, for example, the north-south, or west-east
> > > resize arrow. When the mouse cursor shape is being changed, for a brief
> > > period of time, I can see a 64x64 rectangle full of garbage instead of
> > > the mouse cursor. After this brief lapse of time, the cursor returns to
> > > its normal appearance automatically.

> > Yes.  This a known issue.  I've started looking into this, but have so far
> > been unable to duplicate the problem.  I'll keep trying.  With any luck,
> > this'll be fixed in 4.3.

> OK, Marc... Please, don't hesitate to contact with me for anything you
> need: patching, latest CVS, testing scenarios, hardware description...
> Whatever! :-)

You can go for "b)", after cvsup has had a chance to catch up with what
I've just committed to fix this.

The problem was that the switching back-and-forth between the new "cutesy"
cursors and the standard ones tickles a hardware bug in Mach64, Rage 128
and Radeon variants.

Marc.

___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-12 Thread Felipe Alfaro Solana
- Original Message -
From: Marc Aurele La France <[EMAIL PROTECTED]>
Date: Tue, 11 Feb 2003 15:13:23 -0700 (MST)
To: <[EMAIL PROTECTED]>
Subject: Re: [XFree86] Hardware mouse cursor visual glitches

> On Tue, 11 Feb 2003, Felipe Alfaro Solana wrote:
> 
> > I have a laptop with an ATI RAGE Mobility M1 AGP 8MB video card
> > (Mach64-based) which is running Red Hat Phoebe2 beta distro (8.0.93),
> > based on XFree86 4.2.99.901 latest snapshot (Feb, 6th 2003).
> 
> > I'm experiencing hardware mouse cursor visual glitches when the mouse
> > cursor shape is changed from, let's say, the standard black arrow
> > pointer, to another one, for example, the north-south, or west-east
> > resize arrow. When the mouse cursor shape is being changed, for a brief
> > period of time, I can see a 64x64 rectangle full of garbage instead of
> > the mouse cursor. After this brief lapse of time, the cursor returns to
> > its normal appearance automatically.

> Yes.  This a known issue.  I've started looking into this, but have so far
> been unable to duplicate the problem.  I'll keep trying.  With any luck,
> this'll be fixed in 4.3.
> 
> Thanks for the details.
> 
> Marc.

OK, Marc... Please, don't hesitate to contact with me for anything you need: patching, 
latest CVS, testing scenarios, hardware description... Whatever! :-)

Thanks.

   Felipe
-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] Hardware mouse cursor visual glitches

2003-02-11 Thread Marc Aurele La France
On Tue, 11 Feb 2003, Felipe Alfaro Solana wrote:

> I have a laptop with an ATI RAGE Mobility M1 AGP 8MB video card
> (Mach64-based) which is running Red Hat Phoebe2 beta distro (8.0.93),
> based on XFree86 4.2.99.901 latest snapshot (Feb, 6th 2003).

> I'm experiencing hardware mouse cursor visual glitches when the mouse
> cursor shape is changed from, let's say, the standard black arrow
> pointer, to another one, for example, the north-south, or west-east
> resize arrow. When the mouse cursor shape is being changed, for a brief
> period of time, I can see a 64x64 rectangle full of garbage instead of
> the mouse cursor. After this brief lapse of time, the cursor returns to
> its normal appearance automatically.

> What's curious about this issue is that I can only reproduce this visual
> glitch when the mouse cursor changes its shape between certain images.
> For example, when transitioning from black arrow cursor to the hand
> cursor (the one shown when the cursor is over an hyperlink), the glitch
> can't be reproduced. If transitioning from the black arrow to any of the
> window-resize cursors, the visual glitch can be seen. This has started
> to happen with XFree86 releases of year 2003.

> As a side note, this is reproducible using XFree's stock ATI video
> driver and also with the SourceForge's GATOS project video driver (which
> provides XVideo support), so I think there must be something with the
> new mouse cursor code that is triggering this.

> Has anyone experienced this? Is this a know issue? I have heards of
> Radeon an SiS video chips having similar problems... Don't know if they
> are related.

Yes.  This a known issue.  I've started looking into this, but have so far
been unable to duplicate the problem.  I'll keep trying.  With any luck,
this'll be fixed in 4.3.

Thanks for the details.

Marc.

+--+---+
|  Marc Aurele La France   |  work:   1-780-492-9310   |
|  Computing and Network Services  |  fax:1-780-492-1729   |
|  352 General Services Building   |  email:  [EMAIL PROTECTED]  |
|  University of Alberta   +---+
|  Edmonton, Alberta   |   |
|  T6G 2H1 | Standard disclaimers apply|
|  CANADA  |   |
+--+---+
XFree86 Core Team member.  ATI driver and X server internals.

___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



[XFree86] Hardware mouse cursor visual glitches

2003-02-11 Thread Felipe Alfaro Solana
Hello,

I have a laptop with an ATI RAGE Mobility M1 AGP 8MB video card (Mach64-based) which 
is running Red Hat Phoebe2 beta distro (8.0.93), based on XFree86 4.2.99.901 latest 
snapshot (Feb, 6th 2003).

I'm experiencing hardware mouse cursor visual glitches when the mouse cursor shape is 
changed from, let's say, the standard black arrow pointer, to another one, for 
example, the north-south, or west-east resize arrow. When the mouse cursor shape is 
being changed, for a brief period of time, I can see a 64x64 rectangle full of garbage 
instead of the mouse cursor. After this brief lapse of time, the cursor returns to its 
normal appearance automatically.

What's curious about this issue is that I can only reproduce this visual glitch when 
the mouse cursor changes its shape between certain images. For example, when 
transitioning from black arrow cursor to the hand cursor (the one shown when the 
cursor is over an hyperlink), the glitch can't be reproduced. If transitioning from 
the black arrow to any of the window-resize cursors, the visual glitch can be seen. 
This has started to happen with XFree86 releases of year 2003.

As a side note, this is reproducible using XFree's stock ATI video driver and also 
with the SourceForge's GATOS project video driver (which provides XVideo support), so 
I think there must be something with the new mouse cursor code that is triggering this.

Has anyone experienced this? Is this a know issue? I have heards of Radeon an SiS 
video chips having similar problems... Don't know if they are related.

Thanks!

Best regards,

   Felipe Alfaro Solana

-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86