check dri2 drawable: avoid to increase the invalidate events 2.1b_release accepted/tizen_2.1/20130425.024014 submit/tizen_2.1/20130424.235105
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 15 Apr 2013 10:05:04 +0000 (19:05 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 15 Apr 2013 10:22:20 +0000 (19:22 +0900)
Change-Id: I7031fc398221c504bfcac66f3686d7b1e07f4a4c

hw/xfree86/dri2/dri2.c
packaging/xorg-x11-server.spec

index c3ee839..2f90fed 100755 (executable)
@@ -307,6 +307,21 @@ DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id)
     return NULL;
 }
 
+#ifdef _F_DRI2_FIX_INVALIDATE
+static DRI2DrawableRefPtr
+DRI2LookupDrawableRefByClient(DRI2DrawablePtr pPriv, XID id, ClientPtr client)
+{
+    DRI2DrawableRefPtr ref;
+
+    xorg_list_for_each_entry(ref, &pPriv->reference_list, link) {
+        if ((ref->id == id) && (client->index == CLIENT_ID(ref->dri2_id)))
+            return ref;
+    }
+
+    return NULL;
+}
+#endif
+
 static int
 DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
                    DRI2InvalidateProcPtr invalidate, void *priv)
@@ -352,6 +367,10 @@ DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id,
         pPriv = DRI2AllocateDrawable(pDraw);
     if (pPriv == NULL)
         return BadAlloc;
+#ifdef _F_DRI2_FIX_INVALIDATE
+    if (DRI2LookupDrawableRefByClient(pPriv, id, client))
+        return Success;
+#endif
 
     pPriv->prime_id = dri2_client->prime_id;
 
index 1993609..ee08d4b 100755 (executable)
@@ -1,7 +1,7 @@
 Name:      xorg-x11-server
 Summary:    X.Org X11 X server
 Version:    1.13.0
-Release:    10
+Release:    11
 Group:      System/X11
 License:    MIT
 URL:        http://www.x.org
@@ -186,6 +186,7 @@ drivers, input drivers, or other X modules should install this package.
                -D_F_DRI2_SWAP_REGION_ \
                -D_F_NOT_USE_SW_CURSOR_ \
                -D_F_DPMS_PHONE_CTRL_ \
+               -D_F_DRI2_FIX_INVALIDATE \
         " \
        CPPFLAGS="${CPPFLAGS} "