xserver: Branch 'master' - 2 commits
Tilman Sauerbeck
tilman at kemper.freedesktop.org
Mon Apr 21 14:58:07 PDT 2008
exa/exa.c | 75 +++++++++++++++++++++++++++++++++++++++++++++------------
exa/exa_priv.h | 1
2 files changed, 61 insertions(+), 15 deletions(-)
New commits:
commit 3f081b4de55e1378728a24d069bf06575ffca2d8
Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date: Mon Apr 21 11:22:07 2008 +0200
EXA: Set pixmap->accel_blocked on the screen pixmap, too.
diff --git a/exa/exa.c b/exa/exa.c
index 0e3ea70..3a6ad98 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -699,6 +699,34 @@ exaBitmapToRegion(PixmapPtr pPix)
return ret;
}
+static Bool
+exaCreateScreenResources(ScreenPtr pScreen)
+{
+ ExaScreenPriv(pScreen);
+ PixmapPtr pScreenPixmap;
+ Bool b;
+
+ pScreen->CreateScreenResources = pExaScr->SavedCreateScreenResources;
+ b = pScreen->CreateScreenResources(pScreen);
+ pScreen->CreateScreenResources = exaCreateScreenResources;
+
+ if (!b)
+ return FALSE;
+
+ pScreenPixmap = pScreen->GetScreenPixmap(pScreen);
+
+ if (pScreenPixmap) {
+ ExaPixmapPriv(pScreenPixmap);
+
+ exaSetAccelBlock(pExaScr, pExaPixmap,
+ pScreenPixmap->drawable.width,
+ pScreenPixmap->drawable.height,
+ pScreenPixmap->drawable.bitsPerPixel);
+ }
+
+ return TRUE;
+}
+
/**
* exaCloseScreen() unwraps its wrapped screen functions and tears down EXA's
* screen private, before calling down to the next CloseSccreen.
@@ -720,6 +748,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
pScreen->CopyWindow = pExaScr->SavedCopyWindow;
pScreen->ChangeWindowAttributes = pExaScr->SavedChangeWindowAttributes;
pScreen->BitmapToRegion = pExaScr->SavedBitmapToRegion;
+ pScreen->CreateScreenResources = pExaScr->SavedCreateScreenResources;
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
@@ -877,6 +906,9 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->SavedBitmapToRegion = pScreen->BitmapToRegion;
pScreen->BitmapToRegion = exaBitmapToRegion;
+ pExaScr->SavedCreateScreenResources = pScreen->CreateScreenResources;
+ pScreen->CreateScreenResources = exaCreateScreenResources;
+
#ifdef RENDER
if (ps) {
pExaScr->SavedComposite = ps->Composite;
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index e41f46a..0138e4a 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -107,6 +107,7 @@ typedef struct {
CopyWindowProcPtr SavedCopyWindow;
ChangeWindowAttributesProcPtr SavedChangeWindowAttributes;
BitmapToRegionProcPtr SavedBitmapToRegion;
+ CreateScreenResourcesProcPtr SavedCreateScreenResources;
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
#ifdef RENDER
CompositeProcPtr SavedComposite;
commit 26c1801a27b81fdd988d5bd210ba0e76ecc274ae
Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date: Mon Apr 21 11:03:27 2008 +0200
EXA: Update sys_pitch/fb_pitch in exaModifyPixmapHeader.
exaModifyPixmapHeader now also only evaluates arguments that have a
meaningful value.
diff --git a/exa/exa.c b/exa/exa.c
index 81dc3e2..0e3ea70 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -248,6 +248,19 @@ exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
}
+static void
+exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
+ int w, int h, int bpp)
+{
+ if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
+ pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
+ else
+ pExaPixmap->fb_pitch = w * bpp / 8;
+
+ pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
+ pExaScr->info->pixmapPitchAlign);
+}
+
/**
* exaCreatePixmap() creates a new pixmap.
*
@@ -292,12 +305,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
if (paddedWidth / 4 > 32767 || h > 32767)
return NullPixmap;
- if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
- pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
- else
- pExaPixmap->fb_pitch = w * bpp / 8;
- pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
- pExaScr->info->pixmapPitchAlign);
+ exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
+
if (paddedWidth < pExaPixmap->fb_pitch)
paddedWidth = pExaPixmap->fb_pitch;
@@ -331,12 +340,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
pExaPixmap->offscreen = FALSE;
pExaPixmap->fb_ptr = NULL;
- if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
- pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
- else
- pExaPixmap->fb_pitch = w * bpp / 8;
- pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
- pExaScr->info->pixmapPitchAlign);
+ exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
pExaPixmap->fb_size = pExaPixmap->fb_pitch * h;
if (pExaPixmap->fb_pitch > 131071) {
@@ -384,10 +388,19 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
pExaPixmap = ExaGetPixmapPriv(pPixmap);
if (pExaPixmap) {
- pExaPixmap->sys_ptr = pPixData;
+ if (pPixData)
+ pExaPixmap->sys_ptr = pPixData;
- exaSetAccelBlock(pExaScr, pExaPixmap,
- width, height, bitsPerPixel);
+ if (devKind > 0)
+ pExaPixmap->sys_pitch = devKind;
+
+ if (width > 0 && height > 0 && bitsPerPixel > 0) {
+ exaSetFbPitch(pExaScr, pExaPixmap,
+ width, height, bitsPerPixel);
+
+ exaSetAccelBlock(pExaScr, pExaPixmap,
+ width, height, bitsPerPixel);
+ }
}
More information about the xorg-commit
mailing list