EXA

Lukas Hejtmanek xhejtman at ics.muni.cz
Tue Aug 28 11:43:09 PDT 2007


Michel,

On Tue, Aug 07, 2007 at 11:30:46AM +0200, Michel Dänzer wrote:
> > following:
> > XAA uses always pixman_blt_mmx while EXA uses combination of accelerator
> > CopyArea and memcpy.
> 
> The attached patch seems to help here, how does it work for you?


while the attached patch was quite good, the patch
(http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=5d9e2c282145897008d7d941e2a0a3fdc71f2373) that you committed into
Xserver master branch performs quite poorly, I got only 100FPS using x11perf
-shmput500 instead of 1600 which is the case of the patch bellow. Are you
about to commit rather this one?

> diff --git a/Xext/shm.c b/Xext/shm.c
> index ac587be..7a08a68 100644
> --- a/Xext/shm.c
> +++ b/Xext/shm.c
> @@ -57,6 +57,7 @@ in this Software without prior written authorization from The Open Group.
>  #include "gcstruct.h"
>  #include "extnsionst.h"
>  #include "servermd.h"
> +#include "shmint.h"
>  #define _XSHM_SERVER_
>  #include <X11/extensions/shmstr.h>
>  #include <X11/Xfuncproto.h>
> @@ -77,7 +78,6 @@ typedef struct _ShmDesc {
>      unsigned long size;
>  } ShmDescRec, *ShmDescPtr;
>  
> -static void miShmPutImage(XSHM_PUT_IMAGE_ARGS);
>  static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS);
>  static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
>  static int ShmDetachSegment(
> @@ -477,7 +477,7 @@ ProcShmDetach(client)
>      return(client->noClientException);
>  }
>  
> -static void
> +void
>  miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
>      DrawablePtr dst;
>      GCPtr	pGC;
> diff --git a/Xext/shmint.h b/Xext/shmint.h
> index fc056bc..c00b766 100644
> --- a/Xext/shmint.h
> +++ b/Xext/shmint.h
> @@ -30,6 +30,8 @@
>  #include "pixmap.h"
>  #include "gc.h"
>  
> +void miShmPutImage(XSHM_PUT_IMAGE_ARGS);
> +
>  void
>  ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
>  
> diff --git a/exa/exa.c b/exa/exa.c
> index 8e22b89..a98bf6e 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -550,6 +594,40 @@ exaDriverAlloc(void)
>      return xcalloc(1, sizeof(ExaDriverRec));
>  }
>  
> +#ifdef MITSHM
> +
> +static void
> +exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
> +	       int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
> +	       char *data)
> +{
> +    ExaScreenPriv (pDrawable->pScreen);
> +
> +    if (!pExaScr->info->UploadToScreen && ((format == ZPixmap) || (depth == 1)))
> +    {
> +	PixmapPtr pPixmap;
> +
> +	pPixmap = GetScratchPixmapHeader(pDrawable->pScreen, w, h, depth,
> +		BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data);
> +	if (!pPixmap)
> +	    return;
> +	if (format == XYBitmap)
> +	    (void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, pDrawable, pGC,
> +					 sx, sy, sw, sh, dx, dy, 1L);
> +	else
> +	    (void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, pDrawable, pGC,
> +					sx, sy, sw, sh, dx, dy);
> +	FreeScratchPixmapHeader(pPixmap);
> +    }
> +    else
> +	miShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx,
> +		      dy, data);
> +}
> +
> +static ShmFuncs exaShmFuncs = { NULL, exaShmPutImage };
> +
> +#endif
> +
>  /**
>   * @param pScreen screen being initialized
>   * @param pScreenInfo EXA driver record
> @@ -692,7 +770,7 @@ exaDriverInit (ScreenPtr		pScreen,
>       * Shared pixmaps are almost always a performance loss for us, but this
>       * still allows for SHM PutImage.
>       */
> -    ShmRegisterFuncs(pScreen, NULL);
> +    ShmRegisterFuncs(pScreen, &exaShmFuncs);
>  #endif
>      /*
>       * Hookup offscreen pixmaps


-- 
Lukáš Hejtmánek



More information about the xorg mailing list