egl: Change the way drivers are loaded.
[mesa.git] / src / egl / main / egldisplay.h
index 372ed3cd79a25f8fba46d0de5406c989bed5722d..78fbf5b8401f9c4d878a3c5ae372e1b16f273f1d 100644 (file)
@@ -6,6 +6,7 @@
 #endif
 
 #include "egltypedefs.h"
+#include "eglhash.h"
 
 
 struct _egl_display 
@@ -14,7 +15,6 @@ struct _egl_display
    EGLDisplay Handle;
 
    const char *DriverName;
-   const char *DriverArgs;
    _EGLDriver *Driver;
 
    EGLint NumScreens;
@@ -26,6 +26,10 @@ struct _egl_display
    /* lists of linked contexts and surface */
    _EGLContext *ContextList;
    _EGLSurface *SurfaceList;
+
+   /* hash table to map surfaces to handles */
+   _EGLHashtable *SurfaceHash;
+
 #ifdef _EGL_PLATFORM_X
    Display *Xdpy;
 #endif
@@ -67,7 +71,7 @@ _eglFindDisplay(NativeDisplayType nativeDisplay);
 
 
 extern void
-_eglReleaseDisplayResources(_EGLDriver *drv, EGLDisplay dpy);
+_eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *dpy);
 
 
 extern void
@@ -87,7 +91,7 @@ _eglGetContextHandle(_EGLContext *ctx);
 
 
 extern _EGLContext *
-_eglLookupContext(EGLContext ctx);
+_eglLookupContext(EGLContext ctx, _EGLDisplay *dpy);
 
 
 /**
@@ -112,7 +116,7 @@ _eglGetSurfaceHandle(_EGLSurface *);
 
 
 extern _EGLSurface *
-_eglLookupSurface(EGLSurface surf);
+_eglLookupSurface(EGLSurface surf, _EGLDisplay *dpy);
 
 
 /**
@@ -125,4 +129,25 @@ _eglIsSurfaceLinked(_EGLSurface *surf)
 }
 
 
+/**
+ * Cast an unsigned int to a pointer.
+ */
+static INLINE void *
+_eglUIntToPointer(unsigned int v)
+{
+   return (void *) ((uintptr_t) v);
+}
+
+
+/**
+ * Cast a pointer to an unsigned int.  The pointer must be one that is
+ * returned by _eglUIntToPointer.
+ */
+static INLINE unsigned int
+_eglPointerToUInt(const void *p)
+{
+   return (unsigned int) ((uintptr_t) p);
+}
+
+
 #endif /* EGLDISPLAY_INCLUDED */