summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915tex
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2007-07-18 15:18:43 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2007-07-18 15:18:43 +0200
commitccb713cdb8831617880ac71ac357361b586d05c6 (patch)
tree99e224dc73899baaceecfa5e79932cfae5360409 /src/mesa/drivers/dri/i915tex
parentc5a8bc712542d24a035aa8fe58cf3c28c7c6fbd1 (diff)
swapbuffers with non-current contexts, cleanups
manywin got broken (when intelPageflip got no longer called). Make sure that intelFlush is getting called when a context gets unbound, to handle later swapbuffer calls on that context's drawable better. Related, fix non-current cliprects getting used on unbound drawables.
Diffstat (limited to 'src/mesa/drivers/dri/i915tex')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_blit.c6
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.c13
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.c13
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_context.h2
4 files changed, 17 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_blit.c b/src/mesa/drivers/dri/i915tex/intel_blit.c
index 3ecd2e8e48..28441f4b83 100644
--- a/src/mesa/drivers/dri/i915tex/intel_blit.c
+++ b/src/mesa/drivers/dri/i915tex/intel_blit.c
@@ -78,6 +78,12 @@ intelCopyBuffer(__DRIdrawablePrivate * dPriv,
* should work regardless.
*/
LOCK_HARDWARE(intel);
+ /* 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 (dPriv && dPriv->numClipRects) {
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
index bcd99106b9..0ecf3aa1d4 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -356,7 +356,8 @@ intelClearWithTris(struct intel_context *intel, GLbitfield mask)
/* XXX: Using INTEL_BATCH_NO_CLIPRECTS here is dangerous as the
* drawing origin may not be correctly emitted.
*/
- intel_meta_draw_quad(intel, clear.x1, clear.x2, clear.y1, clear.y2, intel->ctx.Depth.Clear, clearColor, 0, 0, 0, 0); /* texcoords */
+ intel_meta_draw_quad(intel, clear.x1, clear.x2, clear.y1, clear.y2,
+ intel->ctx.Depth.Clear, clearColor, 0, 0, 0, 0); /* texcoords */
mask &=
~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH);
@@ -991,16 +992,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
/**
** Release old regions, reference new regions
**/
-#if 0 /* XXX FBO: this seems to be redundant with i915_state_draw_region() */
- if (intel->draw_region != colorRegion) {
- intel_region_release(&intel->draw_region);
- intel_region_reference(&intel->draw_region, colorRegion);
- }
- if (intel->intelScreen->depth_region != depthRegion) {
- intel_region_release(&intel->intelScreen->depth_region);
- intel_region_reference(&intel->intelScreen->depth_region, depthRegion);
- }
-#endif
intel->vtbl.set_draw_region(intel, colorRegion, depthRegion);
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c
index 527b33f4af..5acfd923b9 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.c
+++ b/src/mesa/drivers/dri/i915tex/intel_context.c
@@ -569,6 +569,9 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
GLboolean
intelUnbindContext(__DRIcontextPrivate * driContextPriv)
{
+ struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate;
+ FLUSH_VERTICES((&intel->ctx), 0);
+ intelFlush(&intel->ctx);
return GL_TRUE;
}
@@ -616,14 +619,16 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
(*dri_interface->getUST) (&intel_fb->swap_ust);
driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
&intel_fb->vbl_seq);
+ }
+ }
+
+ if ((intel->driDrawable != driDrawPriv) ||
+ (intel->lastStamp != driDrawPriv->lastStamp)) {
intel->driDrawable = driDrawPriv;
intelWindowMoved(intel);
intel->lastStamp = driDrawPriv->lastStamp;
- }
- else if (intel->lastStamp != driDrawPriv->lastStamp) {
- intel_draw_buffer(&intel->ctx, &intel_fb->Base);
- }
}
+
}
else {
_mesa_make_current(NULL, NULL, NULL);
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
index 5c8e277799..628a15f8de 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.h
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -247,8 +247,6 @@ struct intel_context
drm_clip_rect_t *pClipRects;
drm_clip_rect_t fboRect; /**< cliprect for rendering */
- int perf_boxes;
-
GLuint do_usleeps;
int do_irqs;
GLuint irqsEmitted;