__DRIcontextPrivate * driContextPriv,
void *sharedContextPrivate)
{
- struct dd_function_table functions;
-
struct intel_context *intel = CALLOC_STRUCT(intel_context);
+#if 0
+ struct dd_function_table functions;
GLcontext *ctx = &intel->ctx;
-
GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
+#endif
+
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
drmI830Sarea *saPriv = intelScreen->sarea;
int fthrottle_mode;
GLboolean havePools;
+#if 0
intelInitDriverFunctions(&functions);
if (!_mesa_initialize_context(&intel->ctx,
mesaVis, shareCtx,
&functions, (void *) intel))
return GL_FALSE;
+#endif
driContextPriv->driverPrivate = intel;
intel->intelScreen = intelScreen;
/* Disable imaging extension until convolution is working in
* teximage paths:
*/
+#if 0
driInitExtensions(ctx, card_extensions,
/* GL_TRUE, */
GL_FALSE);
+#endif
+#if 0
if (intel->ctx.Mesa_DXTn) {
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
_mesa_enable_extension(ctx, "GL_S3_s3tc");
else if (driQueryOptionb(&intel->optionCache, "force_s3tc_enable")) {
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
}
+#endif
#ifdef DEBUG
__intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
}
}
+#if 0
st_create_context( &intel->ctx, intel->pipe );
+#else
+ intel->st = st_create_context2(intel->pipe, mesaVis, NULL);
+ intel->st->ctx->DriverCtx = intel;
+#endif
return GL_TRUE;
}
{
struct intel_context *intel =
(struct intel_context *) driContextPriv->driverPrivate;
+ GLcontext *ctx = intel->st->ctx;
assert(intel); /* should never be null */
if (intel) {
//intel->vtbl.destroy(intel);
- release_texture_heaps = (intel->ctx.Shared->RefCount == 1);
+ release_texture_heaps = (ctx->Shared->RefCount == 1);
intel_batchbuffer_free(intel->batch);
*/
}
+#if 0
/* free the Mesa context data */
- _mesa_free_context_data(&intel->ctx);
+ _mesa_free_context_data(ctx);
st_destroy_context(intel->ctx.st);
+#else
+ st_destroy_context2(intel->st);
+#endif
}
}
struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate;
/* XXX UnbindContext is called AFTER the new context is made current.
Hopefully shouldn't be a problem ? */
- FLUSH_VERTICES((&intel->ctx), 0);
- intelFlush(&intel->ctx);
+ GLcontext *ctx = intel->st->ctx;
+ FLUSH_VERTICES(ctx, 0);
+ intelFlush(ctx);
return GL_TRUE;
}
/**
* Copied/modified from drirenderbuffer.c
*/
-static void
-updateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
+void
+intelUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
{
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
struct intel_framebuffer *intel_fb =
(struct intel_framebuffer *) driDrawPriv->driverPrivate;
GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate;
+ GLcontext *ctx = intel->st->ctx;
/* this is a hack so we have a valid context when the region allocation
is done. Need a per-screen context? */
intel->intelScreen->dummyctxptr = intel;
/* update GLframebuffer size to match window if needed */
- updateFramebufferSize(&intel->ctx, driDrawPriv);
+ intelUpdateFramebufferSize(ctx, driDrawPriv);
if (driReadPriv != driDrawPriv) {
- updateFramebufferSize(&intel->ctx, driReadPriv);
+ intelUpdateFramebufferSize(ctx, driReadPriv);
}
- _mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
+ _mesa_make_current(ctx, &intel_fb->Base, readFb);
/* The drawbuffer won't always be updated by _mesa_make_current:
*/
- if (intel->ctx.DrawBuffer == &intel_fb->Base) {
+ if (ctx->DrawBuffer == &intel_fb->Base) {
if (intel->driDrawable != driDrawPriv) {
if (driDrawPriv->pdraw->swap_interval == (unsigned)-1) {
#include "intel_swapbuffers.h"
#include "intel_batchbuffer.h"
#include "intel_reg.h"
+#include "intel_winsys.h"
#include "context.h"
#include "utils.h"
#include "drirenderbuffer.h"
#include "vblank.h"
#include "pipe/p_context.h"
+#include "state_tracker/st_context.h"
#include "state_tracker/st_cb_fbo.h"
/* if this drawable isn't currently bound the LOCK_HARDWARE done on the
current context (which is what intelScreenContext should return) might
not get a contended lock and thus cliprects not updated (tests/manywin) */
- if ((struct intel_context *)dPriv->driContextPriv->driverPrivate != intel)
- DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv);
+ if ((struct intel_context *)dPriv->driContextPriv->driverPrivate != intel)
+ DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv);
if (dPriv && dPriv->numClipRects) {
DRM_BO_MASK_MEM | DRM_BO_FLAG_WRITE, 0);
OUT_BATCH((sbox.y1 << 16) | sbox.x1);
OUT_BATCH((srcpitch * cpp) & 0xffff);
- OUT_RELOC(backRegion->buffer, DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ OUT_RELOC(dri_bo(backRegion->buffer),
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ, 0);
ADVANCE_BATCH();
void
intelWindowMoved(struct intel_context *intel)
{
- GLcontext *ctx = &intel->ctx;
+ GLcontext *ctx = intel->st->ctx;
__DRIdrawablePrivate *dPriv = intel->driDrawable;
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
- if (!intel->ctx.DrawBuffer) {
+ if (!intel->st->ctx->DrawBuffer) {
/* when would this happen? -BP */
assert(0);
intel->numClipRects = 0;
}
/* Update Mesa's notion of window size */
- driUpdateFramebufferSize(ctx, dPriv);
+ intelUpdateFramebufferSize(ctx, dPriv);
intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
{
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
struct intel_context *intel =
(struct intel_context *) dPriv->driContextPriv->driverPrivate;
- GLcontext *ctx = &intel->ctx;
+ GLcontext *ctx = intel->st->ctx;
if (ctx->Visual.doubleBufferMode) {
drm_clip_rect_t rect;