Re: Sun Creator and XRender

2005-10-26 Thread Michael
Hello,

> > I had a look at x.org's sunffb and all they did is to rewrite
> > ffb_accel.c to use XAA and add a hardware-accelerated alpha-blending
> > function ( plus accompanying changes in ffb_driver.c to load
> > relevant modules and a few more or less trivial ones in other files
> > ). Now I have something that works, is fast but for some strange
> > reason all text drawn via XRender has red and blue components
> > swapped. Only text, images are fine. Playing with anti-aliasing
> > parameters seems to change this too, after disabling subpixel
> > hinting newly started apps get it right, until next start of the
> > Xserver... It worked fine with the old code and affects both KDE and
> > GTK apps. The other changes are only reformatting source and
> > renaming of some macros ( XF86* -> XORG* and such ).
> > Any ideas?
> > Looks almost like an un- or misinitialized variable somewhere,
> > defaults to ARGB, gets overwritten when someone changes
> > anti-aliasing parameters and nobody noticed since ARGB is almost
> > always right.
> 
> Looks like an endian bug to me

I've found the bug.
In fbpict.c / fbComposite() calls fbCompositeSolidMask_nx8x() when
rendering text. This takes a drawable to provide the font colour as
source, one with the background color as destination and the font as
alpha mask. The problem is that gtk and KDE call this with an RGB
picture as source even when rendering directly to the screen which is
BGR. fbCompositeSolidMask*() doesn't convert the source color to the
destination picture's format - apparently it assumes RGB - which is why
text is drawn in the wrong color. Programs that render always in the
display's native format, like apparently WindowMaker, didn't have the
problem in the first place.

have fun
Michael


pgp1QrYCLg58Z.pgp
Description: PGP signature


pgplytfgHOonf.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-19 Thread Marc Aurele La France

On Tue, 18 Oct 2005, Michael wrote:


The problem is definitely in the Xserver:
- sparc64 client with X in ARGB running on a powerpc box - text colours
 are right
- sparc64 client and X with FFB/ABGR - wrong text colours
- sparc64 client and X with mach64 or mga in ARGB - text colours are
 right
- client on powerpc, X on sparc64 with FFB/ABGR - text colours are
 wrong
- sparc64 without Xrender support - text colours are right
... so it should be somewhere in Xrender.



There's a bug ( or at least an inconsistency ) in xf86Helper /
xf86SetWeight():



scrp->offset.red = ffs(mask.red);
scrp->offset.green = ffs(mask.green);
scrp->offset.blue = ffs(mask.blue);



