xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Mon Jun 7 11:28:12 PDT 2010


 hw/xfree86/dri2/dri2.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit fdb081b430ddffb495aa5b05bcc4cf10882ff4b2
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Jun 7 00:54:18 2010 -0700

    dri2: Deal with input-only windows by using WindowDrawable()
    
    Input only windows aren't DRAWABLE_WINDOW, but casting them to a
    PixmapPtr is a bit harsh, and unlikely to get the appropriate privates
    structure. use WindowDrawable instead which checks for both
    input-output and input-only windows.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Tested-by: Eric Anholt <eric at anholt.net>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index baa6706..d33b0d1 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -118,7 +118,7 @@ DRI2GetDrawable(DrawablePtr pDraw)
     WindowPtr pWin;
     PixmapPtr pPixmap;
 
-    if (pDraw->type == DRAWABLE_WINDOW) {
+    if (WindowDrawable(pDraw->type)) {
 	pWin = (WindowPtr) pDraw;
 	return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey);
     } else {
@@ -161,7 +161,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
     pPriv->last_swap_ust = 0;
     list_init(&pPriv->reference_list);
 
-    if (pDraw->type == DRAWABLE_WINDOW) {
+    if (WindowDrawable(pDraw->type)) {
 	pWin = (WindowPtr) pDraw;
 	dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv);
     } else {
@@ -272,7 +272,7 @@ static int DRI2DrawableGone(pointer p, XID id)
 	return Success;
 
     pDraw = pPriv->drawable;
-    if (pDraw->type == DRAWABLE_WINDOW) {
+    if (WindowDrawable(pDraw->type)) {
 	pWin = (WindowPtr) pDraw;
 	dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, NULL);
     } else {
@@ -411,12 +411,12 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 	    need_real_front--;
 	    front_format = format;
 
-	    if (pDraw->type == DRAWABLE_WINDOW) {
+	    if (WindowDrawable(pDraw->type)) {
 		need_fake_front++;
 	    }
 	}
 
-	if (pDraw->type == DRAWABLE_WINDOW) {
+	if (WindowDrawable(pDraw->type)) {
 	    if (attachment == DRI2BufferFakeFrontLeft) {
 		need_fake_front--;
 		have_fake_front = 1;


More information about the xorg-commit mailing list