Maarten Maathuis | 1 Mar 2009 01:36
Picon

[PATCH 3/6] exa: same treatment for FinishAccess.

---
 exa/exa.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 17d75d2..7501b65 100644
--- a/exa/exa.c
+++ b/exa/exa.c
 <at>  <at>  -607,10 +607,11  <at>  <at>  exaFinishAccess(DrawablePtr pDrawable, int index)
     PixmapPtr	    pPixmap = exaGetDrawablePixmap (pDrawable);
     ExaPixmapPriv  (pPixmap);

-    /* Rehide pixmap pointer if we're doing that. */
-    if (pExaPixmap && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
-	pPixmap->devPrivate.ptr = NULL;
-    }
+    if (!pExaPixmap)
+	FatalError("Calling FinishAccess on a pixmap not known to exa.\n");
+
+    /* We always hide the devPrivate.ptr. */
+    pPixmap->devPrivate.ptr = NULL;

     if (pExaScr->info->FinishAccess == NULL)
 	return;
--

-- 
1.6.1.3
Maarten Maathuis | 1 Mar 2009 01:36
Picon

[PATCH 4/6] exa: fix unwrapping of ModifyPixmapHeader upon CloseScreen.

- Cleanup wrapping too.
---
 exa/exa.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 7501b65..81c874b 100644
--- a/exa/exa.c
+++ b/exa/exa.c
 <at>  <at>  -933,6 +933,8  <at>  <at>  exaCloseScreen(int i, ScreenPtr pScreen)
 	unwrap(pExaScr, pScreen, CreatePixmap);
     if (pExaScr->SavedDestroyPixmap)
 	unwrap(pExaScr, pScreen, DestroyPixmap);
+    if (pExaScr->SavedModifyPixmapHeader)
+	unwrap(pExaScr, pScreen, ModifyPixmapHeader);
     unwrap(pExaScr, pScreen, CopyWindow);
     unwrap(pExaScr, pScreen, ChangeWindowAttributes);
     unwrap(pExaScr, pScreen, BitmapToRegion);
 <at>  <at>  -1059,7 +1061,6  <at>  <at>  exaDriverInit (ScreenPtr		pScreen,
 #endif

     pExaScr = xcalloc (sizeof (ExaScreenPrivRec), 1);
-
     if (!pExaScr) {
         LogMessage(X_WARNING, "EXA(%d): Failed to allocate screen private\n",
 		   pScreen->myNum);
 <at>  <at>  -1124,8 +1125,7  <at>  <at>  exaDriverInit (ScreenPtr		pScreen,
 	wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap);
 	wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap);

(Continue reading)

Maarten Maathuis | 1 Mar 2009 01:36
Picon

[PATCH 1/6] exa: simplify exaPixmapIsOffscreen

- This includes properly handling the framebuffer.
---
 exa/exa.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 994a67a..b0a26e9 100644
--- a/exa/exa.c
+++ b/exa/exa.c
 <at>  <at>  -424,6 +424,13  <at>  <at>  exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
         if (devKind > 0)
             pExaPixmap->sys_pitch = devKind;

+	/* Is this the framebuffer (for classic exa)? */
+	if (pPixData && pPixData == pExaScr->info->memoryBase) {
+	    pExaPixmap->fb_ptr = pPixData;
+	    pExaPixmap->fb_pitch = devKind;
+	    pExaPixmap->offscreen = TRUE;
+	}
+
         if (width > 0 && height > 0 && bitsPerPixel > 0) {
             exaSetFbPitch(pExaScr, pExaPixmap,
                           width, height, bitsPerPixel);
 <at>  <at>  -471,22 +478,12  <at>  <at>  exaPixmapIsOffscreen(PixmapPtr p)
     ScreenPtr	pScreen = p->drawable.pScreen;
     ExaScreenPriv(pScreen);
     ExaPixmapPriv(p);
-    void *save_ptr;
     Bool ret;

(Continue reading)

Maarten Maathuis | 1 Mar 2009 01:36
Picon

[PATCH 2/6] exa: clean up some more code

---
 exa/exa.c |   56 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index b0a26e9..17d75d2 100644
--- a/exa/exa.c
+++ b/exa/exa.c
 <at>  <at>  -48,17 +48,6  <at>  <at>  DevPrivateKey exaGCPrivateKey = &exaGCPrivateKeyIndex;
 static ShmFuncs exaShmFuncs = { NULL, NULL };
 #endif

-static _X_INLINE void*
-ExaGetPixmapAddress(PixmapPtr p)
-{
-    ExaPixmapPriv(p);
-
-    if (pExaPixmap->offscreen && pExaPixmap->fb_ptr)
-	return pExaPixmap->fb_ptr;
-    else
-	return pExaPixmap->sys_ptr;
-}
-
 /**
  * exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer of
  * the beginning of the given pixmap.
 <at>  <at>  -73,8 +62,9  <at>  <at>  unsigned long
 exaGetPixmapOffset(PixmapPtr pPix)
 {
     ExaScreenPriv (pPix->drawable.pScreen);
(Continue reading)

Maarten Maathuis | 1 Mar 2009 01:36
Picon

[PATCH 6/6] exa: avoid a potential Prepare/FinishAccess inbalance.

---
 exa/exa_unaccel.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index d16ecf7..4279c87 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
 <at>  <at>  -405,7 +405,7  <at>  <at>  ExaCheckComposite (CARD8      op,
 	if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
 				       xSrc, ySrc, xMask, yMask, xDst, yDst,
 				       width, height))
-	    return;
+	    goto skip;

 	exaGetDrawableDeltas (pDst->pDrawable,
 			      exaGetDrawablePixmap(pDst->pDrawable),
 <at>  <at>  -450,16 +450,18  <at>  <at>  ExaCheckComposite (CARD8      op,
 #endif /* RENDER */
     if (pMask && pMask->pDrawable != NULL)
 	exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
-    if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
-	exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK);
     if (pSrc->pDrawable != NULL)
 	exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
-    if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
-	exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX_SRC);
     exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
     if (pDst->alphaMap && pDst->alphaMap->pDrawable)
 	exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST);
