summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2003-10-22 06:00:50 +0000
committerKeith Packard <keithp@keithp.com>2003-10-22 06:00:50 +0000
commit52ada03edb1367928de62050d98e61b8dc9bda48 (patch)
tree7e3d6b9703c5a85b518088f6bfa506e751db630f /hw/kdrive
parent950cb2fd60ddbeea325b3958df59a4d2a29db88d (diff)
Build damage infrastructure. Don't build layer
Move check for 24/32 copy to fbCopyNtoN so that other users will hit it Eliminate miext/layer Build damage infrastructure. Don't build layer Build damage infrastructure. Don't build layer Memory leak fix of mach64c on server reset Memory leak fix for video on server reset. Eliminate layer Build damage infrastructure. Don't build layer Build damage infrastructure. Don't build layer Build damage infrastructure. Don't build layer Build damage infrastructure. Don't build layer Don't assume windows are onscreen, use GetWindowPixmap and test devPrivate.ptr. Make sure depth 24 pixmaps are 24bpp when hardware format is 24bpp. Get rid of debug KdAssertSync function add memory_size to KdScreenInfo, eliminate off_screen_size, fix tests to suit. Build damage infrastructure. Don't build layer Use damage (for software cursor, I guess) Damage is used for software cursor Build damage infrastructure. Don't build layer Use damage to track changes Fix memory leak
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/fbdev/Makefile.am4
-rw-r--r--hw/kdrive/fbdev/fbdev.c92
-rw-r--r--hw/kdrive/fbdev/fbdev.h4
-rw-r--r--hw/kdrive/linux/Makefile.am2
-rw-r--r--hw/kdrive/mach64/Makefile.am4
-rw-r--r--hw/kdrive/mach64/mach64.c17
-rw-r--r--hw/kdrive/mach64/mach64.h1
-rw-r--r--hw/kdrive/mach64/mach64draw.c1
-rw-r--r--hw/kdrive/mach64/mach64video.c18
-rw-r--r--hw/kdrive/mga/Makefile.am4
-rw-r--r--hw/kdrive/mga/mga.c17
-rw-r--r--hw/kdrive/nvidia/Makefile.am4
-rw-r--r--hw/kdrive/nvidia/nvidia.c6
-rw-r--r--hw/kdrive/r128/Makefile.am4
-rw-r--r--hw/kdrive/smi/Makefile.am4
-rw-r--r--hw/kdrive/src/Makefile.am1
-rw-r--r--hw/kdrive/src/kaa.c136
-rw-r--r--hw/kdrive/src/kasync.c8
-rw-r--r--hw/kdrive/src/kdrive.c4
-rw-r--r--hw/kdrive/src/kdrive.h7
-rw-r--r--hw/kdrive/src/koffscreen.c6
-rw-r--r--hw/kdrive/vesa/Makefile.am4
-rw-r--r--hw/kdrive/vesa/vesa.c110
-rw-r--r--hw/kdrive/vesa/vesa.h9
24 files changed, 223 insertions, 244 deletions
diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am
index 43e737cc4..0d1c14a11 100644
--- a/hw/kdrive/fbdev/Makefile.am
+++ b/hw/kdrive/fbdev/Makefile.am
@@ -2,7 +2,7 @@ INCLUDES = \
-I$(top_srcdir)/fb \
-I$(top_srcdir)/hw/kdrive/src \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/miext/shadow \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
@@ -22,10 +22,10 @@ Xfbdev_LDADD = \
libfbdev.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
$(top_builddir)/miext/shadow/libshadow.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
$(top_builddir)/xfixes/libxfixes.a \
diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index e9ab57454..63db395d7 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -190,7 +190,6 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
}
screen->rate = 72;
scrpriv->randr = screen->randr;
- scrpriv->layerKind = LAYER_FB;
#ifdef FAKE24_ON_16
if (screen->fb[0].depth == 24 && screen->fb[0].bitsPerPixel == 24 &&
@@ -380,16 +379,15 @@ fbdevConfigureScreen (ScreenPtr pScreen)
KdSetMouseMatrix (&m);
}
-LayerPtr
-fbdevLayerCreate (ScreenPtr pScreen)
+PixmapPtr
+fbdevGetPixmap (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
FbdevScrPriv *scrpriv = screen->driver;
ShadowUpdateProc update;
ShadowWindowProc window;
- PixmapPtr pPixmap;
- int kind;
+ PixmapPtr pShadow, pPixmap;
if (scrpriv->shadow)
{
@@ -408,21 +406,26 @@ fbdevLayerCreate (ScreenPtr pScreen)
else
update = shadowUpdatePacked;
}
- if (!update)
- abort ();
- kind = LAYER_SHADOW;
- pPixmap = 0;
+ pPixmap = (*pScreen->CreatePixmap) (pScreen,
+ pScreen->width,
+ pScreen->height,
+ screen->fb[0].depth);
+ if (!pPixmap)
+ return FALSE;
+ shadowSet (pScreen, pPixmap, update, window, scrpriv->randr, 0);
+ pShadow = pPixmap;
}
else
{
- kind = scrpriv->layerKind;
- pPixmap = LAYER_SCREEN_PIXMAP;
- update = 0;
- window = 0;
+ pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
+ pShadow = 0;
}
- return LayerCreate (pScreen, kind, screen->fb[0].depth,
- pPixmap, update, window, scrpriv->randr, 0);
+ if (scrpriv->pShadow)
+ (*pScreen->DestroyPixmap) (scrpriv->pShadow);
+ scrpriv->pShadow = pShadow;
+
+ return pPixmap;
}
@@ -459,25 +462,12 @@ fbdevRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
}
int
-fbdevLayerAdd (WindowPtr pWin, pointer value)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLayer = (LayerPtr) value;
-
- if (!LayerWindowAdd (pScreen, pLayer, pWin))
- return WT_STOPWALKING;
-
- return WT_WALKCHILDREN;
-}
-
-int
-fbdevLayerRemove (WindowPtr pWin, pointer value)
+fbdevPixmapSet (WindowPtr pWin, pointer value)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLayer = (LayerPtr) value;
-
- LayerWindowRemove (pScreen, pLayer, pWin);
+ PixmapPtr pPixmap = value;
+ (*pScreen->SetWindowPixmap) (pWin, pPixmap);
return WT_WALKCHILDREN;
}
@@ -496,8 +486,8 @@ fbdevRandRSetConfig (ScreenPtr pScreen,
int oldheight;
int oldmmwidth;
int oldmmheight;
- LayerPtr pNewLayer;
int newwidth, newheight;
+ PixmapPtr pPixmap;
if (screen->randr & (RR_Rotate_0|RR_Rotate_180))
{
@@ -528,26 +518,21 @@ fbdevRandRSetConfig (ScreenPtr pScreen,
fbdevConfigureScreen (pScreen);
- pNewLayer = fbdevLayerCreate (pScreen);
- if (!pNewLayer)
+ /*
+ * Get the pixmap that windows live in
+ */
+ pPixmap = fbdevGetPixmap (pScreen);
+ if (!pPixmap)
goto bail4;
- if (WalkTree (pScreen, fbdevLayerAdd, (pointer) pNewLayer) == WT_STOPWALKING)
- goto bail5;
-
- WalkTree (pScreen, fbdevLayerRemove, (pointer) scrpriv->pLayer);
- LayerDestroy (pScreen, scrpriv->pLayer);
-
- scrpriv->pLayer = pNewLayer;
+ WalkTree (pScreen, fbdevPixmapSet, (pointer) pPixmap);
+
KdSetSubpixelOrder (pScreen, scrpriv->randr);
if (wasEnabled)
KdEnableScreen (pScreen);
return TRUE;
-bail5:
- WalkTree (pScreen, fbdevLayerRemove, (pointer) pNewLayer);
- LayerDestroy (pScreen, pNewLayer);
bail4:
pScreen->width = oldwidth;
pScreen->height = oldheight;
@@ -616,27 +601,20 @@ fbdevInitScreen (ScreenPtr pScreen)
#endif
pScreen->CreateColormap = fbdevCreateColormap;
-
- if (!LayerStartInit (pScreen))
- return FALSE;
- return TRUE;
+ return shadowSetup (pScreen);
}
Bool
fbdevFinishInitScreen (ScreenPtr pScreen)
{
- KdScreenPriv(pScreen);
- FbdevScrPriv *scrpriv = pScreenPriv->screen->driver;
-
- scrpriv->layerKind = LayerNewKind (pScreen);
+ PixmapPtr pPixmap;
- if (!LayerFinishInit (pScreen))
- return FALSE;
+ fbdevConfigureScreen (pScreen);
- scrpriv->pLayer = fbdevLayerCreate (pScreen);
- if (!scrpriv->pLayer)
+ pPixmap = fbdevGetPixmap (pScreen);
+ if (!pPixmap)
return FALSE;
-
+
#ifdef RANDR
if (!fbdevRandRInit (pScreen))
return FALSE;
diff --git a/hw/kdrive/fbdev/fbdev.h b/hw/kdrive/fbdev/fbdev.h
index 4b14bc2e8..9daff7468 100644
--- a/hw/kdrive/fbdev/fbdev.h
+++ b/hw/kdrive/fbdev/fbdev.h
@@ -30,7 +30,6 @@
#include <unistd.h>
#include <sys/mman.h>
#include "kdrive.h"
-#include "layer.h"
#ifdef RANDR
#include "randrstr.h"
@@ -50,8 +49,7 @@ typedef struct _fbdevPriv {
typedef struct _fbdevScrPriv {
Rotation randr;
Bool shadow;
- int layerKind;
- LayerPtr pLayer;
+ PixmapPtr pShadow;
} FbdevScrPriv;
extern KdCardFuncs fbdevFuncs;
diff --git a/hw/kdrive/linux/Makefile.am b/hw/kdrive/linux/Makefile.am
index 081767cc7..b02ee17c2 100644
--- a/hw/kdrive/linux/Makefile.am
+++ b/hw/kdrive/linux/Makefile.am
@@ -2,7 +2,7 @@ INCLUDES = \
-I$(top_srcdir)/hw/kdrive/src \
-I$(top_srcdir)/mi \
-I$(top_srcdir)/fb \
- -I$(top_srcdir)/miext/layer \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/miext/shadow \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
diff --git a/hw/kdrive/mach64/Makefile.am b/hw/kdrive/mach64/Makefile.am
index 2a960ec5f..66418fbd3 100644
--- a/hw/kdrive/mach64/Makefile.am
+++ b/hw/kdrive/mach64/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = \
-I$(top_srcdir)/hw/kdrive/linux \
-I$(top_srcdir)/hw/kdrive/vesa \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/miext/shadow \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
@@ -31,10 +31,10 @@ Xmach64_LDADD = \
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
$(top_builddir)/miext/shadow/libshadow.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
$(top_builddir)/xfixes/libxfixes.a \
diff --git a/hw/kdrive/mach64/mach64.c b/hw/kdrive/mach64/mach64.c
index a036f3e1d..a6f9c8dad 100644
--- a/hw/kdrive/mach64/mach64.c
+++ b/hw/kdrive/mach64/mach64.c
@@ -70,7 +70,6 @@ mach64ScreenInit (KdScreenInfo *screen)
screen->dumb = TRUE;
if (mach64s->vesa.mapping != VESA_LINEAR)
screen->dumb = TRUE;
- screen->memory_base = mach64s->vesa.fb;
switch (screen->fb[0].depth) {
case 8:
mach64s->colorKey = 0xff;
@@ -86,12 +85,6 @@ mach64ScreenInit (KdScreenInfo *screen)
mach64s->colorKey = 1;
break;
}
- memory = mach64s->vesa.fb_size;
- screen_size = screen->fb[0].byteStride * screen->height;
- memory -= screen_size;
- screen->softCursor = TRUE;
- screen->off_screen_base = screen_size;
- screen->off_screen_size = memory;
screen->driver = mach64s;
return TRUE;
}
@@ -100,10 +93,7 @@ Bool
mach64InitScreen (ScreenPtr pScreen)
{
#ifdef XV
- KdScreenPriv(pScreen);
- Mach64CardInfo *mach64c = pScreenPriv->screen->card->driver;
- if (mach64c->media_reg && mach64c->reg)
- mach64InitVideo(pScreen);
+ mach64InitVideo(pScreen);
#endif
return vesaInitScreen (pScreen);
}
@@ -385,7 +375,9 @@ void
mach64ScreenFini (KdScreenInfo *screen)
{
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
-
+#ifdef XV
+ mach64FiniVideo(screen->pScreen);
+#endif
vesaScreenFini (screen);
xfree (mach64s);
screen->driver = 0;
@@ -398,6 +390,7 @@ mach64CardFini (KdCardInfo *card)
mach64UnmapReg (card, mach64c);
vesaCardFini (card);
+ xfree (mach64c);
}
#define mach64CursorInit 0 /* initCursor */
diff --git a/hw/kdrive/mach64/mach64.h b/hw/kdrive/mach64/mach64.h
index 38ddb9ae9..68e762b3b 100644
--- a/hw/kdrive/mach64/mach64.h
+++ b/hw/kdrive/mach64/mach64.h
@@ -557,6 +557,7 @@ typedef struct _mach64PortPriv {
} Mach64PortPrivRec, *Mach64PortPrivPtr;
Bool mach64InitVideo(ScreenPtr pScreen);
+void mach64FiniVideo(ScreenPtr pScreen);
typedef struct _mach64ScreenInfo {
VesaScreenPrivRec vesa;
diff --git a/hw/kdrive/mach64/mach64draw.c b/hw/kdrive/mach64/mach64draw.c
index aa065c5a8..46cb66a1b 100644
--- a/hw/kdrive/mach64/mach64draw.c
+++ b/hw/kdrive/mach64/mach64draw.c
@@ -449,6 +449,7 @@ mach64DrawDisable (ScreenPtr pScreen)
void
mach64DrawFini (ScreenPtr pScreen)
{
+ kaaDrawFini (pScreen);
}
void
diff --git a/hw/kdrive/mach64/mach64video.c b/hw/kdrive/mach64/mach64video.c
index b66b4007a..64e5fb795 100644
--- a/hw/kdrive/mach64/mach64video.c
+++ b/hw/kdrive/mach64/mach64video.c
@@ -980,7 +980,10 @@ Bool mach64InitVideo(ScreenPtr pScreen)
int num_adaptors;
KdCardInfo *card = pScreenPriv->card;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
+ Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
+ mach64s->pAdaptor = NULL;
+
if (!mach64c->media_reg)
return FALSE;
@@ -1017,3 +1020,18 @@ Bool mach64InitVideo(ScreenPtr pScreen)
xfree(newAdaptors);
return TRUE;
}
+
+void
+mach64FiniVideo (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ mach64ScreenInfo(pScreenPriv);
+ KdVideoAdaptorPtr adapt = mach64s->pAdaptor;
+
+ if (adapt)
+ {
+ Mach64PortPrivPtr pPortPriv = (Mach64PortPrivPtr)(&adapt->pPortPrivates[1]);
+ REGION_UNINIT (pScreen, &pPortPriv->clip);
+ xfree (adapt);
+ }
+}
diff --git a/hw/kdrive/mga/Makefile.am b/hw/kdrive/mga/Makefile.am
index bcc7607ab..68658b5fc 100644
--- a/hw/kdrive/mga/Makefile.am
+++ b/hw/kdrive/mga/Makefile.am
@@ -5,8 +5,8 @@ INCLUDES = \
-I$(top_srcdir)/hw/kdrive/linux \
-I$(top_srcdir)/include \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
-I$(top_srcdir)/miext/shadow \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
$(XSERVER_CFLAGS)
@@ -28,10 +28,10 @@ Xmga_LDADD = \
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
$(top_builddir)/miext/shadow/libshadow.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
$(top_builddir)/xfixes/libxfixes.a \
diff --git a/hw/kdrive/mga/mga.c b/hw/kdrive/mga/mga.c
index 2c3a4831d..106eaa6b9 100644
--- a/hw/kdrive/mga/mga.c
+++ b/hw/kdrive/mga/mga.c
@@ -55,7 +55,6 @@ Bool
mgaScreenInit (KdScreenInfo *screen)
{
MgaScreenInfo *mgas;
- int screen_size, memory;
mgas = (MgaScreenInfo *) xalloc (sizeof (MgaScreenInfo));
if (!mgas)
@@ -75,22 +74,6 @@ mgaScreenInit (KdScreenInfo *screen)
fprintf (stderr, "vesa mapping is %d\n", mgas->vesa.mapping);
#endif
- screen->memory_base = mgas->vesa.fb;
-
- memory = mgas->vesa.fb_size;
- screen_size = screen->fb[0].byteStride * screen->height;
-
- memory -= screen_size;
- if (memory > screen->fb[0].byteStride)
- {
- screen->off_screen_base = screen_size;
- screen->off_screen_size = memory;
- }
- else
- {
- screen->off_screen_base = 0;
- screen->off_screen_size = 0;
- }
screen->driver = mgas;
return TRUE;
}
diff --git a/hw/kdrive/nvidia/Makefile.am b/hw/kdrive/nvidia/Makefile.am
index 324595e8c..0842361ca 100644
--- a/hw/kdrive/nvidia/Makefile.am
+++ b/hw/kdrive/nvidia/Makefile.am
@@ -3,8 +3,8 @@ INCLUDES = \
-I$(top_srcdir)/hw/kdrive/src \
-I$(top_srcdir)/hw/kdrive/vesa \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
-I$(top_srcdir)/miext/shadow \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
$(XSERVER_CFLAGS)
@@ -31,10 +31,10 @@ Xnvidia_LDADD = \
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
$(top_builddir)/miext/shadow/libshadow.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
$(top_builddir)/xfixes/libxfixes.a \
diff --git a/hw/kdrive/nvidia/nvidia.c b/hw/kdrive/nvidia/nvidia.c
index c74daf7a0..75c67ec29 100644
--- a/hw/kdrive/nvidia/nvidia.c
+++ b/hw/kdrive/nvidia/nvidia.c
@@ -111,13 +111,12 @@ nvidiaInitScreen (ScreenPtr pScreen)
}
#ifdef RANDR
+Bool
nvidiaRandRSetConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize)
{
- KdScreenPriv(pScreen);
-
KdCheckSync (pScreen);
if (!vesaRandRSetConfig (pScreen, rotation, rate, pSize))
@@ -149,8 +148,6 @@ nvidiaFinishInitScreen (ScreenPtr pScreen)
void
nvidiaPreserve (KdCardInfo *card)
{
- NvidiaCardInfo *nvidiac = card->driver;
-
vesaPreserve(card);
}
@@ -276,7 +273,6 @@ nvidiaEnable (ScreenPtr pScreen)
return FALSE;
nvidiaSetMMIO (pScreenPriv->card, nvidiac);
- nvidiaDPMS (pScreen, KD_DPMS_NORMAL);
#ifdef XV
KdXVEnable (pScreen);
#endif
diff --git a/hw/kdrive/r128/Makefile.am b/hw/kdrive/r128/Makefile.am
index 86d3070d3..5b8fc824d 100644
--- a/hw/kdrive/r128/Makefile.am
+++ b/hw/kdrive/r128/Makefile.am
@@ -4,8 +4,8 @@ INCLUDES = \
-I$(top_srcdir)/hw/kdrive/vesa \
-I$(top_srcdir)/include \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
-I$(top_srcdir)/miext/shadow \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
$(XSERVER_CFLAGS)
@@ -27,10 +27,10 @@ Xr128_LDADD = \
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
$(top_builddir)/miext/shadow/libshadow.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
$(top_builddir)/xfixes/libxfixes.a \
diff --git a/hw/kdrive/smi/Makefile.am b/hw/kdrive/smi/Makefile.am
index d512ecc6b..b82941319 100644
--- a/hw/kdrive/smi/Makefile.am
+++ b/hw/kdrive/smi/Makefile.am
@@ -4,8 +4,8 @@ INCLUDES = \
-I$(top_srcdir)/hw/kdrive/fbdev \
-I$(top_srcdir)/hw/kdrive/vesa \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
-I$(top_srcdir)/miext/shadow \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
$(XSERVER_CFLAGS)
@@ -29,10 +29,10 @@ Xsmi_LDADD = \
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
$(top_builddir)/miext/shadow/libshadow.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
$(top_builddir)/xfixes/libxfixes.a \
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index 95677f9f6..9f9ad1f69 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -2,6 +2,7 @@ INCLUDES = \
-I$(top_srcdir)/fb \
-I$(top_srcdir)/mi \
-I$(top_srcdir)/miext/shadow \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
$(XSERVER_CFLAGS)
diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c
index 9b1457d77..652e2a898 100644
--- a/hw/kdrive/src/kaa.c
+++ b/hw/kdrive/src/kaa.c
@@ -50,10 +50,6 @@ int kaaPixmapPrivateIndex;
typedef struct {
KaaScreenInfoPtr info;
-
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
- int pixelOffset; /* offset from pPixmap to pixels */
} KaaScreenPrivRec, *KaaScreenPrivPtr;
typedef struct {
@@ -71,22 +67,10 @@ typedef struct {
#define KaaGetScreenPriv(s) ((KaaScreenPrivPtr)(s)->devPrivates[kaaScreenPrivateIndex].ptr)
#define KaaScreenPriv(s) KaaScreenPrivPtr pKaaScr = KaaGetScreenPriv(s)
-#define KaaGetPixmapPriv(p) ((KaaPixmapPrivPtr)(p)->devPrivates[kaaPixmapPrivateIndex].ptr)
-#define KaaSetPixmapPriv(p,a) ((p)->devPrivates[kaaPixmapPrivateIndex].ptr = (pointer) (a))
-#define KaaPixmapPriv(p) KaaPixmapPrivPtr pKaaPixmap = KaaGetPixmapPriv(p)
-
-#define KaaPixmapPitch(w) (((w) + (pKaaScr->info->offscreenPitch - 1)) & ~(pKaaScr->info->offscreenPitch - 1))
-#define KaaDrawableIsOffscreenPixmap(d) (d->type == DRAWABLE_PIXMAP && \
- KaaGetPixmapPriv((PixmapPtr)(d)) && \
- KaaGetPixmapPriv((PixmapPtr)(d))->area)
-#define KaaDrawableIsScreen(d) (((d)->type == DRAWABLE_WINDOW) || \
- KaaDrawableIsOffscreenPixmap(d))
-
-#define KAA_SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \
- ((KaaScreenPrivPtr) (pScreen)->devPrivates[kaaScreenPrivateIndex].ptr)->field)
-
-#define KAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\
- ((pScreen)->field = wrapper)
+#define KaaGetPixmapPriv(p) ((KaaPixmapPrivPtr)(p)->devPrivates[kaaPixmapPrivateIndex].ptr)
+#define KaaSetPixmapPriv(p,a) ((p)->devPrivates[kaaPixmapPrivateIndex].ptr = (pointer) (a))
+#define KaaPixmapPriv(p) KaaPixmapPrivPtr pKaaPixmap = KaaGetPixmapPriv(p)
+#define KaaPixmapPitch(w) (((w) + (pKaaScr->info->offscreenPitch - 1)) & ~(pKaaScr->info->offscreenPitch - 1))
#define MIN_OFFPIX_SIZE (4096)
@@ -268,9 +252,7 @@ kaaDestroyPixmap (PixmapPtr pPixmap)
}
}
- KAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
- ret = (*pScreen->DestroyPixmap) (pPixmap);
- KAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, kaaDestroyPixmap);
+ ret = fbDestroyPixmap (pPixmap);
return ret;
}
@@ -278,12 +260,24 @@ kaaDestroyPixmap (PixmapPtr pPixmap)
static PixmapPtr
kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
{
- PixmapPtr pPixmap = NULL;
+ PixmapPtr pPixmap;
KaaPixmapPrivPtr pKaaPixmap;
+ int bpp;
- KAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
- pPixmap = (* pScreen->CreatePixmap) (pScreen, w, h, depth);
- KAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, kaaCreatePixmap);
+ bpp = BitsPerPixel (depth);
+ if (bpp == 32 && depth == 24)
+ {
+ int fb;
+ KdScreenPriv (pScreen);
+
+ for (fb = 0; fb < KD_MAX_FB && pScreenPriv->screen->fb[fb].depth; fb++)
+ if (pScreenPriv->screen->fb[fb].depth == 24)
+ {
+ bpp = pScreenPriv->screen->fb[fb].bitsPerPixel;
+ break;
+ }
+ }
+ pPixmap = fbCreatePixmapBpp (pScreen, w, h, depth, bpp);
if (!pPixmap)
return NULL;
pKaaPixmap = KaaGetPixmapPriv(pPixmap);
@@ -295,27 +289,52 @@ kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
return pPixmap;
}
-PixmapPtr
-kaaGetDrawingPixmap (DrawablePtr pDrawable, int *x, int *y)
+static Bool
+kaaPixmapIsOffscreen(PixmapPtr p)
+{
+ ScreenPtr pScreen = p->drawable.pScreen;
+ KdScreenPriv(pScreen);
+
+ return ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
+ (CARD8 *) pScreenPriv->screen->memory_base) <
+ pScreenPriv->screen->memory_size);
+}
+
+static PixmapPtr
+kaaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
{
+ PixmapPtr pPixmap;
+ int x = 0, y = 0;
+
if (pDrawable->type == DRAWABLE_WINDOW) {
+ pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
if (x)
- *x = pDrawable->x;
+ x += pDrawable->x;
if (y)
- *y = pDrawable->y;
-
- return (*pDrawable->pScreen->GetScreenPixmap) (pDrawable->pScreen);
+ y += pDrawable->y;
}
- else if (KaaDrawableIsOffscreenPixmap (pDrawable))
+ else
+ pPixmap = (PixmapPtr) pDrawable;
+ if (kaaPixmapIsOffscreen (pPixmap))
{
- if (x)
- *x = 0;
- if (y)
- *y = 0;
- return ((PixmapPtr)pDrawable);
+ x += pPixmap->drawable.x;
+ y += pPixmap->drawable.y;
+ if (xp) *xp = x;
+ if (yp) *yp = y;
+ return pPixmap;
}
+ return NULL;
+}
+
+static Bool
+kaaDrawableIsOffscreen (DrawablePtr pDrawable)
+{
+ PixmapPtr pPixmap;
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
else
- return NULL;
+ pPixmap = (PixmapPtr) pDrawable;
+ return kaaPixmapIsOffscreen (pPixmap);
}
void
@@ -335,7 +354,7 @@ kaaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
if (!pScreenPriv->enabled ||
pGC->fillStyle != FillSolid ||
- !(pPixmap = kaaGetDrawingPixmap (pDrawable, NULL, NULL)) ||
+ !(pPixmap = kaaGetOffscreenPixmap (pDrawable, NULL, NULL)) ||
!(*pKaaScr->info->PrepareSolid) (pPixmap,
pGC->alu,
pGC->planemask,
@@ -389,7 +408,8 @@ kaaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
if (partX2 > fullX2)
partX2 = fullX2;
if (partX2 > partX1)
- (*pKaaScr->info->Solid) (partX1, fullY1, partX2, fullY1 + 1);
+ (*pKaaScr->info->Solid) (partX1, fullY1,
+ partX2, fullY1 + 1);
}
pbox++;
}
@@ -418,15 +438,15 @@ kaaCopyNtoN (DrawablePtr pSrcDrawable,
/* Migrate pixmaps to same place as destination */
if (pScreenPriv->enabled && pSrcDrawable->type == DRAWABLE_PIXMAP) {
- if (KaaDrawableIsScreen (pDstDrawable))
+ if (kaaDrawableIsOffscreen (pDstDrawable))
kaaPixmapUseScreen ((PixmapPtr) pSrcDrawable);
else
kaaPixmapUseMemory ((PixmapPtr) pSrcDrawable);
}
if (pScreenPriv->enabled &&
- (pSrcPixmap = kaaGetDrawingPixmap (pSrcDrawable, NULL, NULL)) &&
- (pDstPixmap = kaaGetDrawingPixmap (pDstDrawable, NULL, NULL)) &&
+ (pSrcPixmap = kaaGetOffscreenPixmap (pSrcDrawable, NULL, NULL)) &&
+ (pDstPixmap = kaaGetOffscreenPixmap (pDstDrawable, NULL, NULL)) &&
(*pKaaScr->info->PrepareCopy) (pSrcPixmap,
pDstPixmap,
dx,
@@ -483,7 +503,7 @@ kaaPolyFillRect(DrawablePtr pDrawable,
if (!pScreenPriv->enabled ||
pGC->fillStyle != FillSolid ||
- !(pPixmap = kaaGetDrawingPixmap (pDrawable, &xorg, &yorg)) ||
+ !(pPixmap = kaaGetOffscreenPixmap (pDrawable, &xorg, &yorg)) ||
!(*pKaaScr->info->PrepareSolid) (pPixmap,
pGC->alu,
pGC->planemask,
@@ -577,7 +597,7 @@ kaaSolidBoxClipped (DrawablePtr pDrawable,
int partX1, partX2, partY1, partY2;
if (!pScreenPriv->enabled ||
- !(pPixmap = kaaGetDrawingPixmap (pDrawable, NULL, NULL)) ||
+ !(pPixmap = kaaGetOffscreenPixmap (pDrawable, NULL, NULL)) ||
!(*pKaaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg))
{
KdCheckSync (pDrawable->pScreen);
@@ -781,7 +801,7 @@ kaaValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable)
{
fbValidateGC (pGC, changes, pDrawable);
- if (KaaDrawableIsScreen (pDrawable))
+ if (kaaDrawableIsOffscreen (pDrawable))
pGC->ops = (GCOps *) &kaaOps;
else
pGC->ops = (GCOps *) &kdAsyncPixmapGCOps;
@@ -843,7 +863,7 @@ kaaFillRegionSolid (DrawablePtr pDrawable,
PixmapPtr pPixmap;
if (pScreenPriv->enabled &&
- (pPixmap = kaaGetDrawingPixmap (pDrawable, NULL, NULL)) &&
+ (pPixmap = kaaGetOffscreenPixmap (pDrawable, NULL, NULL)) &&
(*pKaaScr->info->PrepareSolid) (pPixmap, GXcopy, FB_ALLONES, pixel))
{
int nbox = REGION_NUM_RECTS (pRegion);
@@ -933,7 +953,8 @@ kaaDrawInit (ScreenPtr pScreen,
KaaScreenInfoPtr pScreenInfo)
{
KaaScreenPrivPtr pKaaScr;
- KdScreenInfo *screen = KdGetScreenPriv (pScreen)->screen;
+ KdScreenPriv(pScreen);
+ KdScreenInfo *screen = pScreenPriv->screen;
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
@@ -974,15 +995,13 @@ kaaDrawInit (ScreenPtr pScreen,
* Hookup offscreen pixmaps
*/
if ((pKaaScr->info->flags & KAA_OFFSCREEN_PIXMAPS) &&
- screen->off_screen_size > 0)
+ screen->off_screen_base < screen->memory_size)
{
- pKaaScr->CreatePixmap = pScreen->CreatePixmap;
- pScreen->CreatePixmap = kaaCreatePixmap;
- pKaaScr->DestroyPixmap = pScreen->DestroyPixmap;
- pScreen->DestroyPixmap = kaaDestroyPixmap;
if (!AllocatePixmapPrivate(pScreen, kaaPixmapPrivateIndex,
sizeof (KaaPixmapPrivRec)))
return FALSE;
+ pScreen->CreatePixmap = kaaCreatePixmap;
+ pScreen->DestroyPixmap = kaaDestroyPixmap;
}
else
{
@@ -993,3 +1012,10 @@ kaaDrawInit (ScreenPtr pScreen,
return TRUE;
}
+void
+kaaDrawFini (ScreenPtr pScreen)
+{
+ KaaScreenPriv(pScreen);
+
+ xfree (pKaaScr);
+}
diff --git a/hw/kdrive/src/kasync.c b/hw/kdrive/src/kasync.c
index 3c9158d9f..a2807e899 100644
--- a/hw/kdrive/src/kasync.c
+++ b/hw/kdrive/src/kasync.c
@@ -305,11 +305,3 @@ const GCOps kdAsyncPixmapGCOps = {
,NULL
#endif
};
-
-void
-KdAssertSync (ScreenPtr pScreen)
-{
- KdScreenPriv(pScreen);
- KdCardInfo *card = pScreenPriv->card;
- assert (!card->needSync);
-}
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index a3ed0e764..3d79418cc 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -844,7 +844,7 @@ KdCloseScreen (int index, ScreenPtr pScreen)
pScreen->CloseScreen = pScreenPriv->CloseScreen;
ret = (*pScreen->CloseScreen) (index, pScreen);
- if (screen->off_screen_size > 0)
+ if (screen->off_screen_base < screen->memory_size)
KdOffscreenFini (pScreen);
if (pScreenPriv->dpmsState != KD_DPMS_NORMAL)
@@ -1130,7 +1130,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
if (!(*card->cfuncs->initAccel) (pScreen))
screen->dumb = TRUE;
- if (screen->off_screen_size > 0)
+ if (screen->off_screen_base < screen->memory_size)
KdOffscreenInit (pScreen);
#ifdef PSEUDO8
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 6cc976913..12e1fa94f 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -119,8 +119,8 @@ typedef struct _KdScreenInfo {
DDXPointRec origin;
KdFrameBuffer fb[KD_MAX_FB];
CARD8 *memory_base;
- int off_screen_base;
- int off_screen_size;
+ unsigned long memory_size;
+ unsigned long off_screen_base;
struct _RealOffscreenArea *off_screen_areas;
} KdScreenInfo;
@@ -352,6 +352,9 @@ kaaDrawInit (ScreenPtr pScreen,
KaaScreenInfoPtr pScreenInfo);
void
+kaaDrawFini (ScreenPtr pScreen);
+
+void
kaaWrapGC (GCPtr pGC);
void
diff --git a/hw/kdrive/src/koffscreen.c b/hw/kdrive/src/koffscreen.c
index a8476ab6f..1478d104d 100644
--- a/hw/kdrive/src/koffscreen.c
+++ b/hw/kdrive/src/koffscreen.c
@@ -61,7 +61,7 @@ KdOffscreenValidate (ScreenPtr pScreen)
prev = area;
}
- assert (prev->area.offset + prev->area.size == pScreenPriv->screen->off_screen_size);
+ assert (prev->area.offset + prev->area.size == pScreenPriv->screen->memory_size);
}
#else
#define KdOffscreenValidate(s)
@@ -97,7 +97,7 @@ KdOffscreenAlloc (ScreenPtr pScreen, int size, int align,
}
/* throw out requests that cannot fit */
- if (size > pScreenPriv->screen->off_screen_size)
+ if (size > (pScreenPriv->screen->memory_size - pScreenPriv->screen->off_screen_base))
{
DBG_OFFSCREEN (("Alloc 0x%x -> TOBIG\n", size));
return NULL;
@@ -280,7 +280,7 @@ KdOffscreenInit (ScreenPtr pScreen)
area->area.screen = NULL;
area->area.offset = pScreenPriv->screen->off_screen_base;
- area->area.size = pScreenPriv->screen->off_screen_size;
+ area->area.size = pScreenPriv->screen->memory_size - area->area.offset;
area->save = 0;
area->locked = FALSE;
area->next = NULL;
diff --git a/hw/kdrive/vesa/Makefile.am b/hw/kdrive/vesa/Makefile.am
index 1c639a2e2..232ce9787 100644
--- a/hw/kdrive/vesa/Makefile.am
+++ b/hw/kdrive/vesa/Makefile.am
@@ -2,7 +2,7 @@ INCLUDES = \
-I$(top_srcdir)/fb \
-I$(top_srcdir)/hw/kdrive/src \
-I$(top_srcdir)/mi \
- -I$(top_srcdir)/miext/layer \
+ -I$(top_srcdir)/miext/damage \
-I$(top_srcdir)/miext/shadow \
-I$(top_srcdir)/randr \
-I$(top_srcdir)/render \
@@ -25,9 +25,9 @@ Xvesa_LDADD = \
libvesa.a \
$(top_builddir)/dix/libdix.a \
$(top_builddir)/os/libos.a \
- $(top_builddir)/miext/layer/liblayer.a \
$(top_builddir)/hw/kdrive/src/libkdrive.a \
$(top_builddir)/hw/kdrive/linux/liblinux.a \
+ $(top_builddir)/miext/damage/libdamage.a \
$(top_builddir)/miext/shadow/libshadow.a \
$(top_builddir)/randr/librandr.a \
$(top_builddir)/render/librender.a \
diff --git a/hw/kdrive/vesa/vesa.c b/hw/kdrive/vesa/vesa.c
index 8786d2562..9bd7de8b2 100644
--- a/hw/kdrive/vesa/vesa.c
+++ b/hw/kdrive/vesa/vesa.c
@@ -463,8 +463,6 @@ vesaScreenInitialize (KdScreenInfo *screen, VesaScreenPrivPtr pscr)
pscr->randr = screen->randr;
pscr->shadow = vesa_shadow;
pscr->origDepth = screen->fb[0].depth;
- pscr->layerKind = LAYER_FB;
-
/*
* Compute visual support for the selected depth
*/
@@ -683,7 +681,7 @@ void
vesaUpdateMono (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = REGION_NUM_RECTS (damage);
BoxPtr pbox = REGION_RECTS (damage);
@@ -831,16 +829,15 @@ vesaConfigureScreen (ScreenPtr pScreen)
KdSetMouseMatrix (&m);
}
-LayerPtr
-vesaLayerCreate (ScreenPtr pScreen)
+PixmapPtr
+vesaGetPixmap (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
VesaScreenPrivPtr pscr = pScreenPriv->screen->driver;
ShadowUpdateProc update;
ShadowWindowProc window = 0;
- PixmapPtr pPixmap;
- int kind;
+ PixmapPtr pShadow, pPixmap;
if (pscr->shadow)
{
@@ -872,23 +869,35 @@ vesaLayerCreate (ScreenPtr pScreen)
break;
}
- kind = LAYER_SHADOW;
- pPixmap = 0;
+ pPixmap = (*pScreen->CreatePixmap) (pScreen,
+ pScreen->width,
+ pScreen->height,
+ screen->fb[0].depth);
+ if (!pPixmap)
+ return NullPixmap;
+ if (!shadowSet (pScreen, pPixmap, update,
+ window, pscr->randr, 0))
+ {
+ (*pScreen->DestroyPixmap) (pPixmap);
+ return NullPixmap;
+ }
+ pShadow = pPixmap;
}
else
{
- kind = pscr->layerKind;
- pPixmap = LAYER_SCREEN_PIXMAP;
- update = 0;
- window = 0;
+ pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
+ pShadow = 0;
+ shadowUnset (pScreen);
}
+
+ if (pscr->pShadow)
+ (*pScreen->DestroyPixmap) (pscr->pShadow);
+ pscr->pShadow = pShadow;
if (vesa_verbose)
ErrorF ("Mode selected %dx%dx%d\n",
pScreen->width, pScreen->height, screen->fb[0].depth);
-
- return LayerCreate (pScreen, kind, screen->fb[0].depth,
- pPixmap, update, window, pscr->randr, 0);
+ return pPixmap;
}
Bool
@@ -1013,7 +1022,11 @@ vesaMapFramebuffer (KdScreenInfo *screen)
pscr->fb = NULL;
break;
}
+ screen->memory_base = pscr->fb;
+ screen->memory_size = pscr->fb_size;
screen->fb[0].frameBuffer = (CARD8 *)(pscr->fb);
+ screen->off_screen_base = screen->fb[0].byteStride * screen->height;
+
return TRUE;
}
@@ -1109,25 +1122,13 @@ vesaRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
}
int
-vesaLayerAdd (WindowPtr pWin, pointer value)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLayer = (LayerPtr) value;
-
- if (!LayerWindowAdd (pScreen, pLayer, pWin))
- return WT_STOPWALKING;
-
- return WT_WALKCHILDREN;
-}
-
-int
-vesaLayerRemove (WindowPtr pWin, pointer value)
+vesaPixmapSet (WindowPtr pWin, pointer value)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
- LayerPtr pLayer = (LayerPtr) value;
-
- LayerWindowRemove (pScreen, pLayer, pWin);
+ PixmapPtr pPixmap = value;
+ pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ (*pScreen->SetWindowPixmap) (pWin, pPixmap);
return WT_WALKCHILDREN;
}
@@ -1150,8 +1151,8 @@ vesaRandRSetConfig (ScreenPtr pScreen,
int oldheight;
int oldmmwidth;
int oldmmheight;
- LayerPtr pNewLayer;
int newwidth, newheight;
+ PixmapPtr pPixmap;
if (screen->randr & (RR_Rotate_0|RR_Rotate_180))
{
@@ -1225,13 +1226,15 @@ vesaRandRSetConfig (ScreenPtr pScreen,
break;
}
+ KdOffscreenSwapOut (screen->pScreen);
+
vesaUnmapFramebuffer (screen);
if (!vesaMapFramebuffer (screen))
goto bail3;
#if 0
/*
- * XXX can't switch depths yet
+ * XXX can't switch depths
*/
screen->fb[0].depth = depth;
screen->fb[0].bitsPerPixel = bpp;
@@ -1259,20 +1262,14 @@ vesaRandRSetConfig (ScreenPtr pScreen,
}
/*
- * Create the layer
+ * Get the pixmap that windows live in
*/
- pNewLayer = vesaLayerCreate (pScreen);
- if (!pNewLayer)
+ pPixmap = vesaGetPixmap (pScreen);
+ if (!pPixmap)
goto bail4;
- if (WalkTree (pScreen, vesaLayerAdd, (pointer) pNewLayer) == WT_STOPWALKING)
- goto bail5;
+ WalkTree (pScreen, vesaPixmapSet, (pointer) pPixmap);
- WalkTree (pScreen, vesaLayerRemove, (pointer) pscr->pLayer);
- LayerDestroy (pScreen, pscr->pLayer);
-
- pscr->pLayer = pNewLayer;
-
/* set the subpixel order */
KdSetSubpixelOrder (pScreen, pscr->randr);
@@ -1281,9 +1278,6 @@ vesaRandRSetConfig (ScreenPtr pScreen,
return TRUE;
-bail5:
- WalkTree (pScreen, vesaLayerRemove, (pointer) pNewLayer);
- LayerDestroy (pScreen, pNewLayer);
bail4:
vesaUnmapFramebuffer (screen);
*pscr = oldscr;
@@ -1340,27 +1334,18 @@ vesaRandRInit (ScreenPtr pScreen)
Bool
vesaInitScreen(ScreenPtr pScreen)
{
- if (!LayerStartInit (pScreen))
- return FALSE;
-
- return TRUE;
+ return shadowSetup (pScreen);
}
Bool
vesaFinishInitScreen (ScreenPtr pScreen)
{
- KdScreenPriv(pScreen);
- VesaScreenPrivPtr pscr = pScreenPriv->screen->driver;
+ PixmapPtr pPixmap;
- pscr->layerKind = LayerNewKind (pScreen);
-
- if (!LayerFinishInit (pScreen))
- return FALSE;
-
vesaConfigureScreen (pScreen);
- pscr->pLayer = vesaLayerCreate (pScreen);
- if (!pscr->pLayer)
+ pPixmap = vesaGetPixmap (pScreen);
+ if (!pPixmap)
return FALSE;
#ifdef RANDR
@@ -1668,6 +1653,11 @@ vesaScreenFini(KdScreenInfo *screen)
{
VesaScreenPrivPtr pscr = screen->driver;
+ if (pscr->pShadow)
+ {
+ (*screen->pScreen->DestroyPixmap) (pscr->pShadow);
+ pscr->pShadow = 0;
+ }
vesaUnmapFramebuffer (screen);
screen->fb[0].depth = pscr->origDepth;
}
diff --git a/hw/kdrive/vesa/vesa.h b/hw/kdrive/vesa/vesa.h
index 30222d41b..f3897999d 100644
--- a/hw/kdrive/vesa/vesa.h
+++ b/hw/kdrive/vesa/vesa.h
@@ -25,7 +25,7 @@ THE SOFTWARE.
#define _VESA_H_
#include "kdrive.h"
-#include "layer.h"
+#include "shadow.h"
#include "vm86.h"
#ifdef RANDR
#include "randrstr.h"
@@ -98,11 +98,10 @@ typedef struct _VesaScreenPriv {
Rotation randr;
int mapping;
int origDepth;
- int layerKind;
void *fb;
int fb_size;
CARD32 fb_phys;
- LayerPtr pLayer;
+ PixmapPtr pShadow;
} VesaScreenPrivRec, *VesaScreenPrivPtr;
extern int vesa_video_mode;
@@ -145,8 +144,8 @@ vesaScreenInitialize (KdScreenInfo *screen, VesaScreenPrivPtr pscr);
Bool
vesaScreenInit(KdScreenInfo *screen);
-LayerPtr
-vesaLayerCreate (ScreenPtr pScreen);
+PixmapPtr
+vesaGetPixmap (ScreenPtr pScreen);
Bool
vesaMapFramebuffer (KdScreenInfo *screen);