this sets 1-based offsets while the rest of the code ( or at least
Xrender's PictureCreateDefaultFormats() ) expects 0-based ones.


That's already been fixed in our repository.

Marc.

+--+---+
|  Marc Aurele La France   |  work:   1-780-492-9310   |
|  Academic Information and|  fax:1-780-492-1729   |
|Communications Technologies   |  email:  [EMAIL PROTECTED]  |
|  352 General Services Building   +---+
|  University of Alberta   |   |
|  Edmonton, Alberta   | Standard disclaimers apply|
|  T6G 2H1 |   |
|  CANADA  |   |
+--+---+
XFree86 developer and VP.  ATI driver and X server internals.
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Sun Creator and XRender

2005-10-18 Thread Michael
Hello,

> I had a look at x.org's sunffb and all they did is to rewrite
> ffb_accel.c to use XAA and add a hardware-accelerated alpha-blending
> function ( plus accompanying changes in ffb_driver.c to load relevant
> modules and a few more or less trivial ones in other files ). Now I
> have something that works, is fast but for some strange reason all
> text drawn via XRender has red and blue components swapped. Only text,
> images are fine. Playing with anti-aliasing parameters seems to change
> this too, after disabling subpixel hinting newly started apps get it
> right, until next start of the Xserver... It worked fine with the old
> code and affects both KDE and GTK apps. The other changes are only
> reformatting source and renaming of some macros ( XF86* -> XORG* and
> such ).
> Any ideas?
> Looks almost like an un- or misinitialized variable somewhere,
> defaults to ARGB, gets overwritten when someone changes anti-aliasing
> parameters and nobody noticed since ARGB is almost always right.

The problem is definitely in the Xserver:
- sparc64 client with X in ARGB running on a powerpc box - text colours
  are right 
- sparc64 client and X with FFB/ABGR - wrong text colours
- sparc64 client and X with mach64 or mga in ARGB - text colours are
  right 
- client on powerpc, X on sparc64 with FFB/ABGR - text colours are
  wrong
- sparc64 without Xrender support - text colours are right
... so it should be somewhere in Xrender.

There's a bug ( or at least an inconsistency ) in xf86Helper /
xf86SetWeight():

scrp->offset.red = ffs(mask.red);
scrp->offset.green = ffs(mask.green);
scrp->offset.blue = ffs(mask.blue);

this sets 1-based offsets while the rest of the code ( or at least
Xrender's PictureCreateDefaultFormats() ) expects 0-based ones.

have fun
Michael


pgpiv1nJ6B0Ms.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-17 Thread Michael
Hello,

> > I had a look at x.org's sunffb and all they did is to rewrite
> > ffb_accel.c to use XAA and add a hardware-accelerated alpha-blending
> > function ( plus accompanying changes in ffb_driver.c to load relevant
> > modules and a few more or less trivial ones in other files ). Now I have
> > something that works, is fast but for some strange reason all text drawn
> > via XRender has red and blue components swapped. Only text, images are
> > fine. Playing with anti-aliasing parameters seems to change this too,
> > after disabling subpixel hinting newly started apps get it right, until
> > next start of the Xserver... It worked fine with the old code and
> > affects both KDE and GTK apps. The other changes are only reformatting
> > source and renaming of some macros ( XF86* -> XORG* and such ).
> > Any ideas?
> > Looks almost like an un- or misinitialized variable somewhere, defaults
> > to ARGB, gets overwritten when someone changes anti-aliasing parameters
> > and nobody noticed since ARGB is almost always right.
> 
> Looks like an endian bug to me

Maybe, maybe not.
An endian bug would more likely change ARGB to BGRA but the alpha channel 
is in the right place and all images look right.
It's ARGB vs. ABGR - most PC graphics boards use ARGB, the FFB uses ABGR
and somehow this information doesn't always make it to the font renderer 
it seems ( or things are inappropriately cached, who knows, I'm toatlly 
unfamiliar with XRender and friends ). And it wouldn't change when I play 
with font rendering settings.

have fun
Michael


pgpxNgEIzG24s.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-17 Thread Benjamin Herrenschmidt
> I had a look at x.org's sunffb and all they did is to rewrite
> ffb_accel.c to use XAA and add a hardware-accelerated alpha-blending
> function ( plus accompanying changes in ffb_driver.c to load relevant
> modules and a few more or less trivial ones in other files ). Now I have
> something that works, is fast but for some strange reason all text drawn
> via XRender has red and blue components swapped. Only text, images are
> fine. Playing with anti-aliasing parameters seems to change this too,
> after disabling subpixel hinting newly started apps get it right, until
> next start of the Xserver... It worked fine with the old code and
> affects both KDE and GTK apps. The other changes are only reformatting
> source and renaming of some macros ( XF86* -> XORG* and such ).
> Any ideas?
> Looks almost like an un- or misinitialized variable somewhere, defaults
> to ARGB, gets overwritten when someone changes anti-aliasing parameters
> and nobody noticed since ARGB is almost always right.

Looks like an endian bug to me

Ben.


___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Sun Creator and XRender

2005-10-17 Thread Michael
Hello,

> This has already been done in X.Org's repository and it is on my
> to-do-soon list to merge in.

I had a look at x.org's sunffb and all they did is to rewrite
ffb_accel.c to use XAA and add a hardware-accelerated alpha-blending
function ( plus accompanying changes in ffb_driver.c to load relevant
modules and a few more or less trivial ones in other files ). Now I have
something that works, is fast but for some strange reason all text drawn
via XRender has red and blue components swapped. Only text, images are
fine. Playing with anti-aliasing parameters seems to change this too,
after disabling subpixel hinting newly started apps get it right, until
next start of the Xserver... It worked fine with the old code and
affects both KDE and GTK apps. The other changes are only reformatting
source and renaming of some macros ( XF86* -> XORG* and such ).
Any ideas?
Looks almost like an un- or misinitialized variable somewhere, defaults
to ARGB, gets overwritten when someone changes anti-aliasing parameters
and nobody noticed since ARGB is almost always right.

have fun
Michael


pgpup1nbmRMaI.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-16 Thread Michael
Hello,

> > I wonder if they fixed DRI support too.
> >
> 
> DRI should work with xorg and mesa from cvs.

I'll give it a try - I have a working ( well, as far as I can tell ) DRM
for NetBSD/sparc64. The code from XFree86 4.5 more or less works but
the renderer doesn't seem to work very well ( or not at all ) with the
double-buffering extension, GL-rendered images keep flickering and
switching between GL and X contexts doesn't work either ( clipping
remains active and a few other oddities )

have fun
Michael


pgpe1lH1eHsfA.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-16 Thread Michael
Hello,

> > I wonder if they fixed DRI support too.
> >
> 
> DRI should work with xorg and mesa from cvs.

I'll give it a try - I have a working ( well, as far as I can tell ) DRM
for NetBSD/sparc64. The code from XFree86 4.5 more or less works but
the renderer doesn't seem to work very well ( or not at all ) with the
double-buffering extension, GL-rendered images keep flickering and
switching between GL and X contexts doesn't work either ( clipping
remains active and a few other oddities )

