I dropped the comments because they don't add much.
* DRI versions differ in their implementation of init_screen and swap_buffers.
*/
const struct __DriverAPIRec driDriverAPI = {
- .InitScreen2 = dri2_init_screen,
+ .InitScreen = dri2_init_screen,
.DestroyScreen = dri_destroy_screen,
.CreateContext = dri_create_context,
.DestroyContext = dri_destroy_context,
.DestroyContext = dri_destroy_context,
.CreateBuffer = drisw_create_buffer,
.DestroyBuffer = dri_destroy_buffer,
+ .SwapBuffers = drisw_swap_buffers,
.MakeCurrent = dri_make_current,
.UnbindContext = dri_unbind_context,
-
- .SwapBuffers = drisw_swap_buffers,
};
/* This is the table of extensions that the loader will dlsym() for. */
#include "main/imports.h"
+#include <drm.h>
+#include <xf86drm.h>
#include "dri_util.h"
#include "utils.h"
#include "xmlpool.h"
__DRIscreen *psp;
drmVersionPtr version;
- if (driDriverAPI.InitScreen2 == NULL)
- return NULL;
-
psp = calloc(1, sizeof(*psp));
if (!psp)
return NULL;
psp->DriverAPI = driDriverAPI;
psp->api_mask = (1 << __DRI_API_OPENGL);
- *driver_configs = driDriverAPI.InitScreen2(psp);
+ *driver_configs = driDriverAPI.InitScreen(psp);
if (*driver_configs == NULL) {
free(psp);
return NULL;
#define _DRI_UTIL_H_
#include <GL/gl.h>
-#include <drm.h>
-#include <drm_sarea.h>
-#include <xf86drm.h>
-#include "xmlconfig.h"
-#include "main/glheader.h"
+#include <GL/internal/dri_interface.h>
#include "main/mtypes.h"
-#include "GL/internal/dri_interface.h"
+#include "xmlconfig.h"
-#define GLX_BAD_CONTEXT 5
/**
* Extensions.
* this structure.
*/
struct __DriverAPIRec {
- /**
- * Screen destruction callback
- */
+ const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
+
void (*DestroyScreen)(__DRIscreen *driScrnPriv);
- /**
- * Context creation callback
- */
GLboolean (*CreateContext)(gl_api api,
- const struct gl_config *glVis,
- __DRIcontext *driContextPriv,
+ const struct gl_config *glVis,
+ __DRIcontext *driContextPriv,
void *sharedContextPrivate);
- /**
- * Context destruction callback
- */
void (*DestroyContext)(__DRIcontext *driContextPriv);
- /**
- * Buffer (drawable) creation callback
- */
GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
__DRIdrawable *driDrawPriv,
const struct gl_config *glVis,
GLboolean pixmapBuffer);
-
- /**
- * Buffer (drawable) destruction callback
- */
+
void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
- /**
- * Context activation callback
- */
+ void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
+
GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
__DRIdrawable *driDrawPriv,
__DRIdrawable *driReadPriv);
- /**
- * Context unbinding callback
- */
GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
- /* DRI2 Entry point */
- const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
-
__DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
- unsigned int attachment,
- unsigned int format,
- int width, int height);
+ unsigned int attachment,
+ unsigned int format,
+ int width, int height);
+
void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
};
void (*DestroyScreen)(__DRIscreen *driScrnPriv);
- GLboolean (*CreateContext)(gl_api glapi,
+ GLboolean (*CreateContext)(gl_api api,
const struct gl_config *glVis,
__DRIcontext *driContextPriv,
void *sharedContextPrivate);
__DRIdrawable *driReadPriv);
GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
+
+ __DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
+ unsigned int attachment,
+ unsigned int format,
+ int width, int height);
+
+ void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
};
extern const struct __DriverAPIRec driDriverAPI;
const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = intelInitScreen2,
.DestroyScreen = intelDestroyScreen,
.CreateContext = intelCreateContext,
.DestroyContext = intelDestroyContext,
.DestroyBuffer = intelDestroyBuffer,
.MakeCurrent = intelMakeCurrent,
.UnbindContext = intelUnbindContext,
- .InitScreen2 = intelInitScreen2,
.AllocateBuffer = intelAllocateBuffer,
.ReleaseBuffer = intelReleaseBuffer
};
};
const struct __DriverAPIRec driDriverAPI = {
- .InitScreen2 = nouveau_init_screen2,
+ .InitScreen = nouveau_init_screen2,
.DestroyScreen = nouveau_destroy_screen,
.CreateBuffer = nouveau_create_buffer,
.DestroyBuffer = nouveau_destroy_buffer,
}
const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = radeonInitScreen2,
.DestroyScreen = radeonDestroyScreen,
#if defined(RADEON_R200)
.CreateContext = r200CreateContext,
.DestroyBuffer = radeonDestroyBuffer,
.MakeCurrent = radeonMakeCurrent,
.UnbindContext = radeonUnbindContext,
- /* DRI2 */
- .InitScreen2 = radeonInitScreen2,
};
/* This is the table of extensions that the loader will dlsym() for. */