[Mesa3d-dev] [xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid.

Francisco Jerez currojerez at riseup.net
Mon Feb 8 10:41:19 PST 2010


Keith Whitwell <keithw at vmware.com> writes:

> Francisco,
>
> Will Mesa continue to build after these changes for people who have not
> tracked the latest glproto and dri2proto repos?  
>
> I'd prefer to be able to build Mesa on at least the most recently
> released major distros, which may require the use of some #ifdefs in the
> changes.
>
That's one of the reasons of the last rebase, see the comments in "[mesa
patch v4 1/3] dri2: Event driven buffer validation.".

> Keith
>
> On Mon, 2010-02-08 at 10:25 -0800, Francisco Jerez wrote:
>> Signed-off-by: Francisco Jerez <currojerez at riseup.net>
>> ---
>>  glx/glxdri2.c |   28 +++++++++++++++++++++++++---
>>  1 files changed, 25 insertions(+), 3 deletions(-)
>> 
>> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
>> index 0f998de..dae7b42 100644
>> --- a/glx/glxdri2.c
>> +++ b/glx/glxdri2.c
>> @@ -67,6 +67,7 @@ struct __GLXDRIscreen {
>>  
>>      xf86EnterVTProc	*enterVT;
>>      xf86LeaveVTProc	*leaveVT;
>> +    PreConfigureWindowProcPtr PreConfigureWindow;
>>  
>>      const __DRIcoreExtension *core;
>>      const __DRIdri2Extension *dri2;
>> @@ -217,13 +218,13 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
>>      __GLXDRIscreen *screen = priv->screen;
>>      CARD64 unused;
>>  
>> -    if (screen->flush)
>> -	(*screen->flush->flushInvalidate)(priv->driDrawable);
>> -
>>      if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
>>  			__glXdriSwapEvent, drawable->pDraw) != Success)
>>  	return FALSE;
>>  
>> +    if (screen->flush)
>> +	(*screen->flush->invalidate)(priv->driDrawable);
>> +
>>      return TRUE;
>>  }
>>  
>> @@ -607,6 +608,24 @@ glxDRILeaveVT (int index, int flags)
>>  }
>>  
>>  static void
>> +glxDRIPreConfigureWindow(WindowPtr pWin, int x, int y, int w, int h, int bw,
>> +			 WindowPtr pSib)
>> +{
>> +    ScreenPtr pScreen = pWin->drawable.pScreen;
>> +    __GLXDRIscreen *screen = (__GLXDRIscreen *)glxGetScreen(pScreen);
>> +    __GLXDRIdrawable *draw = (__GLXDRIdrawable *)glxGetDrawableFromWindow(pWin);
>> +
>> +    if (screen->PreConfigureWindow)
>> +	    (*screen->PreConfigureWindow)(pWin, x, y, w, h, bw, pSib);
>> +
>> +    if (!draw || (draw->height == h && draw->width == w))
>> +	    return;
>> +
>> +    if (screen->flush)
>> +	    screen->flush->invalidate(draw->driDrawable);
>> +}
>> +
>> +static void
>>  initializeExtensions(__GLXDRIscreen *screen)
>>  {
>>      const __DRIextension **extensions;
>> @@ -782,6 +801,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
>>      screen->leaveVT = pScrn->LeaveVT;
>>      pScrn->LeaveVT = glxDRILeaveVT;
>>  
>> +    screen->PreConfigureWindow = pScreen->PreConfigureWindow;
>> +    pScreen->PreConfigureWindow = glxDRIPreConfigureWindow;
>> +
>>      LogMessage(X_INFO,
>>  	       "AIGLX: Loaded and initialized %s\n", filename);
>>  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20100208/50a498f4/attachment.pgp 


More information about the xorg-devel mailing list