diff options
author | George Sapountzis <[email protected]> | 2011-11-03 12:46:08 +0200 |
---|---|---|
committer | George Sapountzis <[email protected]> | 2011-11-04 23:33:04 +0200 |
commit | 7192c37294964b3f6e1551469f161593ec8f851d (patch) | |
tree | 89866fb4a584baab61cea882bbb0d4f5520249f5 /src/mesa/drivers/dri/common | |
parent | fc9e80fab9dc529cbe67cc718b89b17e18fa41d8 (diff) |
dri: unify __DriverAPIRec
I dropped the comments because they don't add much.
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.h | 50 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/drisw_util.h | 9 |
3 files changed, 24 insertions, 42 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index da4e39f9c01..1775a43fc3e 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -21,6 +21,8 @@ #include "main/imports.h" +#include <drm.h> +#include <xf86drm.h> #include "dri_util.h" #include "utils.h" #include "xmlpool.h" @@ -410,9 +412,6 @@ dri2CreateNewScreen(int scrn, int fd, __DRIscreen *psp; drmVersionPtr version; - if (driDriverAPI.InitScreen2 == NULL) - return NULL; - psp = calloc(1, sizeof(*psp)); if (!psp) return NULL; @@ -433,7 +432,7 @@ dri2CreateNewScreen(int scrn, int fd, 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; diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 7a3b0a9b2f5..b4f17d139df 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -48,15 +48,10 @@ #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. @@ -76,56 +71,37 @@ extern const __DRI2configQueryExtension dri2ConfigQueryExtension; * 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); }; diff --git a/src/mesa/drivers/dri/common/drisw_util.h b/src/mesa/drivers/dri/common/drisw_util.h index deb27093627..1d3b14c6f52 100644 --- a/src/mesa/drivers/dri/common/drisw_util.h +++ b/src/mesa/drivers/dri/common/drisw_util.h @@ -56,7 +56,7 @@ struct __DriverAPIRec { void (*DestroyScreen)(__DRIscreen *driScrnPriv); - GLboolean (*CreateContext)(gl_api glapi, + GLboolean (*CreateContext)(gl_api api, const struct gl_config *glVis, __DRIcontext *driContextPriv, void *sharedContextPrivate); @@ -77,6 +77,13 @@ struct __DriverAPIRec { __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; |