X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fcommon%2Fdri_util.h;h=900f04853a73498d6a388572429ad9ae95b86094;hb=bdf13dc8324c391b7d34f8bdaea72c4452ab7edb;hp=af012f150103ef2fbfb3f6d3c3bbe6ec762b3208;hpb=875a757ddd103722cfe9a2b21035024aa5a23d32;p=mesa.git diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index af012f15010..900f04853a7 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -44,6 +44,12 @@ * \author Brian Paul */ +/** + * The following structs are shared between DRISW and DRI2, the DRISW structs + * are essentially base classes of the DRI2 structs. DRISW needs to compile on + * platforms without DRM, so keep the structs opaque to DRM. + */ + #ifndef _DRI_UTIL_H_ #define _DRI_UTIL_H_ @@ -52,11 +58,11 @@ #include "main/mtypes.h" #include "xmlconfig.h" - /** * Extensions. */ extern const __DRIcoreExtension driCoreExtension; +extern const __DRIswrastExtension driSWRastExtension; extern const __DRIdri2Extension driDRI2Extension; extern const __DRI2configQueryExtension dri2ConfigQueryExtension; @@ -78,6 +84,10 @@ struct __DriverAPIRec { GLboolean (*CreateContext)(gl_api api, const struct gl_config *glVis, __DRIcontext *driContextPriv, + unsigned major_version, + unsigned minor_version, + uint32_t flags, + unsigned *error, void *sharedContextPrivate); void (*DestroyContext)(__DRIcontext *driContextPriv); @@ -109,59 +119,54 @@ extern const struct __DriverAPIRec driDriverAPI; /** - * Per-drawable private DRI driver information. + * Per-screen private driver information. */ -struct __DRIdrawableRec { +struct __DRIscreenRec { /** - * Driver's private drawable information. - * - * This structure is opaque. + * Current screen's number */ - void *driverPrivate; + int myNum; /** - * Private data from the loader. We just hold on to it and pass - * it back when calling into loader provided functions. + * File descriptor returned when the kernel device driver is opened. + * + * Used to: + * - authenticate client to kernel + * - map the frame buffer, SAREA, etc. + * - close the kernel device driver */ - void *loaderPrivate; + int fd; /** - * Reference count for number of context's currently bound to this - * drawable. - * - * Once it reaches zero, the drawable can be destroyed. - * - * \note This behavior will change with GLX 1.3. + * DRM (kernel module) version information. */ - int refcount; + __DRIversion drm_version; /** - * Last value of the stamp. - * - * If this differs from the value stored at __DRIdrawable::dri2.stamp, - * then the drawable information has been modified by the X server, and the - * drawable information (below) should be retrieved from the X server. + * Device-dependent private information (not stored in the SAREA). + * + * This pointer is never touched by the DRI layer. */ - unsigned int lastStamp; + void *driverPrivate; - int w, h; + void *loaderPrivate; - /** - * Pointer to context to which this drawable is currently bound. - */ - __DRIcontext *driContextPriv; + const __DRIextension **extensions; - /** - * Pointer to screen on which this drawable was created. - */ - __DRIscreen *driScreenPriv; + const __DRIswrastLoaderExtension *swrast_loader; - /** - * Drawable timestamp. Increased when the loader calls invalidate. - */ struct { - unsigned int stamp; + /* Flag to indicate that this is a DRI2 screen. Many of the above + * fields will not be valid or initializaed in that case. */ + __DRIdri2LoaderExtension *loader; + __DRIimageLookupExtension *image; + __DRIuseInvalidateExtension *useInvalidate; } dri2; + + driOptionCache optionInfo; + driOptionCache optionCache; + + unsigned int api_mask; }; /** @@ -173,6 +178,11 @@ struct __DRIcontextRec { */ void *driverPrivate; + /** + * The loaders's private context data. This structure is opaque. + */ + void *loaderPrivate; + /** * Pointer to drawable currently bound to this context for drawing. */ @@ -188,11 +198,6 @@ struct __DRIcontextRec { */ __DRIscreen *driScreenPriv; - /** - * The loaders's private context data. This structure is opaque. - */ - void *loaderPrivate; - struct { int draw_stamp; int read_stamp; @@ -200,54 +205,59 @@ struct __DRIcontextRec { }; /** - * Per-screen private driver information. + * Per-drawable private DRI driver information. */ -struct __DRIscreenRec { +struct __DRIdrawableRec { /** - * Current screen's number + * Driver's private drawable information. + * + * This structure is opaque. */ - int myNum; + void *driverPrivate; /** - * File descriptor returned when the kernel device driver is opened. - * - * Used to: - * - authenticate client to kernel - * - map the frame buffer, SAREA, etc. - * - close the kernel device driver + * Private data from the loader. We just hold on to it and pass + * it back when calling into loader provided functions. */ - int fd; + void *loaderPrivate; /** - * DRM (kernel module) version information. + * Pointer to context to which this drawable is currently bound. */ - __DRIversion drm_version; + __DRIcontext *driContextPriv; /** - * Device-dependent private information (not stored in the SAREA). - * - * This pointer is never touched by the DRI layer. + * Pointer to screen on which this drawable was created. */ - void *driverPrivate; + __DRIscreen *driScreenPriv; - void *loaderPrivate; + /** + * Reference count for number of context's currently bound to this + * drawable. + * + * Once it reaches zero, the drawable can be destroyed. + * + * \note This behavior will change with GLX 1.3. + */ + int refcount; - const __DRIextension **extensions; + /** + * Last value of the stamp. + * + * If this differs from the value stored at __DRIdrawable::dri2.stamp, + * then the drawable information has been modified by the X server, and the + * drawable information (below) should be retrieved from the X server. + */ + unsigned int lastStamp; - const __DRIswrastLoaderExtension *swrast_loader; + int w, h; + /** + * Drawable timestamp. Increased when the loader calls invalidate. + */ struct { - /* Flag to indicate that this is a DRI2 screen. Many of the above - * fields will not be valid or initializaed in that case. */ - __DRIdri2LoaderExtension *loader; - __DRIimageLookupExtension *image; - __DRIuseInvalidateExtension *useInvalidate; + unsigned int stamp; } dri2; - - driOptionCache optionInfo; - driOptionCache optionCache; - - unsigned int api_mask; }; extern void