summaryrefslogtreecommitdiff
path: root/xserver/fb
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
commitdbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch)
treef8963ef73903a7b4374adc2354dffbaa905112ac /xserver/fb
parent33b2029f322f3c238b7ba528083195ad8dde33e1 (diff)
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/fb')
-rw-r--r--xserver/fb/Makefile.am31
-rw-r--r--xserver/fb/Makefile.in108
-rw-r--r--xserver/fb/fb.h213
-rw-r--r--xserver/fb/fb24_32.c84
-rw-r--r--xserver/fb/fballpriv.c59
-rw-r--r--xserver/fb/fbarc.c38
-rw-r--r--xserver/fb/fbblt.c143
-rw-r--r--xserver/fb/fbbstore.c65
-rw-r--r--xserver/fb/fbcmap_mi.c8
-rw-r--r--xserver/fb/fbcopy.c47
-rw-r--r--xserver/fb/fboverlay.c38
-rw-r--r--xserver/fb/fboverlay.h13
-rw-r--r--xserver/fb/fbpixmap.c29
-rw-r--r--xserver/fb/fbpseudocolor.c142
-rw-r--r--xserver/fb/fbscreen.c85
-rw-r--r--xserver/fb/fbwindow.c167
-rw-r--r--xserver/fb/wfbrename.h25
17 files changed, 532 insertions, 763 deletions
diff --git a/xserver/fb/Makefile.am b/xserver/fb/Makefile.am
index 11b2d2fea..e34aaba10 100644
--- a/xserver/fb/Makefile.am
+++ b/xserver/fb/Makefile.am
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libfb.la libfbmmx.la
+noinst_LTLIBRARIES = libfb.la libwfb.la
INCLUDES = \
-I$(top_srcdir)/hw/xfree86/os-support \
@@ -7,25 +7,12 @@ INCLUDES = \
AM_CFLAGS = $(DIX_CFLAGS)
if XORG
-sdk_HEADERS = fb.h fbrop.h fbpseudocolor.h fboverlay.h
+sdk_HEADERS = fb.h fbrop.h fbpseudocolor.h fboverlay.h wfbrename.h
endif
-if MMX_CAPABLE
-AM_CFLAGS += -DUSE_MMX
+libfb_la_CFLAGS = $(AM_CFLAGS)
-libfbmmx_la_CFLAGS = \
- $(DIX_CFLAGS) \
- -DUSE_MMX \
- -mmmx \
- -msse \
- -Winline \
- --param inline-unit-growth=10000 \
- --param large-function-growth=10000
-endif
-
-libfbmmx_la_SOURCES = \
- fbmmx.c \
- fbmmx.h
+libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
libfb_la_SOURCES = \
fb.h \
@@ -37,8 +24,6 @@ libfb_la_SOURCES = \
fbbits.h \
fbblt.c \
fbbltone.c \
- fbbstore.c \
- fbcompose.c \
fbcopy.c \
fbfill.c \
fbfillrect.c \
@@ -66,10 +51,8 @@ libfb_la_SOURCES = \
fbutil.c \
fbwindow.c \
fbpseudocolor.c \
- fbpseudocolor.h \
- fbedge.c \
- fbedgeimp.h
+ fbpseudocolor.h
-libfb_la_LIBADD = libfbmmx.la
+libwfb_la_SOURCES = $(libfb_la_SOURCES)
-EXTRA_DIST = fbcmap.c
+EXTRA_DIST = fbcmap.c fbcmap_mi.c
diff --git a/xserver/fb/Makefile.in b/xserver/fb/Makefile.in
index 029a96273..cbe4fce13 100644
--- a/xserver/fb/Makefile.in
+++ b/xserver/fb/Makefile.in
@@ -59,21 +59,20 @@ LTLIBRARIES = $(noinst_LTLIBRARIES)
libfb_la_LIBADD =
am_libfb_la_OBJECTS = libfb_la-fb24_32.lo libfb_la-fballpriv.lo \
libfb_la-fbarc.lo libfb_la-fbbits.lo libfb_la-fbblt.lo \
- libfb_la-fbbltone.lo libfb_la-fbbstore.lo libfb_la-fbcopy.lo \
- libfb_la-fbfill.lo libfb_la-fbfillrect.lo libfb_la-fbfillsp.lo \
- libfb_la-fbgc.lo libfb_la-fbgetsp.lo libfb_la-fbglyph.lo \
- libfb_la-fbimage.lo libfb_la-fbline.lo libfb_la-fboverlay.lo \
- libfb_la-fbpict.lo libfb_la-fbpixmap.lo libfb_la-fbpoint.lo \
- libfb_la-fbpush.lo libfb_la-fbscreen.lo libfb_la-fbseg.lo \
- libfb_la-fbsetsp.lo libfb_la-fbsolid.lo libfb_la-fbstipple.lo \
- libfb_la-fbtile.lo libfb_la-fbtrap.lo libfb_la-fbutil.lo \
- libfb_la-fbwindow.lo libfb_la-fbpseudocolor.lo
+ libfb_la-fbbltone.lo libfb_la-fbcopy.lo libfb_la-fbfill.lo \
+ libfb_la-fbfillrect.lo libfb_la-fbfillsp.lo libfb_la-fbgc.lo \
+ libfb_la-fbgetsp.lo libfb_la-fbglyph.lo libfb_la-fbimage.lo \
+ libfb_la-fbline.lo libfb_la-fboverlay.lo libfb_la-fbpict.lo \
+ libfb_la-fbpixmap.lo libfb_la-fbpoint.lo libfb_la-fbpush.lo \
+ libfb_la-fbscreen.lo libfb_la-fbseg.lo libfb_la-fbsetsp.lo \
+ libfb_la-fbsolid.lo libfb_la-fbstipple.lo libfb_la-fbtile.lo \
+ libfb_la-fbtrap.lo libfb_la-fbutil.lo libfb_la-fbwindow.lo \
+ libfb_la-fbpseudocolor.lo
libfb_la_OBJECTS = $(am_libfb_la_OBJECTS)
libwfb_la_LIBADD =
am__objects_1 = libwfb_la-fb24_32.lo libwfb_la-fballpriv.lo \
libwfb_la-fbarc.lo libwfb_la-fbbits.lo libwfb_la-fbblt.lo \
- libwfb_la-fbbltone.lo libwfb_la-fbbstore.lo \
- libwfb_la-fbcopy.lo libwfb_la-fbfill.lo \
+ libwfb_la-fbbltone.lo libwfb_la-fbcopy.lo libwfb_la-fbfill.lo \
libwfb_la-fbfillrect.lo libwfb_la-fbfillsp.lo \
libwfb_la-fbgc.lo libwfb_la-fbgetsp.lo libwfb_la-fbglyph.lo \
libwfb_la-fbimage.lo libwfb_la-fbline.lo \
@@ -150,8 +149,6 @@ BSD_KQUEUE_APM_FALSE = @BSD_KQUEUE_APM_FALSE@
BSD_KQUEUE_APM_TRUE = @BSD_KQUEUE_APM_TRUE@
BUILDDOCS_FALSE = @BUILDDOCS_FALSE@
BUILDDOCS_TRUE = @BUILDDOCS_TRUE@
-BUILD_DARWIN_FALSE = @BUILD_DARWIN_FALSE@
-BUILD_DARWIN_TRUE = @BUILD_DARWIN_TRUE@
BUILD_DATE = @BUILD_DATE@
BUILD_IOPORT_FALSE = @BUILD_IOPORT_FALSE@
BUILD_IOPORT_TRUE = @BUILD_IOPORT_TRUE@
@@ -223,6 +220,10 @@ DMX_FALSE = @DMX_FALSE@
DMX_TRUE = @DMX_TRUE@
DPMSExtension_FALSE = @DPMSExtension_FALSE@
DPMSExtension_TRUE = @DPMSExtension_TRUE@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRI2_FALSE = @DRI2_FALSE@
+DRI2_TRUE = @DRI2_TRUE@
DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
DRIPROTO_LIBS = @DRIPROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
@@ -252,7 +253,7 @@ FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@
FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
-FREETYPE_REQUIRES = @FREETYPE_REQUIRES@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_FALSE = @GLX_FALSE@
GLX_TRUE = @GLX_TRUE@
@@ -266,8 +267,8 @@ HAVE_AGL_FRAMEWORK_FALSE = @HAVE_AGL_FRAMEWORK_FALSE@
HAVE_AGL_FRAMEWORK_TRUE = @HAVE_AGL_FRAMEWORK_TRUE@
HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@
HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@
-HAVE_X_PLUGIN_FALSE = @HAVE_X_PLUGIN_FALSE@
-HAVE_X_PLUGIN_TRUE = @HAVE_X_PLUGIN_TRUE@
+HAVE_XPLUGIN_FALSE = @HAVE_XPLUGIN_FALSE@
+HAVE_XPLUGIN_TRUE = @HAVE_XPLUGIN_TRUE@
HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@
HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@
HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@
@@ -308,6 +309,9 @@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
KDRIVE_TRUE = @KDRIVE_TRUE@
+LAUNCHD = @LAUNCHD@
+LAUNCHD_FALSE = @LAUNCHD_FALSE@
+LAUNCHD_TRUE = @LAUNCHD_TRUE@
LDFLAGS = @LDFLAGS@
LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
LEX = @LEX@
@@ -362,6 +366,8 @@ OBJCFLAGS = @OBJCFLAGS@
OBJCLINK = @OBJCLINK@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -369,12 +375,11 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
PERL = @PERL@
-PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
-PIXMAN_LIBS = @PIXMAN_LIBS@
PKG_CONFIG = @PKG_CONFIG@
-PLIST_VENDOR_WEB = @PLIST_VENDOR_WEB@
-PLIST_VERSION_STRING = @PLIST_VERSION_STRING@
PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@
PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@
PROJECTROOT = @PROJECTROOT@
@@ -386,13 +391,12 @@ RECORD_FALSE = @RECORD_FALSE@
RECORD_TRUE = @RECORD_TRUE@
RES_FALSE = @RES_FALSE@
RES_TRUE = @RES_TRUE@
-RGB_DB = @RGB_DB@
SCREENSAVER_FALSE = @SCREENSAVER_FALSE@
SCREENSAVER_TRUE = @SCREENSAVER_TRUE@
SECURE_RPC_FALSE = @SECURE_RPC_FALSE@
SECURE_RPC_TRUE = @SECURE_RPC_TRUE@
SED = @SED@
-SERVERCONFIGdir = @SERVERCONFIGdir@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SGI_VIDEO_FALSE = @SGI_VIDEO_FALSE@
SGI_VIDEO_TRUE = @SGI_VIDEO_TRUE@
@@ -408,20 +412,21 @@ SPARC64_VIDEO_TRUE = @SPARC64_VIDEO_TRUE@
STRIP = @STRIP@
SUN_KBD_MODE_FALSE = @SUN_KBD_MODE_FALSE@
SUN_KBD_MODE_TRUE = @SUN_KBD_MODE_TRUE@
-SYS_LIBS = @SYS_LIBS@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_FALSE = @TSLIB_FALSE@
TSLIB_LIBS = @TSLIB_LIBS@
TSLIB_TRUE = @TSLIB_TRUE@
USE_CURSES_FALSE = @USE_CURSES_FALSE@
USE_CURSES_TRUE = @USE_CURSES_TRUE@
-USE_RGB_BUILTIN_FALSE = @USE_RGB_BUILTIN_FALSE@
-USE_RGB_BUILTIN_TRUE = @USE_RGB_BUILTIN_TRUE@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
VENDOR_NAME = @VENDOR_NAME@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
VENDOR_RELEASE = @VENDOR_RELEASE@
VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11APP_FALSE = @X11APP_FALSE@
+X11APP_TRUE = @X11APP_TRUE@
X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
XACE_FALSE = @XACE_FALSE@
@@ -438,18 +443,22 @@ XDMCP_LIBS = @XDMCP_LIBS@
XDMCP_TRUE = @XDMCP_TRUE@
XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
-XEGLMODULES_LIBS = @XEGLMODULES_LIBS@
XEGL_FALSE = @XEGL_FALSE@
XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
XEGL_TRUE = @XEGL_TRUE@
XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
XEPHYR_FALSE = @XEPHYR_FALSE@
+XEPHYR_HAS_DRI_FALSE = @XEPHYR_HAS_DRI_FALSE@
+XEPHYR_HAS_DRI_TRUE = @XEPHYR_HAS_DRI_TRUE@
XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XEPHYR_TRUE = @XEPHYR_TRUE@
-XERRORDB_PATH = @XERRORDB_PATH@
XEVIE_FALSE = @XEVIE_FALSE@
XEVIE_TRUE = @XEVIE_TRUE@
XF86BIGFONT_FALSE = @XF86BIGFONT_FALSE@
@@ -473,10 +482,12 @@ XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
XGLX_FALSE = @XGLX_FALSE@
XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
XGLX_TRUE = @XGLX_TRUE@
XGL_FALSE = @XGL_FALSE@
XGL_LIBS = @XGL_LIBS@
XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
XGL_TRUE = @XGL_TRUE@
XINERAMA_FALSE = @XINERAMA_FALSE@
XINERAMA_TRUE = @XINERAMA_TRUE@
@@ -490,19 +501,18 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_FALSE = @XNEST_FALSE@
XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
XNEST_TRUE = @XNEST_TRUE@
XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
-XORG_BUS_FREEBSDPCI_FALSE = @XORG_BUS_FREEBSDPCI_FALSE@
-XORG_BUS_FREEBSDPCI_TRUE = @XORG_BUS_FREEBSDPCI_TRUE@
+XORG_BUS_BSDPCI_FALSE = @XORG_BUS_BSDPCI_FALSE@
+XORG_BUS_BSDPCI_TRUE = @XORG_BUS_BSDPCI_TRUE@
XORG_BUS_IX86PCI_FALSE = @XORG_BUS_IX86PCI_FALSE@
XORG_BUS_IX86PCI_TRUE = @XORG_BUS_IX86PCI_TRUE@
XORG_BUS_LINUXPCI_FALSE = @XORG_BUS_LINUXPCI_FALSE@
XORG_BUS_LINUXPCI_TRUE = @XORG_BUS_LINUXPCI_TRUE@
-XORG_BUS_NETBSDPCI_FALSE = @XORG_BUS_NETBSDPCI_FALSE@
-XORG_BUS_NETBSDPCI_TRUE = @XORG_BUS_NETBSDPCI_TRUE@
XORG_BUS_PPCPCI_FALSE = @XORG_BUS_PPCPCI_FALSE@
XORG_BUS_PPCPCI_TRUE = @XORG_BUS_PPCPCI_TRUE@
XORG_BUS_SPARCPCI_FALSE = @XORG_BUS_SPARCPCI_FALSE@
@@ -510,7 +520,6 @@ XORG_BUS_SPARCPCI_TRUE = @XORG_BUS_SPARCPCI_TRUE@
XORG_BUS_SPARC_FALSE = @XORG_BUS_SPARC_FALSE@
XORG_BUS_SPARC_TRUE = @XORG_BUS_SPARC_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
-XORG_CORE_LIBS = @XORG_CORE_LIBS@
XORG_FALSE = @XORG_FALSE@
XORG_INCS = @XORG_INCS@
XORG_LIBS = @XORG_LIBS@
@@ -520,23 +529,31 @@ XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
XORG_OS = @XORG_OS@
XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
XORG_TRUE = @XORG_TRUE@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
XPRINT_CFLAGS = @XPRINT_CFLAGS@
XPRINT_FALSE = @XPRINT_FALSE@
XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
XPRINT_TRUE = @XPRINT_TRUE@
XP_USE_FREETYPE_FALSE = @XP_USE_FREETYPE_FALSE@
XP_USE_FREETYPE_TRUE = @XP_USE_FREETYPE_TRUE@
XQUARTZ_FALSE = @XQUARTZ_FALSE@
XQUARTZ_TRUE = @XQUARTZ_TRUE@
+XREGISTRY_FALSE = @XREGISTRY_FALSE@
+XREGISTRY_TRUE = @XREGISTRY_TRUE@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
XSDLSERVER_FALSE = @XSDLSERVER_FALSE@
XSDLSERVER_TRUE = @XSDLSERVER_TRUE@
XSDL_INCS = @XSDL_INCS@
XSDL_LIBS = @XSDL_LIBS@
+XSELINUX_FALSE = @XSELINUX_FALSE@
+XSELINUX_TRUE = @XSELINUX_TRUE@
XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
@@ -544,12 +561,14 @@ XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
XSERVER_DTRACE_FALSE = @XSERVER_DTRACE_FALSE@
XSERVER_DTRACE_TRUE = @XSERVER_DTRACE_TRUE@
XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
XTRAP_FALSE = @XTRAP_FALSE@
XTRAP_TRUE = @XTRAP_TRUE@
XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
XVFB_FALSE = @XVFB_FALSE@
XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
XVFB_TRUE = @XVFB_TRUE@
XVMC_FALSE = @XVMC_FALSE@
XVMC_TRUE = @XVMC_TRUE@
@@ -574,7 +593,7 @@ XWIN_PRIMARYFB_TRUE = @XWIN_PRIMARYFB_TRUE@
XWIN_RANDR_FALSE = @XWIN_RANDR_FALSE@
XWIN_RANDR_TRUE = @XWIN_RANDR_TRUE@
XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
-XWIN_SYSTEM_LIBS = @XWIN_SYSTEM_LIBS@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
XWIN_TRUE = @XWIN_TRUE@
XWIN_XV_FALSE = @XWIN_XV_FALSE@
XWIN_XV_TRUE = @XWIN_XV_TRUE@
@@ -582,6 +601,11 @@ X_PRIVSEP_FALSE = @X_PRIVSEP_FALSE@
X_PRIVSEP_TRUE = @X_PRIVSEP_TRUE@
YACC = @YACC@
__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
@@ -624,6 +648,7 @@ host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
@@ -661,7 +686,6 @@ libfb_la_SOURCES = \
fbbits.h \
fbblt.c \
fbbltone.c \
- fbbstore.c \
fbcopy.c \
fbfill.c \
fbfillrect.c \
@@ -752,7 +776,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbbits.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbblt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbbltone.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbbstore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbcopy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbfill.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbfillrect.Plo@am__quote@
@@ -783,7 +806,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbbits.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbblt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbbltone.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbbstore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbcopy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbfill.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbfillrect.Plo@am__quote@
@@ -872,13 +894,6 @@ libfb_la-fbbltone.lo: fbbltone.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbbltone.lo `test -f 'fbbltone.c' || echo '$(srcdir)/'`fbbltone.c
-libfb_la-fbbstore.lo: fbbstore.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbbstore.lo -MD -MP -MF "$(DEPDIR)/libfb_la-fbbstore.Tpo" -c -o libfb_la-fbbstore.lo `test -f 'fbbstore.c' || echo '$(srcdir)/'`fbbstore.c; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libfb_la-fbbstore.Tpo" "$(DEPDIR)/libfb_la-fbbstore.Plo"; else rm -f "$(DEPDIR)/libfb_la-fbbstore.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fbbstore.c' object='libfb_la-fbbstore.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -c -o libfb_la-fbbstore.lo `test -f 'fbbstore.c' || echo '$(srcdir)/'`fbbstore.c
-
libfb_la-fbcopy.lo: fbcopy.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfb_la_CFLAGS) $(CFLAGS) -MT libfb_la-fbcopy.lo -MD -MP -MF "$(DEPDIR)/libfb_la-fbcopy.Tpo" -c -o libfb_la-fbcopy.lo `test -f 'fbcopy.c' || echo '$(srcdir)/'`fbcopy.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libfb_la-fbcopy.Tpo" "$(DEPDIR)/libfb_la-fbcopy.Plo"; else rm -f "$(DEPDIR)/libfb_la-fbcopy.Tpo"; exit 1; fi
@@ -1089,13 +1104,6 @@ libwfb_la-fbbltone.lo: fbbltone.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbbltone.lo `test -f 'fbbltone.c' || echo '$(srcdir)/'`fbbltone.c
-libwfb_la-fbbstore.lo: fbbstore.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbbstore.lo -MD -MP -MF "$(DEPDIR)/libwfb_la-fbbstore.Tpo" -c -o libwfb_la-fbbstore.lo `test -f 'fbbstore.c' || echo '$(srcdir)/'`fbbstore.c; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libwfb_la-fbbstore.Tpo" "$(DEPDIR)/libwfb_la-fbbstore.Plo"; else rm -f "$(DEPDIR)/libwfb_la-fbbstore.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fbbstore.c' object='libwfb_la-fbbstore.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -c -o libwfb_la-fbbstore.lo `test -f 'fbbstore.c' || echo '$(srcdir)/'`fbbstore.c
-
libwfb_la-fbcopy.lo: fbcopy.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwfb_la_CFLAGS) $(CFLAGS) -MT libwfb_la-fbcopy.lo -MD -MP -MF "$(DEPDIR)/libwfb_la-fbcopy.Tpo" -c -o libwfb_la-fbcopy.lo `test -f 'fbcopy.c' || echo '$(srcdir)/'`fbcopy.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libwfb_la-fbcopy.Tpo" "$(DEPDIR)/libwfb_la-fbcopy.Plo"; else rm -f "$(DEPDIR)/libwfb_la-fbcopy.Tpo"; exit 1; fi
diff --git a/xserver/fb/fb.h b/xserver/fb/fb.h
index 3742cf01a..1cd947380 100644
--- a/xserver/fb/fb.h
+++ b/xserver/fb/fb.h
@@ -26,6 +26,8 @@
#define _FB_H_
#include <X11/X.h>
+#include <pixman.h>
+
#include "scrnintstr.h"
#include "pixmap.h"
#include "pixmapstr.h"
@@ -35,6 +37,7 @@
#include "miscstruct.h"
#include "servermd.h"
#include "windowstr.h"
+#include "privates.h"
#include "mi.h"
#include "migc.h"
#include "mibstore.h"
@@ -44,6 +47,39 @@
#include "picture.h"
#endif
+#ifdef FB_ACCESS_WRAPPER
+
+#include "wfbrename.h"
+#define FBPREFIX(x) wfb##x
+#define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
+#define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
+
+#define MEMCPY_WRAPPED(dst, src, size) do { \
+ size_t _i; \
+ CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
+ for(_i = 0; _i < size; _i++) { \
+ WRITE(_dst +_i, READ(_src + _i)); \
+ } \
+} while(0)
+
+#define MEMSET_WRAPPED(dst, val, size) do { \
+ size_t _i; \
+ CARD8 *_dst = (CARD8*)(dst); \
+ for(_i = 0; _i < size; _i++) { \
+ WRITE(_dst +_i, (val)); \
+ } \
+} while(0)
+
+#else
+
+#define FBPREFIX(x) fb##x
+#define WRITE(ptr, val) (*(ptr) = (val))
+#define READ(ptr) (*(ptr))
+#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
+#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
+
+#endif
+
/*
* This single define controls the basic size of data manipulated
* by this software; it must be log2(sizeof (FbBits) * 8)
@@ -105,7 +141,7 @@ typedef unsigned __int64 FbBits;
defined(ia64) || defined(__ia64__) || \
defined(__sparc64__) || defined(_LP64) || \
defined(__s390x__) || \
- defined(amd64) || defined (__amd64__) || \
+ defined(amd64) || defined (__amd64__) || defined(__x86_64__) || \
defined (__powerpc64__) || \
(defined(sgi) && (_MIPS_SZLONG == 64))
typedef unsigned long FbBits;
@@ -222,8 +258,8 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
#define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
#define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3))
-#define FbStorePart(dst,off,t,xor) (*FbPtrOffset(dst,off,t) = \
- FbSelectPart(xor,off,t))
+#define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset(dst,off,t), \
+ FbSelectPart(xor,off,t)))
#ifndef FbSelectPart
#define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
#endif
@@ -403,7 +439,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \
break; \
default: \
- *dst = FbDoMaskRRop(*dst, and, xor, l); \
+ WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, l)); \
break; \
} \
}
@@ -423,7 +459,7 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
break; \
FbDoRightMaskByteRRop6Cases(dst,xor) \
default: \
- *dst = FbDoMaskRRop (*dst, and, xor, r); \
+ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \
} \
}
#endif
@@ -455,20 +491,20 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
* The term "lane" comes from the hardware term "byte-lane" which
*/
-#define FbLaneCase1(n,a,o) ((n) == 0x01 ? \
- (*(CARD8 *) ((a)+FbPatternOffset(o,CARD8)) = \
- fgxor) : 0)
-#define FbLaneCase2(n,a,o) ((n) == 0x03 ? \
- (*(CARD16 *) ((a)+FbPatternOffset(o,CARD16)) = \
+#define FbLaneCase1(n,a,o) ((n) == 0x01 ? (void) \
+ WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), \
+ fgxor) : (void) 0)
+#define FbLaneCase2(n,a,o) ((n) == 0x03 ? (void) \
+ WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), \
fgxor) : \
((void)FbLaneCase1((n)&1,a,o), \
FbLaneCase1((n)>>1,a,(o)+1)))
-#define FbLaneCase4(n,a,o) ((n) == 0x0f ? \
- (*(CARD32 *) ((a)+FbPatternOffset(o,CARD32)) = \
+#define FbLaneCase4(n,a,o) ((n) == 0x0f ? (void) \
+ WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), \
fgxor) : \
((void)FbLaneCase2((n)&3,a,o), \
FbLaneCase2((n)>>2,a,(o)+2)))
-#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (*(FbBits *) ((a)+(o)) = fgxor) : \
+#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (void) (*(FbBits *) ((a)+(o)) = fgxor) : \
((void)FbLaneCase4((n)&15,a,o), \
FbLaneCase4((n)>>4,a,(o)+4)))
@@ -563,56 +599,62 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
} \
}
-/* XXX fb*PrivateIndex should be static, but it breaks the ABI */
-
-extern int fbGCPrivateIndex;
-extern int fbGetGCPrivateIndex(void);
+extern DevPrivateKey fbGetGCPrivateKey(void);
#ifndef FB_NO_WINDOW_PIXMAPS
-extern int fbWinPrivateIndex;
-extern int fbGetWinPrivateIndex(void);
+extern DevPrivateKey fbGetWinPrivateKey(void);
#endif
extern const GCOps fbGCOps;
extern const GCFuncs fbGCFuncs;
-#ifdef TEKX11
-#define FB_OLD_GC
-#define FB_OLD_SCREEN
+#ifdef FB_24_32BIT
+#define FB_SCREEN_PRIVATE
#endif
-#ifdef FB_OLD_SCREEN
-# define FB_OLD_MISCREENINIT /* miScreenInit requires 14 args, not 13 */
-extern WindowPtr *WindowTable;
-#endif
+/* Framebuffer access wrapper */
+typedef FbBits (*ReadMemoryProcPtr)(const void *src, int size);
+typedef void (*WriteMemoryProcPtr)(void *dst, FbBits value, int size);
+typedef void (*SetupWrapProcPtr)(ReadMemoryProcPtr *pRead,
+ WriteMemoryProcPtr *pWrite,
+ DrawablePtr pDraw);
+typedef void (*FinishWrapProcPtr)(DrawablePtr pDraw);
+
+#ifdef FB_ACCESS_WRAPPER
+
+#define fbPrepareAccess(pDraw) \
+ fbGetScreenPrivate((pDraw)->pScreen)->setupWrap( \
+ &wfbReadMemory, \
+ &wfbWriteMemory, \
+ (pDraw))
+#define fbFinishAccess(pDraw) \
+ fbGetScreenPrivate((pDraw)->pScreen)->finishWrap(pDraw)
+
+#else
+
+#define fbPrepareAccess(pPix)
+#define fbFinishAccess(pDraw)
-#ifdef FB_24_32BIT
-#define FB_SCREEN_PRIVATE
#endif
+
#ifdef FB_SCREEN_PRIVATE
-extern int fbScreenPrivateIndex;
-extern int fbGetScreenPrivateIndex(void);
+extern DevPrivateKey fbGetScreenPrivateKey(void);
/* private field of a screen */
typedef struct {
unsigned char win32bpp; /* window bpp for 32-bpp images */
unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
+#ifdef FB_ACCESS_WRAPPER
+ SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
+ FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */
+#endif
} FbScreenPrivRec, *FbScreenPrivPtr;
#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
- (pScreen)->devPrivates[fbGetScreenPrivateIndex()].ptr)
+ dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey()))
#endif
/* private field of GC */
typedef struct {
-#ifdef FB_OLD_GC
- unsigned char pad1;
- unsigned char pad2;
- unsigned char pad3;
- unsigned fExpose:1;
- unsigned freeCompClip:1;
- PixmapPtr pRotatedPixmap;
- RegionPtr pCompositeClip;
-#endif
FbBits and, xor; /* reduced rop values */
FbBits bgand, bgxor; /* for stipples */
FbBits fg, bg, pm; /* expanded and filled */
@@ -623,26 +665,19 @@ typedef struct {
} FbGCPrivRec, *FbGCPrivPtr;
#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
- (pGC)->devPrivates[fbGetGCPrivateIndex()].ptr)
+ dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey()))
-#ifdef FB_OLD_GC
-#define fbGetCompositeClip(pGC) (fbGetGCPrivate(pGC)->pCompositeClip)
-#define fbGetExpose(pGC) (fbGetGCPrivate(pGC)->fExpose)
-#define fbGetFreeCompClip(pGC) (fbGetGCPrivate(pGC)->freeCompClip)
-#define fbGetRotatedPixmap(pGC) (fbGetGCPrivate(pGC)->pRotatedPixmap)
-#else
#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
#define fbGetExpose(pGC) ((pGC)->fExpose)
#define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip)
#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
-#endif
#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
#ifdef FB_NO_WINDOW_PIXMAPS
#define fbGetWindowPixmap(d) fbGetScreenPixmap(((DrawablePtr) (d))->pScreen)
#else
#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
- ((WindowPtr) (pWin))->devPrivates[fbGetWinPrivateIndex()].ptr)
+ dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey()))
#endif
#ifdef ROOTLESS
@@ -674,6 +709,7 @@ typedef struct {
(xoff) = __fbPixOffXPix(_pPix); \
(yoff) = __fbPixOffYPix(_pPix); \
} \
+ fbPrepareAccess(pDrawable); \
(pointer) = (FbBits *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
@@ -690,6 +726,7 @@ typedef struct {
(xoff) = __fbPixOffXPix(_pPix); \
(yoff) = __fbPixOffYPix(_pPix); \
} \
+ fbPrepareAccess(pDrawable); \
(pointer) = (FbStip *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
@@ -708,12 +745,6 @@ typedef struct {
((pDrawable)->type == DRAWABLE_PIXMAP ? \
TRUE : fbWindowEnabled((WindowPtr) pDrawable))
-#ifdef FB_OLD_SCREEN
-#define BitsPerPixel(d) (\
- ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
- (PixmapWidthPaddingInfo[d].padRoundUp+1)))
-#endif
-
#define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
/*
* Accelerated tiles are power of 2 width <= FB_UNIT
@@ -799,7 +830,7 @@ fb24_32ModifyPixmapHeader (PixmapPtr pPixmap,
* fballpriv.c
*/
Bool
-fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex);
+fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCIndex);
/*
* fbarc.c
@@ -1227,23 +1258,6 @@ fbBltPlane (FbBits *src,
Pixel planeMask);
/*
- * fbbstore.c
- */
-void
-fbSaveAreas(PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin);
-
-void
-fbRestoreAreas(PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin);
-
-/*
* fbcmap.c
*/
int
@@ -1277,6 +1291,9 @@ void
fbClearVisualTypes(void);
Bool
+fbHasVisualTypes (int depth);
+
+Bool
fbSetVisualTypes (int depth, int visuals, int bitsPerRGB);
Bool
@@ -1600,10 +1617,12 @@ fbPictureInit (ScreenPtr pScreen,
*/
PixmapPtr
-fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp);
+fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
+ unsigned usage_hint);
PixmapPtr
-fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth);
+fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
+ unsigned usage_hint);
Bool
fbDestroyPixmap (PixmapPtr pPixmap);
@@ -1720,13 +1739,11 @@ fbQueryBestSize (int class,
unsigned short *width, unsigned short *height,
ScreenPtr pScreen);
-#ifndef FB_OLD_SCREEN
PixmapPtr
_fbGetWindowPixmap (WindowPtr pWindow);
void
_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap);
-#endif
Bool
fbSetupScreen(ScreenPtr pScreen,
@@ -1739,6 +1756,30 @@ fbSetupScreen(ScreenPtr pScreen,
int bpp); /* bits per pixel of frame buffer */
Bool
+wfbFinishScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap);
+
+Bool
+wfbScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap);
+
+Bool
fbFinishScreenInit(ScreenPtr pScreen,
pointer pbits,
int xsize,
@@ -1938,6 +1979,7 @@ fbEvenTile (FbBits *dst,
int height,
FbBits *tile,
+ FbStride tileStride,
int tileHeight,
int alu,
@@ -1994,6 +2036,11 @@ fbReplicatePixel (Pixel p, int bpp);
void
fbReduceRasterOp (int rop, FbBits fg, FbBits pm, FbBits *andp, FbBits *xorp);
+#ifdef FB_ACCESS_WRAPPER
+extern ReadMemoryProcPtr wfbReadMemory;
+extern WriteMemoryProcPtr wfbWriteMemory;
+#endif
+
/*
* fbwindow.c
*/
@@ -2040,13 +2087,9 @@ fbFillRegionSolid (DrawablePtr pDrawable,
FbBits and,
FbBits xor);
-void
-fbFillRegionTiled (DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile);
-
-void
-fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-
+pixman_image_t *image_from_pict (PicturePtr pict,
+ Bool has_clip);
+void free_pixman_pict (PicturePtr, pixman_image_t *);
#endif /* _FB_H_ */
+
diff --git a/xserver/fb/fb24_32.c b/xserver/fb/fb24_32.c
index 572da4865..1ebd598a8 100644
--- a/xserver/fb/fb24_32.c
+++ b/xserver/fb/fb24_32.c
@@ -1,5 +1,4 @@
/*
- *
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -38,18 +37,18 @@
* by reading/writing aligned CARD32s where it's easy
*/
-#define Get8(a) ((CARD32) *(a))
+#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) (((a)[0] = (CARD8) ((p) >> 16)), \
- ((a)[1] = (CARD8) ((p) >> 8)), \
- ((a)[2] = (CARD8) (p)))
+#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) (((a)[0] = (CARD8) (p)), \
- ((a)[1] = (CARD8) ((p) >> 8)), \
- ((a)[2] = (CARD8) ((p) >> 16)))
+#define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \
+ (WRITE((a+1), (CARD8) ((p) >> 8))), \
+ (WRITE((a+2), (CARD8) ((p) >> 16))))
#endif
typedef void (*fb24_32BltFunc) (CARD8 *srcLine,
@@ -106,7 +105,7 @@ fb24_32BltDown (CARD8 *srcLine,
while (((long) dst & 3) && w)
{
w--;
- pixel = *src++;
+ pixel = READ(src++);
pixel = FbDoDestInvarientMergeRop(pixel);
Put24 (dst, pixel);
dst += 3;
@@ -115,35 +114,35 @@ fb24_32BltDown (CARD8 *srcLine,
while (w >= 4)
{
CARD32 s0, s1;
- s0 = *src++;
+ s0 = READ(src++);
s0 = FbDoDestInvarientMergeRop(s0);
- s1 = *src++;
+ s1 = READ(src++);
s1 = FbDoDestInvarientMergeRop(s1);
#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst) = (s0 & 0xffffff) | (s1 << 24);
+ WRITE((CARD32 *)dst, (s0 & 0xffffff) | (s1 << 24));
#else
- *(CARD32 *)(dst) = (s0 << 8) | ((s1 & 0xffffff) >> 16);
+ WRITE((CARD32 *)dst, (s0 << 8) | ((s1 & 0xffffff) >> 16));
#endif
- s0 = *src++;
+ s0 = READ(src++);
s0 = FbDoDestInvarientMergeRop(s0);
#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst+4) = ((s1 & 0xffffff) >> 8) | (s0 << 16);
+ WRITE((CARD32 *)(dst+4), ((s1 & 0xffffff) >> 8) | (s0 << 16));
#else
- *(CARD32 *)(dst+4) = (s1 << 16) | ((s0 & 0xffffff) >> 8);
+ WRITE((CARD32 *)(dst+4), (s1 << 16) | ((s0 & 0xffffff) >> 8));
#endif
- s1 = *src++;
+ s1 = READ(src++);
s1 = FbDoDestInvarientMergeRop(s1);
#if BITMAP_BIT_ORDER == LSBFirst
- *(CARD32 *)(dst+8) = ((s0 & 0xffffff) >> 16) | (s1 << 8);
+ WRITE((CARD32 *)(dst+8), ((s0 & 0xffffff) >> 16) | (s1 << 8));
#else
- *(CARD32 *)(dst+8) = (s0 << 24) | (s1 & 0xffffff);
+ WRITE((CARD32 *)(dst+8), (s0 << 24) | (s1 & 0xffffff));
#endif
dst += 12;
w -= 4;
}
while (w--)
{
- pixel = *src++;
+ pixel = READ(src++);
pixel = FbDoDestInvarientMergeRop(pixel);
Put24 (dst, pixel);
dst += 3;
@@ -153,7 +152,7 @@ fb24_32BltDown (CARD8 *srcLine,
{
while (w--)
{
- pixel = *src++;
+ pixel = READ(src++);
dpixel = Get24 (dst);
pixel = FbDoMergeRop(pixel, dpixel);
Put24 (dst, pixel);
@@ -205,40 +204,40 @@ fb24_32BltUp (CARD8 *srcLine,
w--;
pixel = Get24(src);
src += 3;
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
}
/* Do four aligned pixels at a time */
while (w >= 4)
{
CARD32 s0, s1;
- s0 = *(CARD32 *)(src);
+ s0 = READ((CARD32 *)src);
#if BITMAP_BIT_ORDER == LSBFirst
pixel = s0 & 0xffffff;
#else
pixel = s0 >> 8;
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- s1 = *(CARD32 *)(src+4);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
+ s1 = READ((CARD32 *)(src+4));
#if BITMAP_BIT_ORDER == LSBFirst
pixel = (s0 >> 24) | ((s1 << 8) & 0xffffff);
#else
pixel = ((s0 << 16) & 0xffffff) | (s1 >> 16);
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
- s0 = *(CARD32 *)(src+8);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
+ s0 = READ((CARD32 *)(src+8));
#if BITMAP_BIT_ORDER == LSBFirst
pixel = (s1 >> 16) | ((s0 << 16) & 0xffffff);
#else
pixel = ((s1 << 8) & 0xffffff) | (s0 >> 24);
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
#if BITMAP_BIT_ORDER == LSBFirst
pixel = s0 >> 8;
#else
pixel = s0 & 0xffffff;
#endif
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
src += 12;
w -= 4;
}
@@ -247,7 +246,7 @@ fb24_32BltUp (CARD8 *srcLine,
w--;
pixel = Get24(src);
src += 3;
- *dst++ = FbDoDestInvarientMergeRop(pixel);
+ WRITE(dst++, FbDoDestInvarientMergeRop(pixel));
}
}
else
@@ -256,7 +255,7 @@ fb24_32BltUp (CARD8 *srcLine,
{
pixel = Get24(src);
src += 3;
- *dst = FbDoMergeRop(pixel, *dst);
+ WRITE(dst, FbDoMergeRop(pixel, READ(dst)));
dst++;
}
}
@@ -305,6 +304,8 @@ fb24_32GetSpans(DrawablePtr pDrawable,
ppt++;
pwidth++;
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -366,6 +367,8 @@ fb24_32SetSpans (DrawablePtr pDrawable,
ppt++;
pwidth++;
}
+
+ fbFinishAccess (pDrawable);
}
/*
@@ -429,6 +432,8 @@ fb24_32PutZImage (DrawablePtr pDrawable,
alu,
pm);
}
+
+ fbFinishAccess (pDrawable);
}
void
@@ -463,6 +468,8 @@ fb24_32GetImage (DrawablePtr pDrawable,
fb24_32BltUp (src + (y + srcYoff) * srcStride, srcStride, x + srcXoff,
(CARD8 *) d, dstStride, 0,
w, h, GXcopy, pm);
+
+ fbFinishAccess (pDrawable);
}
void
@@ -519,6 +526,9 @@ fb24_32CopyMtoN (DrawablePtr pSrcDrawable,
pPriv->pm);
pbox++;
}
+
+ fbFinishAccess (pSrcDrawable);
+ fbFinishAccess (pDstDrawable);
}
PixmapPtr
@@ -533,11 +543,10 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
int oldXoff, oldYoff;
int newXoff, newYoff;
- pNewTile = fbCreatePixmapBpp (pScreen,
- pOldTile->drawable.width,
- pOldTile->drawable.height,
- pOldTile->drawable.depth,
- bitsPerPixel);
+ pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
+ pOldTile->drawable.height,
+ pOldTile->drawable.depth,
+ pOldTile->usage_hint);
if (!pNewTile)
return 0;
fbGetDrawable (&pOldTile->drawable,
@@ -563,6 +572,9 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
GXcopy,
FB_ALLONES);
+ fbFinishAccess (&pOldTile->drawable);
+ fbFinishAccess (&pNewTile->drawable);
+
return pNewTile;
}
diff --git a/xserver/fb/fballpriv.c b/xserver/fb/fballpriv.c
index 3c05ff36e..68cb2e4c0 100644
--- a/xserver/fb/fballpriv.c
+++ b/xserver/fb/fballpriv.c
@@ -1,6 +1,4 @@
/*
- * Id: fballpriv.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -29,55 +27,33 @@
#include "fb.h"
#ifdef FB_SCREEN_PRIVATE
-int fbScreenPrivateIndex;
-int fbGetScreenPrivateIndex(void)
+static DevPrivateKey fbScreenPrivateKey = &fbScreenPrivateKey;
+DevPrivateKey fbGetScreenPrivateKey(void)
{
- return fbScreenPrivateIndex;
+ return fbScreenPrivateKey;
}
#endif
-int fbGCPrivateIndex;
-int fbGetGCPrivateIndex(void)
+static DevPrivateKey fbGCPrivateKey = &fbGCPrivateKey;
+DevPrivateKey fbGetGCPrivateKey(void)
{
- return fbGCPrivateIndex;
+ return fbGCPrivateKey;
}
#ifndef FB_NO_WINDOW_PIXMAPS
-int fbWinPrivateIndex;
-int fbGetWinPrivateIndex(void)
+static DevPrivateKey fbWinPrivateKey = &fbWinPrivateKey;
+DevPrivateKey fbGetWinPrivateKey(void)
{
- return fbWinPrivateIndex;
+ return fbWinPrivateKey;
}
#endif
-int fbGeneration;
-
-#ifdef FB_OLD_SCREEN
-#define miAllocateGCPrivateIndex() AllocateGCPrivateIndex()
-#endif
Bool
-fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
+fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
{
- if (fbGeneration != serverGeneration)
- {
- fbGCPrivateIndex = miAllocateGCPrivateIndex ();
-#ifndef FB_NO_WINDOW_PIXMAPS
- fbWinPrivateIndex = AllocateWindowPrivateIndex();
-#endif
-#ifdef FB_SCREEN_PRIVATE
- fbScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (fbScreenPrivateIndex == -1)
- return FALSE;
-#endif
-
- fbGeneration = serverGeneration;
- }
- if (pGCIndex)
- *pGCIndex = fbGCPrivateIndex;
- if (!AllocateGCPrivate(pScreen, fbGCPrivateIndex, sizeof(FbGCPrivRec)))
- return FALSE;
-#ifndef FB_NO_WINDOW_PIXMAPS
- if (!AllocateWindowPrivate(pScreen, fbWinPrivateIndex, 0))
+ if (pGCKey)
+ *pGCKey = fbGCPrivateKey;
+
+ if (!dixRequestPrivate(fbGCPrivateKey, sizeof(FbGCPrivRec)))
return FALSE;
-#endif
#ifdef FB_SCREEN_PRIVATE
{
FbScreenPrivPtr pScreenPriv;
@@ -85,8 +61,13 @@ fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec));
if (!pScreenPriv)
return FALSE;
- pScreen->devPrivates[fbScreenPrivateIndex].ptr = (pointer) pScreenPriv;
+ dixSetPrivate(&pScreen->devPrivates, fbScreenPrivateKey, pScreenPriv);
}
#endif
return TRUE;
}
+
+#ifdef FB_ACCESS_WRAPPER
+ReadMemoryProcPtr wfbReadMemory;
+WriteMemoryProcPtr wfbWriteMemory;
+#endif
diff --git a/xserver/fb/fbarc.c b/xserver/fb/fbarc.c
index 8f4d2960e..f89b81c52 100644
--- a/xserver/fb/fbarc.c
+++ b/xserver/fb/fbarc.c
@@ -1,6 +1,4 @@
/*
- * Id: fbarc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -73,9 +71,13 @@ fbPolyArc (DrawablePtr pDrawable,
BoxRec box;
int x2, y2;
RegionPtr cclip;
+ int wrapped = 0;
cclip = fbGetCompositeClip (pGC);
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
+#ifdef FB_ACCESS_WRAPPER
+ wrapped = 1;
+#endif
while (narcs--)
{
if (miCanZeroArc (parcs))
@@ -98,17 +100,43 @@ fbPolyArc (DrawablePtr pDrawable,
y2 = box.y1 + (int)parcs->height + 1;
box.y2 = y2;
if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
- (RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) )
+ (RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) ) {
+#ifdef FB_ACCESS_WRAPPER
+ if (!wrapped) {
+ fbPrepareAccess (pDrawable);
+ wrapped = 1;
+ }
+#endif
(*arc) (dst, dstStride, dstBpp,
parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff,
pPriv->and, pPriv->xor);
- else
+ } else {
+#ifdef FB_ACCESS_WRAPPER
+ if (wrapped) {
+ fbFinishAccess (pDrawable);
+ wrapped = 0;
+ }
+#endif
miZeroPolyArc(pDrawable, pGC, 1, parcs);
+ }
}
- else
+ else {
+#ifdef FB_ACCESS_WRAPPER
+ if (wrapped) {
+ fbFinishAccess (pDrawable);
+ wrapped = 0;
+ }
+#endif
miPolyArc(pDrawable, pGC, 1, parcs);
+ }
parcs++;
}
+#ifdef FB_ACCESS_WRAPPER
+ if (wrapped) {
+ fbFinishAccess (pDrawable);
+ wrapped = 0;
+ }
+#endif
}
else
#endif
diff --git a/xserver/fb/fbblt.c b/xserver/fb/fbblt.c
index d176a7c27..38271c0c9 100644
--- a/xserver/fb/fbblt.c
+++ b/xserver/fb/fbblt.c
@@ -1,6 +1,4 @@
/*
- * Id: fbblt.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -92,10 +90,10 @@ fbBlt (FbBits *srcLine,
if (!upsidedown)
for (i = 0; i < height; i++)
- memcpy(dst + i * dstStride, src + i * srcStride, width);
+ MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
else
for (i = height - 1; i >= 0; i--)
- memcpy(dst + i * dstStride, src + i * srcStride, width);
+ MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
return;
}
@@ -137,7 +135,7 @@ fbBlt (FbBits *srcLine,
{
if (endmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
}
@@ -145,20 +143,20 @@ fbBlt (FbBits *srcLine,
if (destInvarient)
{
while (n--)
- *--dst = FbDoDestInvarientMergeRop(*--src);
+ WRITE(--dst, FbDoDestInvarientMergeRop(READ(--src)));
}
else
{
while (n--)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMergeRop (bits, *dst);
+ WRITE(dst, FbDoMergeRop (bits, READ(dst)));
}
}
if (startmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
}
@@ -167,7 +165,7 @@ fbBlt (FbBits *srcLine,
{
if (startmask)
{
- bits = *src++;
+ bits = READ(src++);
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
dst++;
}
@@ -198,20 +196,20 @@ fbBlt (FbBits *srcLine,
}
#endif
while (n--)
- *dst++ = FbDoDestInvarientMergeRop(*src++);
+ WRITE(dst++, FbDoDestInvarientMergeRop(READ(src++)));
}
else
{
while (n--)
{
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
+ bits = READ(src++);
+ WRITE(dst, FbDoMergeRop (bits, READ(dst)));
dst++;
}
}
if (endmask)
{
- bits = *src;
+ bits = READ(src);
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
}
}
@@ -240,13 +238,13 @@ fbBlt (FbBits *srcLine,
if (reverse)
{
if (srcX < dstX)
- bits1 = *--src;
+ bits1 = READ(--src);
if (endmask)
{
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
@@ -258,10 +256,10 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
- *dst = FbDoDestInvarientMergeRop(bits);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits));
}
}
else
@@ -269,10 +267,10 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
- *dst = FbDoMergeRop(bits, *dst);
+ WRITE(dst, FbDoMergeRop(bits, READ(dst)));
}
}
if (startmask)
@@ -280,7 +278,7 @@ fbBlt (FbBits *srcLine,
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
@@ -290,13 +288,13 @@ fbBlt (FbBits *srcLine,
else
{
if (srcX > dstX)
- bits1 = *src++;
+ bits1 = READ(src++);
if (startmask)
{
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(startmask, rightShift))
{
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
}
FbDoLeftMaskByteMergeRop (dst, bits, startbyte, startmask);
@@ -308,9 +306,9 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits));
dst++;
}
}
@@ -319,9 +317,9 @@ fbBlt (FbBits *srcLine,
while (n--)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMergeRop(bits, *dst);
+ WRITE(dst, FbDoMergeRop(bits, READ(dst)));
dst++;
}
}
@@ -330,7 +328,7 @@ fbBlt (FbBits *srcLine,
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift))
{
- bits1 = *src;
+ bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift);
}
FbDoRightMaskByteMergeRop (dst, bits, endbyte, endmask);
@@ -425,45 +423,45 @@ fbBlt24Line (FbBits *src,
{
if (endmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
mask = FbPrev24Pix (mask);
}
while (n--)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
mask = FbPrev24Pix (mask);
}
if (startmask)
{
- bits = *--src;
+ bits = READ(--src);
--dst;
- *dst = FbDoMaskMergeRop(bits, *dst, mask & startmask);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
}
}
else
{
if (startmask)
{
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
+ bits = READ(src++);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
dst++;
mask = FbNext24Pix(mask);
}
while (n--)
{
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, mask);
+ bits = READ(src++);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask));
dst++;
mask = FbNext24Pix(mask);
}
if (endmask)
{
- bits = *src;
- *dst = FbDoMaskMergeRop(bits, *dst, mask & endmask);
+ bits = READ(src);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
}
}
}
@@ -484,26 +482,26 @@ fbBlt24Line (FbBits *src,
if (reverse)
{
if (srcX < dstX)
- bits1 = *--src;
+ bits1 = READ(--src);
if (endmask)
{
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(endmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
mask = FbPrev24Pix(mask);
}
while (n--)
{
bits = FbScrRight(bits1, rightShift);
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
--dst;
- *dst = FbDoMaskMergeRop(bits, *dst, mask);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
mask = FbPrev24Pix(mask);
}
if (startmask)
@@ -511,32 +509,32 @@ fbBlt24Line (FbBits *src,
bits = FbScrRight(bits1, rightShift);
if (FbScrRight(startmask, leftShift))
{
- bits1 = *--src;
+ bits1 = READ(--src);
bits |= FbScrLeft(bits1, leftShift);
}
--dst;
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
}
}
else
{
if (srcX > dstX)
- bits1 = *src++;
+ bits1 = READ(src++);
if (startmask)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMaskMergeRop (bits, *dst, mask & startmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & startmask));
dst++;
mask = FbNext24Pix(mask);
}
while (n--)
{
bits = FbScrLeft(bits1, leftShift);
- bits1 = *src++;
+ bits1 = READ(src++);
bits |= FbScrRight(bits1, rightShift);
- *dst = FbDoMaskMergeRop(bits, *dst, mask);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
dst++;
mask = FbNext24Pix(mask);
}
@@ -545,10 +543,10 @@ fbBlt24Line (FbBits *src,
bits = FbScrLeft(bits1, leftShift);
if (FbScrLeft(endmask, rightShift))
{
- bits1 = *src;
+ bits1 = READ(src);
bits |= FbScrRight(bits1, rightShift);
}
- *dst = FbDoMaskMergeRop (bits, *dst, mask & endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), mask & endmask));
}
}
}
@@ -707,8 +705,8 @@ fbBltOdd (FbBits *srcLine,
{
if (startmask)
{
- bits = *src++;
- *dst = FbDoMaskMergeRop (bits, *dst, startmask);
+ bits = READ(src++);
+ WRITE(dst, FbDoMaskMergeRop (bits, READ(dst), startmask));
dst++;
}
n = nmiddle;
@@ -716,8 +714,8 @@ fbBltOdd (FbBits *srcLine,
{
while (n--)
{
- bits = *src++;
- *dst = FbDoDestInvarientMergeRop(bits);
+ bits = READ(src++);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits));
dst++;
}
}
@@ -725,28 +723,28 @@ fbBltOdd (FbBits *srcLine,
{
while (n--)
{
- bits = *src++;
- *dst = FbDoMergeRop (bits, *dst);
+ bits = READ(src++);
+ WRITE(dst, FbDoMergeRop (bits, READ(dst)));
dst++;
}
}
if (endmask)
{
- bits = *src;
- *dst = FbDoMaskMergeRop(bits, *dst, endmask);
+ bits = READ(src);
+ WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), endmask));
}
}
else
{
bits = 0;
if (srcX > dstX)
- bits = *src++;
+ bits = READ(src++);
if (startmask)
{
bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
+ bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoMaskMergeRop (bits1, *dst, startmask);
+ WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), startmask));
dst++;
}
n = nmiddle;
@@ -755,9 +753,9 @@ fbBltOdd (FbBits *srcLine,
while (n--)
{
bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
+ bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoDestInvarientMergeRop(bits1);
+ WRITE(dst, FbDoDestInvarientMergeRop(bits1));
dst++;
}
}
@@ -766,9 +764,9 @@ fbBltOdd (FbBits *srcLine,
while (n--)
{
bits1 = FbScrLeft(bits, leftShift);
- bits = *src++;
+ bits = READ(src++);
bits1 |= FbScrRight(bits, rightShift);
- *dst = FbDoMergeRop(bits1, *dst);
+ WRITE(dst, FbDoMergeRop(bits1, READ(dst)));
dst++;
}
}
@@ -777,10 +775,10 @@ fbBltOdd (FbBits *srcLine,
bits1 = FbScrLeft(bits, leftShift);
if (FbScrLeft(endmask, rightShift))
{
- bits = *src;
+ bits = READ(src);
bits1 |= FbScrRight(bits, rightShift);
}
- *dst = FbDoMaskMergeRop (bits1, *dst, endmask);
+ WRITE(dst, FbDoMaskMergeRop (bits1, READ(dst), endmask));
}
}
}
@@ -827,9 +825,6 @@ fbBltOdd24 (FbBits *srcLine,
even = TRUE;
}
}
-#if 0
- fprintf (stderr, "\n");
-#endif
}
#endif
diff --git a/xserver/fb/fbbstore.c b/xserver/fb/fbbstore.c
deleted file mode 100644
index 78174b6fc..000000000
--- a/xserver/fb/fbbstore.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Id: fbbstore.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
- * Copyright © 1998 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 "fb.h"
-
-void
-fbSaveAreas(PixmapPtr pPixmap,
- RegionPtr prgnSave,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- fbCopyWindowProc (&pWin->drawable,
- &pPixmap->drawable,
- 0,
- REGION_RECTS(prgnSave),
- REGION_NUM_RECTS(prgnSave),
- xorg, yorg,
- FALSE,
- FALSE,
- 0,0);
-}
-
-void
-fbRestoreAreas(PixmapPtr pPixmap,
- RegionPtr prgnRestore,
- int xorg,
- int yorg,
- WindowPtr pWin)
-{
- fbCopyWindowProc (&pPixmap->drawable,
- &pWin->drawable,
- 0,
- REGION_RECTS(prgnRestore),
- REGION_NUM_RECTS(prgnRestore),
- -xorg, -yorg,
- FALSE,
- FALSE,
- 0,0);
-}
diff --git a/xserver/fb/fbcmap_mi.c b/xserver/fb/fbcmap_mi.c
index 58bcae3aa..188decd4c 100644
--- a/xserver/fb/fbcmap_mi.c
+++ b/xserver/fb/fbcmap_mi.c
@@ -103,6 +103,14 @@ fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
}
+Bool
+fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
+ Pixel redMask, Pixel greenMask, Pixel blueMask)
+{
+ return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1,
+ redMask, greenMask, blueMask);
+}
+
/*
* Given a list of formats for a screen, create a list
* of visuals and depths for the screen which coorespond to
diff --git a/xserver/fb/fbcopy.c b/xserver/fb/fbcopy.c
index 0d1cb7faf..b8b0b6a8c 100644
--- a/xserver/fb/fbcopy.c
+++ b/xserver/fb/fbcopy.c
@@ -1,6 +1,4 @@
/*
- * Id: fbcopy.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -29,7 +27,6 @@
#include <stdlib.h>
#include "fb.h"
-#include "fbmmx.h"
void
fbCopyNtoN (DrawablePtr pSrcDrawable,
@@ -60,21 +57,17 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
while (nbox--)
{
-#ifdef USE_MMX
+#ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
- !upsidedown && fbHaveMMX())
+ !upsidedown)
{
- if (!fbCopyAreammx (pSrcDrawable,
- pDstDrawable,
-
- (pbox->x1 + dx),
- (pbox->y1 + dy),
-
- (pbox->x1),
- (pbox->y1),
-
- (pbox->x2 - pbox->x1),
- (pbox->y2 - pbox->y1)))
+ if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
+ (pbox->x1 + dx + srcXoff),
+ (pbox->y1 + dy + srcYoff),
+ (pbox->x1 + dstXoff),
+ (pbox->y1 + dstYoff),
+ (pbox->x2 - pbox->x1),
+ (pbox->y2 - pbox->y1)))
goto fallback;
else
goto next;
@@ -98,11 +91,13 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
reverse,
upsidedown);
-#ifdef USE_MMX
+#ifndef FB_ACCESS_WRAPPER
next:
#endif
pbox++;
}
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
void
@@ -173,6 +168,9 @@ fbCopy1toN (DrawablePtr pSrcDrawable,
}
pbox++;
}
+
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
void
@@ -221,6 +219,8 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
(FbStip) pPriv->and, (FbStip) pPriv->xor,
(FbStip) pPriv->bgand, (FbStip) pPriv->bgxor,
bitplane);
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
else
{
@@ -281,6 +281,9 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
pPriv->and, pPriv->xor,
pPriv->bgand, pPriv->bgxor);
xfree (tmp);
+
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
pbox++;
}
@@ -323,7 +326,7 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1)
{
/* keep ordering in each band, reverse order of bands */
- pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew1)
return;
pboxBase = pboxNext = pbox+nbox-1;
@@ -360,11 +363,11 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
if (nbox > 1)
{
/* reverse order of rects in each band */
- pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox);
if(!pboxNew2)
{
if (pboxNew1)
- DEALLOCATE_LOCAL(pboxNew1);
+ xfree(pboxNew1);
return;
}
pboxBase = pboxNext = pbox;
@@ -399,9 +402,9 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
reverse, upsidedown, bitPlane, closure);
if (pboxNew1)
- DEALLOCATE_LOCAL (pboxNew1);
+ xfree (pboxNew1);
if (pboxNew2)
- DEALLOCATE_LOCAL (pboxNew2);
+ xfree (pboxNew2);
}
RegionPtr
diff --git a/xserver/fb/fboverlay.c b/xserver/fb/fboverlay.c
index 1e3d756ed..f9f7c52a3 100644
--- a/xserver/fb/fboverlay.c
+++ b/xserver/fb/fboverlay.c
@@ -33,12 +33,11 @@
#include "fboverlay.h"
#include "shmint.h"
-int fbOverlayGeneration;
-int fbOverlayScreenPrivateIndex = -1;
+static DevPrivateKey fbOverlayScreenPrivateKey = &fbOverlayScreenPrivateKey;
-int fbOverlayGetScreenPrivateIndex(void)
+DevPrivateKey fbOverlayGetScreenPrivateKey(void)
{
- return fbOverlayScreenPrivateIndex;
+ return fbOverlayScreenPrivateKey;
}
/*
@@ -65,7 +64,7 @@ fbOverlayCreateWindow(WindowPtr pWin)
pPixmap = pScrPriv->layer[i].u.run.pixmap;
if (pWin->drawable.depth == pPixmap->drawable.depth)
{
- pWin->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap;
+ dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), pPixmap);
/*
* Make sure layer keys are written correctly by
* having non-root layers set to full while the
@@ -108,7 +107,7 @@ fbOverlayWindowLayer(WindowPtr pWin)
int i;
for (i = 0; i < pScrPriv->nlayers; i++)
- if (pWin->devPrivates[fbWinPrivateIndex].ptr ==
+ if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey()) ==
(pointer) pScrPriv->layer[i].u.run.pixmap)
return i;
return 0;
@@ -137,7 +136,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen)
pbits = pScrPriv->layer[i].u.init.pbits;
width = pScrPriv->layer[i].u.init.width;
depth = pScrPriv->layer[i].u.init.depth;
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
+ pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap)
return FALSE;
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
@@ -278,16 +277,6 @@ fbOverlayWindowExposures (WindowPtr pWin,
miWindowExposures(pWin, prgn, other_exposed);
}
-void
-fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- if (what == PW_BORDER)
- fbOverlayUpdateLayerRegion (pWin->drawable.pScreen,
- fbOverlayWindowLayer (pWin),
- pRegion);
- fbPaintWindow (pWin, pRegion, what);
-}
-
Bool
fbOverlaySetupScreen(ScreenPtr pScreen,
pointer pbits1,
@@ -358,12 +347,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
VisualID defaultVisual;
FbOverlayScrPrivPtr pScrPriv;
- if (fbOverlayGeneration != serverGeneration)
- {
- fbOverlayScreenPrivateIndex = AllocateScreenPrivateIndex ();
- fbOverlayGeneration = serverGeneration;
- }
-
pScrPriv = xalloc (sizeof (FbOverlayScrPrivRec));
if (!pScrPriv)
return FALSE;
@@ -413,11 +396,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
return FALSE;
if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0,
depth1, ndepths, depths,
- defaultVisual, nvisuals, visuals
-#ifdef FB_OLD_MISCREENINIT
- , (miBSFuncPtr) 0
-#endif
- ))
+ defaultVisual, nvisuals, visuals))
return FALSE;
/* MI thinks there's no frame buffer */
#ifdef MITSHM
@@ -437,7 +416,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
pScrPriv->layer[1].u.init.width = width2;
pScrPriv->layer[1].u.init.depth = depth2;
- pScreen->devPrivates[fbOverlayScreenPrivateIndex].ptr = (pointer) pScrPriv;
+ dixSetPrivate(&pScreen->devPrivates, fbOverlayScreenPrivateKey, pScrPriv);
/* overwrite miCloseScreen with our own */
pScreen->CloseScreen = fbOverlayCloseScreen;
@@ -445,7 +424,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
pScreen->CreateWindow = fbOverlayCreateWindow;
pScreen->WindowExposures = fbOverlayWindowExposures;
pScreen->CopyWindow = fbOverlayCopyWindow;
- pScreen->PaintWindowBorder = fbOverlayPaintWindow;
#ifdef FB_24_32BIT
if (bpp == 24 && imagebpp == 32)
{
diff --git a/xserver/fb/fboverlay.h b/xserver/fb/fboverlay.h
index af0acb889..f3db0bb7d 100644
--- a/xserver/fb/fboverlay.h
+++ b/xserver/fb/fboverlay.h
@@ -25,9 +25,9 @@
#ifndef _FBOVERLAY_H_
#define _FBOVERLAY_H_
-extern int fbOverlayGeneration;
-extern int fbOverlayScreenPrivateIndex; /* XXX should be static */
-extern int fbOverlayGetScreenPrivateIndex(void);
+#include "privates.h"
+
+extern DevPrivateKey fbOverlayGetScreenPrivateKey(void);
#ifndef FB_OVERLAY_MAX
#define FB_OVERLAY_MAX 2
@@ -58,8 +58,7 @@ typedef struct _fbOverlayScrPriv {
} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
#define fbOverlayGetScrPriv(s) \
- ((fbOverlayGetScreenPrivateIndex() != -1) ? \
- (s)->devPrivates[fbOverlayGetScreenPrivateIndex()].ptr : NULL)
+ dixLookupPrivate(&(s)->devPrivates, fbOverlayGetScreenPrivateKey())
Bool
fbOverlayCreateWindow(WindowPtr pWin);
@@ -93,10 +92,6 @@ fbOverlayWindowExposures (WindowPtr pWin,
RegionPtr prgn,
RegionPtr other_exposed);
-void
-fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
-
-
Bool
fbOverlaySetupScreen(ScreenPtr pScreen,
pointer pbits1,
diff --git a/xserver/fb/fbpixmap.c b/xserver/fb/fbpixmap.c
index f79f7010d..311da9e62 100644
--- a/xserver/fb/fbpixmap.c
+++ b/xserver/fb/fbpixmap.c
@@ -1,6 +1,4 @@
/*
- * Id: fbpixmap.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -31,7 +29,8 @@
#include "fb.h"
PixmapPtr
-fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
+fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
+ unsigned usage_hint)
{
PixmapPtr pPixmap;
size_t datasize;
@@ -43,11 +42,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
if (paddedWidth / 4 > 32767 || height > 32767)
return NullPixmap;
datasize = height * paddedWidth;
-#ifdef PIXPRIV
base = pScreen->totalPixmapSize;
-#else
- base = sizeof (PixmapRec);
-#endif
adjust = 0;
if (base & 7)
adjust = 8 - (base & 7);
@@ -82,11 +77,14 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
pPixmap->screen_y = 0;
#endif
+ pPixmap->usage_hint = usage_hint;
+
return pPixmap;
}
PixmapPtr
-fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth)
+fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
+ unsigned usage_hint)
{
int bpp;
bpp = BitsPerPixel (depth);
@@ -94,7 +92,7 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth)
if (bpp == 32 && depth <= 24)
bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
#endif
- return fbCreatePixmapBpp (pScreen, width, height, depth, bpp);
+ return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
}
Bool
@@ -102,6 +100,7 @@ fbDestroyPixmap (PixmapPtr pPixmap)
{
if(--pPixmap->refcnt)
return TRUE;
+ dixFreePrivates(pPixmap->devPrivates);
xfree(pPixmap);
return TRUE;
}
@@ -160,6 +159,8 @@ fbPixmapToRegion(PixmapPtr pPix)
FirstRect = REGION_BOXPTR(pReg);
rects = FirstRect;
+ fbPrepareAccess(&pPix->drawable);
+
pwLine = (FbBits *) pPix->devPrivate.ptr;
nWidth = pPix->devKind >> (FB_SHIFT-3);
@@ -174,7 +175,7 @@ fbPixmapToRegion(PixmapPtr pPix)
irectLineStart = rects - FirstRect;
/* If the Screen left most bit of the word is set, we're starting in
* a box */
- if(*pw & mask0)
+ if(READ(pw) & mask0)
{
fInBox = TRUE;
rx1 = 0;
@@ -185,7 +186,7 @@ fbPixmapToRegion(PixmapPtr pPix)
pwLineEnd = pw + (width >> FB_SHIFT);
for (base = 0; pw < pwLineEnd; base += FB_UNIT)
{
- w = *pw++;
+ w = READ(pw++);
if (fInBox)
{
if (!~w)
@@ -226,7 +227,7 @@ fbPixmapToRegion(PixmapPtr pPix)
if(width & FB_MASK)
{
/* Process final partial word on line */
- w = *pw++;
+ w = READ(pw++);
for(ib = 0; ib < (width & FB_MASK); ib++)
{
/* If the Screen left most bit of the word is set, we're
@@ -311,6 +312,8 @@ fbPixmapToRegion(PixmapPtr pPix)
pReg->data = (RegDataPtr)NULL;
}
}
+
+ fbFinishAccess(&pPix->drawable);
#ifdef DEBUG
if (!miValidRegion(pReg))
FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
@@ -362,6 +365,7 @@ fbValidateDrawable (DrawablePtr pDrawable)
if (!fbValidateBits (first, stride, FB_HEAD_BITS) ||
!fbValidateBits (last, stride, FB_TAIL_BITS))
fbInitializeDrawable(pDrawable);
+ fbFinishAccess (pDrawable);
}
void
@@ -383,5 +387,6 @@ fbInitializeDrawable (DrawablePtr pDrawable)
last = bits + stride * pDrawable->height;
fbSetBits (first, stride, FB_HEAD_BITS);
fbSetBits (last, stride, FB_TAIL_BITS);
+ fbFinishAccess (pDrawable);
}
#endif /* FB_DEBUG */
diff --git a/xserver/fb/fbpseudocolor.c b/xserver/fb/fbpseudocolor.c
index 2233f95dc..06cf15992 100644
--- a/xserver/fb/fbpseudocolor.c
+++ b/xserver/fb/fbpseudocolor.c
@@ -94,8 +94,6 @@ typedef struct {
CreateScreenResourcesProcPtr CreateScreenResources;
CreateWindowProcPtr CreateWindow;
CopyWindowProcPtr CopyWindow;
- PaintWindowProcPtr PaintWindowBackground;
- PaintWindowProcPtr PaintWindowBorder;
WindowExposuresProcPtr WindowExposures;
CreateGCProcPtr CreateGC;
CreateColormapProcPtr CreateColormap;
@@ -125,13 +123,11 @@ typedef struct {
} xxScrPrivRec, *xxScrPrivPtr;
#define xxGetScrPriv(s) ((xxScrPrivPtr) \
- (xxScrPrivateIndex != -1) \
- ? (s)->devPrivates[xxScrPrivateIndex].ptr\
- : NULL)
+ dixLookupPrivate(&(s)->devPrivates, xxScrPrivateKey))
#define xxScrPriv(s) xxScrPrivPtr pScrPriv = xxGetScrPriv(s)
#define xxGetCmapPriv(s) ((xxCmapPrivPtr) \
- (s)->devPrivates[xxColormapPrivateIndex].ptr)
+ dixLookupPrivate(&(s)->devPrivates, xxColormapPrivateKey))
#define xxCmapPriv(s) xxCmapPrivPtr pCmapPriv = xxGetCmapPriv(s);
typedef struct _xxGCPriv {
@@ -140,13 +136,12 @@ typedef struct _xxGCPriv {
} xxGCPrivRec, *xxGCPrivPtr;
#define xxGetGCPriv(pGC) ((xxGCPrivPtr) \
- (pGC)->devPrivates[xxGCPrivateIndex].ptr)
+ dixLookupPrivate(&(pGC)->devPrivates, xxGCPrivateKey))
#define xxGCPriv(pGC) xxGCPrivPtr pGCPriv = xxGetGCPriv(pGC)
-int xxScrPrivateIndex = -1;
-int xxGCPrivateIndex;
-int xxColormapPrivateIndex = -1;
-int xxGeneration;
+static DevPrivateKey xxScrPrivateKey = &xxScrPrivateKey;
+static DevPrivateKey xxGCPrivateKey = &xxGCPrivateKey;
+static DevPrivateKey xxColormapPrivateKey = &xxColormapPrivateKey;
#define wrap(priv,real,mem,func) {\
@@ -277,7 +272,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
* (BitsPerPixel(depth) >> 3));
if (!pBits) return FALSE;
- pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
+ pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap) {
xfree(pBits);
return FALSE;
@@ -356,26 +351,20 @@ xxMyVisual(ScreenPtr pScreen, VisualID vid)
}
static Bool
-xxInitColormapDummy(ColormapPtr pmap, int index)
-{
- return TRUE;
-}
-
-static Bool
xxInitColormapPrivate(ColormapPtr pmap)
{
xxScrPriv(pmap->pScreen);
xxCmapPrivPtr pCmapPriv;
pointer cmap;
- pmap->devPrivates[xxColormapPrivateIndex].ptr = (pointer) -1;
+ dixSetPrivate(&pmap->devPrivates, xxColormapPrivateKey, (pointer) -1);
if (xxMyVisual(pmap->pScreen,pmap->pVisual->vid)) {
DBG("CreateColormap\n");
pCmapPriv = (xxCmapPrivPtr) xalloc (sizeof (xxCmapPrivRec));
if (!pCmapPriv)
return FALSE;
- pmap->devPrivates[xxColormapPrivateIndex].ptr = (pointer) pCmapPriv;
+ dixSetPrivate(&pmap->devPrivates, xxColormapPrivateKey, pCmapPriv);
cmap = xalloc(sizeof (CARD32) * (1 << pScrPriv->myDepth));
if (!cmap)
return FALSE;
@@ -502,7 +491,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
DBG("StoreColors\n");
- expanddefs = ALLOCATE_LOCAL(sizeof(xColorItem)
+ expanddefs = xalloc(sizeof(xColorItem)
* (1 << pScrPriv->myDepth));
if (!expanddefs) return;
@@ -529,7 +518,7 @@ xxStoreColors(ColormapPtr pmap, int nColors, xColorItem *pColors)
pColors++;
}
- DEALLOCATE_LOCAL(expanddefs);
+ xfree(expanddefs);
pCmapPriv->dirty = TRUE;
pScrPriv->colormapDirty = TRUE;
@@ -567,9 +556,9 @@ xxInstallColormap(ColormapPtr pmap)
wrap(pScrPriv,pmap->pScreen,InstallColormap,xxInstallColormap);
}
- pixels = ALLOCATE_LOCAL(sizeof(Pixel) * (1 << pScrPriv->myDepth));
- colors = ALLOCATE_LOCAL(sizeof(xrgb) * (1 << pScrPriv->myDepth));
- defs = ALLOCATE_LOCAL(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
+ pixels = xalloc(sizeof(Pixel) * (1 << pScrPriv->myDepth));
+ colors = xalloc(sizeof(xrgb) * (1 << pScrPriv->myDepth));
+ defs = xalloc(sizeof(xColorItem) * (1 << pScrPriv->myDepth));
if (!pixels || !colors)
return;
@@ -597,9 +586,9 @@ xxInstallColormap(ColormapPtr pmap)
}
xxStoreColors(pmap,(1 << pScrPriv->myDepth),defs);
- DEALLOCATE_LOCAL(pixels);
- DEALLOCATE_LOCAL(colors);
- DEALLOCATE_LOCAL(defs);
+ xfree(pixels);
+ xfree(colors);
+ xfree(defs);
return;
}
@@ -677,7 +666,7 @@ xxCreateWindow(WindowPtr pWin)
DBG("CreateWindow\n");
- pWin->devPrivates[fbWinPrivateIndex].ptr = (pointer) pScrPriv->pPixmap;
+ dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), pScrPriv->pPixmap);
PRINT_RECTS(pScrPriv->region);
if (!pWin->parent) {
REGION_EMPTY (pWin->drawable.pScreen, &pScrPriv->region);
@@ -746,9 +735,10 @@ xxCopyWindow(WindowPtr pWin,
xxPickMyWindows(pWin,&rgn);
unwrap (pScrPriv, pScreen, CopyWindow);
- pWin->devPrivates[fbWinPrivateIndex].ptr = fbGetScreenPixmap(pScreen);
+ dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(),
+ fbGetScreenPixmap(pScreen));
pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc);
- pWin->devPrivates[fbWinPrivateIndex].ptr = pPixmap;
+ dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), pPixmap);
wrap(pScrPriv, pScreen, CopyWindow, xxCopyWindow);
REGION_INTERSECT(pScreen,&rgn,&rgn,&rgn_new);
@@ -795,70 +785,6 @@ xxWindowExposures (WindowPtr pWin,
}
static void
-xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- xxScrPriv(pWin->drawable.pScreen);
- RegionRec rgni;
-
- DBG("xxPaintWindow\n");
-
- REGION_NULL (pWin->drawable.pScreen, &rgni);
-#if 0
- REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, &pWin->borderClip);
- REGION_INTERSECT(pWin->drawable.pScreen, &rgni, &rgni, pRegion);
-#else
- REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, pRegion);
-#endif
- switch (what) {
- case PW_BORDER:
- REGION_SUBTRACT (pWin->drawable.pScreen, &rgni, &rgni, &pWin->winSize);
- if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) {
- DBG("PaintWindowBorder\n");
- REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region,
- &pScrPriv->region, &rgni);
- } else {
- DBG("PaintWindowBorder NoOverlay\n");
- REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region,
- &pScrPriv->region, &rgni);
- }
- unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBorder);
- pWin->drawable.pScreen->PaintWindowBorder (pWin, pRegion, what);
- wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBorder,
- xxPaintWindow);
- break;
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- break;
- default:
- REGION_INTERSECT (pWin->drawable.pScreen, &rgni,
- &rgni,&pWin->winSize);
- if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) {
- DBG("PaintWindowBackground\n");
- REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region,
- &pScrPriv->region, &rgni);
- } else {
- DBG("PaintWindowBackground NoOverlay\n");
- REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region,
- &pScrPriv->region, &rgni);
- }
- break;
- }
-
- unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBackground);
- pWin->drawable.pScreen->PaintWindowBackground (pWin, pRegion, what);
- wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBackground,
- xxPaintWindow);
- break;
- }
- PRINT_RECTS(rgni);
- PRINT_RECTS(pScrPriv->region);
-#if 1
- REGION_UNINIT(pWin->drawable.pScreen,&rgni);
-#endif
-}
-
-static void
xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg,
xxCmapPrivPtr pCmapPriv)
{
@@ -875,6 +801,8 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg,
register CARD16 *d;
int w;
+ fbPrepareAccess((DrawablePtr)pScreen->devPrivate);
+
dst_base = (CARD16*) ((PixmapPtr)pScreen->devPrivate)->devPrivate.ptr;
dst_stride = (int)((PixmapPtr)pScreen->devPrivate)->devKind
/ sizeof (CARD16);
@@ -899,6 +827,8 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg,
}
pbox++;
}
+
+ fbFinishAccess(&((PixmapPtr)pScreen->devPrivate)->drawable);
}
static void
@@ -1094,21 +1024,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
- if (xxGeneration != serverGeneration) {
- xxScrPrivateIndex = AllocateScreenPrivateIndex ();
- if (xxScrPrivateIndex == -1)
- return FALSE;
- xxColormapPrivateIndex
- = AllocateColormapPrivateIndex (xxInitColormapDummy);
- if (xxColormapPrivateIndex == -1)
- return FALSE;
- xxGCPrivateIndex = AllocateGCPrivateIndex ();
- if (xxGCPrivateIndex == -1)
- return FALSE;
- xxGeneration = serverGeneration;
- }
-
- if (!AllocateGCPrivate (pScreen, xxGCPrivateIndex, sizeof (xxGCPrivRec)))
+ if (!dixRequestPrivate(xxGCPrivateKey, sizeof (xxGCPrivRec)))
return FALSE;
pScrPriv = (xxScrPrivPtr) xalloc (sizeof (xxScrPrivRec));
@@ -1167,8 +1083,6 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy
wrap (pScrPriv, pScreen, CreateScreenResources, xxCreateScreenResources);
wrap (pScrPriv, pScreen, CreateWindow, xxCreateWindow);
wrap (pScrPriv, pScreen, CopyWindow, xxCopyWindow);
- wrap (pScrPriv, pScreen, PaintWindowBorder, xxPaintWindow);
- wrap (pScrPriv, pScreen, PaintWindowBackground, xxPaintWindow);
#if 0 /* can we leave this out even with backing store enabled ? */
wrap (pScrPriv, pScreen, WindowExposures, xxWindowExposures);
#endif
@@ -1186,7 +1100,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy
}
#endif
pScrPriv->addr = addr;
- pScreen->devPrivates[xxScrPrivateIndex].ptr = (pointer) pScrPriv;
+ dixSetPrivate(&pScreen->devPrivates, xxScrPrivateKey, pScrPriv);
pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
if (!xxInitColormapPrivate(pDefMap))
@@ -1200,7 +1114,7 @@ GCFuncs xxGCFuncs = {
xxChangeClip, xxDestroyClip, xxCopyClip
};
-GCOps xxGCOps = {
+static GCOps xxGCOps = {
xxFillSpans, xxSetSpans,
xxPutImage, xxCopyArea,
xxCopyPlane, xxPolyPoint,
diff --git a/xserver/fb/fbscreen.c b/xserver/fb/fbscreen.c
index b88375810..12b19e419 100644
--- a/xserver/fb/fbscreen.c
+++ b/xserver/fb/fbscreen.c
@@ -38,7 +38,7 @@ fbCloseScreen (int index, ScreenPtr pScreen)
xfree (pScreen->visuals);
xfree (pScreen->devPrivate);
#ifdef FB_SCREEN_PRIVATE
- xfree (pScreen->devPrivates[fbScreenPrivateIndex].ptr);
+ xfree (dixLookupPrivate(&pScreen->devPrivates, fbGetScreenPrivateKey()));
#endif
return TRUE;
}
@@ -81,7 +81,6 @@ fbQueryBestSize (int class,
}
}
-#ifndef FB_OLD_SCREEN
PixmapPtr
_fbGetWindowPixmap (WindowPtr pWindow)
{
@@ -94,10 +93,9 @@ _fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
#ifdef FB_NO_WINDOW_PIXMAPS
FatalError ("Attempted to set window pixmap without fb support\n");
#else
- pWindow->devPrivates[fbWinPrivateIndex].ptr = (pointer) pPixmap;
+ dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(), pPixmap);
#endif
}
-#endif
Bool
fbSetupScreen(ScreenPtr pScreen,
@@ -109,7 +107,7 @@ fbSetupScreen(ScreenPtr pScreen,
int width, /* pixel width of frame buffer */
int bpp) /* bits per pixel for screen */
{
- if (!fbAllocatePrivates(pScreen, (int *) 0))
+ if (!fbAllocatePrivates(pScreen, NULL))
return FALSE;
pScreen->defColormap = FakeClientID(0);
/* let CreateDefColormap do whatever it wants for pixels */
@@ -124,8 +122,6 @@ fbSetupScreen(ScreenPtr pScreen,
pScreen->ChangeWindowAttributes = fbChangeWindowAttributes;
pScreen->RealizeWindow = fbMapWindow;
pScreen->UnrealizeWindow = fbUnmapWindow;
- pScreen->PaintWindowBackground = fbPaintWindow;
- pScreen->PaintWindowBorder = fbPaintWindow;
pScreen->CopyWindow = fbCopyWindow;
pScreen->CreatePixmap = fbCreatePixmap;
pScreen->DestroyPixmap = fbDestroyPixmap;
@@ -141,20 +137,25 @@ fbSetupScreen(ScreenPtr pScreen,
pScreen->ResolveColor = fbResolveColor;
pScreen->BitmapToRegion = fbPixmapToRegion;
-#ifndef FB_OLD_SCREEN
pScreen->GetWindowPixmap = _fbGetWindowPixmap;
pScreen->SetWindowPixmap = _fbSetWindowPixmap;
- pScreen->BackingStoreFuncs.SaveAreas = fbSaveAreas;
- pScreen->BackingStoreFuncs.RestoreAreas = fbRestoreAreas;
- pScreen->BackingStoreFuncs.SetClipmaskRgn = 0;
- pScreen->BackingStoreFuncs.GetImagePixmap = 0;
- pScreen->BackingStoreFuncs.GetSpansPixmap = 0;
-#endif
-
return TRUE;
}
+#ifdef FB_ACCESS_WRAPPER
+Bool
+wfbFinishScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap)
+#else
Bool
fbFinishScreenInit(ScreenPtr pScreen,
pointer pbits,
@@ -164,6 +165,7 @@ fbFinishScreenInit(ScreenPtr pScreen,
int dpiy,
int width,
int bpp)
+#endif
{
VisualPtr visuals;
DepthPtr depths;
@@ -222,6 +224,10 @@ fbFinishScreenInit(ScreenPtr pScreen,
fbGetScreenPrivate(pScreen)->win32bpp = 32;
fbGetScreenPrivate(pScreen)->pix32bpp = 32;
}
+#ifdef FB_ACCESS_WRAPPER
+ fbGetScreenPrivate(pScreen)->setupWrap = setupWrap;
+ fbGetScreenPrivate(pScreen)->finishWrap = finishWrap;
+#endif
#endif
rootdepth = 0;
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
@@ -229,11 +235,7 @@ fbFinishScreenInit(ScreenPtr pScreen,
return FALSE;
if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
rootdepth, ndepths, depths,
- defaultVisual, nvisuals, visuals
-#ifdef FB_OLD_MISCREENINIT
- , (miBSFuncPtr) 0
-#endif
- ))
+ defaultVisual, nvisuals, visuals))
return FALSE;
/* overwrite miCloseScreen with our own */
pScreen->CloseScreen = fbCloseScreen;
@@ -256,6 +258,27 @@ fbFinishScreenInit(ScreenPtr pScreen,
}
/* dts * (inch/dot) * (25.4 mm / inch) = mm */
+#ifdef FB_ACCESS_WRAPPER
+Bool
+wfbScreenInit(ScreenPtr pScreen,
+ pointer pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap,
+ FinishWrapProcPtr finishWrap)
+{
+ if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp))
+ return FALSE;
+ if (!wfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy,
+ width, bpp, setupWrap, finishWrap))
+ return FALSE;
+ return TRUE;
+}
+#else
Bool
fbScreenInit(ScreenPtr pScreen,
pointer pbits,
@@ -273,26 +296,4 @@ fbScreenInit(ScreenPtr pScreen,
return FALSE;
return TRUE;
}
-
-
-#ifdef FB_OLD_SCREEN
-const miBSFuncRec fbBSFuncRec = {
- fbSaveAreas,
- fbRestoreAreas,
- (void (*)(GCPtr, RegionPtr)) 0,
- (PixmapPtr (*)(void)) 0,
- (PixmapPtr (*)(void)) 0,
-};
-#endif
-
-#if 0
-void
-fbInitializeBackingStore (ScreenPtr pScreen)
-{
-#ifdef FB_OLD_SCREEN
- miInitializeBackingStore (pScreen, (miBSFuncRec *) &fbBSFuncRec);
-#else
- miInitializeBackingStore (pScreen);
-#endif
-}
#endif
diff --git a/xserver/fb/fbwindow.c b/xserver/fb/fbwindow.c
index 968b5a61d..f6fe8aa83 100644
--- a/xserver/fb/fbwindow.c
+++ b/xserver/fb/fbwindow.c
@@ -1,6 +1,4 @@
/*
- * Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
- *
* Copyright © 1998 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -30,16 +28,12 @@
#include "fb.h"
-#ifdef USE_MMX
-#include "fbmmx.h"
-#endif
-
Bool
fbCreateWindow(WindowPtr pWin)
{
#ifndef FB_NO_WINDOW_PIXMAPS
- pWin->devPrivates[fbWinPrivateIndex].ptr =
- (pointer) fbGetScreenPixmap(pWin->drawable.pScreen);
+ dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(),
+ fbGetScreenPixmap(pWin->drawable.pScreen));
#endif
#ifdef FB_SCREEN_PRIVATE
if (pWin->drawable.bitsPerPixel == 32)
@@ -118,6 +112,9 @@ fbCopyWindowProc (DrawablePtr pSrcDrawable,
upsidedown);
pbox++;
}
+
+ fbFinishAccess (pDstDrawable);
+ fbFinishAccess (pSrcDrawable);
}
void
@@ -219,151 +216,37 @@ fbFillRegionSolid (DrawablePtr pDrawable,
int n = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion);
-#ifdef USE_MMX
- int has_mmx = 0;
- if (!and && fbHaveMMX())
- has_mmx = 1;
+#ifndef FB_ACCESS_WRAPPER
+ int try_mmx = 0;
+ if (!and)
+ try_mmx = 1;
#endif
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
while (n--)
{
-#ifdef USE_MMX
- if (!has_mmx || !fbSolidFillmmx (pDrawable,
- pbox->x1,
- pbox->y1,
- (pbox->x2 - pbox->x1),
- (pbox->y2 - pbox->y1), xor)) {
+#ifndef FB_ACCESS_WRAPPER
+ if (!try_mmx || !pixman_fill (dst, dstStride, dstBpp,
+ pbox->x1 + dstXoff, pbox->y1 + dstYoff,
+ (pbox->x2 - pbox->x1),
+ (pbox->y2 - pbox->y1),
+ xor))
+ {
#endif
- fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- and, xor);
-#ifdef USE_MMX
+ fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
+ dstStride,
+ (pbox->x1 + dstXoff) * dstBpp,
+ dstBpp,
+ (pbox->x2 - pbox->x1) * dstBpp,
+ pbox->y2 - pbox->y1,
+ and, xor);
+#ifndef FB_ACCESS_WRAPPER
}
#endif
fbValidateDrawable (pDrawable);
pbox++;
}
-}
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-void
-fbFillRegionTiled (DrawablePtr pDrawable,
- RegionPtr pRegion,
- PixmapPtr pTile)
-{
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
- int dstXoff, dstYoff;
- FbBits *tile;
- FbStride tileStride;
- int tileBpp;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
- int tileWidth, tileHeight;
- int n = REGION_NUM_RECTS(pRegion);
- BoxPtr pbox = REGION_RECTS(pRegion);
- int xRot = pDrawable->x;
- int yRot = pDrawable->y;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- {
- int index = pDrawable->pScreen->myNum;
- if(&WindowTable[index]->drawable == pDrawable)
- {
- xRot -= panoramiXdataPtr[index].x;
- yRot -= panoramiXdataPtr[index].y;
- }
- }
-#endif
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
- tileWidth = pTile->drawable.width;
- tileHeight = pTile->drawable.height;
- xRot += dstXoff;
- yRot += dstYoff;
-
- while (n--)
- {
- fbTile (dst + (pbox->y1 + dstYoff) * dstStride,
- dstStride,
- (pbox->x1 + dstXoff) * dstBpp,
- (pbox->x2 - pbox->x1) * dstBpp,
- pbox->y2 - pbox->y1,
- tile,
- tileStride,
- tileWidth * dstBpp,
- tileHeight,
- GXcopy,
- FB_ALLONES,
- dstBpp,
- xRot * dstBpp,
- yRot - (pbox->y1 + dstYoff));
- pbox++;
- }
-}
-
-void
-fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
-{
- WindowPtr pBgWin;
-
- switch (what) {
- case PW_BACKGROUND:
- switch (pWin->backgroundState) {
- case None:
- break;
- case ParentRelative:
- do {
- pWin = pWin->parent;
- } while (pWin->backgroundState == ParentRelative);
- (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
- what);
- break;
- case BackgroundPixmap:
- fbFillRegionTiled (&pWin->drawable,
- pRegion,
- pWin->background.pixmap);
- break;
- case BackgroundPixel:
- fbFillRegionSolid (&pWin->drawable,
- pRegion,
- 0,
- fbReplicatePixel (pWin->background.pixel,
- pWin->drawable.bitsPerPixel));
- break;
- }
- break;
- case PW_BORDER:
- if (pWin->borderIsPixel)
- {
- fbFillRegionSolid (&pWin->drawable,
- pRegion,
- 0,
- fbReplicatePixel (pWin->border.pixel,
- pWin->drawable.bitsPerPixel));
- }
- else
- {
- for (pBgWin = pWin;
- pBgWin->backgroundState == ParentRelative;
- pBgWin = pBgWin->parent);
-
- fbFillRegionTiled (&pBgWin->drawable,
- pRegion,
- pWin->border.pixmap);
- }
- break;
- }
- fbValidateDrawable (&pWin->drawable);
+ fbFinishAccess (pDrawable);
}
diff --git a/xserver/fb/wfbrename.h b/xserver/fb/wfbrename.h
index 5ea9092f8..dc0528559 100644
--- a/xserver/fb/wfbrename.h
+++ b/xserver/fb/wfbrename.h
@@ -79,19 +79,18 @@
#define fbExpandDirectColors wfbExpandDirectColors
#define fbFill wfbFill
#define fbFillRegionSolid wfbFillRegionSolid
-#define fbFillRegionTiled wfbFillRegionTiled
#define fbFillSpans wfbFillSpans
#define fbFixCoordModePrevious wfbFixCoordModePrevious
#define fbGCFuncs wfbGCFuncs
#define fbGCOps wfbGCOps
-#define fbGCPrivateIndex wfbGCPrivateIndex
+#define fbGCPrivateKey wfbGCPrivateKey
#define fbGeneration wfbGeneration
-#define fbGetGCPrivateIndex wfbGetGCPrivateIndex
+#define fbGetGCPrivateKey wfbGetGCPrivateKey
#define fbGetImage wfbGetImage
-#define fbGetScreenPrivateIndex wfbGetScreenPrivateIndex
+#define fbGetScreenPrivateKey wfbGetScreenPrivateKey
#define fbGetSpans wfbGetSpans
#define _fbGetWindowPixmap _wfbGetWindowPixmap
-#define fbGetWinPrivateIndex wfbGetWinPrivateIndex
+#define fbGetWinPrivateKey wfbGetWinPrivateKey
#define fbGlyph16 wfbGlyph16
#define fbGlyph24 wfbGlyph24
#define fbGlyph32 wfbGlyph32
@@ -117,16 +116,14 @@
#define fbOverlayCreateWindow wfbOverlayCreateWindow
#define fbOverlayFinishScreenInit wfbOverlayFinishScreenInit
#define fbOverlayGeneration wfbOverlayGeneration
-#define fbOverlayGetScreenPrivateIndex wfbOverlayGetScreenPrivateIndex
+#define fbOverlayGetScreenPrivateKey wfbOverlayGetScreenPrivateKey
#define fbOverlayPaintKey wfbOverlayPaintKey
-#define fbOverlayPaintWindow wfbOverlayPaintWindow
-#define fbOverlayScreenPrivateIndex wfbOverlayScreenPrivateIndex
+#define fbOverlayScreenPrivateKey wfbOverlayScreenPrivateKey
#define fbOverlaySetupScreen wfbOverlaySetupScreen
#define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion
#define fbOverlayWindowExposures wfbOverlayWindowExposures
#define fbOverlayWindowLayer wfbOverlayWindowLayer
#define fbPadPixmap wfbPadPixmap
-#define fbPaintWindow wfbPaintWindow
#define fbPictureInit wfbPictureInit
#define fbPixmapToRegion wfbPixmapToRegion
#define fbPolyArc wfbPolyArc
@@ -160,7 +157,7 @@
#define fbResolveColor wfbResolveColor
#define fbRestoreAreas wfbRestoreAreas
#define fbSaveAreas wfbSaveAreas
-#define fbScreenPrivateIndex wfbScreenPrivateIndex
+#define fbScreenPrivateKey wfbScreenPrivateKey
#define fbSegment wfbSegment
#define fbSelectBres wfbSelectBres
#define fbSetSpans wfbSetSpans
@@ -185,14 +182,14 @@
#define fbUnrealizeFont wfbUnrealizeFont
#define fbValidateGC wfbValidateGC
#define fbWalkCompositeRegion wfbWalkCompositeRegion
-#define fbWinPrivateIndex wfbWinPrivateIndex
+#define fbWinPrivateKey wfbWinPrivateKey
#define fbZeroLine wfbZeroLine
#define fbZeroSegment wfbZeroSegment
#define free_pixman_pict wfb_free_pixman_pict
#define image_from_pict wfb_image_from_pict
-#define xxScrPrivateIndex wfbxxScrPrivateIndex
-#define xxGCPrivateIndex wfbxxGCPrivateIndex
-#define xxColormapPrivateIndex wfbxxColormapPrivateIndex
+#define xxScrPrivateKey wfbxxScrPrivateKey
+#define xxGCPrivateKey wfbxxGCPrivateKey
+#define xxColormapPrivateKey wfbxxColormapPrivateKey
#define xxGeneration wfbxxGeneration
#define xxPrintVisuals wfbxxPrintVisuals
#define xxGCFuncs wfbxxGCFuncs