aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/nvidia
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive/nvidia')
-rw-r--r--xorg-server/hw/kdrive/nvidia/Makefile.am39
-rw-r--r--xorg-server/hw/kdrive/nvidia/Makefile.in720
-rw-r--r--xorg-server/hw/kdrive/nvidia/nvidia.c361
-rw-r--r--xorg-server/hw/kdrive/nvidia/nvidia.h247
-rw-r--r--xorg-server/hw/kdrive/nvidia/nvidiadraw.c238
-rw-r--r--xorg-server/hw/kdrive/nvidia/nvidiadraw.h69
-rw-r--r--xorg-server/hw/kdrive/nvidia/nvidiastub.c65
7 files changed, 1739 insertions, 0 deletions
diff --git a/xorg-server/hw/kdrive/nvidia/Makefile.am b/xorg-server/hw/kdrive/nvidia/Makefile.am
new file mode 100644
index 000000000..81736c311
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/Makefile.am
@@ -0,0 +1,39 @@
+INCLUDES = \
+ @KDRIVE_INCS@ \
+ -I$(top_srcdir)/hw/kdrive/vesa \
+ @KDRIVE_CFLAGS@
+
+bin_PROGRAMS = Xnvidia
+
+noinst_LIBRARIES = libnvidia.a
+
+# nvidiavideo.c
+
+libnvidia_a_SOURCES = \
+ nvidia.c \
+ nvidiadraw.c \
+ nvidia.h \
+ nvidiadraw.h
+
+Xnvidia_SOURCES = \
+ nvidiastub.c
+
+NVIDIA_LIBS = \
+ libnvidia.a \
+ $(top_builddir)/hw/kdrive/vesa/libvesa.a \
+ @KDRIVE_LIBS@
+
+if GLX
+Xnvidia_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+endif
+
+Xnvidia_LDADD = \
+ $(NVIDIA_LIBS) \
+ @KDRIVE_LIBS@
+
+Xnvidia_DEPENDENCIES = \
+ libnvidia.a \
+ @KDRIVE_LOCAL_LIBS@
+
+relink:
+ rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
diff --git a/xorg-server/hw/kdrive/nvidia/Makefile.in b/xorg-server/hw/kdrive/nvidia/Makefile.in
new file mode 100644
index 000000000..e93f94789
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/Makefile.in
@@ -0,0 +1,720 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = Xnvidia$(EXEEXT)
+subdir = hw/kdrive/nvidia
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xgl-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libnvidia_a_AR = $(AR) $(ARFLAGS)
+libnvidia_a_LIBADD =
+am_libnvidia_a_OBJECTS = nvidia.$(OBJEXT) nvidiadraw.$(OBJEXT)
+libnvidia_a_OBJECTS = $(am_libnvidia_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_Xnvidia_OBJECTS = nvidiastub.$(OBJEXT)
+Xnvidia_OBJECTS = $(am_Xnvidia_OBJECTS)
+am__DEPENDENCIES_1 = libnvidia.a \
+ $(top_builddir)/hw/kdrive/vesa/libvesa.a
+Xnvidia_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(Xnvidia_LDFLAGS) \
+ $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libnvidia_a_SOURCES) $(Xnvidia_SOURCES)
+DIST_SOURCES = $(libnvidia_a_SOURCES) $(Xnvidia_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LAUNCHD = @LAUNCHD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+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@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+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@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+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@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+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_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+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@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+INCLUDES = \
+ @KDRIVE_INCS@ \
+ -I$(top_srcdir)/hw/kdrive/vesa \
+ @KDRIVE_CFLAGS@
+
+noinst_LIBRARIES = libnvidia.a
+
+# nvidiavideo.c
+libnvidia_a_SOURCES = \
+ nvidia.c \
+ nvidiadraw.c \
+ nvidia.h \
+ nvidiadraw.h
+
+Xnvidia_SOURCES = \
+ nvidiastub.c
+
+NVIDIA_LIBS = \
+ libnvidia.a \
+ $(top_builddir)/hw/kdrive/vesa/libvesa.a \
+ @KDRIVE_LIBS@
+
+@GLX_TRUE@Xnvidia_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+Xnvidia_LDADD = \
+ $(NVIDIA_LIBS) \
+ @KDRIVE_LIBS@
+
+Xnvidia_DEPENDENCIES = \
+ libnvidia.a \
+ @KDRIVE_LOCAL_LIBS@
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/kdrive/nvidia/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/kdrive/nvidia/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libnvidia.a: $(libnvidia_a_OBJECTS) $(libnvidia_a_DEPENDENCIES)
+ -rm -f libnvidia.a
+ $(libnvidia_a_AR) libnvidia.a $(libnvidia_a_OBJECTS) $(libnvidia_a_LIBADD)
+ $(RANLIB) libnvidia.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+Xnvidia$(EXEEXT): $(Xnvidia_OBJECTS) $(Xnvidia_DEPENDENCIES)
+ @rm -f Xnvidia$(EXEEXT)
+ $(Xnvidia_LINK) $(Xnvidia_OBJECTS) $(Xnvidia_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidiadraw.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidiastub.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+ clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool clean-noinstLIBRARIES ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS
+
+
+relink:
+ rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/hw/kdrive/nvidia/nvidia.c b/xorg-server/hw/kdrive/nvidia/nvidia.c
new file mode 100644
index 000000000..be42e561a
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/nvidia.c
@@ -0,0 +1,361 @@
+/*
+ * Copyright © 2003 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_CONFIG_H
+#include <kdrive-config.h>
+#endif
+#include "nvidia.h"
+#include "kaa.h"
+#include <sys/io.h>
+
+static Bool
+nvidiaCardInit (KdCardInfo *card)
+{
+ NvidiaCardInfo *nvidiac;
+
+ nvidiac = (NvidiaCardInfo *) xalloc (sizeof (NvidiaCardInfo));
+ if (!nvidiac)
+ return FALSE;
+
+ (void) nvidiaMapReg (card, nvidiac);
+
+ if (!vesaInitialize (card, &nvidiac->vesa))
+ {
+ xfree (nvidiac);
+ return FALSE;
+ }
+
+ card->driver = nvidiac;
+
+ return TRUE;
+}
+
+static Bool
+nvidiaScreenInit (KdScreenInfo *screen)
+{
+ NvidiaCardInfo *nvidiac = screen->card->driver;
+ NvidiaScreenInfo *nvidias;
+ int screen_size, memory;
+
+ nvidias = (NvidiaScreenInfo *) xalloc (sizeof (NvidiaScreenInfo));
+ if (!nvidias)
+ return FALSE;
+ memset (nvidias, '\0', sizeof (NvidiaScreenInfo));
+ if (!vesaScreenInitialize (screen, &nvidias->vesa))
+ {
+ xfree (nvidias);
+ return FALSE;
+ }
+ if (!nvidiac->reg_base)
+ screen->dumb = TRUE;
+ if (nvidias->vesa.mapping != VESA_LINEAR)
+ screen->dumb = TRUE;
+ nvidias->screen = nvidias->vesa.fb;
+ memory = nvidias->vesa.fb_size;
+ screen_size = screen->fb[0].byteStride * screen->height;
+ if (nvidias->screen && memory >= screen_size + 2048)
+ {
+ memory -= 2048;
+ nvidias->cursor_base = nvidias->screen + memory - 2048;
+ }
+ else
+ nvidias->cursor_base = 0;
+ screen->softCursor = TRUE; /* XXX for now */
+ memory -= screen_size;
+ if (memory > screen->fb[0].byteStride)
+ {
+ nvidias->off_screen = nvidias->screen + screen_size;
+ nvidias->off_screen_size = memory;
+ }
+ else
+ {
+ nvidias->off_screen = 0;
+ nvidias->off_screen_size = 0;
+ }
+ screen->driver = nvidias;
+ return TRUE;
+}
+
+static Bool
+nvidiaInitScreen (ScreenPtr pScreen)
+{
+#if 0
+#ifdef XV
+ KdScreenPriv(pScreen);
+ NvidiaCardInfo *nvidiac = pScreenPriv->screen->card->driver;
+ if (nvidiac->media_reg && nvidiac->reg)
+ nvidiaInitVideo(pScreen);
+#endif
+#endif
+ return vesaInitScreen (pScreen);
+}
+
+#ifdef RANDR
+static Bool
+nvidiaRandRSetConfig (ScreenPtr pScreen,
+ Rotation rotation,
+ int rate,
+ RRScreenSizePtr pSize)
+{
+ kaaWaitSync (pScreen);
+
+ if (!vesaRandRSetConfig (pScreen, rotation, rate, pSize))
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+nvidiaRandRInit (ScreenPtr pScreen)
+{
+ rrScrPriv(pScreen);
+
+ pScrPriv->rrSetConfig = nvidiaRandRSetConfig;
+}
+#endif
+
+static Bool
+nvidiaFinishInitScreen (ScreenPtr pScreen)
+{
+ Bool ret;
+ ret = vesaFinishInitScreen (pScreen);
+#ifdef RANDR
+ nvidiaRandRInit (pScreen);
+#endif
+ return ret;
+}
+
+void
+nvidiaPreserve (KdCardInfo *card)
+{
+ vesaPreserve(card);
+}
+
+void
+nvidiaOutb (NvidiaCardInfo *nvidiac, CARD16 port, CARD8 val)
+{
+ asm volatile ("outb %b0,%w1" : : "a" (val), "d" (port));
+}
+
+CARD8
+nvidiaInb (NvidiaCardInfo *nvidiac, CARD16 port)
+{
+ CARD8 v;
+ asm volatile ("inb %w1,%b0" : "=a" (v) : "d" (port));
+ return v;
+}
+
+CARD8
+nvidiaGetIndex (NvidiaCardInfo *nvidiac, CARD16 addr, CARD16 data, CARD8 id)
+{
+ CARD8 ret;
+ DBGOUT ("nvidiaGetIndex(0x%x,0x%x)\n", addr, id);
+ nvidiaOutb (nvidiac, addr, id);
+ ret = nvidiaInb (nvidiac, data);
+ DBGOUT (" -> 0x%x\n", ret);
+ return ret;
+}
+
+void
+nvidiaSetIndex (NvidiaCardInfo *nvidiac, CARD16 addr, CARD16 data, CARD8 id, CARD8 val)
+{
+ DBGOUT ("nvidiaSetIndex(0x%x,0x%x) = 0x%x\n", addr, id, val);
+ nvidiaOutb (nvidiac, addr, id);
+ nvidiaOutb (nvidiac, data, val);
+}
+
+static void vgaLockUnlock (NvidiaCardInfo *nvidiac, Bool lock)
+{
+ CARD8 cr11;
+ ENTER ();
+ cr11 = nvidiaGetIndex (nvidiac, 0x3d4, 0x3d5, 0x11);
+ if (lock) cr11 |= 0x80;
+ else cr11 &= ~0x80;
+ nvidiaSetIndex (nvidiac, 0x3d4, 0x3d5, 0x11, cr11);
+ LEAVE ();
+}
+
+static void nvidiaLockUnlock (NvidiaCardInfo *nvidiac, Bool lock)
+{
+ if (NVIDIA_IS_3(nvidiac))
+ nvidiaSetIndex (nvidiac, 0x3c4, 0x3c5, 0x06, lock ? 0x99 : 0x57);
+ else
+ nvidiaSetIndex (nvidiac, 0x3c4, 0x3c5, 0x1f, lock ? 0x99 : 0x57);
+ vgaLockUnlock(nvidiac, lock);
+}
+
+Bool
+nvidiaMapReg (KdCardInfo *card, NvidiaCardInfo *nvidiac)
+{
+ nvidiac->reg_base = (CARD8 *) KdMapDevice (NVIDIA_REG_BASE(card),
+ NVIDIA_REG_SIZE(card));
+
+ if (!nvidiac->reg_base)
+ {
+ nvidiac->mmio = 0;
+ nvidiac->rop = 0;
+ nvidiac->blt = 0;
+ nvidiac->rect = 0;
+ return FALSE;
+ }
+
+ nvidiac->mmio = (CARD8 *) (nvidiac->reg_base + NVIDIA_MMIO_OFF(card));
+ nvidiac->rop = (NvidiaRop *) (nvidiac->reg_base + NVIDIA_ROP_OFF(card));
+ nvidiac->rect = (NvidiaRectangle *) (nvidiac->reg_base + NVIDIA_RECTANGLE_OFF(card));
+ nvidiac->blt = (NvidiaScreenBlt *) (nvidiac->reg_base + NVIDIA_BLT_OFF(card));
+ nvidiac->busy = (NvidiaBusy *) (nvidiac->reg_base + NVIDIA_BUSY_OFF(card));
+ KdSetMappedMode (NVIDIA_REG_BASE(card),
+ NVIDIA_REG_SIZE(card),
+ KD_MAPPED_MODE_REGISTERS);
+ return TRUE;
+}
+
+void
+nvidiaUnmapReg (KdCardInfo *card, NvidiaCardInfo *nvidiac)
+{
+ if (nvidiac->reg_base)
+ {
+ KdResetMappedMode (NVIDIA_REG_BASE(card),
+ NVIDIA_REG_SIZE(card),
+ KD_MAPPED_MODE_REGISTERS);
+ KdUnmapDevice ((void *) nvidiac->reg_base, NVIDIA_REG_SIZE(card));
+ nvidiac->reg_base = 0;
+ nvidiac->rop = 0;
+ nvidiac->blt = 0;
+ nvidiac->rect = 0;
+ }
+}
+
+void
+nvidiaSetMMIO (KdCardInfo *card, NvidiaCardInfo *nvidiac)
+{
+ if (!nvidiac->reg_base)
+ nvidiaMapReg (card, nvidiac);
+ nvidiaLockUnlock (nvidiac, FALSE);
+ nvidiac->fifo_free = 0;
+ nvidiac->fifo_size = nvidiac->rop->FifoFree.FifoFree;
+}
+
+void
+nvidiaResetMMIO (KdCardInfo *card, NvidiaCardInfo *nvidiac)
+{
+ nvidiaUnmapReg (card, nvidiac);
+ nvidiaLockUnlock (nvidiac, TRUE);
+}
+
+Bool
+nvidiaEnable (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ NvidiaCardInfo *nvidiac = pScreenPriv->card->driver;
+
+ if (!vesaEnable (pScreen))
+ return FALSE;
+
+ nvidiaSetMMIO (pScreenPriv->card, nvidiac);
+#ifdef XV
+ KdXVEnable (pScreen);
+#endif
+ return TRUE;
+}
+
+void
+nvidiaDisable (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ NvidiaCardInfo *nvidiac = pScreenPriv->card->driver;
+
+#ifdef XV
+ KdXVDisable (pScreen);
+#endif
+ nvidiaResetMMIO (pScreenPriv->card, nvidiac);
+ vesaDisable (pScreen);
+}
+
+static Bool
+nvidiaDPMS (ScreenPtr pScreen, int mode)
+{
+ return vesaDPMS (pScreen, mode);
+}
+
+static void
+nvidiaRestore (KdCardInfo *card)
+{
+ NvidiaCardInfo *nvidiac = card->driver;
+
+ nvidiaResetMMIO (card, nvidiac);
+ vesaRestore (card);
+}
+
+static void
+nvidiaScreenFini (KdScreenInfo *screen)
+{
+ NvidiaScreenInfo *nvidias = (NvidiaScreenInfo *) screen->driver;
+
+ vesaScreenFini (screen);
+ xfree (nvidias);
+ screen->driver = 0;
+}
+
+static void
+nvidiaCardFini (KdCardInfo *card)
+{
+ NvidiaCardInfo *nvidiac = card->driver;
+
+ nvidiaUnmapReg (card, nvidiac);
+ vesaCardFini (card);
+}
+
+#define nvidiaCursorInit 0 /* initCursor */
+#define nvidiaCursorEnable 0 /* enableCursor */
+#define nvidiaCursorDisable 0 /* disableCursor */
+#define nvidiaCursorFini 0 /* finiCursor */
+#define nvidiaRecolorCursor 0 /* recolorCursor */
+
+KdCardFuncs nvidiaFuncs = {
+ nvidiaCardInit, /* cardinit */
+ nvidiaScreenInit, /* scrinit */
+ nvidiaInitScreen, /* initScreen */
+ nvidiaFinishInitScreen, /* finishInitScreen */
+ vesaCreateResources, /* createRes */
+ nvidiaPreserve, /* preserve */
+ nvidiaEnable, /* enable */
+ nvidiaDPMS, /* dpms */
+ nvidiaDisable, /* disable */
+ nvidiaRestore, /* restore */
+ nvidiaScreenFini, /* scrfini */
+ nvidiaCardFini, /* cardfini */
+
+ nvidiaCursorInit, /* initCursor */
+ nvidiaCursorEnable, /* enableCursor */
+ nvidiaCursorDisable, /* disableCursor */
+ nvidiaCursorFini, /* finiCursor */
+ nvidiaRecolorCursor, /* recolorCursor */
+
+ nvidiaDrawInit, /* initAccel */
+ nvidiaDrawEnable, /* enableAccel */
+ nvidiaDrawDisable, /* disableAccel */
+ nvidiaDrawFini, /* finiAccel */
+
+ vesaGetColors, /* getColors */
+ vesaPutColors, /* putColors */
+};
diff --git a/xorg-server/hw/kdrive/nvidia/nvidia.h b/xorg-server/hw/kdrive/nvidia/nvidia.h
new file mode 100644
index 000000000..026233cc1
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/nvidia.h
@@ -0,0 +1,247 @@
+/*
+ * Copyright © 2003 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.
+ */
+
+#ifndef _NVIDIA_H_
+#define _NVIDIA_H_
+#include <vesa.h>
+#include "kxv.h"
+#include "klinux.h"
+
+/*
+ * offset from ioport beginning
+ */
+
+#define DEBUG
+#ifdef DEBUG
+#define DBGOUT(fmt,a...) fprintf (stderr, fmt, ##a)
+#else
+#define DBGOUT(fmt,a...)
+#endif
+
+#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
+#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
+
+#define NVIDIA_REG_BASE(c) ((c)->attr.address[0])
+#define NVIDIA_REG_SIZE(c) (16 * 1024 * 1024)
+
+#define NVIDIA_PCIO_OFF(c) (0x601000)
+#define NVIDIA_MMIO_OFF(c) (NVIDIA_PCIO_OFF(c) + 0)
+#define NVIDIA_FIFO_OFF(c) (0x800000)
+#define NVIDIA_ROP_OFF(c) (NVIDIA_FIFO_OFF(c) + 0)
+#define NVIDIA_CLIP_OFF(c) (NVIDIA_FIFO_OFF(c) + 0x2000)
+#define NVIDIA_PATT_OFF(c) (NVIDIA_FIFO_OFF(c) + 0x4000)
+#define NVIDIA_PIXMAP_OFF(c) (NVIDIA_FIFO_OFF(c) + 0x6000)
+#define NVIDIA_BLT_OFF(c) (NVIDIA_FIFO_OFF(c) + 0x8000)
+#define NVIDIA_RECTANGLE_OFF(c) (NVIDIA_FIFO_OFF(c) + 0xa000)
+#define NVIDIA_LINE_OFF(c) (NVIDIA_FIFO_OFF(c) + 0xc000)
+#define NVIDIA_IS_3(c) (0)
+#define NVIDIA_BUSY(c) (NVIDIA_IS_3(c) ? 0x6b0 : 0x700)
+#define NVIDIA_BUSY_OFF(c) (0x400000 + NVIDIA_BUSY(c))
+
+typedef volatile CARD8 VOL8;
+typedef volatile CARD16 VOL16;
+typedef volatile CARD32 VOL32;
+
+#define NVIDIA_XY(x,y) ((x) | ((y) << 16))
+
+typedef struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ VOL32 FifoFree;
+#else
+ VOL16 FifoFree;
+ VOL16 Nop;
+#endif
+} NvidiaFifoFree;
+
+/*
+ * Raster OPeration. Windows style ROP3.
+ */
+typedef struct {
+ VOL32 reserved00[4];
+ NvidiaFifoFree FifoFree;
+ VOL32 reserved01[0x0BB];
+ VOL32 Rop3;
+} NvidiaRop;
+
+/*
+ * 2D filled rectangle.
+ */
+typedef struct {
+ VOL32 reserved00[4];
+ NvidiaFifoFree FifoFree;
+ VOL32 reserved01[0x0BB];
+ VOL32 reserved03[(0x040)-1];
+ VOL32 Color1A;
+ VOL32 TopLeft;
+ VOL32 WidthHeight;
+} NvidiaRectangle;
+
+/*
+ * 2D screen-screen BLT.
+ */
+typedef struct {
+ VOL32 reserved00[4];
+ NvidiaFifoFree FifoFree;
+ VOL32 reserved01[0x0BB];
+ VOL32 TopLeftSrc;
+ VOL32 TopLeftDst;
+ VOL32 WidthHeight;
+} NvidiaScreenBlt;
+
+typedef struct {
+ VOL32 busy;
+} NvidiaBusy;
+
+typedef struct _nvidiaCardInfo {
+ VesaCardPrivRec vesa;
+ CARD8 *reg_base;
+ int fifo_free;
+ int fifo_size;
+ CARD8 *mmio;
+ NvidiaRop *rop;
+ NvidiaRectangle *rect;
+ NvidiaScreenBlt *blt;
+ NvidiaBusy *busy;
+} NvidiaCardInfo;
+
+#define getNvidiaCardInfo(kd) ((NvidiaCardInfo *) ((kd)->card->driver))
+#define nvidiaCardInfo(kd) NvidiaCardInfo *nvidiac = getNvidiaCardInfo(kd)
+
+/*
+ * Xv information, optional
+ */
+typedef struct _nvidiaPortPriv {
+ CARD32 YBuf0Offset;
+
+ CARD32 YBuf1Offset;
+
+ CARD8 currentBuf;
+
+ int brightness;
+ int saturation;
+
+ RegionRec clip;
+ CARD32 colorKey;
+
+ Bool videoOn;
+ Time offTime;
+ Time freeTime;
+ CARD32 size;
+ CARD32 offset;
+} NvidiaPortPrivRec, *NvidiaPortPrivPtr;
+
+Bool nvidiaInitVideo(ScreenPtr pScreen);
+
+typedef struct _nvidiaScreenInfo {
+ VesaScreenPrivRec vesa;
+ CARD8 *cursor_base;
+ CARD8 *screen;
+ CARD8 *off_screen;
+ int off_screen_size;
+ KdVideoAdaptorPtr pAdaptor;
+ KaaScreenInfoRec kaa;
+} NvidiaScreenInfo;
+
+#define getNvidiaScreenInfo(kd) ((NvidiaScreenInfo *) ((kd)->screen->driver))
+#define nvidiaScreenInfo(kd) NvidiaScreenInfo *nvidias = getNvidiaScreenInfo(kd)
+
+void
+nvidiaPreserve (KdCardInfo *card);
+
+void
+nvidiaOutb (NvidiaCardInfo *nvidiac, CARD16 port, CARD8 val);
+
+CARD8
+nvidiaInb (NvidiaCardInfo *nvidiac, CARD16 port);
+
+CARD8
+nvidiaGetIndex (NvidiaCardInfo *nvidiac, CARD16 addr, CARD16 data, CARD8 id);
+
+void
+nvidiaSetIndex (NvidiaCardInfo *nvidiac, CARD16 addr, CARD16 data, CARD8 id, CARD8 val);
+
+Bool
+nvidiaMapReg (KdCardInfo *card, NvidiaCardInfo *nvidiac);
+
+void
+nvidiaUnmapReg (KdCardInfo *card, NvidiaCardInfo *nvidiac);
+
+void
+nvidiaSetMMIO (KdCardInfo *card, NvidiaCardInfo *nvidiac);
+
+void
+nvidiaResetMMIO (KdCardInfo *card, NvidiaCardInfo *nvidiac);
+
+Bool
+nvidiaEnable (ScreenPtr pScreen);
+
+void
+nvidiaDisable (ScreenPtr pScreen);
+
+void
+nvidiaWait (NvidiaCardInfo *card, NvidiaFifoFree *free, int n);
+
+void
+nvidiaWaitIdle (NvidiaCardInfo *card);
+
+Bool
+nvidiaDrawSetup (ScreenPtr pScreen);
+
+Bool
+nvidiaDrawInit (ScreenPtr pScreen);
+
+void
+nvidiaDrawReinit (ScreenPtr pScreen);
+
+void
+nvidiaDrawEnable (ScreenPtr pScreen);
+
+void
+nvidiaDrawDisable (ScreenPtr pScreen);
+
+void
+nvidiaDrawFini (ScreenPtr pScreen);
+
+CARD8
+nvidiaReadIndex (NvidiaCardInfo *nvidiac, CARD16 port, CARD8 index);
+
+void
+nvidiaWriteIndex (NvidiaCardInfo *nvidiac, CARD16 port, CARD8 index, CARD8 value);
+
+Bool
+nvidiaCursorInit (ScreenPtr pScreen);
+
+void
+nvidiaCursorEnable (ScreenPtr pScreen);
+
+void
+nvidiaCursorDisable (ScreenPtr pScreen);
+
+void
+nvidiaCursorFini (ScreenPtr pScreen);
+
+void
+nvidiaRecolorCursor (ScreenPtr pScreen, int ndef, xColorItem *pdef);
+
+extern KdCardFuncs nvidiaFuncs;
+
+#endif /* _NVIDIA_H_ */
diff --git a/xorg-server/hw/kdrive/nvidia/nvidiadraw.c b/xorg-server/hw/kdrive/nvidia/nvidiadraw.c
new file mode 100644
index 000000000..a39f79888
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/nvidiadraw.c
@@ -0,0 +1,238 @@
+/*
+ * Copyright © 2003 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_CONFIG_H
+#include <kdrive-config.h>
+#endif
+#include "nvidia.h"
+#include "nvidiadraw.h"
+
+#include <X11/Xmd.h>
+#include "gcstruct.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "regionstr.h"
+#include "mistruct.h"
+#include "dixfontstr.h"
+#include "fb.h"
+#include "migc.h"
+#include "miline.h"
+#include "picturestr.h"
+#include "kaa.h"
+
+CARD8 nvidiaRop[16] = {
+ /* GXclear */ 0x01, /* 0 */
+ /* GXand */ 0x0c, /* src AND dst */
+ /* GXandReverse */ 0x0d, /* src AND NOT dst */
+ /* GXcopy */ 0x07, /* src */
+ /* GXandInverted*/ 0x0e, /* NOT src AND dst */
+ /* GXnoop */ 0x03, /* dst */
+ /* GXxor */ 0x05, /* src XOR dst */
+ /* GXor */ 0x0b, /* src OR dst */
+ /* GXnor */ 0x0f, /* NOT src AND NOT dst */
+ /* GXequiv */ 0x06, /* NOT src XOR dst */
+ /* GXinvert */ 0x00, /* NOT dst */
+ /* GXorReverse */ 0x0a, /* src OR NOT dst */
+ /* GXcopyInverted*/ 0x04, /* NOT src */
+ /* GXorInverted */ 0x09, /* NOT src OR dst */
+ /* GXnand */ 0x08, /* NOT src OR NOT dst */
+ /* GXset */ 0x02, /* 1 */
+};
+
+static NvidiaCardInfo *card;
+
+void
+nvidiaWait (NvidiaCardInfo *card, NvidiaFifoFree *free, int n)
+{
+ while (card->fifo_free < n)
+ {
+ card->fifo_free = free->FifoFree >> 2;
+ }
+ card->fifo_free -= n;
+}
+
+void
+nvidiaWaitIdle (NvidiaCardInfo *card)
+{
+ while (card->fifo_free < card->fifo_size || (card->busy->busy & 1))
+ {
+ card->fifo_free = card->rop->FifoFree.FifoFree >> 2;
+ }
+}
+
+static void
+nvidiaWaitMarker (ScreenPtr pScreen, int marker)
+{
+ KdScreenPriv(pScreen);
+ nvidiaCardInfo(pScreenPriv);
+
+ nvidiaWaitIdle (nvidiac);
+}
+
+static Bool
+nvidiaPrepareSolid (PixmapPtr pPixmap,
+ int alu,
+ Pixel pm,
+ Pixel fg)
+{
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ KdScreenPriv(pScreen);
+ nvidiaCardInfo(pScreenPriv);
+
+ card = nvidiac;
+ if (~pm & FbFullMask(pPixmap->drawable.depth))
+ return FALSE;
+ nvidiaWait (nvidiac, &nvidiac->rop->FifoFree, 1);
+ nvidiac->rop->Rop3 = nvidiaRop[alu];
+ nvidiaWait (nvidiac, &nvidiac->rect->FifoFree, 1);
+ nvidiac->rect->Color1A = fg;
+ return TRUE;
+}
+
+static void
+nvidiaSolid (int x1, int y1, int x2, int y2)
+{
+ nvidiaWait (card, &card->rect->FifoFree, 2);
+ card->rect->TopLeft = NVIDIA_XY(x1,y1);
+ card->rect->WidthHeight = NVIDIA_XY(x2-x1,y2-y1);
+}
+
+static void
+nvidiaDoneSolid (void)
+{
+}
+
+
+static Bool
+nvidiaPrepareCopy (PixmapPtr pSrcPixmap,
+ PixmapPtr pDstPixmap,
+ int dx,
+ int dy,
+ int alu,
+ Pixel pm)
+{
+ ScreenPtr pScreen = pDstPixmap->drawable.pScreen;
+ KdScreenPriv(pScreen);
+ nvidiaCardInfo(pScreenPriv);
+
+ card = nvidiac;
+ if (~pm & FbFullMask(pDstPixmap->drawable.depth))
+ return FALSE;
+ nvidiaWait (nvidiac, &card->rop->FifoFree, 1);
+ nvidiac->rop->Rop3 = nvidiaRop[alu];
+ return TRUE;
+}
+
+static void
+nvidiaCopy (int srcX,
+ int srcY,
+ int dstX,
+ int dstY,
+ int w,
+ int h)
+{
+ nvidiaWait (card, &card->blt->FifoFree, 3);
+ card->blt->TopLeftSrc = NVIDIA_XY(srcX, srcY);
+ card->blt->TopLeftDst = NVIDIA_XY(dstX, dstY);
+ card->blt->WidthHeight = NVIDIA_XY(w, h);
+}
+
+static void
+nvidiaDoneCopy (void)
+{
+}
+
+Bool
+nvidiaDrawInit (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ nvidiaCardInfo(pScreenPriv);
+ nvidiaScreenInfo(pScreenPriv);
+ Bool ret = TRUE;
+
+ ENTER ();
+ if (pScreenPriv->screen->fb[0].depth == 4)
+ ret = FALSE;
+
+ memset(&nvidias->kaa, 0, sizeof(KaaScreenInfoRec));
+ nvidias->kaa.waitMarker = nvidiaWaitMarker;
+ nvidias->kaa.PrepareSolid = nvidiaPrepareSolid;
+ nvidias->kaa.Solid = nvidiaSolid;
+ nvidias->kaa.DoneSolid = nvidiaDoneSolid;
+ nvidias->kaa.PrepareCopy = nvidiaPrepareCopy;
+ nvidias->kaa.Copy = nvidiaCopy;
+ nvidias->kaa.DoneCopy = nvidiaDoneCopy;
+
+ if (ret && !nvidiac->rop)
+ {
+ ErrorF ("Failed to map fifo registers\n");
+ ret = FALSE;
+ }
+ if (ret && !nvidiac->rop->FifoFree.FifoFree)
+ {
+ ErrorF ("Fifo appears broken\n");
+ ret = FALSE;
+ }
+ if (ret && !kaaDrawInit (pScreen, &nvidias->kaa))
+ {
+ ErrorF ("kaaDrawInit failed\n");
+ ret = FALSE;
+ }
+
+ LEAVE ();
+ return ret;
+}
+
+#define PIX_FORMAT_MONO 0
+#define PIX_FORMAT_PSEUDO_8 2
+#define PIX_FORMAT_TRUE_1555 3
+#define PIX_FORMAT_TRUE_565 4
+#define PIX_FORMAT_TRUE_8888 6
+#define PIX_FORMAT_TRUE_332 7
+#define PIX_FORMAT_GRAY_8 8
+#define PIX_FORMAT_YUV_422 0xb
+#define PIX_FORMAT_YUV_444 0xe
+#define PIX_FORMAT_TRUE_4444 0xf
+
+void
+nvidiaDrawEnable (ScreenPtr pScreen)
+{
+ KdScreenPriv(pScreen);
+ nvidiaCardInfo(pScreenPriv);
+
+ ENTER ();
+ nvidiac->fifo_size = nvidiac->rop->FifoFree.FifoFree;
+ nvidiac->fifo_free = 0;
+ kaaMarkSync (pScreen);
+ LEAVE ();
+}
+
+void
+nvidiaDrawDisable (ScreenPtr pScreen)
+{
+}
+
+void
+nvidiaDrawFini (ScreenPtr pScreen)
+{
+}
+
diff --git a/xorg-server/hw/kdrive/nvidia/nvidiadraw.h b/xorg-server/hw/kdrive/nvidia/nvidiadraw.h
new file mode 100644
index 000000000..bac11c2a6
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/nvidiadraw.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright © 1999 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.
+ */
+
+#ifndef _TRIDENTDRAW_H_
+#define _TRIDENTDRAW_H_
+
+#define SetupTrident(s) KdScreenPriv(s); \
+ tridentCardInfo(pScreenPriv); \
+ Cop *cop = tridentc->cop
+
+#define TridentAlpha (COP_MULTI_ALPHA|COP_ALPHA_WRITE_ENABLE)
+
+#define _tridentInit(cop,tridentc) { \
+ if ((cop)->status == 0xffffffff) tridentSetMMIO(tridentc); \
+ (cop)->multi = (tridentc)->cop_depth; \
+ (cop)->multi = (tridentc)->cop_stride; \
+ (cop)->multi = TridentAlpha; \
+} \
+
+#define _tridentSetSolidRect(cop,pix,alu,cmd) {\
+ cop->multi = COP_MULTI_PATTERN; \
+ cop->multi = COP_MULTI_ROP | tridentRop[alu]; \
+ cop->fg = (pix); \
+ cmd = COP_OP_BLT | COP_SCL_OPAQUE | COP_OP_ROP | COP_OP_FG; \
+}
+
+#define _tridentRect(cop,x1,y1,x2,y2,cmd) { \
+ (cop)->dst_start_xy = TRI_XY (x1,y1); \
+ (cop)->dst_end_xy = TRI_XY(x2,y2); \
+ _tridentWaitDone(cop); \
+ (cop)->command = (cmd); \
+}
+
+#define COP_STATUS_BUSY (COP_STATUS_BE_BUSY | \
+ COP_STATUS_DPE_BUSY | \
+ COP_STATUS_MI_BUSY)
+
+#define _tridentWaitDone(cop) { \
+ int __q__ = 500000; \
+ while (__q__-- && (cop)->status & COP_STATUS_BUSY) \
+ ; \
+ if (!__q__) \
+ (cop)->status = 0; \
+}
+
+#define _tridentWaitIdleEmpty(cop) _tridentWaitDone(cop)
+
+#define sourceInvarient(alu) (((alu) & 3) == (((alu) >> 2) & 3))
+
+#endif
diff --git a/xorg-server/hw/kdrive/nvidia/nvidiastub.c b/xorg-server/hw/kdrive/nvidia/nvidiastub.c
new file mode 100644
index 000000000..0e8250e31
--- /dev/null
+++ b/xorg-server/hw/kdrive/nvidia/nvidiastub.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright © 2003 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_CONFIG_H
+#include <kdrive-config.h>
+#endif
+#include "nvidia.h"
+
+void
+InitCard (char *name)
+{
+ KdCardAttr attr;
+
+ if (LinuxFindPci (0x10de, 0x0112, 0, &attr))
+ KdCardInfoAdd (&nvidiaFuncs, &attr, 0);
+}
+
+void
+InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv)
+{
+ KdInitOutput (pScreenInfo, argc, argv);
+}
+
+void
+InitInput (int argc, char **argv)
+{
+ KdOsAddInputDrivers ();
+ KdInitInput ();
+}
+
+void
+ddxUseMsg (void)
+{
+ KdUseMsg();
+ vesaUseMsg();
+}
+
+int
+ddxProcessArgument (int argc, char **argv, int i)
+{
+ int ret;
+
+ if (!(ret = vesaProcessArgument (argc, argv, i)))
+ ret = KdProcessArgument(argc, argv, i);
+ return ret;
+}