summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/graw-xlib/graw_xlib.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-01-20 22:43:18 +0100
committerChristian König <[email protected]>2011-01-20 22:43:18 +0100
commit78faf8d0e9c276a0ff1465e501d58fb3d66de2f7 (patch)
tree4e124bd6b511e408c5e113c4166b8fa97fd75b24 /src/gallium/targets/graw-xlib/graw_xlib.c
parentd2ff6b8715e817c1ef14d4bf12be58c19d894143 (diff)
parent37233f1ee0213a224611788bbab38840ba9f8308 (diff)
Merge remote branch 'origin/master' into pipe-video
Conflicts: src/gallium/drivers/r600/r600_asm.c
Diffstat (limited to 'src/gallium/targets/graw-xlib/graw_xlib.c')
-rw-r--r--src/gallium/targets/graw-xlib/graw_xlib.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gallium/targets/graw-xlib/graw_xlib.c b/src/gallium/targets/graw-xlib/graw_xlib.c
index 578086f8f9a..b6d798e577c 100644
--- a/src/gallium/targets/graw-xlib/graw_xlib.c
+++ b/src/gallium/targets/graw-xlib/graw_xlib.c
@@ -66,9 +66,6 @@ graw_create_window_and_screen( int x,
root = RootWindow( graw.display, scrnum );
- if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
- goto fail;
-
if (graw.display == NULL)
goto fail;
@@ -88,6 +85,23 @@ graw_create_window_and_screen( int x,
exit(1);
}
+ /* See if the requirested pixel format matches the visual */
+ if (visinfo->red_mask == 0xff0000 &&
+ visinfo->green_mask == 0xff00 &&
+ visinfo->blue_mask == 0xff) {
+ if (format != PIPE_FORMAT_B8G8R8A8_UNORM)
+ goto fail;
+ }
+ else if (visinfo->red_mask == 0xff &&
+ visinfo->green_mask == 0xff00 &&
+ visinfo->blue_mask == 0xff0000) {
+ if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
+ goto fail;
+ }
+ else {
+ goto fail;
+ }
+
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;