From 61d26bc82e7c4100acfb551cbb0ba9d84bbc4ba5 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 8 Feb 2010 19:27:56 +0100 Subject: dri2: Event driven buffer validation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a buffer invalidation event is received from the X server, the "invalidate" hook of the DRI2 flush extension is executed: A generic implementation (dri2InvalidateDrawable) is provided that just bumps the "pStamp" sequence number in __DRIdrawableRec. For old servers not supporting buffer invalidation events, the invalidate hook will be called before flushing the fake front/back buffer (that's typically once per frame -- not a lot worse than the situation we were in before). No effort has been made on preserving backwards compatibility with version 2 of the flush extension, but I think it's acceptable because AFAIK no released stack is making use of it. Signed-off-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_screen.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/intel/intel_screen.c') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index f7ce87e063..8eed8ee737 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -123,22 +123,19 @@ intelDRI2Flush(__DRIdrawable *drawable) } static void -intelDRI2FlushInvalidate(__DRIdrawable *drawable) +intelDRI2Invalidate(__DRIdrawable *drawable) { struct intel_context *intel = drawable->driContextPriv->driverPrivate; intel->using_dri2_swapbuffers = GL_TRUE; - - intelDRI2Flush(drawable); - drawable->validBuffers = GL_FALSE; - + dri2InvalidateDrawable(drawable); intel_update_renderbuffers(intel->driContext, drawable); } static const struct __DRI2flushExtensionRec intelFlushExtension = { { __DRI2_FLUSH, __DRI2_FLUSH_VERSION }, intelDRI2Flush, - intelDRI2FlushInvalidate, + intelDRI2Invalidate, }; static const __DRIextension *intelScreenExtensions[] = { -- cgit v1.2.3