diff options
author | Dave Airlie <airlied@gmail.com> | 2012-04-12 12:14:26 +0100 |
---|---|---|
committer | Dave Airlie <airlied@gmail.com> | 2012-04-12 12:14:26 +0100 |
commit | 1b9187192a2bf649838eca485abd24af014be453 (patch) | |
tree | 04ad81a35cf258b619157e09bb60957c6abb2ed8 | |
parent | 08028acfe793ac7f6716f1916e9ef02571c62afe (diff) |
WIP copy area
-rw-r--r-- | drv/imped_gc.c | 29 | ||||
-rw-r--r-- | drv/imped_scrn.c | 1 | ||||
-rw-r--r-- | fb/fbscreen.c | 14 | ||||
-rw-r--r-- | include/scrnintstr.h | 9 |
4 files changed, 36 insertions, 17 deletions
diff --git a/drv/imped_gc.c b/drv/imped_gc.c index 8eb6f94b6..b5fc39e59 100644 --- a/drv/imped_gc.c +++ b/drv/imped_gc.c @@ -79,8 +79,6 @@ impedValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) for (i = 0; i < pGC->pScreen->num_gpu; i++) { pDrvGC = pGC->gpu[i]; - // SyncDrvGC(pGC, pDrvGC, i); - pDrvGC->funcs->ValidateGC(pDrvGC, changes, &pPixmap->gpu[i]->drawable); } #ifdef COMPOSITE @@ -197,6 +195,7 @@ static void impedModChildGC(GCPtr pGC, GCPtr pChild, int index, unsigned long ma } } } + static void impedChangeGC(GCPtr pGC, unsigned long mask) { unsigned long maskQ; @@ -624,7 +623,6 @@ impedImageGlyphBlt (DrawablePtr pDrawable, ppciInit, pglyphBase)); } -#if 0 void impedCopyNtoN (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, @@ -638,13 +636,13 @@ impedCopyNtoN (DrawablePtr pSrcDrawable, Pixel bitplane, void *closure) { - drvCopyProc copy; + miCopyProc copy; int src_x_off, src_y_off; int dst_x_off, dst_y_off; PixmapPtr pSrcPixmap = (PixmapPtr)GetDrawablePixmap(pSrcDrawable); PixmapPtr pDstPixmap = (PixmapPtr)GetDrawablePixmap(pDstDrawable); int i; - DrvGCPtr pDrvGC = NULL; + GCPtr pDrvGC = NULL; impedGetCompositeDeltas(pSrcDrawable, pSrcPixmap, &src_x_off, &src_y_off); impedGetCompositeDeltas(pDstDrawable, pDstPixmap, &dst_x_off, &dst_y_off); @@ -663,12 +661,11 @@ impedCopyNtoN (DrawablePtr pSrcDrawable, } } - for (i = 0; i < imped_src_screen->num_gpu; i++) { - copy = imped_src_screen->gpu[i]->GetCopyAreaFunction(imped_src_pixmap->gpu[i], imped_dst_pixmap->gpu[i]); + for (i = 0; i < pSrcDrawable->pScreen->num_gpu; i++) { + copy = pSrcDrawable->pScreen->gpu[i]->GetCopyAreaFunction(&pSrcPixmap->drawable, &pDstPixmap->drawable); if (pGC) { - impedGCPrivPtr imped_gc = impedGetGC(pGC); - pDrvGC = imped_gc->gpu[i]; + pDrvGC = pGC->gpu[i]; } copy(pSrcPixmap->gpu[i], pDstPixmap->gpu[i], @@ -677,7 +674,7 @@ impedCopyNtoN (DrawablePtr pSrcDrawable, } } -#endif + static RegionPtr impedCopyArea (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, @@ -689,8 +686,6 @@ impedCopyArea (DrawablePtr pSrcDrawable, int xOut, int yOut) { - return NULL; -#if 0 return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, @@ -699,8 +694,8 @@ impedCopyArea (DrawablePtr pSrcDrawable, xOut, yOut, impedCopyNtoN, 0, 0); -#endif } + #if 0 static void impedCopyPlaneNtoN (DrawablePtr pSrcDrawable, @@ -739,6 +734,7 @@ impedCopyPlaneNtoN (DrawablePtr pSrcDrawable, } } +#endif static RegionPtr impedCopyPlane (DrawablePtr pSrcDrawable, @@ -752,12 +748,13 @@ impedCopyPlane (DrawablePtr pSrcDrawable, int yOut, unsigned long bitplane) { - drvCopyProc copy; + // drvCopyProc copy; PixmapPtr pSrcPixmap, pDstPixmap; pSrcPixmap = GetDrawablePixmap(pSrcDrawable); pDstPixmap = GetDrawablePixmap(pDstDrawable); +#if 0 copy = imped_src_screen->gpu[0]->GetCopyPlaneFunction(imped_src_pixmap->gpu[0], imped_dst_pixmap->gpu[0], bitplane); @@ -771,13 +768,13 @@ impedCopyPlane (DrawablePtr pSrcDrawable, yOut, impedCopyPlaneNtoN, (Pixel)bitplane, 0); else +#endif return miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, bitplane); } -#endif static void impedPushPixels (GCPtr pGC, @@ -805,7 +802,7 @@ const GCOps impedGCOps = { impedSetSpans, impedPutImage, impedCopyArea, - NULL,//impedCopyPlane, + impedCopyPlane, impedPolyPoint, impedPolyLines, impedPolySegment, diff --git a/drv/imped_scrn.c b/drv/imped_scrn.c index 757d00916..3acb9f9f8 100644 --- a/drv/imped_scrn.c +++ b/drv/imped_scrn.c @@ -329,6 +329,7 @@ impedAttachScreen(ScreenPtr pScreen, ScreenPtr slave) { xorg_list_add(&slave->gpu_screen_head, &pScreen->gpu_screen_list); slave->protocol_master = pScreen; + pScreen->gpu[pScreen->num_gpu] = slave; pScreen->num_gpu++; } diff --git a/fb/fbscreen.c b/fb/fbscreen.c index 1f81fcf63..2bb9c3926 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -88,6 +88,17 @@ _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap) dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(), pPixmap); } +static miCopyProc +fbGetCopyAreaFunction(DrawablePtr pSrc, + DrawablePtr pDst) +{ + if (pSrc->bitsPerPixel != pDst->bitsPerPixel) + return fb24_32CopyMtoN; + else + return fbCopyNtoN; +} + + Bool fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ @@ -128,6 +139,9 @@ fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */ pScreen->GetWindowPixmap = _fbGetWindowPixmap; pScreen->SetWindowPixmap = _fbSetWindowPixmap; + if (pScreen->isDrv) { + pScreen->GetCopyAreaFunction = fbGetCopyAreaFunction; + } return TRUE; } diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 240ba834f..22038f91b 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -55,6 +55,7 @@ SOFTWARE. #include <X11/Xproto.h> #include "dix.h" #include "privates.h" +#include "mi.h" #define ROLE_MASTER 0x1 #define ROLE_SLAVE_OFFLOAD 0x2 @@ -345,6 +346,9 @@ typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ , typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int, int *, int *); +typedef miCopyProc (*GetCopyAreaFunctionProcPtr)(DrawablePtr pSrc, DrawablePtr pDst); +typedef miCopyProc (*GetCopyPlaneFunctionProcPtr)(DrawablePtr pSrc, DrawablePtr pDst); + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -488,7 +492,7 @@ typedef struct _Screen { Bool isDrv; int num_gpu; /* subscreen lists - master gpus, offload gpus, output gpus, unattached gpus */ - ScreenPtr gpus[MAXGPU]; + ScreenPtr gpu[MAXGPU]; struct xorg_list gpu_screen_list; struct xorg_list offload_slave_list; struct xorg_list output_slave_list; @@ -510,6 +514,9 @@ typedef struct _Screen { ScreenPtr master; ScreenPtr offload_master; ScreenPtr output_master; + + GetCopyAreaFunctionProcPtr GetCopyAreaFunction; + GetCopyPlaneFunctionProcPtr GetCopyPlaneFunction; } ScreenRec; static inline RegionPtr |