xserver: Branch 'master' - 7 commits
Adam Jackson
ajax at kemper.freedesktop.org
Mon Dec 12 19:33:44 UTC 2016
dix/gc.c | 21 +--
hw/dmx/dmxextension.c | 10 -
hw/xfree86/drivers/modesetting/Makefile.am | 2
hw/xfree86/drivers/modesetting/driver.c | 7 -
hw/xfree86/drivers/modesetting/sh3224.c | 140 -----------------------
hw/xfree86/drivers/modesetting/sh3224.h | 7 -
hw/xfree86/shadowfb/Makefile.am | 2
hw/xfree86/shadowfb/shadow.c | 171 -----------------------------
hw/xfree86/shadowfb/shadowfb.c | 171 +++++++++++++++++++++++++++++
hw/xnest/Screen.c | 2
hw/xwin/winshadddnl.c | 2
hw/xwin/winshadgdi.c | 2
include/scrnintstr.h | 12 --
miext/shadow/Makefile.am | 2
miext/shadow/sh3224.c | 138 +++++++++++++++++++++++
miext/shadow/shadow.c | 5
miext/shadow/shadow.h | 17 --
miext/shadow/shafb4.c | 2
miext/shadow/shafb8.c | 2
miext/shadow/shalloc.c | 49 --------
miext/shadow/shiplan2p4.c | 2
miext/shadow/shiplan2p8.c | 2
miext/shadow/shpacked.c | 8 -
miext/shadow/shplanar.c | 14 --
miext/shadow/shplanar8.c | 2
miext/shadow/shrotate.c | 8 -
miext/shadow/shrotpack.h | 2
miext/shadow/shrotpackYX.h | 2
28 files changed, 352 insertions(+), 452 deletions(-)
New commits:
commit 6dd65a6e9bd41237afe7615bea1cc9510e82781a
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:38 2016 -0500
shadow: Remove unused shadowAlloc
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/miext/shadow/Makefile.am b/miext/shadow/Makefile.am
index b611c9b..dabbf03 100644
--- a/miext/shadow/Makefile.am
+++ b/miext/shadow/Makefile.am
@@ -13,7 +13,6 @@ libshadow_la_SOURCES = \
sh3224.c \
shafb4.c \
shafb8.c \
- shalloc.c \
shiplan2p4.c \
shiplan2p8.c \
shpacked.c \
diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h
index b8cd1b5..c08e153 100644
--- a/miext/shadow/shadow.h
+++ b/miext/shadow/shadow.h
@@ -81,8 +81,6 @@ shadowAdd(ScreenPtr pScreen,
extern _X_EXPORT void
shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap);
-extern _X_EXPORT void *shadowAlloc(int width, int height, int bpp);
-
extern _X_EXPORT void
shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf);
diff --git a/miext/shadow/shalloc.c b/miext/shadow/shalloc.c
deleted file mode 100644
index 6a79085..0000000
--- a/miext/shadow/shalloc.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include <X11/fonts/font.h>
-#include "dixfontstr.h"
-#include <X11/fonts/fontstruct.h>
-#include "mi.h"
-#include "regionstr.h"
-#include "globals.h"
-#include "gcstruct.h"
-#include "shadow.h"
-
-void *
-shadowAlloc(int width, int height, int bpp)
-{
- int stride;
- void *fb;
-
- /* Cant use PixmapBytePad -- the structure is probably not initialized yet */
- stride = BitmapBytePad(width * bpp);
- fb = xallocarray(stride, height);
- return fb;
-}
commit 8d985c1e696bf46edaea0021f03f6f613ce37860
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:37 2016 -0500
shadow: Macro cleanup
shadowDamage is just obfuscation. The other two macros won't work
outside shadow.c since the private key is in fact static there (meaning
the extern decl is a lie).
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 0ec5246..6ad32eb 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -520,7 +520,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf)
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
HRESULT ddrval = DD_OK;
RECT rcDest, rcSrc;
POINT ptOrigin;
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 22836c5..705cdfb 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -434,7 +434,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
DWORD dwBox = RegionNumRects(damage);
BoxPtr pBox = RegionRects(damage);
int x, y, w, h;
diff --git a/miext/shadow/sh3224.c b/miext/shadow/sh3224.c
index ba54121..5d8f274 100644
--- a/miext/shadow/sh3224.c
+++ b/miext/shadow/sh3224.c
@@ -100,7 +100,7 @@ sh24_32BltLine(CARD8 *srcLine,
void
shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
index b8e23da..529402d 100644
--- a/miext/shadow/shadow.c
+++ b/miext/shadow/shadow.c
@@ -37,9 +37,12 @@
#include "shadow.h"
static DevPrivateKeyRec shadowScrPrivateKeyRec;
-
#define shadowScrPrivateKey (&shadowScrPrivateKeyRec)
+#define shadowGetBuf(pScr) ((shadowBufPtr) \
+ dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey))
+#define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
+
#define wrap(priv, real, mem) {\
priv->mem = real->mem; \
real->mem = shadow##mem; \
diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h
index c9a4100..b8cd1b5 100644
--- a/miext/shadow/shadow.h
+++ b/miext/shadow/shadow.h
@@ -68,13 +68,6 @@ typedef struct _shadowBuf {
#define SHADOW_REFLECT_Y 32
#define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
-extern _X_EXPORT DevPrivateKey shadowScrPrivateKey;
-
-#define shadowGetBuf(pScr) ((shadowBufPtr) \
- dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey))
-#define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
-#define shadowDamage(pBuf) DamageRegion(pBuf->pDamage)
-
extern _X_EXPORT Bool
shadowSetup(ScreenPtr pScreen);
diff --git a/miext/shadow/shafb4.c b/miext/shadow/shafb4.c
index d88ae1c..ae59e2d 100644
--- a/miext/shadow/shafb4.c
+++ b/miext/shadow/shafb4.c
@@ -80,7 +80,7 @@ static inline void store_afb4(void *dst, unsigned int stride,
void
shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shafb8.c b/miext/shadow/shafb8.c
index 8d84bfa..d2b73fc 100644
--- a/miext/shadow/shafb8.c
+++ b/miext/shadow/shafb8.c
@@ -84,7 +84,7 @@ static inline void store_afb8(void *dst, unsigned int stride,
void
shadowUpdateAfb8(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shiplan2p4.c b/miext/shadow/shiplan2p4.c
index 0e46bae..f37c58d 100644
--- a/miext/shadow/shiplan2p4.c
+++ b/miext/shadow/shiplan2p4.c
@@ -78,7 +78,7 @@ static inline void store_iplan2p4(void *dst, const CARD32 d[2])
void
shadowUpdateIplan2p4(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shiplan2p8.c b/miext/shadow/shiplan2p8.c
index 17d6a13..44cb8d3 100644
--- a/miext/shadow/shiplan2p8.c
+++ b/miext/shadow/shiplan2p8.c
@@ -79,7 +79,7 @@ static inline void store_iplan2p8(void *dst, const CARD32 d[4])
void
shadowUpdateIplan2p8(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
index 34527bc..5220854 100644
--- a/miext/shadow/shpacked.c
+++ b/miext/shadow/shpacked.c
@@ -43,7 +43,7 @@
void
shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c
index cb5fc54..92c7971 100644
--- a/miext/shadow/shplanar.c
+++ b/miext/shadow/shplanar.c
@@ -89,7 +89,7 @@
void
shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c
index 214fa9a..4123359 100644
--- a/miext/shadow/shplanar8.c
+++ b/miext/shadow/shplanar8.c
@@ -92,7 +92,7 @@
void
shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c
index 7dc471f..1745537 100644
--- a/miext/shadow/shrotate.c
+++ b/miext/shadow/shrotate.c
@@ -51,7 +51,7 @@
void
shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h
index b1cb30d..4814991 100644
--- a/miext/shadow/shrotpack.h
+++ b/miext/shadow/shrotpack.h
@@ -96,7 +96,7 @@
void
FUNC(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
diff --git a/miext/shadow/shrotpackYX.h b/miext/shadow/shrotpackYX.h
index f3df6c5..3c5b3a1 100644
--- a/miext/shadow/shrotpackYX.h
+++ b/miext/shadow/shrotpackYX.h
@@ -56,7 +56,7 @@
void
FUNC(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = shadowDamage(pBuf);
+ RegionPtr damage = DamageRegion(pBuf->pDamage);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects(damage);
BoxPtr pbox = RegionRects(damage);
commit a530dc2a62349d922de77a75786a3795102aec11
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:36 2016 -0500
shadow: Remove indirection stubs
These are no longer used in the drivers.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h
index 0bbbe45..c9a4100 100644
--- a/miext/shadow/shadow.h
+++ b/miext/shadow/shadow.h
@@ -161,9 +161,4 @@ extern _X_EXPORT void
typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr);
-extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void);
-extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void);
-extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void);
-extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void);
-
#endif /* _SHADOW_H_ */
diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
index 5ef18f8..34527bc 100644
--- a/miext/shadow/shpacked.c
+++ b/miext/shadow/shpacked.c
@@ -107,9 +107,3 @@ shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
pbox++;
}
}
-
-shadowUpdateProc
-shadowUpdatePackedWeak(void)
-{
- return shadowUpdatePacked;
-}
diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c
index 4f6542c..cb5fc54 100644
--- a/miext/shadow/shplanar.c
+++ b/miext/shadow/shplanar.c
@@ -166,15 +166,3 @@ shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf)
pbox++;
}
}
-
-shadowUpdateProc
-shadowUpdatePlanar4Weak(void)
-{
- return shadowUpdatePlanar4;
-}
-
-shadowUpdateProc
-shadowUpdatePlanar4x8Weak(void)
-{
- return shadowUpdatePlanar4x8;
-}
diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c
index a0fc4ec..7dc471f 100644
--- a/miext/shadow/shrotate.c
+++ b/miext/shadow/shrotate.c
@@ -296,9 +296,3 @@ shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
}
}
}
-
-shadowUpdateProc
-shadowUpdateRotatePackedWeak(void)
-{
- return shadowUpdateRotatePacked;
-}
commit 1ae09800863992cfb1d5d21c600e2bc29e3b6ab2
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:35 2016 -0500
shadow: Lift 32->24 conversion from modesetting to dix
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am
index 44823b0..e0411ef 100644
--- a/hw/xfree86/drivers/modesetting/Makefile.am
+++ b/hw/xfree86/drivers/modesetting/Makefile.am
@@ -51,8 +51,6 @@ modesetting_drv_la_SOURCES = \
dumb_bo.c \
dumb_bo.h \
present.c \
- sh3224.c \
- sh3224.h \
vblank.c \
pageflip.c \
$(NULL)
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 3da69a3..a27b327 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -60,7 +60,6 @@
#endif
#include "driver.h"
-#include "sh3224.h"
static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y);
static Bool CloseScreen(ScreenPtr pScreen);
@@ -1124,7 +1123,7 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
modesettingPtr ms = modesettingPTR(pScrn);
- Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32;
+ Bool use_3224 = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32;
if (ms->drmmode.shadow_enable2 && ms->drmmode.shadow_fb2) do {
RegionPtr damage = DamageRegion(pBuf->pDamage), tiles;
@@ -1166,8 +1165,8 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
free(prect);
} while (0);
- if (use_ms_shadow)
- ms_shadowUpdate32to24(pScreen, pBuf);
+ if (use_3224)
+ shadowUpdate32to24(pScreen, pBuf);
else
shadowUpdatePacked(pScreen, pBuf);
}
diff --git a/hw/xfree86/drivers/modesetting/sh3224.c b/hw/xfree86/drivers/modesetting/sh3224.c
deleted file mode 100644
index a64a103..0000000
--- a/hw/xfree86/drivers/modesetting/sh3224.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Copyright © 2000 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include "dix-config.h"
-#endif
-
-#include "shadow.h"
-#include "fb.h"
-
-#include "sh3224.h"
-#define Get8(a) ((CARD32) READ(a))
-
-#if BITMAP_BIT_ORDER == MSBFirst
-#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2))
-#define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \
- (WRITE((a+1), (CARD8) ((p) >> 8))), \
- (WRITE((a+2), (CARD8) (p))))
-#else
-#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16))
-#define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \
- (WRITE((a+1), (CARD8) ((p) >> 8))), \
- (WRITE((a+2), (CARD8) ((p) >> 16))))
-#endif
-
-static void
-sh24_32BltLine(CARD8 *srcLine,
- CARD8 *dstLine,
- int width)
-{
- CARD32 *src;
- CARD8 *dst;
- int w;
- CARD32 pixel;
-
- src = (CARD32 *) srcLine;
- dst = dstLine;
- w = width;
-
- while (((long)dst & 3) && w) {
- w--;
- pixel = READ(src++);
- Put24(dst, pixel);
- dst += 3;
- }
- /* Do four aligned pixels at a time */
- while (w >= 4) {
- CARD32 s0, s1;
-
- s0 = READ(src++);
- s1 = READ(src++);
-#if BITMAP_BIT_ORDER == LSBFirst
- WRITE((CARD32 *) dst, (s0 & 0xffffff) | (s1 << 24));
-#else
- WRITE((CARD32 *) dst, (s0 << 8) | ((s1 & 0xffffff) >> 16));
-#endif
- s0 = READ(src++);
-#if BITMAP_BIT_ORDER == LSBFirst
- WRITE((CARD32 *) (dst + 4),
- ((s1 & 0xffffff) >> 8) | (s0 << 16));
-#else
- WRITE((CARD32 *) (dst + 4),
- (s1 << 16) | ((s0 & 0xffffff) >> 8));
-#endif
- s1 = READ(src++);
-#if BITMAP_BIT_ORDER == LSBFirst
- WRITE((CARD32 *) (dst + 8),
- ((s0 & 0xffffff) >> 16) | (s1 << 8));
-#else
- WRITE((CARD32 *) (dst + 8), (s0 << 24) | (s1 & 0xffffff));
-#endif
- dst += 12;
- w -= 4;
- }
- while (w--) {
- pixel = READ(src++);
- Put24(dst, pixel);
- dst += 3;
- }
-}
-
-void
-ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf)
-{
- RegionPtr damage = shadowDamage(pBuf);
- PixmapPtr pShadow = pBuf->pPixmap;
- int nbox = RegionNumRects(damage);
- BoxPtr pbox = RegionRects(damage);
- FbStride shaStride;
- int shaBpp;
- _X_UNUSED int shaXoff, shaYoff;
- int x, y, w, h;
- CARD32 winSize;
- FbBits *shaBase, *shaLine;
- CARD8 *winBase = NULL, *winLine;
-
- fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff,
- shaYoff);
-
- /* just get the initial window base + stride */
- winBase = (*pBuf->window)(pScreen, 0, 0, SHADOW_WINDOW_WRITE,
- &winSize, pBuf->closure);
-
- while (nbox--) {
- x = pbox->x1;
- y = pbox->y1;
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
-
- winLine = winBase + y * winSize + (x * 3);
- shaLine = shaBase + y * shaStride + ((x * shaBpp) >> FB_SHIFT);
-
- while (h--) {
- sh24_32BltLine((CARD8 *)shaLine, (CARD8 *)winLine, w);
- winLine += winSize;
- shaLine += shaStride;
- }
- pbox++;
- }
-}
diff --git a/hw/xfree86/drivers/modesetting/sh3224.h b/hw/xfree86/drivers/modesetting/sh3224.h
deleted file mode 100644
index fc301f9..0000000
--- a/hw/xfree86/drivers/modesetting/sh3224.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef SH3224_H
-#define SH3224_H
-
-void
-ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf);
-
-#endif
diff --git a/miext/shadow/Makefile.am b/miext/shadow/Makefile.am
index 27cf414..b611c9b 100644
--- a/miext/shadow/Makefile.am
+++ b/miext/shadow/Makefile.am
@@ -10,6 +10,7 @@ libshadow_la_SOURCES = \
c2p_core.h \
shadow.c \
shadow.h \
+ sh3224.c \
shafb4.c \
shafb8.c \
shalloc.c \
diff --git a/miext/shadow/sh3224.c b/miext/shadow/sh3224.c
new file mode 100644
index 0000000..ba54121
--- /dev/null
+++ b/miext/shadow/sh3224.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright © 2000 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include "dix-config.h"
+#endif
+
+#include "shadow.h"
+#include "fb.h"
+
+#define Get8(a) ((CARD32) READ(a))
+
+#if BITMAP_BIT_ORDER == MSBFirst
+#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2))
+#define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \
+ (WRITE((a+1), (CARD8) ((p) >> 8))), \
+ (WRITE((a+2), (CARD8) (p))))
+#else
+#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16))
+#define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \
+ (WRITE((a+1), (CARD8) ((p) >> 8))), \
+ (WRITE((a+2), (CARD8) ((p) >> 16))))
+#endif
+
+static void
+sh24_32BltLine(CARD8 *srcLine,
+ CARD8 *dstLine,
+ int width)
+{
+ CARD32 *src;
+ CARD8 *dst;
+ int w;
+ CARD32 pixel;
+
+ src = (CARD32 *) srcLine;
+ dst = dstLine;
+ w = width;
+
+ while (((long)dst & 3) && w) {
+ w--;
+ pixel = READ(src++);
+ Put24(dst, pixel);
+ dst += 3;
+ }
+ /* Do four aligned pixels at a time */
+ while (w >= 4) {
+ CARD32 s0, s1;
+
+ s0 = READ(src++);
+ s1 = READ(src++);
+#if BITMAP_BIT_ORDER == LSBFirst
+ WRITE((CARD32 *) dst, (s0 & 0xffffff) | (s1 << 24));
+#else
+ WRITE((CARD32 *) dst, (s0 << 8) | ((s1 & 0xffffff) >> 16));
+#endif
+ s0 = READ(src++);
+#if BITMAP_BIT_ORDER == LSBFirst
+ WRITE((CARD32 *) (dst + 4),
+ ((s1 & 0xffffff) >> 8) | (s0 << 16));
+#else
+ WRITE((CARD32 *) (dst + 4),
+ (s1 << 16) | ((s0 & 0xffffff) >> 8));
+#endif
+ s1 = READ(src++);
+#if BITMAP_BIT_ORDER == LSBFirst
+ WRITE((CARD32 *) (dst + 8),
+ ((s0 & 0xffffff) >> 16) | (s1 << 8));
+#else
+ WRITE((CARD32 *) (dst + 8), (s0 << 24) | (s1 & 0xffffff));
+#endif
+ dst += 12;
+ w -= 4;
+ }
+ while (w--) {
+ pixel = READ(src++);
+ Put24(dst, pixel);
+ dst += 3;
+ }
+}
+
+void
+shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf)
+{
+ RegionPtr damage = shadowDamage(pBuf);
+ PixmapPtr pShadow = pBuf->pPixmap;
+ int nbox = RegionNumRects(damage);
+ BoxPtr pbox = RegionRects(damage);
+ FbStride shaStride;
+ int shaBpp;
+ _X_UNUSED int shaXoff, shaYoff;
+ int x, y, w, h;
+ CARD32 winSize;
+ FbBits *shaBase, *shaLine;
+ CARD8 *winBase = NULL, *winLine;
+
+ fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff,
+ shaYoff);
+
+ /* just get the initial window base + stride */
+ winBase = (*pBuf->window)(pScreen, 0, 0, SHADOW_WINDOW_WRITE,
+ &winSize, pBuf->closure);
+
+ while (nbox--) {
+ x = pbox->x1;
+ y = pbox->y1;
+ w = pbox->x2 - pbox->x1;
+ h = pbox->y2 - pbox->y1;
+
+ winLine = winBase + y * winSize + (x * 3);
+ shaLine = shaBase + y * shaStride + ((x * shaBpp) >> FB_SHIFT);
+
+ while (h--) {
+ sh24_32BltLine((CARD8 *)shaLine, (CARD8 *)winLine, w);
+ winLine += winSize;
+ shaLine += shaStride;
+ }
+ pbox++;
+ }
+}
diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h
index 7f22169..0bbbe45 100644
--- a/miext/shadow/shadow.h
+++ b/miext/shadow/shadow.h
@@ -156,6 +156,9 @@ extern _X_EXPORT void
extern _X_EXPORT void
shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf);
+extern _X_EXPORT void
+ shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf);
+
typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr);
extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void);
commit 2b486f052d8a7d3bada9eb2615aa19d79e999cbe
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:34 2016 -0500
shadowfb: Rename this particular shadow.c to shadowfb.c
So as not to conflict with the one in miext/shadow.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xfree86/shadowfb/Makefile.am b/hw/xfree86/shadowfb/Makefile.am
index 22f7ada..67fb2e4 100644
--- a/hw/xfree86/shadowfb/Makefile.am
+++ b/hw/xfree86/shadowfb/Makefile.am
@@ -1,6 +1,6 @@
module_LTLIBRARIES = libshadowfb.la
libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
-libshadowfb_la_SOURCES = sfbmodule.c shadow.c
+libshadowfb_la_SOURCES = sfbmodule.c shadowfb.c
libshadowfb_la_LIBADD = $(PIXMAN_LIBS)
sdk_HEADERS = shadowfb.h
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
deleted file mode 100644
index d2481ed..0000000
--- a/hw/xfree86/shadowfb/shadow.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- Copyright (C) 1999. The XFree86 Project Inc.
- Copyright 2014 Red Hat, Inc.
-
- Written by Mark Vojkovich (mvojkovi at ucsd.edu)
- Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan at vmware.com)
-*/
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "pixmapstr.h"
-#include "input.h"
-#include <X11/fonts/font.h>
-#include "mi.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "dixfontstr.h"
-#include <X11/fonts/fontstruct.h>
-#include "xf86.h"
-#include "xf86str.h"
-#include "shadowfb.h"
-
-#include "picturestr.h"
-
-static Bool ShadowCloseScreen(ScreenPtr pScreen);
-static Bool ShadowCreateRootWindow(WindowPtr pWin);
-
-typedef struct {
- ScrnInfoPtr pScrn;
- RefreshAreaFuncPtr preRefresh;
- RefreshAreaFuncPtr postRefresh;
- CloseScreenProcPtr CloseScreen;
- CreateWindowProcPtr CreateWindow;
-} ShadowScreenRec, *ShadowScreenPtr;
-
-static DevPrivateKeyRec ShadowScreenKeyRec;
-
-static ShadowScreenPtr
-shadowfbGetScreenPrivate(ScreenPtr pScreen)
-{
- return dixLookupPrivate(&(pScreen)->devPrivates, &ShadowScreenKeyRec);
-}
-
-Bool
-ShadowFBInit2(ScreenPtr pScreen,
- RefreshAreaFuncPtr preRefreshArea,
- RefreshAreaFuncPtr postRefreshArea)
-{
- ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
- ShadowScreenPtr pPriv;
-
- if (!preRefreshArea && !postRefreshArea)
- return FALSE;
-
- if (!dixRegisterPrivateKey(&ShadowScreenKeyRec, PRIVATE_SCREEN, 0))
- return FALSE;
-
- if (!(pPriv = (ShadowScreenPtr) malloc(sizeof(ShadowScreenRec))))
- return FALSE;
-
- dixSetPrivate(&pScreen->devPrivates, &ShadowScreenKeyRec, pPriv);
-
- pPriv->pScrn = pScrn;
- pPriv->preRefresh = preRefreshArea;
- pPriv->postRefresh = postRefreshArea;
-
- pPriv->CloseScreen = pScreen->CloseScreen;
- pPriv->CreateWindow = pScreen->CreateWindow;
-
- pScreen->CloseScreen = ShadowCloseScreen;
- pScreen->CreateWindow = ShadowCreateRootWindow;
-
- return TRUE;
-}
-
-Bool
-ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea)
-{
- return ShadowFBInit2(pScreen, NULL, refreshArea);
-}
-
-/*
- * Note that we don't do DamageEmpty, or indeed look at the region inside the
- * DamagePtr at all. This is an optimization, believe it or not. The
- * incoming RegionPtr is the new damage, and if we were to empty the region
- * miext/damage would just have to waste time reallocating and re-unioning
- * it every time, whereas if we leave it around the union gets fast-pathed
- * away.
- */
-
-static void
-shadowfbReportPre(DamagePtr damage, RegionPtr reg, void *closure)
-{
- ShadowScreenPtr pPriv = closure;
-
- if (!pPriv->pScrn->vtSema)
- return;
-
- pPriv->preRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg));
-}
-
-static void
-shadowfbReportPost(DamagePtr damage, RegionPtr reg, void *closure)
-{
- ShadowScreenPtr pPriv = closure;
-
- if (!pPriv->pScrn->vtSema)
- return;
-
- pPriv->postRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg));
-}
-
-static Bool
-ShadowCreateRootWindow(WindowPtr pWin)
-{
- Bool ret;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen);
-
- /* paranoia */
- if (pWin != pScreen->root)
- ErrorF("ShadowCreateRootWindow called unexpectedly\n");
-
- /* call down, but don't hook ourselves back in; we know the first time
- * we're called it's for the root window.
- */
- pScreen->CreateWindow = pPriv->CreateWindow;
- ret = pScreen->CreateWindow(pWin);
-
- /* this might look like it leaks, but the damage code reaps listeners
- * when their drawable disappears.
- */
- if (ret) {
- DamagePtr damage;
-
- if (pPriv->preRefresh) {
- damage = DamageCreate(shadowfbReportPre, NULL,
- DamageReportRawRegion,
- TRUE, pScreen, pPriv);
- DamageRegister(&pWin->drawable, damage);
- }
-
- if (pPriv->postRefresh) {
- damage = DamageCreate(shadowfbReportPost, NULL,
- DamageReportRawRegion,
- TRUE, pScreen, pPriv);
- DamageSetReportAfterOp(damage, TRUE);
- DamageRegister(&pWin->drawable, damage);
- }
- }
-
- return ret;
-}
-
-static Bool
-ShadowCloseScreen(ScreenPtr pScreen)
-{
- ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen);
-
- pScreen->CloseScreen = pPriv->CloseScreen;
-
- free(pPriv);
-
- return (*pScreen->CloseScreen) (pScreen);
-}
diff --git a/hw/xfree86/shadowfb/shadowfb.c b/hw/xfree86/shadowfb/shadowfb.c
new file mode 100644
index 0000000..d2481ed
--- /dev/null
+++ b/hw/xfree86/shadowfb/shadowfb.c
@@ -0,0 +1,171 @@
+/*
+ Copyright (C) 1999. The XFree86 Project Inc.
+ Copyright 2014 Red Hat, Inc.
+
+ Written by Mark Vojkovich (mvojkovi at ucsd.edu)
+ Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan at vmware.com)
+*/
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "pixmapstr.h"
+#include "input.h"
+#include <X11/fonts/font.h>
+#include "mi.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "dixfontstr.h"
+#include <X11/fonts/fontstruct.h>
+#include "xf86.h"
+#include "xf86str.h"
+#include "shadowfb.h"
+
+#include "picturestr.h"
+
+static Bool ShadowCloseScreen(ScreenPtr pScreen);
+static Bool ShadowCreateRootWindow(WindowPtr pWin);
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ RefreshAreaFuncPtr preRefresh;
+ RefreshAreaFuncPtr postRefresh;
+ CloseScreenProcPtr CloseScreen;
+ CreateWindowProcPtr CreateWindow;
+} ShadowScreenRec, *ShadowScreenPtr;
+
+static DevPrivateKeyRec ShadowScreenKeyRec;
+
+static ShadowScreenPtr
+shadowfbGetScreenPrivate(ScreenPtr pScreen)
+{
+ return dixLookupPrivate(&(pScreen)->devPrivates, &ShadowScreenKeyRec);
+}
+
+Bool
+ShadowFBInit2(ScreenPtr pScreen,
+ RefreshAreaFuncPtr preRefreshArea,
+ RefreshAreaFuncPtr postRefreshArea)
+{
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ ShadowScreenPtr pPriv;
+
+ if (!preRefreshArea && !postRefreshArea)
+ return FALSE;
+
+ if (!dixRegisterPrivateKey(&ShadowScreenKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
+ if (!(pPriv = (ShadowScreenPtr) malloc(sizeof(ShadowScreenRec))))
+ return FALSE;
+
+ dixSetPrivate(&pScreen->devPrivates, &ShadowScreenKeyRec, pPriv);
+
+ pPriv->pScrn = pScrn;
+ pPriv->preRefresh = preRefreshArea;
+ pPriv->postRefresh = postRefreshArea;
+
+ pPriv->CloseScreen = pScreen->CloseScreen;
+ pPriv->CreateWindow = pScreen->CreateWindow;
+
+ pScreen->CloseScreen = ShadowCloseScreen;
+ pScreen->CreateWindow = ShadowCreateRootWindow;
+
+ return TRUE;
+}
+
+Bool
+ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea)
+{
+ return ShadowFBInit2(pScreen, NULL, refreshArea);
+}
+
+/*
+ * Note that we don't do DamageEmpty, or indeed look at the region inside the
+ * DamagePtr at all. This is an optimization, believe it or not. The
+ * incoming RegionPtr is the new damage, and if we were to empty the region
+ * miext/damage would just have to waste time reallocating and re-unioning
+ * it every time, whereas if we leave it around the union gets fast-pathed
+ * away.
+ */
+
+static void
+shadowfbReportPre(DamagePtr damage, RegionPtr reg, void *closure)
+{
+ ShadowScreenPtr pPriv = closure;
+
+ if (!pPriv->pScrn->vtSema)
+ return;
+
+ pPriv->preRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg));
+}
+
+static void
+shadowfbReportPost(DamagePtr damage, RegionPtr reg, void *closure)
+{
+ ShadowScreenPtr pPriv = closure;
+
+ if (!pPriv->pScrn->vtSema)
+ return;
+
+ pPriv->postRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg));
+}
+
+static Bool
+ShadowCreateRootWindow(WindowPtr pWin)
+{
+ Bool ret;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen);
+
+ /* paranoia */
+ if (pWin != pScreen->root)
+ ErrorF("ShadowCreateRootWindow called unexpectedly\n");
+
+ /* call down, but don't hook ourselves back in; we know the first time
+ * we're called it's for the root window.
+ */
+ pScreen->CreateWindow = pPriv->CreateWindow;
+ ret = pScreen->CreateWindow(pWin);
+
+ /* this might look like it leaks, but the damage code reaps listeners
+ * when their drawable disappears.
+ */
+ if (ret) {
+ DamagePtr damage;
+
+ if (pPriv->preRefresh) {
+ damage = DamageCreate(shadowfbReportPre, NULL,
+ DamageReportRawRegion,
+ TRUE, pScreen, pPriv);
+ DamageRegister(&pWin->drawable, damage);
+ }
+
+ if (pPriv->postRefresh) {
+ damage = DamageCreate(shadowfbReportPost, NULL,
+ DamageReportRawRegion,
+ TRUE, pScreen, pPriv);
+ DamageSetReportAfterOp(damage, TRUE);
+ DamageRegister(&pWin->drawable, damage);
+ }
+ }
+
+ return ret;
+}
+
+static Bool
+ShadowCloseScreen(ScreenPtr pScreen)
+{
+ ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen);
+
+ pScreen->CloseScreen = pPriv->CloseScreen;
+
+ free(pPriv);
+
+ return (*pScreen->CloseScreen) (pScreen);
+}
commit 98caba9f5669291e84f8610cc3071a9ac2df205f
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:29 2016 -0500
dix: Clear graphicsExposures for scratch GCs in one place
... instead of in all the CreateScratchGC callers.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/dix/gc.c b/dix/gc.c
index 960e868..cb8db85 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -811,6 +811,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
FreeGC(pGC, (XID) 0);
pGC = (GCPtr) NULL;
}
+ pGC->graphicsExposures = FALSE;
return pGC;
}
@@ -843,7 +844,6 @@ CreateGCperDepth(int screenNum)
/* do depth 1 separately because it's not included in list */
if (!(ppGC[0] = CreateScratchGC(pScreen, 1)))
return FALSE;
- ppGC[0]->graphicsExposures = FALSE;
/* Make sure we don't overflow GCperDepth[] */
if (pScreen->numDepths > MAXFORMATS)
return FALSE;
@@ -855,7 +855,6 @@ CreateGCperDepth(int screenNum)
(void) FreeGC(ppGC[i], (XID) 0);
return FALSE;
}
- ppGC[i + 1]->graphicsExposures = FALSE;
}
return TRUE;
}
@@ -1072,10 +1071,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen)
}
}
/* if we make it this far, need to roll our own */
- pGC = CreateScratchGC(pScreen, depth);
- if (pGC)
- pGC->graphicsExposures = FALSE;
- return pGC;
+ return CreateScratchGC(pScreen, depth);
}
/*
commit e900a00f8dc5a1db63bafddd4ad1cde744975db1
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 9 14:52:28 2016 -0500
dix: Rename (and retype) PixmapPerDepth[1] to defaultStipple
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/dix/gc.c b/dix/gc.c
index 78f3be2..960e868 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -504,7 +504,7 @@ NewGCObject(ScreenPtr pScreen, int depth)
pGC->font = defaultFont;
if (pGC->font) /* necessary, because open of default font could fail */
pGC->font->refcnt++;
- pGC->stipple = pGC->pScreen->PixmapPerDepth[0];
+ pGC->stipple = pGC->pScreen->defaultStipple;
if (pGC->stipple)
pGC->stipple->refcnt++;
@@ -874,8 +874,7 @@ CreateDefaultStipple(int screenNum)
w = 16;
h = 16;
(*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen);
- if (!(pScreen->PixmapPerDepth[0] =
- (*pScreen->CreatePixmap) (pScreen, w, h, 1, 0)))
+ if (!(pScreen->defaultStipple = pScreen->CreatePixmap(pScreen, w, h, 1, 0)))
return FALSE;
/* fill stipple with 1 */
tmpval[0].val = GXcopy;
@@ -883,17 +882,17 @@ CreateDefaultStipple(int screenNum)
tmpval[2].val = FillSolid;
pgcScratch = GetScratchGC(1, pScreen);
if (!pgcScratch) {
- (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]);
+ (*pScreen->DestroyPixmap) (pScreen->defaultStipple);
return FALSE;
}
(void) ChangeGC(NullClient, pgcScratch,
GCFunction | GCForeground | GCFillStyle, tmpval);
- ValidateGC((DrawablePtr) pScreen->PixmapPerDepth[0], pgcScratch);
+ ValidateGC((DrawablePtr) pScreen->defaultStipple, pgcScratch);
rect.x = 0;
rect.y = 0;
rect.width = w;
rect.height = h;
- (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->PixmapPerDepth[0],
+ (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->defaultStipple,
pgcScratch, 1, &rect);
FreeScratchGC(pgcScratch);
return TRUE;
@@ -904,7 +903,7 @@ FreeDefaultStipple(int screenNum)
{
ScreenPtr pScreen = screenInfo.screens[screenNum];
- (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]);
+ (*pScreen->DestroyPixmap) (pScreen->defaultStipple);
}
int
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index 75d7166..4f5ca72 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -922,7 +922,7 @@ dmxBECreateResources(void *value, XID id, RESTYPE type, void *n)
dmxBECreatePixmap(pGC->tile.pixmap);
dmxBERestorePixmap(pGC->tile.pixmap);
}
- if (pGC->stipple != pScreen->PixmapPerDepth[0]) {
+ if (pGC->stipple != pScreen->defaultStipple) {
dmxBECreatePixmap(pGC->stipple);
dmxBERestorePixmap(pGC->stipple);
}
@@ -1327,8 +1327,8 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
* updated to handle dynamic addition/removal of screens. */
/* Create default stipple */
- dmxBECreatePixmap(pScreen->PixmapPerDepth[0]);
- dmxBERestorePixmap(pScreen->PixmapPerDepth[0]);
+ dmxBECreatePixmap(pScreen->defaultStipple);
+ dmxBERestorePixmap(pScreen->defaultStipple);
/* Create the scratch GCs */
dmxBECreateScratchGCs(idx);
@@ -1692,8 +1692,8 @@ dmxDetachScreen(int idx)
dmxBEDestroyWindowTree(idx);
/* Free default stipple */
- dmxBESavePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]);
- dmxBEFreePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]);
+ dmxBESavePixmap(screenInfo.screens[idx]->defaultStipple);
+ dmxBEFreePixmap(screenInfo.screens[idx]->defaultStipple);
/* Free the remaining screen resources and close the screen */
dmxBECloseScreen(screenInfo.screens[idx]);
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 214b550..30c6a46 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -248,7 +248,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->whitePixel = xnestWhitePixel;
pScreen->blackPixel = xnestBlackPixel;
/* GCperDepth */
- /* PixmapPerDepth */
+ /* defaultStipple */
pScreen->devPrivate = NULL;
/* WindowPrivateLen */
/* WindowPrivateSizes */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index f898392..f174549 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -504,14 +504,12 @@ typedef struct _Screen {
char backingStoreSupport, saveUnderSupport;
unsigned long whitePixel, blackPixel;
GCPtr GCperDepth[MAXFORMATS + 1];
- /* next field is a stipple to use as default in
- a GC. we don't build default tiles of all depths
- because they are likely to be of a color
- different from the default fg pixel, so
- we don't win anything by building
- a standard one.
+ /* next field is a stipple to use as default in a GC. we don't build
+ * default tiles of all depths because they are likely to be of a color
+ * different from the default fg pixel, so we don't win anything by
+ * building a standard one.
*/
- PixmapPtr PixmapPerDepth[1];
+ PixmapPtr defaultStipple;
void *devPrivate;
short numVisuals;
VisualPtr visuals;
More information about the xorg-commit
mailing list