summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-06-28 16:31:10 +0100
committerDave Airlie <airlied@redhat.com>2012-06-28 16:31:10 +0100
commit5d0b4306fed6faeeacf8191c0262915949420d35 (patch)
treec0a6ad208a05b1a3a42f632649a53704da25c18a
parentd756a4b4b05f2a6c33228b3460b842eaf6e774fd (diff)
bring back get copy area functiongpu-switch-101
-rw-r--r--dix/impedance.c2
-rw-r--r--exa/exa.c15
-rw-r--r--exa/exa_priv.h1
-rw-r--r--fb/fbscreen.c13
-rw-r--r--include/scrnintstr.h6
5 files changed, 36 insertions, 1 deletions
diff --git a/dix/impedance.c b/dix/impedance.c
index 7674f5c5c..3712875d0 100644
--- a/dix/impedance.c
+++ b/dix/impedance.c
@@ -679,7 +679,7 @@ impedCopyNtoN (DrawablePtr pSrcDrawable,
}
for (i = 0; i < pSrcDrawable->pScreen->num_gpu; i++) {
- // copy = pSrcDrawable->pScreen->gpu[i]->GetCopyAreaFunction(&pSrcPixmap->gpu[i]->drawable, &pDstPixmap->gpu[i]->drawable);
+ copy = pSrcDrawable->pScreen->gpu[i]->GetCopyAreaFunction(&pSrcPixmap->gpu[i]->drawable, &pDstPixmap->gpu[i]->drawable);
if (pGC) {
pDrvGC = pGC->gpu[i];
diff --git a/exa/exa.c b/exa/exa.c
index 007495583..8513020fe 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -675,6 +675,18 @@ exaBitmapToRegion(PixmapPtr pPix)
return ret;
}
+static miCopyProc
+exaGetCopyAreaFunction(DrawablePtr pSrc,
+ DrawablePtr pDst)
+{
+ ExaScreenPriv (pDst->pScreen);
+
+ if (pExaScr->fallback_counter || pExaScr->swappedOut)
+ return ExaCheckCopyNtoN;
+ else
+ return exaCopyNtoN;
+}
+
static Bool
exaCreateScreenResources(ScreenPtr pScreen)
{
@@ -788,6 +800,8 @@ exaCloseScreen(ScreenPtr pScreen)
unwrap(pExaScr, pScreen, SharePixmapBacking);
if (pExaScr->SavedSetSharedPixmapBacking)
unwrap(pExaScr, pScreen, SetSharedPixmapBacking);
+ if (pExaScr->SavedGetCopyAreaFunction)
+ unwrap(pExaScr, pScreen, GetCopyAreaFunction);
unwrap(pExaScr, ps, Composite);
if (pExaScr->SavedGlyphs)
unwrap(pExaScr, ps, Glyphs);
@@ -944,6 +958,7 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
wrap(pExaScr, pScreen, ChangeWindowAttributes, exaChangeWindowAttributes);
wrap(pExaScr, pScreen, BitmapToRegion, exaBitmapToRegion);
wrap(pExaScr, pScreen, CreateScreenResources, exaCreateScreenResources);
+ wrap(pExaScr, pScreen, GetCopyAreaFunction, exaGetCopyAreaFunction);
if (ps) {
wrap(pExaScr, ps, Composite, exaComposite);
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 77a96986d..687b52c3b 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -171,6 +171,7 @@ typedef struct {
GlyphsProcPtr SavedGlyphs;
TrapezoidsProcPtr SavedTrapezoids;
AddTrapsProcPtr SavedAddTraps;
+ GetCopyAreaFunctionProcPtr SavedGetCopyAreaFunction;
void (*do_migration) (ExaMigrationPtr pixmaps, int npixmaps,
Bool can_accel);
Bool (*pixmap_has_gpu_copy) (PixmapPtr pPixmap);
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 0833cd41e..78f31fc9a 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -88,6 +88,16 @@ _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 +138,9 @@ fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */
pScreen->GetWindowPixmap = _fbGetWindowPixmap;
pScreen->SetWindowPixmap = _fbSetWindowPixmap;
+ if (pScreen->isGPU) {
+ pScreen->GetCopyAreaFunction = fbGetCopyAreaFunction;
+ }
return TRUE;
}
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 975c36885..dd371f183 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"
typedef struct _PixmapFormat {
unsigned char depth;
@@ -353,6 +354,9 @@ typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr);
typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool);
+typedef miCopyProc (*GetCopyAreaFunctionProcPtr)(DrawablePtr pSrc, DrawablePtr pDst);
+typedef miCopyProc (*GetCopyPlaneFunctionProcPtr)(DrawablePtr pSrc, DrawablePtr pDst, int bitplane);
+
typedef struct _Screen {
int myNum; /* index of this instance in Screens[] */
ATOM id;
@@ -521,6 +525,8 @@ typedef struct _Screen {
struct xorg_list picture_list;
PixmapPtr omghack;
+ GetCopyAreaFunctionProcPtr GetCopyAreaFunction;
+ GetCopyPlaneFunctionProcPtr GetCopyPlaneFunction;
} ScreenRec;
static inline RegionPtr