xserver: Branch 'server-1.7-nominations' - 3 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Sat Oct 10 03:23:40 PDT 2009
composite/compinit.c | 4 --
exa/exa_render.c | 71 ++++++++++++++++++++++++++++++---------------------
2 files changed, 44 insertions(+), 31 deletions(-)
New commits:
commit b6e723eaebe79116dfa15162851b02bbdc29be2a
Author: Michel Dänzer <daenzer at vmware.com>
Date: Fri Oct 9 11:31:44 2009 +0200
EXA: Fix exaTryDriverSolidFill() for solid source pictures.
Solid pictures have a NULL pFormat field, but their format is always
PICT_a8r8g8b8.
Signed-off-by: Michel Dänzer <daenzer at vmware.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
(cherry picked from commit 1088073b11ed488c0df45af3867b900ef93c6fe1)
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 70701a2..db355d6 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -185,24 +185,33 @@ exaGetRGBAFromPixel(CARD32 pixel,
CARD16 *green,
CARD16 *blue,
CARD16 *alpha,
- PictFormatPtr pFormat)
+ PictFormatPtr pFormat,
+ PictFormatShort format)
{
int rbits, bbits, gbits, abits;
int rshift, bshift, gshift, ashift;
- if (!PICT_FORMAT_COLOR(pFormat->format) &&
- PICT_FORMAT_TYPE(pFormat->format) != PICT_TYPE_A)
+ if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A)
return FALSE;
- rbits = PICT_FORMAT_R(pFormat->format);
- gbits = PICT_FORMAT_G(pFormat->format);
- bbits = PICT_FORMAT_B(pFormat->format);
- abits = PICT_FORMAT_A(pFormat->format);
-
- rshift = pFormat->direct.red;
- gshift = pFormat->direct.green;
- bshift = pFormat->direct.blue;
- ashift = pFormat->direct.alpha;
+ rbits = PICT_FORMAT_R(format);
+ gbits = PICT_FORMAT_G(format);
+ bbits = PICT_FORMAT_B(format);
+ abits = PICT_FORMAT_A(format);
+
+ if (pFormat) {
+ rshift = pFormat->direct.red;
+ gshift = pFormat->direct.green;
+ bshift = pFormat->direct.blue;
+ ashift = pFormat->direct.alpha;
+ } else if (format == PICT_a8r8g8b8) {
+ rshift = 16;
+ gshift = 8;
+ bshift = 0;
+ ashift = 24;
+ } else
+ FatalError("EXA bug: exaGetRGBAFromPixel() doesn't match "
+ "createSourcePicture()\n");
if (rbits) {
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
@@ -293,7 +302,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
pixel = pSrc->pSourcePict->solidFill.color;
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
- pSrc->pFormat) ||
+ pSrc->pFormat, pSrc->format) ||
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
pDst->pFormat))
{
commit 2e37bda8d6b0203973893d8440d9917975f53d97
Author: Ben Skeggs <bskeggs at redhat.com>
Date: Fri Oct 9 16:08:15 2009 -0700
EXA: fix exaGetRGBAFromPixel to not loop forever on PICT_a8 picture
Easily reproducible by running "rendercheck -t fill".
It should be safe to just test against rbits for all colour components
as we should always have values for r/g/bbits for PICT_FORMAT_COLOR
formats.
Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
Signed-off-by: Michel Dänzer <daenzer at vmware
Signed-off-by: Keith Packard <keithp at keithp.com>
(cherry picked from commit 55305cf8db7787883bc80b7348eb626e609626f8)
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 1c18566..70701a2 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -204,22 +204,28 @@ exaGetRGBAFromPixel(CARD32 pixel,
bshift = pFormat->direct.blue;
ashift = pFormat->direct.alpha;
- *red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
- while (rbits < 16) {
- *red |= *red >> rbits;
- rbits <<= 1;
- }
+ if (rbits) {
+ *red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
+ while (rbits < 16) {
+ *red |= *red >> rbits;
+ rbits <<= 1;
+ }
- *green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
- while (gbits < 16) {
- *green |= *green >> gbits;
- gbits <<= 1;
- }
+ *green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
+ while (gbits < 16) {
+ *green |= *green >> gbits;
+ gbits <<= 1;
+ }
- *blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
- while (bbits < 16) {
- *blue |= *blue >> bbits;
- bbits <<= 1;
+ *blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
+ while (bbits < 16) {
+ *blue |= *blue >> bbits;
+ bbits <<= 1;
+ }
+ } else {
+ *red = 0x0000;
+ *green = 0x0000;
+ *blue = 0x0000;
}
if (abits) {
commit 6d99a7de3f2c60bf90faf604b1a39d4aa5bdfd09
Author: Michel Dänzer <daenzer at vmware.com>
Date: Fri Oct 9 11:31:46 2009 +0200
composite: Revert changes from adding support for BGRA picture formats.
They were aimed towards a since abandoned approach for making radeon KMS work
on big endian machines, and Aaron Plattner pointed out that they break the
Composite extension when the X server runs in 16bpp.
Signed-off-by: Michel Dänzer <daenzer at vmware.com>
Tested-by: Aaron Plattner <aplattner at nvidia.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
(cherry picked from commit b375be9285c40467578fac2f1360c29a75306ab4)
diff --git a/composite/compinit.c b/composite/compinit.c
index 96ac70f..9b033c8 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -238,7 +238,6 @@ static CompAlternateVisual altVisuals[] = {
{ 24, PICT_r8g8b8 },
#endif
{ 32, PICT_a8r8g8b8 },
- { 32, PICT_b8g8r8a8 },
};
static const int NUM_COMP_ALTERNATE_VISUALS = sizeof(altVisuals) /
@@ -267,8 +266,7 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
return TRUE;
pPictFormat = PictureMatchFormat (pScreen, alt->depth, alt->format);
- if (!pPictFormat ||
- pPictFormat->direct.red != pScreen->visuals[0].offsetRed)
+ if (!pPictFormat)
return FALSE;
if (ResizeVisualArray(pScreen, 1, depth) == FALSE) {
More information about the xorg-commit
mailing list