]> git.draconx.ca Git - gentoo-draconx.git/blob - media-libs/mesa/files/0001-glx-Only-call-DRI2-invalidate-when-necessary.patch
3ea35d7d0e2878c9122bec7e02eacbdb22c47896
[gentoo-draconx.git] / media-libs / mesa / files / 0001-glx-Only-call-DRI2-invalidate-when-necessary.patch
1 From 2d00d16da7f5d2255cb37b48edaf4cbb9ca7e930 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= <krh@bitplanet.net>
3 Date: Mon, 10 May 2010 15:51:31 -0400
4 Subject: [PATCH] glx: Only call DRI2 invalidate when necessary
5
6 We only need this when the server may have swapped the buffers or
7 when we receive an invalidate event from the server.  The default
8 behaviour is still that the DRI driver will invalidate its own buffers
9 when glViewport is called.
10
11 https://bugs.freedesktop.org/show_bug.cgi?id=27277
12 ---
13  src/glx/dri2_glx.c |   16 ++++------------
14  1 files changed, 4 insertions(+), 12 deletions(-)
15
16 diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
17 index 6058c72..ca2a753 100644
18 --- a/src/glx/dri2_glx.c
19 +++ b/src/glx/dri2_glx.c
20 @@ -359,14 +359,6 @@ dri2WaitGL(__GLXDRIdrawable * pdraw)
21  static void
22  dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate)
23  {
24 -   __GLXDRIdrawablePrivate *pdraw = loaderPrivate;
25 -   __GLXdisplayPrivate *priv = __glXInitialize(pdraw->base.psc->dpy);
26 -   __GLXDRIdisplayPrivate *pdp = (__GLXDRIdisplayPrivate *)priv->dri2Display;
27 -
28 -   /* Old servers don't send invalidate events */
29 -   if (!pdp->invalidateAvailable)
30 -       dri2InvalidateBuffers(priv->dpy, pdraw->base.drawable);
31 -
32     dri2WaitGL(loaderPrivate);
33  }
34  
35 @@ -427,16 +419,16 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
36         (*pdraw->psc->f->flush)(pdraw->driDrawable);
37  #endif
38  
39 -    /* Old servers don't send invalidate events */
40 -    if (!pdp->invalidateAvailable)
41 -       dri2InvalidateBuffers(dpyPriv->dpy, pdraw->drawable);
42 -
43      /* Old servers can't handle swapbuffers */
44      if (!pdp->swapAvailable) {
45         dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height);
46         return 0;
47      }
48  
49 +    /* Old servers don't send invalidate events */
50 +    if (!pdp->invalidateAvailable)
51 +       dri2InvalidateBuffers(dpyPriv->dpy, pdraw->drawable);
52 +
53  #ifdef X_DRI2SwapBuffers
54      DRI2SwapBuffers(pdraw->psc->dpy, pdraw->xDrawable, target_msc, divisor,
55                     remainder, &ret);
56 -- 
57 1.6.4.4
58