diff options
author | Kristian Høgsberg <[email protected]> | 2008-03-26 19:26:59 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2008-03-31 16:51:26 -0400 |
commit | e82dd8c6e1fa2fff5b960de26961080ba5e9651d (patch) | |
tree | 1bd230661a032b1ab539998f947573de1acaf80d /src/glx/x11/glxclient.h | |
parent | 63d8a8417d68365cd10c11178516378411c09f87 (diff) |
DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code. Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.
Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration. Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide. glcore.h is no
longer part of the DRI driver interface. The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.
The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for. The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts. The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.
Change DRI2 client code to not use drm drawables or contexts. We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock. We now just allocate a
unique lock ID out of the DRILock sarea block. Once we get rid of the
lock entirely, we can drop this hack.
Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point. This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
Diffstat (limited to 'src/glx/x11/glxclient.h')
-rw-r--r-- | src/glx/x11/glxclient.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index ea90282b08f..5fd64209df5 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -59,7 +59,6 @@ #include "GL/glxproto.h" #include "GL/internal/glcore.h" #include "glapitable.h" -#include "glxextensions.h" #include "glxhash.h" #if defined( USE_XTHREADS ) # include <X11/Xthreads.h> @@ -97,6 +96,8 @@ typedef struct __GLXDRIscreenRec __GLXDRIscreen; typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; typedef struct __GLXDRIcontextRec __GLXDRIcontext; +#include "glxextensions.h" + struct __GLXDRIdisplayRec { /** * Method to destroy the private DRI display data. @@ -117,8 +118,9 @@ struct __GLXDRIscreenRec { GLXContext shareList, int renderType); __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, - GLXDrawable drawable, - GLXContext gc); + XID drawable, + GLXDrawable glxDrawable, + const __GLcontextModes *modes); }; struct __GLXDRIcontextRec { @@ -134,9 +136,11 @@ struct __GLXDRIcontextRec { struct __GLXDRIdrawableRec { void (*destroyDrawable)(__GLXDRIdrawable *drawable); + XID xDrawable; XID drawable; __GLXscreenConfigs *psc; - __DRIdrawable driDrawable; + __DRIdrawable *driDrawable; + GLenum textureTarget; }; /* @@ -144,6 +148,7 @@ struct __GLXDRIdrawableRec { ** dependent methods. */ extern __GLXDRIdisplay *driCreateDisplay(Display *dpy); +extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy); extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); @@ -364,6 +369,7 @@ struct __GLXcontextRec { #ifdef GLX_DIRECT_RENDERING __GLXDRIcontext *driContext; + __DRIcontext *__driContext; #endif /** @@ -458,32 +464,38 @@ struct __GLXscreenConfigsRec { /** * Per screen direct rendering interface functions and data. */ - __DRIscreen __driScreen; + __DRIscreen *__driScreen; + const __DRIcoreExtension *core; + const __DRIlegacyExtension *legacy; __glxHashTable *drawHash; Display *dpy; - int scr; + int scr, fd; void *driver; __GLXDRIscreen *driScreen; #ifdef __DRI_COPY_SUB_BUFFER - __DRIcopySubBufferExtension *copySubBuffer; + const __DRIcopySubBufferExtension *copySubBuffer; #endif #ifdef __DRI_SWAP_CONTROL - __DRIswapControlExtension *swapControl; + const __DRIswapControlExtension *swapControl; #endif #ifdef __DRI_ALLOCATE - __DRIallocateExtension *allocate; + const __DRIallocateExtension *allocate; #endif #ifdef __DRI_FRAME_TRACKING - __DRIframeTrackingExtension *frameTracking; + const __DRIframeTrackingExtension *frameTracking; #endif #ifdef __DRI_MEDIA_STREAM_COUNTER - __DRImediaStreamCounterExtension *msc; + const __DRImediaStreamCounterExtension *msc; +#endif + +#ifdef __DRI_TEX_BUFFER + const __DRItexBufferExtension *texBuffer; #endif #endif @@ -555,6 +567,7 @@ struct __GLXdisplayPrivateRec { * Per display direct rendering interface functions and data. */ __GLXDRIdisplay *driDisplay; + __GLXDRIdisplay *dri2Display; #endif }; @@ -720,7 +733,8 @@ extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, #ifdef GLX_DIRECT_RENDERING GLboolean -__driGetMscRateOML(__DRIdrawable *draw, int32_t *numerator, int32_t *denominator); +__driGetMscRateOML(__DRIdrawable *draw, + int32_t *numerator, int32_t *denominator, void *private); #endif #endif /* !__GLX_client_h__ */ |