xserver/hw/xgl/egl xegl.c,1.7,1.8 xeglinit.c,1.1,1.2

Dave Airlie xserver-commit at pdx.freedesktop.org
Tue Jan 3 02:15:56 PST 2006


Committed by: airlied

Update of /cvs/xserver/xserver/hw/xgl/egl
In directory gabe:/tmp/cvs-serv18900/hw/xgl/egl

Modified Files:
	xegl.c xeglinit.c 
Log Message:
egl changes for latest xgl codedrop (untested)


Index: xegl.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/egl/xegl.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- xegl.c	28 Dec 2005 01:57:11 -0000	1.7
+++ xegl.c	3 Jan 2006 10:15:54 -0000	1.8
@@ -33,12 +33,16 @@
 
 #include <glitz-egl.h>
 
+#include "xegl.h"
+
+#ifdef GLXEXT
+#include "xglglxext.h"
+#endif
+
 #include "inputstr.h"
 #include "cursorstr.h"
 #include "mipointer.h"
 
-#include "xegl.h"
-
 #define XEGL_DEFAULT_SCREEN_WIDTH  800
 #define XEGL_DEFAULT_SCREEN_HEIGHT 600
 
@@ -59,6 +63,8 @@
 static ScreenPtr     currentScreen = 0;
 static Bool	     softCursor = TRUE;
 
+static glitz_drawable_format_t *xeglScreenFormat = 0;
+
 extern miPointerScreenFuncRec kdPointerScreenFuncs;
 
 static Bool
@@ -132,7 +138,7 @@
     screenAttribs[1] = xglScreenInfo.width;
     screenAttribs[3] = xglScreenInfo.height;
 
-    format = xglVisuals[0].format;
+    format = xeglScreenFormat;
 
     if (!xeglAllocatePrivates (pScreen))
 	return FALSE;
@@ -196,7 +202,13 @@
     glitz_drawable_format_t *format, templ;
     int			    i, maj, min, count;
     unsigned long	    mask;
-    
+    unsigned long	    extraMask[] = {
+	GLITZ_FORMAT_DOUBLEBUFFER_MASK | GLITZ_FORMAT_ALPHA_SIZE_MASK,
+	GLITZ_FORMAT_DOUBLEBUFFER_MASK,
+	GLITZ_FORMAT_ALPHA_SIZE_MASK,
+	0
+    };
+
     xglSetPixmapFormats (pScreenInfo);
 
     if (!eDisplay)
@@ -211,19 +223,35 @@
 
     templ.samples          = 1;
     templ.doublebuffer     = 1;
+    templ.color.fourcc     = GLITZ_FOURCC_RGB;
     templ.color.alpha_size = 8;
 
-    mask = GLITZ_FORMAT_SAMPLES_MASK;
+    mask = GLITZ_FORMAT_SAMPLES_MASK | GLITZ_FORMAT_FOURCC_MASK;
 
-    format = glitz_egl_find_window_config (eDisplay, eScreen,
-				    mask, &templ, 0);
+    for (i = 0; i < sizeof (extraMask) / sizeof (extraMask[0]); i++)
+    {
+	format = glitz_egl_find_window_config (eDisplay, eScreen,
+					       mask | extraMask[i],
+					       &templ, 0);
+	if (format)
+	    break;
+    }
 
     if (!format)
 	FatalError ("no visual format found");
 
-    xglSetVisualTypesAndMasks (pScreenInfo, format, (1 << TrueColor));
+    xglScreenInfo.depth =
+	format->color.red_size   +
+	format->color.green_size +
+	format->color.blue_size;
 
-    xglInitVisuals (pScreenInfo);
+    xglSetVisualTypes (xglScreenInfo.depth,
+		       (1 << TrueColor),
+		       format->color.red_size,
+		       format->color.green_size,
+		       format->color.blue_size);
+
+    xeglScreenFormat = format;
 
     AddScreen (xeglScreenInit, argc, argv);
 }

Index: xeglinit.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/egl/xeglinit.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xeglinit.c	23 Dec 2005 02:07:58 -0000	1.1
+++ xeglinit.c	3 Jan 2006 10:15:54 -0000	1.2
@@ -26,13 +26,18 @@
 #include "xegl.h"
 
 static xglScreenInfoRec xglScreenInfo = {
-    NULL, 0, 0, 0, 0,
+    NULL, 0, 0, 0, 0, 0,
     DEFAULT_GEOMETRY_DATA_TYPE,
     DEFAULT_GEOMETRY_USAGE,
     FALSE,
     XGL_DEFAULT_PBO_MASK,
     FALSE,
-    FALSE
+    {
+	{ FALSE, FALSE, { 0, 0, 0, 0 } },
+	{ FALSE, FALSE, { 0, 0, 0, 0 } },
+	{ FALSE, FALSE, { 0, 0, 0, 0 } },
+	{ FALSE, FALSE, { 0, 0, 0, 0 } }
+    }
 };
 
 #ifdef GLXEXT



More information about the xserver-commit mailing list