*/
LOCK_HARDWARE(intel);
- if (intel->revalidateDrawable) {
- __DRIscreenPrivate *sPriv = intel->driScreen;
- if (dPriv) {
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
- }
- }
-
if (dPriv && dPriv->numClipRects) {
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
const struct intel_region *frontRegion
UNLOCK_HARDWARE(intel);
- if (intel->revalidateDrawable) {
- intel->revalidateDrawable = GL_FALSE;
- intelWindowMoved(intel);
+ /* XXX this is bogus. The context here may not even be bound to this drawable! */
+ if (intel->lastStamp != dPriv->lastStamp) {
+ GET_CURRENT_CONTEXT(currctx);
+ struct intel_context *intelcurrent = intel_context(currctx);
+ if (intelcurrent == intel && intelcurrent->driDrawable == dPriv) {
+ intelWindowMoved(intel);
+ intel->lastStamp = dPriv->lastStamp;
+ }
}
}
__DRIdrawablePrivate * driDrawPriv,
__DRIdrawablePrivate * driReadPriv)
{
- GLuint updatebufsize = GL_FALSE;
#if 0
if (driDrawPriv) {
}
}
- /* only update GLframebuffer size to match window
- if here for the first time */
- if (intel->ctx.FirstTimeCurrent) {
- updatebufsize = GL_TRUE;
- driUpdateFramebufferSize(&intel->ctx, driDrawPriv);
+ /* update GLframebuffer size to match window if needed */
+ driUpdateFramebufferSize(&intel->ctx, driDrawPriv);
- if (driReadPriv != driDrawPriv) {
- driUpdateFramebufferSize(&intel->ctx, driReadPriv);
- }
+ if (driReadPriv != driDrawPriv) {
+ driUpdateFramebufferSize(&intel->ctx, driReadPriv);
}
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
/* The drawbuffer won't always be updated by _mesa_make_current:
*/
- if (updatebufsize && intel->ctx.DrawBuffer == &intel_fb->Base) {
+ if (intel->ctx.DrawBuffer == &intel_fb->Base) {
if (intel->driDrawable != driDrawPriv) {
intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0)
&intel_fb->vbl_seq);
intel->driDrawable = driDrawPriv;
intelWindowMoved(intel);
+ intel->lastStamp = driDrawPriv->lastStamp;
+ }
+ else if (intel->lastStamp != driDrawPriv->lastStamp) {
+ intel_draw_buffer(&intel->ctx, &intel_fb->Base);
}
-
- intel_draw_buffer(&intel->ctx, &intel_fb->Base);
}
}
else {
* checking must be done *after* this call:
*/
if (dPriv)
- intel->revalidateDrawable = GL_TRUE;
-// DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
if (sarea->width != intelScreen->width ||
sarea->height != intelScreen->height ||
drmI830Sarea *sarea;
GLuint lastStamp;
- GLuint revalidateDrawable;
/**
* Configuration cache
}
-
+#if 0
/**
* Called for each hardware renderbuffer when a _window_ is resized.
* Just update fields.
return GL_TRUE;
}
+#endif
static void
intel_resize_buffers(GLcontext *ctx, struct gl_framebuffer *fb,
}
-
+#if 0
/**
* Create a new intel_renderbuffer which corresponds to an on-screen window,
* not a user-created renderbuffer.
return irb;
}
+#endif
-struct gl_renderbuffer *
-intel_new_renderbuffer_fb(GLcontext * ctx, GLuint intFormat)
+struct intel_renderbuffer *
+intel_new_renderbuffer_fb(GLuint intFormat)
{
struct intel_renderbuffer *irb;
irb = CALLOC_STRUCT(intel_renderbuffer);
if (!irb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ _mesa_error(NULL, GL_OUT_OF_MEMORY, "creating renderbuffer");
return NULL;
}
irb->Base.GetPointer = intel_get_pointer;
/* span routines set in alloc_storage function */
- return &irb->Base;
+ return irb;
}
/**
GLuint vbl_pending; /**< vblank sequence number of pending flip */
};
-
+#if 0
extern struct intel_renderbuffer *intel_create_renderbuffer(GLenum intFormat,
GLsizei width,
GLsizei height,
int pitch,
int cpp,
void *map);
+#endif
+extern struct intel_renderbuffer *intel_new_renderbuffer_fb(GLuint intFormat);
extern void intel_fbo_init(struct intel_context *intel);
/* XXX allocation should only happen in the unusual case
it's actually needed */
intel_fb->color_rb[0]
- = intel_new_renderbuffer_fb(NULL, rgbFormat);
+ = intel_new_renderbuffer_fb(rgbFormat);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT,
&intel_fb->color_rb[0]->Base);
}
if (mesaVis->doubleBufferMode) {
intel_fb->color_rb[1]
- = intel_new_renderbuffer_fb(NULL, rgbFormat);
+ = intel_new_renderbuffer_fb(rgbFormat);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT,
&intel_fb->color_rb[1]->Base);
struct gl_renderbuffer *tmp_rb = NULL;
intel_fb->color_rb[2]
- = intel_new_renderbuffer_fb(NULL, rgbFormat);
+ = intel_new_renderbuffer_fb(rgbFormat);
_mesa_reference_renderbuffer(&tmp_rb, &intel_fb->color_rb[2]->Base);
}
}
if (mesaVis->depthBits == 24 && mesaVis->stencilBits == 8) {
/* combined depth/stencil buffer */
struct intel_renderbuffer *depthStencilRb
- = intel_new_renderbuffer_fb(NULL, GL_DEPTH24_STENCIL8_EXT);
+ = intel_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT);
/* note: bind RB to two attachment points */
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH,
&depthStencilRb->Base);
else if (mesaVis->depthBits == 16) {
/* just 16-bit depth buffer, no hw stencil */
struct intel_renderbuffer *depthRb
- = intel_new_renderbuffer_fb(NULL, GL_DEPTH_COMPONENT16);
+ = intel_new_renderbuffer_fb(GL_DEPTH_COMPONENT16);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, &depthRb->Base);
}
* context at screen creation. For now just use the current context.
*/
-/* GET_CURRENT_CONTEXT(ctx);
+ GET_CURRENT_CONTEXT(ctx);
if (ctx == NULL) {
- _mesa_problem(NULL, "No current context in intelScreenContext\n");
- return NULL;
+/* _mesa_problem(NULL, "No current context in intelScreenContext\n");
+ return NULL; */
+ /* need a context for the first time makecurrent is called (for hw lock
+ when allocating priv buffers) */
+ if (intelScreen->dummyctxptr == NULL) {
+ _mesa_problem(NULL, "No current context in intelScreenContext\n");
+ return NULL;
+ }
+ return intelScreen->dummyctxptr;
}
return intel_context(ctx);
-*/
- if (intelScreen->dummyctxptr == NULL) {
- _mesa_problem(NULL, "No current context in intelScreenContext\n");
- return NULL;
- }
- return intelScreen->dummyctxptr;
}