{ NULL, NULL }
};
-static const struct dri_extension arb_oc_extension =
+const struct dri_extension arb_oc_extension =
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions};
+void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
+{
+ struct intel_context *intel = ctx?intel_context(ctx):NULL;
+ driInitExtensions(ctx, card_extensions, enable_imaging);
+ if (!ctx || intel->intelScreen->drmMinor >= 8)
+ driInitSingleExtension (ctx, &arb_oc_extension);
+}
+
static const struct dri_debug_control debug_control[] =
{
{ "fall", DEBUG_FALLBACKS },
intelBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
{
struct intel_context *intel = intel_context( ctx );
- GLuint64EXT tmp = 0;
drmI830MMIO io = {
.read_write = MMIO_WRITE,
.reg = MMIO_REGS_PS_DEPTH_COUNT,
- .data = &tmp
+ .data = &q->Result
};
intel->stats_wm = GL_TRUE;
intelFinish(&intel->ctx);
- drmCommandWrite(intel->driFd, DRM_I830_MMIO, &io, sizeof(io));
+ drmCommandRead(intel->driFd, DRM_I830_MMIO, &io, sizeof(io));
}
static void
intelEndQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
{
struct intel_context *intel = intel_context( ctx );
+ GLuint64EXT tmp;
drmI830MMIO io = {
.read_write = MMIO_READ,
.reg = MMIO_REGS_PS_DEPTH_COUNT,
- .data = &q->Result
+ .data = &tmp
};
intelFinish(&intel->ctx);
drmCommandRead(intel->driFd, DRM_I830_MMIO, &io, sizeof(io));
+ q->Result = tmp - q->Result;
q->Ready = GL_TRUE;
intel->stats_wm = GL_FALSE;
}
_mesa_printf("IRQs not active. Exiting\n");
exit(1);
}
-
- driInitExtensions( ctx, card_extensions,
- GL_TRUE );
-
- if (intel->intelScreen->drmMinor >= 8)
- driInitSingleExtension (ctx, &arb_oc_extension);
+ intelInitExtensions(ctx, GL_TRUE);
INTEL_DEBUG = driParseDebugString( getenv( "INTEL_DEBUG" ),
debug_control );
_glthread_UNLOCK_MUTEX(lockMutex);
}
+
#include "intel_screen.h"
+#include "intel_context.h"
#include "intel_tex.h"
#include "intel_span.h"
#include "intel_ioctl.h"
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /*USE_NEW_INTERFACE*/
-extern const struct dri_extension card_extensions[];
-
/**
* Map all the memory regions described by the screen.
* \return GL_TRUE if success, GL_FALSE if error.
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
GL_TRUE );
-
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
*
* Hello chicken. Hello egg. How are you two today?
*/
- driInitExtensions( NULL, card_extensions, GL_FALSE );
+ intelInitExtensions(NULL, GL_FALSE);
}
return (void *) psp;