have fun
Michael


pgpbTI5pZOLr6.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-16 Thread Alex Deucher
On 10/16/05, Michael <[EMAIL PROTECTED]> wrote:
> Hello,
>
> > > since the sunffb driver doesn't support the XRender extension but
> > > the graphics processor supports alpha blending and a few other nice
> > > tricks I've been poking around a bit to add this sort of
> > > functionality. The problem seems to be that sunffb doesn't use xaa
> > > or the standard framebuffer manager. so I couldn't get the included
> > > render code to work.
> > > So my questions are:
> > > - is there a text somewhere describing how to add xrender
> > > functionality to a driver without using fbPictureInit() ?
> > > - is there some more comprehensive ffb documentation available
> > > somewhere? I think I know how alpha blending and so on is supposed
> > > to work ( from reading the mesa driver source ) but there are still
> > > a few more questions.
> >
> > This has already been done in X.Org's repository and it is on my
> > to-do-soon list to merge in.
>
> Nice :)
> So I'll stop reinventing the wheel, wait until you're done and then
> import the result into NetBSD.
> I wonder if they fixed DRI support too.
>

DRI should work with xorg and mesa from cvs.

Alex

> have fun
> Michael
>
>
>

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Sun Creator and XRender

2005-10-16 Thread Michael
Hello,

> > since the sunffb driver doesn't support the XRender extension but
> > the graphics processor supports alpha blending and a few other nice
> > tricks I've been poking around a bit to add this sort of
> > functionality. The problem seems to be that sunffb doesn't use xaa
> > or the standard framebuffer manager. so I couldn't get the included
> > render code to work.
> > So my questions are:
> > - is there a text somewhere describing how to add xrender
> > functionality to a driver without using fbPictureInit() ?
> > - is there some more comprehensive ffb documentation available
> > somewhere? I think I know how alpha blending and so on is supposed
> > to work ( from reading the mesa driver source ) but there are still
> > a few more questions.
> 
> This has already been done in X.Org's repository and it is on my
> to-do-soon list to merge in.

Nice :)
So I'll stop reinventing the wheel, wait until you're done and then
import the result into NetBSD.
I wonder if they fixed DRI support too.

have fun
Michael


pgpY6xXTuIz1M.pgp
Description: PGP signature


Re: Sun Creator and XRender

2005-10-16 Thread Marc Aurele La France

On Sat, 15 Oct 2005, Michael wrote:


since the sunffb driver doesn't support the XRender extension but the
graphics processor supports alpha blending and a few other nice tricks
I've been poking around a bit to add this sort of functionality. The
problem seems to be that sunffb doesn't use xaa or the standard
framebuffer manager. so I couldn't get the included render code to work.
So my questions are:
- is there a text somewhere describing how to add xrender functionality
to a driver without using fbPictureInit() ?
- is there some more comprehensive ffb documentation available
somewhere? I think I know how alpha blending and so on is supposed to
work ( from reading the mesa driver source ) but there are still a few
more questions.


This has already been done in X.Org's repository and it is on my to-do-soon 
list to merge in.


Marc.

+--+---+
|  Marc Aurele La France   |  work:   1-780-492-9310   |
|  Academic Information and|  fax:1-780-492-1729   |
|Communications Technologies   |  email:  [EMAIL PROTECTED]  |
|  352 General Services Building   +---+
|  University of Alberta   |   |
|  Edmonton, Alberta   | Standard disclaimers apply|
|  T6G 2H1 |   |
|  CANADA  |   |
+--+---+
XFree86 developer and VP.  ATI driver and X server internals.
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Sun Creator and XRender

2005-10-15 Thread Michael
Hello,

since the sunffb driver doesn't support the XRender extension but the
graphics processor supports alpha blending and a few other nice tricks
I've been poking around a bit to add this sort of functionality. The
problem seems to be that sunffb doesn't use xaa or the standard
framebuffer manager. so I couldn't get the included render code to work.
So my questions are:
- is there a text somewhere describing how to add xrender functionality
to a driver without using fbPictureInit() ?
- is there some more comprehensive ffb documentation available
somewhere? I think I know how alpha blending and so on is supposed to
work ( from reading the mesa driver source ) but there are still a few
more questions.

have fun
Michael


pgpG11CF8xp6j.pgp
Description: PGP signature