(Continue reading)

Maarten Maathuis | 1 Mar 2009 01:36
Picon

[PATCH 5/6] exa: remove a few pExaPixmap checks and turn others in FatalErrors.

---
 exa/exa_migration.c |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 8b91150..e7c73f8 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
 <at>  <at>  -52,7 +52,10  <at>  <at>  exaPixmapIsPinned (PixmapPtr pPix)
 {
     ExaPixmapPriv (pPix);

-    return pExaPixmap == NULL || pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED;
+    if (pExaPixmap == NULL)
+	FatalError("exaPixmapIsPinned was called on a non-exa pixmap.\n");
+
+    return pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED;
 }

 /**
 <at>  <at>  -78,16 +81,17  <at>  <at>  exaMemcpyBox (PixmapPtr pPixmap, BoxPtr pbox, CARD8 *src, int src_pitch,

 /**
  * Returns TRUE if the pixmap is dirty (has been modified in its current
- * location compared to the other), or lacks a private for tracking
- * dirtiness.
+ * location compared to the other).
  */
 static Bool
 exaPixmapIsDirty (PixmapPtr pPix)
(Continue reading)

Michel Dänzer | 1 Mar 2009 11:11

Re: [PATCH 4/6] exa: fix unwrapping of ModifyPixmapHeader upon CloseScreen.

On Son, 2009-03-01 at 01:36 +0100, Maarten Maathuis wrote:
> - Cleanup wrapping too.

Looks good.

--

-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
xorg-devel mailing list
xorg-devel <at> lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel
Michel Dänzer | 1 Mar 2009 11:14

Re: [PATCH 6/6] exa: avoid a potential Prepare/FinishAccess inbalance.


Looks good.

 
--

-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
xorg-devel mailing list
xorg-devel <at> lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel
Michel Dänzer | 1 Mar 2009 11:17

Re: [PATCH 1/6] exa: simplify exaPixmapIsOffscreen

On Son, 2009-03-01 at 01:36 +0100, Maarten Maathuis wrote:
> - This includes properly handling the framebuffer.
> ---
>  exa/exa.c |   19 ++++++++-----------
>  1 files changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/exa/exa.c b/exa/exa.c
> index 994a67a..b0a26e9 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
>  <at>  <at>  -424,6 +424,13  <at>  <at>  exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
>          if (devKind > 0)
>              pExaPixmap->sys_pitch = devKind;
>  
> +	/* Is this the framebuffer (for classic exa)? */
> +	if (pPixData && pPixData == pExaScr->info->memoryBase) {
> +	    pExaPixmap->fb_ptr = pPixData;
> +	    pExaPixmap->fb_pitch = devKind;
> +	    pExaPixmap->offscreen = TRUE;
> +	}
> +

This part looks okay.

>  <at>  <at>  -471,22 +478,12  <at>  <at>  exaPixmapIsOffscreen(PixmapPtr p)
>      ScreenPtr	pScreen = p->drawable.pScreen;
>      ExaScreenPriv(pScreen);
>      ExaPixmapPriv(p);
> -    void *save_ptr;
>      Bool ret;
(Continue reading)

Michel Dänzer | 1 Mar 2009 11:24

Re: [PATCH 2/6] exa: clean up some more code

On Son, 2009-03-01 at 01:36 +0100, Maarten Maathuis wrote:
> 
>  <at>  <at>  -73,8 +62,9  <at>  <at>  unsigned long
>  exaGetPixmapOffset(PixmapPtr pPix)
>  {
>      ExaScreenPriv (pPix->drawable.pScreen);
> +    ExaPixmapPriv (pPix);
>  
> -    return (CARD8 *)ExaGetPixmapAddress(pPix) - pExaScr->info->memoryBase;
> +    return (CARD8 *)pExaPixmap->fb_ptr - pExaScr->info->memoryBase;
>  }
>  
>  void *

This looks good, might want to put it in the same commit which sets
pExaPixmap->fb_ptr for the screen pixmap though.

>  <at>  <at>  -449,15 +439,20  <at>  <at>  exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
>  	}
>      }
>  
> -
>      if (pExaScr->info->ModifyPixmapHeader) {
>  	ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
>  						bitsPerPixel, devKind, pPixData);
>  	if (ret == TRUE)
> -	    return ret;
> +	    goto out;
>      }
> -    return pExaScr->SavedModifyPixmapHeader(pPixmap, width, height, depth,
(Continue reading)


Gmane