projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
i965/vs: Allocate register set once at context creation.
[mesa.git]
/
src
/
mesa
/
drivers
/
dri
/
common
/
dri_util.h
diff --git
a/src/mesa/drivers/dri/common/dri_util.h
b/src/mesa/drivers/dri/common/dri_util.h
index 38394a7fefa7e52d6f6614a8346b4cffa0983671..900f04853a73498d6a388572429ad9ae95b86094 100644
(file)
--- a/
src/mesa/drivers/dri/common/dri_util.h
+++ b/
src/mesa/drivers/dri/common/dri_util.h
@@
-44,24
+44,25
@@
* \author Brian Paul <brian@precisioninsight.com>
*/
* \author Brian Paul <brian@precisioninsight.com>
*/
+/**
+ * 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_
#include <GL/gl.h>
#ifndef _DRI_UTIL_H_
#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 "main/mtypes.h"
-#include "GL/internal/dri_interface.h"
-
-#define GLX_BAD_CONTEXT 5
+#include "xmlconfig.h"
/**
* Extensions.
*/
extern const __DRIcoreExtension driCoreExtension;
/**
* Extensions.
*/
extern const __DRIcoreExtension driCoreExtension;
+extern const __DRIswrastExtension driSWRastExtension;
extern const __DRIdri2Extension driDRI2Extension;
extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
extern const __DRIdri2Extension driDRI2Extension;
extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
@@
-76,56
+77,41
@@
extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
* this structure.
*/
struct __DriverAPIRec {
* this structure.
*/
struct __DriverAPIRec {
- /**
- * Screen destruction callback
- */
+ const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
+
void (*DestroyScreen)(__DRIscreen *driScrnPriv);
void (*DestroyScreen)(__DRIscreen *driScrnPriv);
- /**
- * Context creation callback
- */
GLboolean (*CreateContext)(gl_api api,
GLboolean (*CreateContext)(gl_api api,
- const struct gl_config *glVis,
- __DRIcontext *driContextPriv,
+ const struct gl_config *glVis,
+ __DRIcontext *driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
void *sharedContextPrivate);
void *sharedContextPrivate);
- /**
- * Context destruction callback
- */
void (*DestroyContext)(__DRIcontext *driContextPriv);
void (*DestroyContext)(__DRIcontext *driContextPriv);
- /**
- * Buffer (drawable) creation callback
- */
GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
__DRIdrawable *driDrawPriv,
const struct gl_config *glVis,
GLboolean pixmapBuffer);
GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
__DRIdrawable *driDrawPriv,
const struct gl_config *glVis,
GLboolean pixmapBuffer);
-
- /**
- * Buffer (drawable) destruction callback
- */
+
void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
- /**
- * Context activation callback
- */
+ void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
+
GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
__DRIdrawable *driDrawPriv,
__DRIdrawable *driReadPriv);
GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
__DRIdrawable *driDrawPriv,
__DRIdrawable *driReadPriv);
- /**
- * Context unbinding callback
- */
GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
- /* DRI2 Entry point */
- const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
-
__DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
__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 (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
};
@@
-133,59
+119,54
@@
extern const struct __DriverAPIRec driDriverAPI;
/**
/**
- * Per-
drawable private DRI
driver information.
+ * Per-
screen private
driver information.
*/
*/
-struct __DRI
drawable
Rec {
+struct __DRI
screen
Rec {
/**
/**
- * 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 {
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;
} dri2;
+
+ driOptionCache optionInfo;
+ driOptionCache optionCache;
+
+ unsigned int api_mask;
};
/**
};
/**
@@
-197,6
+178,11
@@
struct __DRIcontextRec {
*/
void *driverPrivate;
*/
void *driverPrivate;
+ /**
+ * The loaders's private context data. This structure is opaque.
+ */
+ void *loaderPrivate;
+
/**
* Pointer to drawable currently bound to this context for drawing.
*/
/**
* Pointer to drawable currently bound to this context for drawing.
*/
@@
-212,11
+198,6
@@
struct __DRIcontextRec {
*/
__DRIscreen *driScreenPriv;
*/
__DRIscreen *driScreenPriv;
- /**
- * The loaders's private context data. This structure is opaque.
- */
- void *loaderPrivate;
-
struct {
int draw_stamp;
int read_stamp;
struct {
int draw_stamp;
int read_stamp;
@@
-224,62
+205,65
@@
struct __DRIcontextRec {
};
/**
};
/**
- * Per-
screen private
driver information.
+ * Per-
drawable private DRI
driver information.
*/
*/
-struct __DRI
screen
Rec {
+struct __DRI
drawable
Rec {
/**
/**
- * Current screen's number
+ * Driver's private drawable information.
+ *
+ * This structure is opaque.
*/
*/
-
int myNum
;
+
void *driverPrivate
;
/**
/**
- * Callback functions into the hardware-specific DRI driver code.
+ * Private data from the loader. We just hold on to it and pass
+ * it back when calling into loader provided functions.
*/
*/
-
struct __DriverAPIRec DriverAPI
;
+
void *loaderPrivate
;
- const __DRIextension **extensions;
+ /**
+ * Pointer to context to which this drawable is currently bound.
+ */
+ __DRIcontext *driContextPriv;
/**
/**
- *
DRM (kernel module) version information
.
+ *
Pointer to screen on which this drawable was created
.
*/
*/
- __DRI
version drm_version
;
+ __DRI
screen *driScreenPriv
;
/**
/**
- *
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
+ *
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
fd
;
+ int
refcount
;
/**
/**
- * Device-dependent private information (not stored in the SAREA).
- *
- * This pointer is never touched by the DRI layer.
+ * 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.
*/
*/
-#ifdef __cplusplus
- void *priv;
-#else
- void *private;
-#endif
+ unsigned int lastStamp;
+
+ int w, h;
+ /**
+ * Drawable timestamp. Increased when the loader calls invalidate.
+ */
struct {
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;
} dri2;
-
- driOptionCache optionInfo;
- driOptionCache optionCache;
- unsigned int api_mask;
- void *loaderPrivate;
};
extern void
dri2InvalidateDrawable(__DRIdrawable *drawable);
};
extern void
dri2InvalidateDrawable(__DRIdrawable *drawable);
+extern void
+driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv);
+
#endif /* _DRI_UTIL_H_ */
#endif /* _DRI_UTIL_H_ */