diff options
Diffstat (limited to 'hw/xfree86/doc')
-rw-r--r-- | hw/xfree86/doc/Makefile.am | 4 | ||||
-rw-r--r-- | hw/xfree86/doc/Makefile.in | 774 | ||||
-rw-r--r-- | hw/xfree86/doc/README.modes | 474 | ||||
-rw-r--r-- | hw/xfree86/doc/devel/Makefile.am | 7 | ||||
-rw-r--r-- | hw/xfree86/doc/devel/Makefile.in | 576 | ||||
-rw-r--r-- | hw/xfree86/doc/devel/README.DRIcomp | 556 | ||||
-rw-r--r-- | hw/xfree86/doc/devel/Registry | 409 | ||||
-rw-r--r-- | hw/xfree86/doc/devel/exa-driver.txt | 94 | ||||
-rw-r--r-- | hw/xfree86/doc/man/Makefile.am | 3 | ||||
-rw-r--r-- | hw/xfree86/doc/man/Makefile.in | 699 | ||||
-rw-r--r-- | hw/xfree86/doc/man/Xorg.man | 689 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.d.man | 1 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man | 2485 | ||||
-rw-r--r-- | hw/xfree86/doc/sgml/DESIGN.xml | 9394 | ||||
-rw-r--r-- | hw/xfree86/doc/sgml/Makefile.am | 27 | ||||
-rw-r--r-- | hw/xfree86/doc/sgml/Makefile.in | 656 |
16 files changed, 16848 insertions, 0 deletions
diff --git a/hw/xfree86/doc/Makefile.am b/hw/xfree86/doc/Makefile.am new file mode 100644 index 0000000..8021736 --- /dev/null +++ b/hw/xfree86/doc/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS = devel man sgml + +EXTRA_DIST = \ + README.modes diff --git a/hw/xfree86/doc/Makefile.in b/hw/xfree86/doc/Makefile.in new file mode 100644 index 0000000..a39ef07 --- /dev/null +++ b/hw/xfree86/doc/Makefile.in @@ -0,0 +1,774 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@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@ +subdir = hw/xfree86/doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/ax_tls.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/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ +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@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +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@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +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@ +DOXYGEN = @DOXYGEN@ +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_CFLAGS = @DRI_CFLAGS@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +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_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +LD = @LD@ +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@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +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@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SYSCONFDIR = @SYSCONFDIR@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +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@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_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@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_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@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +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@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +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_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +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@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = devel man sgml +EXTRA_DIST = \ + README.modes + +all: all-recursive + +.SUFFIXES: +$(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 ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/doc/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 +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + 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)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__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 "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am 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 installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# 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/hw/xfree86/doc/README.modes b/hw/xfree86/doc/README.modes new file mode 100644 index 0000000..894e213 --- /dev/null +++ b/hw/xfree86/doc/README.modes @@ -0,0 +1,474 @@ + Multi-monitor Mode Setting APIs + Keith Packard, <keithp@keithp.com + 6 March 2007 + +1. Introduction + +This document describes a set of mode setting APIs added in X server version +1.3 that support multiple monitors per card. These interfaces expose the +underlying hardware CRTC and output concepts to the xf86 DDX layer so that +the implementation of initial server setup and mode changes through +extensions can be shared across drivers. In addition, these new interfaces +support a new configuration mechanism as well which allows each monitor to +be customized separately providing a consistent cross-driver configuration +mechanism that supports the full range of output features. + +All of the code implementing this interface can be found in hw/xfree86/modes +in the X server sources. + +2. Overview + +This document describes both the driver API and the configuration data +placed in xorg.conf; these are entirely separate as the driver has no +interaction with the configuration information at all. Much of the structure +here is cloned from the RandR extension version 1.2 additions which deal +with the same kinds of information. + +2.1 API overview + +The mode setting API is expressed through two new driver-visible objects, +the 'CRTC' (xf86CrtcRec) and the 'Output' (xf86OutputRec). A CRTC refers to +hardware within the video system that can scan a subset of the framebuffer +and generate a video signal. An Output receives that signal and transmits it +to a monitor, projector or other device. + +The xf86CrtcRec and xf86OutputRec contain a small amount of state data +related to the object along with a pointer to a set of functions provided by +the driver that manipulate the object in fairly simple ways. + +To emulate older behaviour, one of the outputs is picked as the 'compat' +output; this output changes over time as outputs are detected and used, the +goal is to always have one 'special' output which is used for operations +which need a single defined monitor (like XFree86-VidModeExtension mode +setting, RandR 1.1 mode setting, DDC property setting, etc.). + +2.1.1 Output overview + +As outputs are connected to monitors, they hold a list of modes supported by +the monitor. If the monitor and output support DDC, then the list of modes +generally comes from the EDID data in the monitor. Otherwise, the server +uses the standard VESA modes, pruned by monitor timing. If the configuration +file doesn't contain monitor timing data, the server uses default timing +information which supports 640x480, 800x600 and 1024x768 all with a 60Hz +refresh rate. + +As hardware often limits possible configuration combinations, each output +knows the set of CRTCs that it can be connected to as well as the set of +other outputs which can be simutaneously connected to a CRTC. + +2.1.2 CRTC overview + +CRTCs serve only to stream frame buffer data to outputs using a mode line. +Ideally, they would not be presented to the user at all, and in fact the +configuration file doesn't expose them. The RandR 1.2 protocol does, but the +hope there is that client-side applications will hide them carefully away. + +Each crtc has an associated cursor, along with the current configuration. +All of the data needed to determine valid configurations is contained within +the Outputs. + +2.2 Configuration overview + +As outputs drive monitors, the "Monitor" section has been repurposed to +define their configuration. This provides for a bit more syntax than +the large list of driver-specific options that were used in the past for +similar configuration. + +However, the existing "Monitor" section referenced by the active "Screen" +section no longer has any use at all; some sensible meaning for this +parameter is needed now that a Screen can have multiple Monitors. + +3. Public Functions + +3.1 PreInit functions + +These functions should be used during the driver PreInit phase, they are +arranged in the order they should be invoked. + + void + xf86CrtcConfigInit (ScrnInfoPtr scrn + const xf86CrtcConfigFuncsRec *funcs) + +This function allocates and initializes structures needed to track CRTC and +Output state. + + void + xf86CrtcSetSizeRange (ScrnInfoPtr scrn, + int minWidth, int minHeight, + int maxWidth, int maxHeight) + +This sets the range of screen sizes supported by the driver. + + xf86CrtcPtr + xf86CrtcCreate (ScrnInfoPtr scrn, + const xf86CrtcFuncsRec *funcs) + +Create one CRTC object. See the discussion below for a description of the +contents of the xf86CrtcFuncsRec. Note that this is done in PreInit, so it +should not be re-invoked at each server generation. Create one of these for +each CRTC present in the hardware. + + xf86OutputPtr + xf86OutputCreate (ScrnInfoPtr scrn, + const xf86OutputFuncsRec *funcs, + const char *name) + +Create one Output object. See the discussion below for a description of the +contents of the xf86OutputFuncsRec. This is also called from PreInit and +need not be re-invoked at each ScreenInit time. An Output should be created +for every Output present in the hardware, not just for outputs which have +detected monitors. + + Bool + xf86OutputRename (xf86OutputPtr output, const char *name) + +If necessary, the name of an output can be changed after it is created using +this function. + + Bool + xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) + +Using the resources provided, and the configuration specified by the user, +this function computes an initial configuration for the server. It tries to +enable as much hardware as possible using some fairly simple heuristics. + +The 'canGrow' parameter indicates that the frame buffer does not have a fixed +size (fixed size frame buffers are required by XAA). When the frame buffer +has a fixed size, the configuration selects a 'reasonablely large' frame +buffer so that common reconfiguration options are possible. For resizable +frame buffers, the frame buffer is set to the smallest size that encloses +the desired configuration. + +3.2 ScreenInit functions + +These functions should be used during the driver ScreenInit phase. + + Bool + xf86DiDGAInit (ScreenPtr screen, unsigned long dga_address) + +This function provides driver-independent accelerated DGA support for some +of the DGA operations; using this, the driver can avoid needing to implement +any of the rest of DGA. + + Bool + xf86SaveScreen(ScreenPtr pScreen, int mode) + +Stick this in pScreen->SaveScreen and the core X screen saver will be +implemented by disabling outputs and crtcs using their dpms functions. + + void + xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) + +Pass this function to xf86DPMSInit and all DPMS mode switching will be +managed by using the dpms functions provided by the Outputs and CRTCs. + + Bool + xf86CrtcScreenInit (ScreenPtr screen) + +This function completes the screen initialization process for the crtc and +output objects. Call it near the end of the ScreenInit function, after the +frame buffer and acceleration layers have been added. + +3.3 EnterVT functions + +Functions used during EnterVT, or whenever the current configuration needs +to be applied to the hardware. + + Bool + xf86SetDesiredModes (ScrnInfoPtr scrn) + +xf86InitialConfiguration selects the desired configuration at PreInit time; +when the server finally hits ScreenInit, xf86SetDesiredModes is used by the +driver to take that configuration and apply it to the hardware. In addition, +successful mode selection at other times updates the configuration that will +be used by this function, so LeaveVT/EnterVT pairs can simply invoke this +and return to the previous configuration. + +3.4 SwitchMode functions + +Functions called from the pScrn->SwitchMode hook, which is used by the +XFree86-VidModeExtension and the keypad mode switch commands. + + Bool + xf86SetSingleMode (ScrnInfoPtr scrn, + DisplayModePtr desired, + Rotation rotation) + +This function applies the specified mode to all active outputs. Which is to +say, it picks reasonable modes for all active outputs, attempting to get the +screen to the specified size while not breaking anything that is currently +working. + +3.7 get_modes functions + +Functions called during output->get_modes to help build lists of modes + + xf86MonPtr + xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) + +This returns the EDID data structure for the 'output' using the I2C bus +'pDDCBus'. This has no effect on 'output' itself. + + void + xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) + +Once the EDID data has been fetched, this call applies the EDID data to the +output object, setting the physical size and also various properties, like +the DDC root window property (when output is the 'compat' output), and the +RandR 1.2 EDID output properties. + + DisplayModePtr + xf86OutputGetEDIDModes (xf86OutputPtr output) + +Given an EDID data structure, this function computes a list of suitable +modes. This function also applies a sequence of 'quirks' during this process +so that the returned modes may not actually match the mode data present in +the EDID data. + +3.6 Other functions + +These remaining functions in the API can be used by the driver as needed. + + Bool + xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, + int x, int y) + +Applies a mode to a CRTC. All of the outputs which are currently using the +specified CRTC are included in the mode setting process. 'x' and 'y' are the +offset within the frame buffer that the crtc is placed at. No checking is +done in this function to ensure that the mode is usable by the active +outputs. + + void + xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY) + +This discards the mode lists for all outputs, re-detects monitor presence +and then acquires new mode lists for all monitors which are not disconnected. +Monitor configuration data is used to modify the mode lists returned by the +outputs. 'maxX' and 'maxY' limit the maximum size modes that will be +returned. + + void + xf86SetScrnInfoModes (ScrnInfoPtr pScrn) + +This copies the 'compat' output mode list into the pScrn modes list which is +used by the XFree86-VidModeExtension and the keypad mode switching +operations. The current 'desired' mode for the CRTC associated with the +'compat' output is placed first in this list to indicate the current mode. +Usually, the driver won't need to call this function as +xf86InitialConfiguration will do so automatically, as well as any RandR +functions which reprobe for modes. However, if the driver reprobes for modes +at other times using xf86ProbeOutputModes, this function needs to be called. + + Bool + xf86DiDGAReInit (ScreenPtr pScreen) + +This is similar to xf86SetScrnInfoModes, but it applies the 'compat' output +mode list to the set of modes advertised by the DGA extension; it needs to +be called whenever xf86ProbeOutputModes is invoked. + + void + xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) + +After any sequence of calls using xf86CrtcSetMode, this function cleans up +any leftover Output and CRTC objects by disabling them, saving power. It is +safe to call this whenever the server is running as it only disables objects +which are not currently in use. + +4. CRTC operations + +4.1 CRTC functions + +These functions provide an abstract interface for the CRTC object; most +manipulation of the CRTC object is done through these functions. + + void + crtc->funcs->dpms (xf86CrtcPtr crtc, int mode) + +Where 'mode' is one of DPMSModeOff, DPMSModeSuspend, DPMSModeStandby or +DPMSModeOn. This requests that the crtc go to the specified power state. +When changing power states, the output dpms functions are invoked before the +crtc dpms functions. + + void + crtc->funcs->save (xf86CrtcPtr crtc) + + void + crtc->funcs->restore (xf86CrtcPtr crtc) + +Preserve/restore any register contents related to the CRTC. These are +strictly a convenience for the driver writer; if the existing driver has +fully operation save/restore functions, you need not place any additional +code here. In particular, the server itself never uses this function. + + Bool + crtc->funcs->lock (xf86CrtcPtr crtc) + + void + crtc->funcs->unlock (xf86CrtcPtr crtc) + +These functions are invoked around mode setting operations; the intent is +that DRI locking be done here to prevent DRI applications from manipulating +the hardware while the server is busy changing the output configuration. If +the lock function returns FALSE, the unlock function will not be invoked. + + Bool + crtc->funcs->mode_fixup (xf86CrtcPtr crtc, + DisplayModePtr mode, + DisplayModePtr adjusted_mode) + +This call gives the CRTC a chance to see what mode will be set and to +comment on the mode by changing 'adjusted_mode' as needed. This function +shall not modify the state of the crtc hardware at all. If the CRTC cannot +accept this mode, this function may return FALSE. + + void + crtc->funcs->prepare (xf86CrtcPtr crtc) + +This call is made just before the mode is set to make the hardware ready for +the operation. A usual function to perform here is to disable the crtc so +that mode setting can occur with clocks turned off and outputs deactivated. + + void + crtc->funcs->mode_set (xf86CrtcPtr crtc, + DisplayModePtr mode, + DisplayModePtr adjusted_mode) + +This function applies the specified mode (possibly adjusted by the CRTC +and/or Outputs). + + void + crtc->funcs->commit (xf86CrtcPtr crtc) + +Once the mode has been applied to the CRTC and Outputs, this function is +invoked to let the hardware turn things back on. + + void + crtc->funcs->gamma_set (xf86CrtcPtr crtc, CARD16 *red, + CARD16 *green, CARD16 *blue, int size) + +This function adjusts the gamma ramps for the specified crtc. + + void * + crtc->funcs->shadow_allocate (xf86CrtcPtr crtc, int width, int height) + +This function allocates frame buffer space for a shadow frame buffer. When +allocated, the crtc must scan from the shadow instead of the main frame +buffer. This is used for rotation. The address returned is passed to the +shadow_create function. This function should return NULL on failure. + + PixmapPtr + crtc->funcs->shadow_create (xf86CrtcPtr crtc, void *data, + int width, int height) + +This function creates a pixmap object that will be used as a shadow of the +main frame buffer for CRTCs which are rotated or reflected. 'data' is the +value returned by shadow_allocate. + + void + crtc->funcs->shadow_destroy (xf86CrtcPtr crtc, PixmapPtr pPixmap, + void *data) + +Destroys any associated shadow objects. If pPixmap is NULL, then a pixmap +was not created, but 'data' may still be non-NULL indicating that the shadow +had been allocated. + + void + crtc->funcs->destroy (xf86CrtcPtr crtc) + +When a CRTC is destroyed (which only happens in error cases), this function +can clean up any driver-specific data. + +4.2 CRTC fields + +The CRTC object is not opaque; there are several fields of interest to the +driver writer. + + struct _xf86Crtc { + /** + * Associated ScrnInfo + */ + ScrnInfoPtr scrn; + + /** + * Active state of this CRTC + * + * Set when this CRTC is driving one or more outputs + */ + Bool enabled; + + /** Track whether cursor is within CRTC range */ + Bool cursorInRange; + + /** Track state of cursor associated with this CRTC */ + Bool cursorShown; + + /** + * Active mode + * + * This reflects the mode as set in the CRTC currently + * It will be cleared when the VT is not active or + * during server startup + */ + DisplayModeRec mode; + Rotation rotation; + PixmapPtr rotatedPixmap; + void *rotatedData; + + /** + * Position on screen + * + * Locates this CRTC within the frame buffer + */ + int x, y; + + /** + * Desired mode + * + * This is set to the requested mode, independent of + * whether the VT is active. In particular, it receives + * the startup configured mode and saves the active mode + * on VT switch. + */ + DisplayModeRec desiredMode; + Rotation desiredRotation; + int desiredX, desiredY; + + /** crtc-specific functions */ + const xf86CrtcFuncsRec *funcs; + + /** + * Driver private + * + * Holds driver-private information + */ + void *driver_private; + #ifdef RANDR_12_INTERFACE + /** + * RandR crtc + * + * When RandR 1.2 is available, this + * points at the associated crtc object + */ + RRCrtcPtr randr_crtc; + #else + void *randr_crtc; + #endif + }; + + +5. Output functions. + +6. Configuration + +Because the configuration file syntax is fixed, +this was done by creating new "Driver" section options that hook specific +outputs to specific "Monitor" sections in the file. The option: +section of the form: + + Option "monitor-VGA" "My VGA Monitor" + +connects the VGA output of this driver to the "Monitor" section with +Identifier "My VGA Monitor". All of the usual monitor options can now be +placed in that "Monitor" section and will be applied to the VGA output +configuration. diff --git a/hw/xfree86/doc/devel/Makefile.am b/hw/xfree86/doc/devel/Makefile.am new file mode 100644 index 0000000..c9eca5e --- /dev/null +++ b/hw/xfree86/doc/devel/Makefile.am @@ -0,0 +1,7 @@ +# Documentation for developers that is distributed with the source but +# not installed on the system for end-users + +EXTRA_DIST = \ + Registry \ + exa-driver.txt \ + README.DRIcomp diff --git a/hw/xfree86/doc/devel/Makefile.in b/hw/xfree86/doc/devel/Makefile.in new file mode 100644 index 0000000..c1c4db7 --- /dev/null +++ b/hw/xfree86/doc/devel/Makefile.in @@ -0,0 +1,576 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +# Documentation for developers that is distributed with the source but +# not installed on the system for end-users +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@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@ +subdir = hw/xfree86/doc/devel +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/ax_tls.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/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ +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@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +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@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +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@ +DOXYGEN = @DOXYGEN@ +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_CFLAGS = @DRI_CFLAGS@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +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_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +LD = @LD@ +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@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +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@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SYSCONFDIR = @SYSCONFDIR@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +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@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_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@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_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@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +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@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +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_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +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@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + Registry \ + exa-driver.txt \ + README.DRIcomp + +all: all-am + +.SUFFIXES: +$(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 ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/doc/devel/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/doc/devel/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 +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +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 "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 +installdirs: +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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + 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-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# 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/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp new file mode 100644 index 0000000..89f40a7 --- /dev/null +++ b/hw/xfree86/doc/devel/README.DRIcomp @@ -0,0 +1,556 @@ + DRI Compilation Guide + + VA Linux Systems, Inc. Professional Services - Graphics. + + 21 April 2001 + +1. Preamble + +1.1 Copyright + +Copyright 2000-2001 by VA Linux Systems, Inc. All Rights Reserved. + +Permission is granted to make and distribute verbatim copies of this document +provided the copyright notice and this permission notice are preserved on all +copies. + +1.2 Trademarks + +OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics, +Inc. Unix is a registered trademark of The Open Group. The `X' device and X +Window System are trademarks of The Open Group. XFree86 is a trademark of +The XFree86 Project. Linux is a registered trademark of Linus Torvalds. +Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and +Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd. +3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter- +active, Incorporated. Matrox is a registered trademark of Matrox Electronic +Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo- +gies, Inc. All other trademarks mentioned are the property of their respec- +tive owners. + +2. Introduction + +This document describes how to download, compile and install the DRI. The +DRI provides 3D graphics hardware acceleration for the XFree86 project. This +information is intended for experienced Linux developers. Beginners are +probably better off installing precompiled packages. + +Edits, corrections and updates to this document may be mailed to <brian@tung- +stengraphics.com>. + +Last updated on 13 February 2002 by Brian Paul. + +3. Prerequisites + +You'll need the following: + + o An installation of XFree86 4.1 or later. The DRI tree has been pruned + down to minimize its size. But in order to build the DRI tree you need + to have recent X header files, etc. already installed. If you don't + have XFree86 4.1 (or later) installed you can probably install it from + RPMs (or another package format). Or, you can download XFree86 as + sources and compile/install it yourself. + + o At least 200MB of free disk space. If you compile for debugging (the -g + option) then you'll need about 600MB. + + o GCC compiler and related tools. + + o ssh (secure shell) if you're a DRI developer and don't want to use + anonymous CVS download. + + o A 2.4.x Linux Kernel. See below for details. + + o FreeBSD support is not currently being maintained and may not work. + +The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How- +ever, limited support for Alpha and PowerPC support is underway. + +For 3dfx Voodoo hardware, you'll also need the Glide3 runtime library +(libglide3-v3.so for Voodoo3 or libglide3-v5.so for Voodoo4/5). These can be +downloaded from the DRI website. You can compile them yourself, but it's +often a painful process. + +For Matrox G200/G400, Intel i810/i830 or ATI Rage128/Radeon hardware, you'll +also need AGP support in your Linux kernel, either built-in or as a loadable +module. + +4. Linux Kernel Preparation + +Only the Linux 2.4.x kernels are currently supported by the DRI hardware +drivers. 2.5.x kernels may work, but aren't tested. + +Most of the DRI drivers require AGP support and using Intel Pentium III SSE +optimizations also requires an up-to-date Linux kernel. Configuring your +kernel correctly is very important, as features such as SSE optimizations +will be disabled if your kernel does not support them. Thus, if you have a +Pentium III processor, you must configure your kernel for the Pentium III +processor family. + +Building a new Linux kernel can be difficult for beginners but there are +resources on the Internet to help. This document assumes experience with +configuring, building and installing Linux kernels. + +Linux kernels can be downloaded from www.kernel.org + +Here are the basic steps for kernel setup. + + o Download the needed kernel and put it in /usr/src. Create a directory + for the source and unpack it. For example: + + cd /usr/src + rm -f linux + mkdir linux-2.4.x + ln -s linux-2.4.x linux + bzcat linux-2.4.x.tar.bz2 | tar xf - + + It is critical that /usr/src/linux point to your new kernel sources, + otherwise the kernel headers will not be used when building the DRI. + This will almost certainly cause compilation problems. + + o Read /usr/src/linux/Documentation/Changes. This file lists the minimum + requirements for all software packages required to build the kernel. + You must upgrade at least gcc, make, binutils and modutils to at least + the versions specified in this file. The other packages may not be + needed. If you are upgrading from Linux 2.2.x you must upgrade your + modutils package for Linux 2.4.x. + + o Configure your kernel. You might, for example, use make menuconfig and + do the following: + + o Go to Code maturity level options + + o Enable Prompt for development and/or incomplete code/drivers + + o hit ESC to return to the top-level menu + + o Go to Processor type and features + + o Select your processor type from Processor Family + + o hit ESC to return to the top-level menu + + o Go to Character devices + + o Disable Direct Rendering Manager (XFree86 DRI support) since we'll + use the DRI code from the XFree86/DRI tree and will compile it + there. + + o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW) + + o Hit SPACE twice to build AGP support into the kernel + + o Enable all chipsets' support for AGP + + o It's recommended that you turn on MTRRs under Processor type and + Features, but not required. + + o Configure the rest of the kernel as required for your system (i.e. Eth- + ernet, SCSI, etc) + + o Exit, saving your kernel configuration. + + o Edit your /etc/lilo.conf file. Make sure you have an image entry as + follows (or similar): + + image=/boot/vmlinuz + label=linux.2.4.x + read-only + root=/dev/hda1 + + The important part is that you have /boot/vmlinuz without a trailing + version number. If this is the first entry in your /etc/lilo.conf AND + you haven't set a default, then this will be your default kernel. + + o Compile the new kernel. + + cd /usr/src/linux-2.4.x + make dep + make bzImage + make modules + make modules_install + make install + + Note that last make command will automatically run lilo for you. + + o Now reboot to use the new kernel. + +5. CPU Architectures + +In general, nothing special has to be done to use the DRI on different CPU +architectures. There are, however, a few optimizations that are CPU-depen- +dent. Mesa will determine at runtime which CPU-dependent optimizations +should be used and enable them where appropriate. + +5.1 Intel Pentium III Features + +The Pentium III SSE instructions are used in optimized vertex transformation +functions in the Mesa-based DRI drivers. On Linux, SSE requires a recent +kernel (such as 2.4.0-test11 or later) both at compile time and runtime. + +5.2 AMD 3DNow! Features + +AMD's 3DNow! instructions are used in optimized vertex transformation func- +tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of +Linux. + +5.3 Alpha Features + +On newer Alpha processors a significant performance increase can be seen with +the addition of the -mcpu= option to GCC. This option is dependent on the +architecture of the processor. For example, -mcpu=ev6 will build specifi- +cally for the EV6 based AXP's, giving both byte and word alignment access to +the DRI/Mesa drivers. + +To enable this optimization edit your xc/config/host.def file and add the +line: + +#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 + +Additional speed improvements to 3D rendering can be achieved by installing +Compaq's Math Libraries (CPML) which can be obtained from http://www.sup- +port.compaq.com/alpha-tools/software/index.html + +Once installed, you can add this line to your host.def to build with the CPML +libraries: + +#define UseCompaqMathLibrary YES + +The host.def file is explained below. + +6. Downloading the XFree86/DRI CVS Sources + +The DRI project is hosted by SourceForge. The DRI source code, which is a +subset of the XFree86 source tree, is kept in a CVS repository there. + +The DRI CVS sources may be accessed either anonymously or as a registered +SourceForge user. It's recommended that you become a registered SourceForge +user so that you may submit non-anonymous bug reports and can participate in +the mailing lists. + +6.1 Anonymous CVS download: + + 1. Create a directory to store the CVS files: + + cd ~ + mkdir DRI-CVS + + You could put your CVS directory in a different place but we'll use + ~/DRI-CVS/ here. + + 2. Check out the CVS sources: + + cd ~/DRI-CVS + cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login + (hit ENTER when prompted for a password) + cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc + + The -z3 flag causes compression to be used in order to reduce the down- + load time. + +6.2 Registered CVS download: + + 1. Create a directory to store the CVS files: + + cd ~ + mkdir DRI-CVS + + You could put your CVS directory in a different place but we'll use + ~/DRI-CVS/ here. + + 2. Set the CVS_RSH environment variable: + + setenv CVS_RSH ssh // if using csh or tcsh + export CVS_RSH=ssh // if using sh or bash + + 3. Check out the CVS sources: + + cd ~/DRI-CVS + cvs -z3 -d:ext:YOURID@cvs.dri.sourceforge.net:/cvsroot/dri co xc + + Replace YOURID with your CVS login name. You'll be prompted to enter + your sourceforge password. + + The -z3 flag causes compression to be used in order to reduce the down- + load time. + +6.3 Updating your CVS sources + +In the future you'll want to occasionally update your local copy of the DRI +source code to get the latest changes. This can be done with: + + cd ~/DRI-CVS + cvs -z3 update -dA xc + +The -d flag causes any new subdirectories to be created and -A causes most +recent trunk sources to be fetched, not branch sources. + +7. Mesa + +Most of the DRI 3D drivers are based on Mesa (the free implementation of the +OpenGL API). The relevant files from Mesa are already included in the +XFree86/DRI source tree. There is no need to download or install the Mesa +source files separately. + +Sometimes a newer version of Mesa will be available than the version included +in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor- +ward. It can be an error-prone undertaking, especially for beginners, and is +not generally recommended. The DRI developers will upgrade Mesa when appro- +priate. + +8. Compiling the XFree86/DRI tree + +8.1 Make a build tree + +Rather than placing object files and library files right in the source tree, +they're instead put into a parallel build tree. The build tree is made with +the lndir command: + + cd ~/DRI-CVS + ln -s xc XFree40 + mkdir build + cd build + lndir -silent -ignorelinks ../XFree40 + +The build tree will be populated with symbolic links which point back into +the CVS source tree. + +Advanced users may have several build trees for compiling and testing with +different options. + +8.2 Edit the host.def file + +The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the +XFree86 build process. You can change it to customize your build options or +make adjustments for your particular system configuration + +The default host.def file will look something like this: + + #define DefaultCCOptions -Wall + (i386) #define DefaultGcc2i386Opt -O2 + (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) + #define LibraryCDebugFlags -O2 + #define BuildServersOnly YES + #define XF86CardDrivers vga tdfx mga ati i810 + #define LinuxDistribution LinuxRedHat + #define DefaultCCOptions -ansi GccWarningOptions -pipe + #define BuildXF86DRI YES + /* Optionally turn these on for debugging */ + /* #define GlxBuiltInTdfx YES */ + /* #define GlxBuiltInMga YES */ + /* #define GlxBuiltInR128 YES */ + /* #define GlxBuiltInRadeon YES */ + /* #define DoLoadableServer NO */ + #define SharedLibFont NO + +The ProjectRoot variable specifies where the XFree86 files will be installed. +We recommend installing the DRI files over your existing XFree86 installation +- it's generally safe to do and less error-prone. This policy is different +than what we used to recommend. + +If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the follow- +ing to the host.def file: + + #define ProjectRoot pathToYourXFree86installation + +Note the XF86CardDrivers line to be sure your card's driver is listed. + +If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you +should add the following: + + #define MesaUse3DNow YES + +You don't have to be using an AMD processor in order to enable this option. +The DRI will look for 3DNow! support and runtime and only enable it if appli- +cable. + +If you want to enable SSE optimizations in Mesa and the DRI drivers, you must +upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by +both your processor and your operating system, but to build Mesa inside the +DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If +you enable SSE optimizations with an earlier version of the Linux kernel in +/usr/src/linux, Mesa will not compile. You have been warned. If you do have +a 2.4.x kernel, you should add the following: + + #define MesaUseSSE YES + +If you want to build the DRM kernel modules as part of the full build pro- +cess, add the following: + + #define BuildXF86DRM YES + +Otherwise, you'll need to build them separately as described below. + +8.3 Compilation + +To compile the complete DRI tree: + + cd ~/DRI-CVS/build/xc/ + make World >& world.log + +Or if you want to watch the compilation progress: + + cd ~/DRI-CVS/build/xc/ + make World >& world.log & + tail -f world.log + +With the default compilation flags it's normal to get a lot of warnings dur- +ing compilation. + +Building will take some time so you may want to go check your email or visit +slashdot. + +WARNING: do not use the -j option with make. It's reported that it does not +work with XFree86/DRI. + +8.4 Check for compilation errors + +Using your text editor, examine world.log for errors by searching for the +pattern ***. + +After fixing the errors, run make World again. Later, you might just compile +parts of the source tree but it's important that the whole tree will build +first. + +If you edited your host.def file to enable automatic building of the DRI ker- +nel module(s), verify that they were built: + + cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel + ls + +Otherwise, build them now by running + + cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel + make -f Makefile.linux + +For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you +should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI +Radeon, you should see radeon.o. For the Intel i810, you should see i810.o. + +If the DRI kernel module(s) failed to build you should verify that you're +using the right version of the Linux kernel. The most recent kernels are not +always supported. + +If your build machine is running a different version of the kernel than your +target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel +source tree. This can be fixed by explicitly setting the value of LINUXDIR. +If the path to your kernel source is /usr/src/linux-2.4.x, + + cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel + make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x + +or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN- +UXDIR line. + +8.5 DRI kernel module installation + +The DRI kernel modules will be in ~/DRI-CVS/build/xc/pro- +grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/. + +To load the appropriate DRM module in your running kernel you can either use +ismod and restart your X server or copy the kernel module to /lib/mod- +ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X +server. + +Make sure you first unload any older DRI kernel modules that might be already +loaded. + +Note that some DRM modules require that the agpgart module be loaded first. + +9. Normal Installation and Configuration + +Most users will want to install the new X server and use it in place of their +old X server. This section explains how to do that. + +Developers, on the other hand, may just want to test the X server without +actually installing it as their default server. If you want to do that, skip +to the next section. + +9.1 Installation + +Here are the installation commands: + + su + cd ~/DRI-CVS/build/xc + make install + +9.2 Update the XF86Config File + +You may need to edit your XF86Config file to enable the DRI. The config file +is usually installed as /etc/X11/XF86Config-4. See the DRI User Guide for +details, but basically, you need to load the "glx" and "dri" modules and add +a "DRI" section. + +On the DRI web site, in the resources section, you'll find example XF86Config +files for a number of graphics cards. These configuration files also setup +DRI options so it's highly recommended that you look at these examples. + +The XFree86 4.x server can generate a basic configuration file itself. Sim- +ply do this: + + cd /usr/X11R6/bin + ./XFree86 -configure + +A file named /root/XF86Config.new will be created. It should allow you to +try your X server but you'll almost certainly have to edit it. For example, +you should add HorizSync and VertRefresh options to the Monitor section and +Modes options to the Screen section. Also, the ModulePath option in the +Files section should be set to /usr/X11R6/lib/modules. + +9.3 Start the New X Server + +The new X server should be ready to use now. Start your X server in your +usual manner. Often times the startx command is used: + + startx + +10. Testing the Server Without Installing It + +As mentioned at the start of section 9, developers may want to simply run the +X server without installing it. This can save some time and allow you to +keep a number of X servers available for testing. + +10.1 Configuration + +As described in the preceding section, you'll need to create a configuration +file for the new server. Put the XF86Config file in your ~/DRI- +CVS/build/xc/programs/Xserver directory. + +Be sure the ModulePath option in your XF86Config file is set correctly. + +10.2 A Startup Script + +A simple shell script can be used to start the X server. Here's an example. + + #!/bin/sh + export DISPLAY=:0 + ./XFree86 -xf86config XF86Config & \ + sleep 2 + fvwm2 & + xset b off + xmodmap -e "clear mod4" + xsetroot -solid "#00306f" + xterm -geometry 80x40+0+0 + +You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro- +grams/Xserver directory. + +To test the server run the script: + + cd ~/DRI-CVS/build/xc/programs/Xserver + ./start-dri + +For debugging, you may also want to capture the log messages printed by the +server in a file. If you're using the C-shell: + + ./start-dri >& log + +11. Where To Go From Here + +At this point your X server should be up and running with hardware-acceler- +ated direct rendering. Please read the DRI User Guide for information about +trouble shooting and how to use the DRI-enabled X server for 3D applications. + + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $ + + diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/devel/Registry new file mode 100644 index 0000000..48e24a2 --- /dev/null +++ b/hw/xfree86/doc/devel/Registry @@ -0,0 +1,409 @@ +This is the XFree86 driver/module registry. To avoid name space clashes and +to maintain some consistency between drivers the important name spaces are +maintained here. + +1. Module Names. + +Each module is required to have a unique name. Registered names are: + +GLcore +acecad +afb +apm +ark +ati +atimisc +bitmap +bt8xx +calcomp +cfb +cfb16 +cfb24 +cfb32 +chips +cirrus +citron +cyrix +dbe +ddc +digitaledge +dmc +dri +drm +dynapro +elo2300 +elographics +extmod +fb +fbdev +fbdevhw +fi12x6 +freetype +glide +glint +glx +hyperpen +i128 +i2c +i740 +i810 +imstt +int10 +joystick +keyboard +layer +magellan +magictouch +mfb +mga +microtouch +mouse +msp34xx +mutouch +neomagic +newport +nv +pcidata +penmount +pex5 +r128 +radeon +rac +ramdac +record +rendition +s3 +s3virge +savage +shadow +shadowfb +siliconmotion +sis +spaceorb +speedo +summa +sunbw2 +suncg14 +suncg3 +suncg6 +sunffb +sunleo +suntcx +tdfx +tga +trident +tseng +type1 +v4l +vbe +vesa +vga +vgahw +vmware +void +wacom +xaa +xf1bpp +xf24_32bpp +xf4bpp +xf8_16bpp +xf8_32bpp +xf8_32wid +xie +xtrap +xtt + +2. External Module Object Symbols. + +Each module is required to use a unique prefix or prefixes for all of +its externally visible symbols. They should be unique without regard to +case. Registered prefixes are: + +ati +bt8xx +cfb +chips +fi12x6 +glide +glint +mfb +mga +msp34xx +neo +permedia +tseng +vga +vgahw +vmware +xaa +xf1bpp +xf4bpp + +3. Chipset Names. + +Each video driver is required to use a unique set of chipset names. Case, +white space and underscore characters are ignored when comparing chipset +names. All names listed here are in lower case with all white space and +underscores removed. Registered chipset names are: + +ati +ativga +ct64200 +ct64300 +ct65520 +ct65525 +ct65530 +ct65535 +ct65540 +ct65545 +ct65546 +ct65548 +ct65550 +ct65554 +ct65555 +ct68554 +ct69000 +et4000 +et4000w32 +et4000w32i +et4000w32p +et6000 +et6100 +generic +ibmvga +ibm8514 +mach32 +mach64 +mach8 +mga2064w +mga1064sg +mga2164w +mga2164wagp +neo2070 +neo2090 +neo2093 +neo2097 +neo2160 +neo2200 +tipm2 +vgawonder +voodoo + +4. Option Names. + +Option names and their usage should be consistent between drivers. +Case, white space and underscore characters are ignored when comparing +option names. The prefix "no" may be added or removed from boolean +option names. All names listed here are in their preferred user-visible +form. Some registered option names are: + +Types are: B = boolean, O = set/unset (no value), I = integer, S = string, + A = optional string, F = floating point number Q = frequency + +Scopes are: F = global flags, V = video driver, C = common (per screen), + I = input drivers, X = XAA, Xv = Xv extension, M = misc. + +Names currently in use: + +Name Type Scope Description +---------------------------------------------------------------------------- +AllowMouseOpenFail B F ignore mouse dev open failure +AllowNonLocalModInDev B F allow non-local mod of input devs +AllowNonLocalXvidtune B F allow non-local VidMode connections +BlankTime I F Screen saver timeout (min) +DisableModInDev B F disallow changing input devs +DisableVidModeExtension B F disable VidMode extension +DontVTSwitch B F disable Ctrl-Alt-Fn +DontZap B F disable Ctrl-Alt-BS sequence +DontZoom B F disable Ctrl-Alt-+/- +NoTrapSignals B F don't trap signals +OffTime I F Time before DPMS off mode active (min) +PciProbe1 O F use PCI probe algorithm 1 +PciProbe2 O F use PCI probe algorithm 2 +PciForceConfig1 O F force PCI config type 1 +PciForceConfig2 O F force PCI config type 2 +Pixmap I F depth 24 pixmap size (24 or 32) +StandbyTime I F Time before DPMS standby active (min) +SuspendTime I F Time before DPMS suspend mode active (min) + +BackingStore B C Enable backing store +DDC B C Enable/disable DDC +DDC1 B C Enable/disable DDC1 +DDC2 B C Enable/disable DDC2 +DPMS O C Enable DPMS +MTRR B C Enable/disable setting MTRRs + +BaudRate I I Serial port baud rate +ButtonNumber I I Button number (for touch screen?) +ButtonThreshold I I ?? +ClearDTR O I Clear serial port DTR +ClearRTS O I Clear serial port RTS +DataBits I I Serial port data bits +DemandLoad O I ?? +Device S I Device file name +DeviceName S I Input device name +FlowControl S I Serial flow control ("xon", "none") +Floating B I Device initialised as floating +HistorySize I I ?? +MaxX I I Maximum X coordinate +MaxY I I Maximum Y coordinate +MinX I I Minimum X coordinate +MinY I I Minimum Y coordinate +Parity S I Serial port parity ("odd", "even", "none") +ReportDelay I I ?? +ReportingMode S I may be "raw" or "scaled" +ScreenNumber I I Screen number (for touch screen) +SendCoreEvents B I Send core events +StopBits I I Serial port stop bits +SwapXY B I Swap the X and Y axes +UntouchDelay I I ?? +Vmin I I Tty VMIN +Vtime I I Tty VTIME + + +18BitBus B V ?? +8Plus16 B V Enable depth 8 + depth 16 with overlay +8Plus24 B V Enable depth 8 + depth 24 with overlay +BlockWrite B V Enable/disable block write +ColorKey I V Set the color key for overlay modes +CompositeSync B V Composite sync +CRTDisplay B V Force display on CRT, not LCD +CRTScreen B V Display on CRT, not LCD (Obsolete) +EarlyRasPrecharge O V Early RAS pre-charge +FastDRAM O V Fast DRAM +FifoAggressive O V Aggressive FIFO setting +FifoConservative O V Conservative FIFO setting +FifoModerate O V Moderate FIFO setting +FireGL3000 B V Card is Diamond FireGL3000 +FixPanelSize B V ?? +FPClock8 Q V Flat panel clock for 8bpp fb (MHz) +FPClock16 Q V Flat panel clock for 16bpp fb (MHz) +FPClock24 Q V Flat panel clock for 24bpp fb (MHz) +FPClock32 Q V Flat panel clock for 32bpp fb (MHz) +FPMVRAM O V Fast page mode VRAM +FramebufferWC B V Enable/disable WC for the framebuffer +GlideDevice I V Selects which Voodoo board to use +HiBitHigh O V High clock bit default to set +HiBitLow O V High clock bit default to cleared +HWClocks B V Enable/disable HW clocks +HWCursor B V Enable/disable HW cursor +LateRasPrecharge O V Late RAS pre-charge +Legend O V Card is Legend ET4000 +LCDCenter B V Enable/disable centering for LCD displays +Linear B V Enable/disable linear framebuffer +MCLK Q V Specify the current MCLK value (MHz) +MedDRAM B V Medium speed DRAM +MemCfg1 I V ?? +MemCfg2 I V ?? +MGASDRAM B V Mga card has SDRAM +MMIO B V Enable/disable memory mapped I/O +MMIOCache B V Enable/Disable MMIO cache +MuxThreshold I V Multiplexing threshold (kHz) +NoAccel B V Disable/enable acceleration +NoClockChip B V ?? +NoStretch B V Disable/enable stretching for LCD displays +OnAtExit B V Leave video signal on when exiting server +OverclockMem B V Enable memory overclocking +Overlay A V Enable multi-depth/overlay. An optional + string "M,N" may be specified, where + M, N are the depths. +PanelDisplay B V Force display on LCD +PciBurst B V Enable/disable PCI burst mode +PciRetry B V Enable/disable PCI retries +ProbeClocks B V Force probe for non-programmable clocks +ReferenceClock Q V Clock generator reference frequency +RGBbits I V Number of significant bits per rgb +Rotate S V Rotate the virtual display (CW or CCW) +SetLCDClk Q V Set LCD clock (MHz) +SetMclk Q V Set Memory Clock (MHz) +ShadowFB B V Enable shadow framebuffer layer +ShowCache B V Enable viewing of offscreen memory +ShowOverscan O V Set the overscan area to a visible colour +SlowDRAM O V Slow DRAM +SlowEDODRAM O V Slow EDO DRAM +STN B V STN screen type (??) +SWCursor B V Enable/disable SW cursor +SuspendHack B V ?? +SyncOnGreen B V Enable/disable sync on green +TurboQueue B V Enable/disable turbo queue +UseFBDev B V Use the fbdev driver interface +UseModeLine B V Use Modeline (??) +W32Interleave B V ?? + +Buffers I Xv Number of buffers +Device S Xv Device file name +Expose B Xv Disable occlusion clipping (see DESIGN) +FramesPerSec I Xv Max. refresh frequency + +XAA options. All are of type "O" and scope "X", and are self-explanatory + +XaaNoColor8x8PatternFillRect +XaaNoColor8x8PatternFillTrap +XaaNoCPUToScreenColorExpandFill +XaaNoDashedBresenhamLine +XaaNoDashedTwoPointLine +XaaNoScreenToScreenCopy +XaaNoImageReadRect +XaaNoImageWriteRect +XaaNoMono8x8PatternFillRect +XaaNoMono8x8PatternFillTrap +XaaNoOffscreenPixmaps +XaaNoPixmapCache +XaaNoScanlineCPUToScreenColorExpandFill +XaaNoScanlineImageWriteRect +XaaNoScreenToScreenColorExpandFill +XaaNoSolidBresenhamLine +XaaNoSolidFillRect +XaaNoSolidFillTrap +XaaNoSolidHorVertLine +XaaNoSolidTwoPointLine + + +Names used in previous versions: + +16Clocks +8Clocks +ClkDiv2 +EDO VRAM +ExternDisp +ExtFramBuf +FastVRAM +FavorBitBlt +InternDisp +NoBitBlt +NoFontCache +NoImageBlt +NoMemAccess +NoPciDisconnect +NoPixmapCache +NoProgramClocks +NoSplitXfer +OverrideBIOS +OverrideValidateMode +ProgLcdModeRegs +ProgLcdModeStretch +SlowDRAMrefresh +SlowVRAM +SwapHiBit + + +5. Ramdac Names. + +Ramdac names should be consistent between drivers. Case, white space +and underscore characters are ignored when comparing ramdac names. All +names listed here are in lower case with all white space and underscores +removed. + + +6. Clock Chip Names. + +Clock chip names should be consistent between drivers. Case, white +space and underscore characters are ignored when comparing clock chip +names. All names listed here are in lower case with all white space +and underscores removed. + + + + + +$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.18 2002/04/06 18:31:09 tsi Exp $ diff --git a/hw/xfree86/doc/devel/exa-driver.txt b/hw/xfree86/doc/devel/exa-driver.txt new file mode 100644 index 0000000..048307e --- /dev/null +++ b/hw/xfree86/doc/devel/exa-driver.txt @@ -0,0 +1,94 @@ +Adding EXA support to your X.Org video driver +--------------------------------------------- +EXA (for EXcellent Architecture or Ex-kaa aXeleration Architecture or +whatever) aims to extend the life of the venerable XFree86 video drivers by +introducing a new set of acceleration hooks that efficiently accelerate the X +Render extension, including solid fills, blits within screen memory and to and +from system memory, and Porter-Duff compositing and transform operations. + +Configuration +------------- +A new config file option, AccelMethod, should be added to your driver, to allow +the user to select between the EXA and XAA acceleration APIs. + +Some drivers implement a per-instance useEXA flag to track whether EXA is +active or not. It can be helpful to also conditionalize XAA support with an +ifdef so that it can easily be turned off/removed in the future. + +Setting the flag and checking for AccelMethod can be done in the driver's +Options parsing routine. + +Loading EXA +------------ +EXA drivers in the XFree86 DDX should use the loadable module loader to load +the EXA core. Careful versioning allows the EXA API to be extended without +breaking the ABI for older versions of drivers. Example code for loading EXA: + +static const char *exaSymbols[] = { + "exaDriverAlloc", + "exaDriverInit", + "exaDriverFini", + "exaOffscreenAlloc", + "exaOffscreenFree", + "exaGetPixmapOffset", + "exaGetPixmapPitch", + "exaGetPixmapSize", + "exaMarkSync", + "exaWaitSync", + NULL +}; + + if (info->useEXA) { + info->exaReq.majorversion = 2; + info->exaReq.minorversion = 0; + + if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, + &info->exaReq, &errmaj, &errmin)) { + LoaderErrorMsg(NULL, "exa", errmaj, errmin); + return FALSE; + } + xf86LoaderReqSymLists(exaSymbols, NULL); + } + +EXA is then initialized using exaDriverAlloc and exaDriverInit. See doxygen +documentation for getting started there. + +Further documentation +------------ +The EXA driver interface and public API is documented using doxygen in +xserver/xorg/exa/. To build the documentation, run: + doxygen -g + doxygen Doxyfile +The resulting documentation will appear an html/index.html under the current +directory. + +EXA initialization +------------------ +Your driver's AccelInit routine must initialize an ExaDriverRec structure if +EXA support is enabled, with appropriate error handling (i.e. NoAccel and +NoXvideo should be set to true if EXA fails to initialize for whatever +reason). + +The AccelInit routine also needs to make sure that there's enough offscreen +memory for certain operations to function, like Xvideo, which should advertise +a maximum size no larger than can be dealt with given the amount of offscreen +memory available. + +EXA and Xv +---------- +Video support becomes easier with EXA since AllocateFBMemory can use +exaOffscreenAlloc directly, freeing a previous area if necessary and +allocating a new one. Likewise, FreeFBMemory can call exaOffscreenFree. + +EXA teardown +------------ +At screen close time, EXA drivers should call exaDriverFini with their screen +pointer, free their EXADriver structure, and do any other necessary teardown. + +EXA misc. +--------- +In many drivers, DGA support will need to be changed to be aware of the new +EXA support. + +Send updates and corrections to Jesse Barnes <jbarnes@virtuousgeek.org> or +just check them in if you have permission. diff --git a/hw/xfree86/doc/man/Makefile.am b/hw/xfree86/doc/man/Makefile.am new file mode 100644 index 0000000..80e22cb --- /dev/null +++ b/hw/xfree86/doc/man/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/manpages.am +appman_PRE = Xorg.man +fileman_PRE = xorg.conf.man xorg.conf.d.man diff --git a/hw/xfree86/doc/man/Makefile.in b/hw/xfree86/doc/man/Makefile.in new file mode 100644 index 0000000..d785322 --- /dev/null +++ b/hw/xfree86/doc/man/Makefile.in @@ -0,0 +1,699 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@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@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/manpages.am +subdir = hw/xfree86/doc/man +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/ax_tls.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/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" \ + "$(DESTDIR)$(filemandir)" +DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ +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@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +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@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +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@ +DOXYGEN = @DOXYGEN@ +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_CFLAGS = @DRI_CFLAGS@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +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_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +LD = @LD@ +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@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ + +# Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS +# 's|/,|/, |g' will add a space to help font path formatting +MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__logdir__|$(logdir)|g' -e \ + 's|__datadir__|$(datadir)|g' -e 's|__mandir__|$(mandir)|g' -e \ + 's|__sysconfdir__|$(sysconfdir)|g' -e \ + 's|__xconfigdir__|$(__XCONFIGDIR__)|g' -e \ + 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' -e \ + 's|__laucnd_id_prefix__|$(LAUNCHD_ID_PREFIX)|g' -e \ + 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' -e \ + 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' -e \ + '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +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@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SYSCONFDIR = @SYSCONFDIR@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +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@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_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@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_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@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +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@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +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_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +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@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +appmandir = $(APP_MAN_DIR) +#appman_PRE = list of application man page files set by calling Makefile.am +appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) +drivermandir = $(DRIVER_MAN_DIR) +#driverman_PRE = list of driver man page files set by calling Makefile.am +driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX)) +filemandir = $(FILE_MAN_DIR) +#fileman_PRE = list of file man page files set by calling Makefile.am +fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX)) + +# The calling Makefile should only contain man page targets +# Otherwise the following three global variables may conflict +EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE) +CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA) +SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man +appman_PRE = Xorg.man +fileman_PRE = xorg.conf.man xorg.conf.d.man +all: all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/doc/man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/doc/man/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 +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(appmandir)" && rm -f $$files +install-drivermanDATA: $(driverman_DATA) + @$(NORMAL_INSTALL) + test -z "$(drivermandir)" || $(MKDIR_P) "$(DESTDIR)$(drivermandir)" + @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(drivermandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(drivermandir)" || exit $$?; \ + done + +uninstall-drivermanDATA: + @$(NORMAL_UNINSTALL) + @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(drivermandir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(drivermandir)" && rm -f $$files +install-filemanDATA: $(fileman_DATA) + @$(NORMAL_INSTALL) + test -z "$(filemandir)" || $(MKDIR_P) "$(DESTDIR)$(filemandir)" + @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filemandir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \ + done + +uninstall-filemanDATA: + @$(NORMAL_UNINSTALL) + @list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(filemandir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(filemandir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +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 "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(DATA) +installdirs: + for dir in "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; 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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-appmanDATA install-drivermanDATA \ + install-filemanDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \ + uninstall-filemanDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-appmanDATA install-data install-data-am \ + install-drivermanDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-filemanDATA 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-appmanDATA \ + uninstall-drivermanDATA uninstall-filemanDATA + + +.man.$(APP_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +.man.$(DRIVER_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ +.man.$(FILE_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ + +# 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/hw/xfree86/doc/man/Xorg.man b/hw/xfree86/doc/man/Xorg.man new file mode 100644 index 0000000..6fa334c --- /dev/null +++ b/hw/xfree86/doc/man/Xorg.man @@ -0,0 +1,689 @@ +.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH __xservername__ __appmansuffix__ __vendorversion__ +.SH NAME +__xservername__ - X11R7 X server +.SH SYNOPSIS +.B __xservername__ +.RI [\fB:\fP display ] +.RI [ option +.IR ... ] +.SH DESCRIPTION +.B __xservername__ +is a full featured X server that was originally designed for UNIX and +UNIX-like operating systems running on Intel x86 hardware. It now runs +on a wider range of hardware and OS platforms. +.PP +This work was derived by the X.Org Foundation from the XFree86 Project's +.I "XFree86\ 4.4rc2" +release. +The XFree86 release was originally derived from +.I "X386\ 1.2" +by Thomas Roell which was contributed to X11R5 by Snitily Graphics +Consulting Service. +.SH PLATFORMS +.PP +.B __xservername__ +operates under a wide range of operating systems and hardware platforms. +The Intel x86 (IA32) architecture is the most widely supported hardware +platform. Other hardware platforms include Compaq Alpha, Intel IA64, AMD64, +SPARC and PowerPC. The most widely supported operating systems are the +free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD, +OpenBSD, and Solaris. Commercial UNIX operating systems such as +UnixWare are also supported. Other supported operating systems include +GNU Hurd. Mac OS X is supported with the +Xquartz(__appmansuffix__) X server. Win32/Cygwin is supported with the +XWin(__appmansuffix__) X server. +.PP +.SH "NETWORK CONNECTIONS" +.B __xservername__ +supports connections made using the following reliable +byte-streams: +.TP 4 +.I "Local" +On most platforms, the "Local" connection type is a UNIX-domain socket. +On some System V platforms, the "local" connection types also include +STREAMS pipes, named pipes, and some other mechanisms. +.TP 4 +.I TCP\/IP +.B __xservername__ +listens on port +.RI 6000+ n , +where +.I n +is the display number. This connection type can be disabled with the +.B \-nolisten +option (see the Xserver(1) man page for details). +.SH "ENVIRONMENT VARIABLES" +For operating systems that support local connections other than Unix +Domain sockets (SVR3 and SVR4), there is a compiled-in list specifying +the order in which local connections should be attempted. This list +can be overridden by the +.I XLOCAL +environment variable described below. If the display name indicates a +best-choice connection should be made (e.g. +.BR :0.0 ), +each connection mechanism is tried until a connection succeeds or no +more mechanisms are available. Note: for these OSs, the Unix Domain +socket connection is treated differently from the other local connection +types. To use it the connection must be made to +.BR unix:0.0 . +.PP +The +.I XLOCAL +environment variable should contain a list of one more +more of the following: +.PP +.RS 8 +.nf +NAMED +PTS +SCO +ISC +.fi +.RE +.PP +which represent SVR4 Named Streams pipe, Old-style USL Streams pipe, +SCO XSight Streams pipe, and ISC Streams pipe, respectively. You can +select a single mechanism (e.g. +.IR XLOCAL=NAMED ), +or an ordered list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP). +his variable overrides the compiled-in defaults. For SVR4 it is +recommended that +.I NAMED +be the first preference connection. The default setting is +.IR PTS:NAMED:ISC:SCO . +.PP +To globally override the compiled-in defaults, you should define (and +export if using +.B sh +or +.BR ksh ) +.I XLOCAL +globally. If you use startx(1) or xinit(1), the definition should be +at the top of your +.I .xinitrc +file. If you use xdm(1), the definitions should be early on in the +.I __projectroot__/lib/X11/xdm/Xsession +script. +.SH OPTIONS +.B __xservername__ +supports several mechanisms for supplying/obtaining configuration and +run-time parameters: command line options, environment variables, the +__xconfigfile__(__filemansuffix__) configuration files, auto-detection, and +fallback defaults. When the same information is supplied in more than +one way, the highest precedence mechanism is used. The list of mechanisms +is ordered from highest precedence to lowest. Note that not all parameters +can be supplied via all methods. The available command line options +and environment variables (and some defaults) are described here and in +the Xserver(__appmansuffix__) manual page. Most configuration file +parameters, with their defaults, are described in the +__xconfigfile__(__filemansuffix__) manual page. Driver and module specific +configuration parameters are described in the relevant driver or module +manual page. +.PP +In addition to the normal server options described in the +Xserver(__appmansuffix__) manual page, +.B __xservername__ +accepts the following command line switches: +.TP 8 +.BI vt XX +.I XX +specifies the Virtual Terminal device number which +.B __xservername__ +will use. Without this option, +.B __xservername__ +will pick the first available Virtual Terminal that it can locate. This +option applies only to platforms that have virtual terminal support, such +as Linux, BSD, OpenSolaris, SVR3, and SVR4. +.TP +.B \-allowMouseOpenFail +Allow the server to start up even if the mouse device can't be opened +or initialised. This is equivalent to the +.B AllowMouseOpenFail +__xconfigfile__(__filemansuffix__) file option. +.TP 8 +.B \-allowNonLocalXvidtune +Make the VidMode extension available to remote clients. This allows +the xvidtune client to connect from another host. This is equivalent +to the +.B AllowNonLocalXvidtune +__xconfigfile__(__filemansuffix__) file option. By default non-local +connections are not allowed. +.TP 8 +.BI \-bgamma " value" +Set the blue gamma correction. +.I value +must be between 0.1 and 10. +The default is 1.0. Not all drivers support this. See also the +.BR \-gamma , +.BR \-rgamma , +and +.B \-ggamma +options. +.TP 8 +.BI \-bpp " n" +No longer supported. Use +.B \-depth +to set the color depth, and use +.B \-fbbpp +if you really need to force a non-default framebuffer (hardware) pixel +format. +.TP 8 +.BI \-config " file" +Read the server configuration from +.IR file . +This option will work for any file when the server is run as root (i.e, +with real-uid 0), or for files relative to a directory in the config +search path for all other users. +.TP 8 +.BI \-configdir " directory" +Read the server configuration files from +.IR directory . +This option will work for any directory when the server is run as root +(i.e, with real-uid 0), or for directories relative to a directory in the +config directory search path for all other users. +.TP 8 +.B \-configure +When this option is specified, the +.B __xservername__ +server loads all video driver modules, probes for available hardware, +and writes out an initial __xconfigfile__(__filemansuffix__) file based on +what was detected. This option currently has some problems on some +platforms, but in most cases it is a good way to bootstrap the +configuration process. This option is only available when the server +is run as root (i.e, with real-uid 0). +.TP 8 +.BI "\-crt /dev/tty" XX +SCO only. This is the same as the +.B vt +option, and is provided for compatibility with the native SCO X server. +.TP 8 +.BI \-depth " n" +Sets the default color depth. Legal values are 1, 4, 8, 15, 16, and +24. Not all drivers support all values. +.TP 8 +.B \-disableVidMode +Disable the parts of the VidMode extension (used by the xvidtune +client) that can be used to change the video modes. This is equivalent +to the +.B DisableVidModeExtension +__xconfigfile__(__filemansuffix__) file option. +.TP 8 +.B \-fbbpp \fIn\fP +Sets the number of framebuffer bits per pixel. You should only set this +if you're sure it's necessary; normally the server can deduce the correct +value from +.B \-depth +above. Useful if you want to run a depth 24 configuration with a 24 +bpp framebuffer rather than the (possibly default) 32 bpp framebuffer +(or vice versa). Legal values are 1, 8, 16, 24, 32. Not all drivers +support all values. +.TP 8 +.B \-flipPixels +Swap the default values for the black and white pixels. +.TP 8 +.BI \-gamma " value" +Set the gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. This value is applied +equally to the R, G and B values. Those values can be set independently +with the +.BR \-rgamma , +.BR \-bgamma , +and +.B \-ggamma +options. Not all drivers support this. +.TP 8 +.BI \-ggamma " value" +Set the green gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. Not all drivers support +this. See also the +.BR \-gamma , +.BR \-rgamma , +and +.B \-bgamma +options. +.TP 8 +.B \-ignoreABI +The +.B __xservername__ +server checks the ABI revision levels of each module that it loads. It +will normally refuse to load modules with ABI revisions that are newer +than the server's. This is because such modules might use interfaces +that the server does not have. When this option is specified, mismatches +like this are downgraded from fatal errors to warnings. This option +should be used with care. +.TP 8 +.B \-isolateDevice \fIbus\-id\fP +Restrict device resets to the device at +.IR bus\-id . +The +.I bus\-id +string has the form +.IB bustype : bus : device : function +(e.g., \(oqPCI:1:0:0\(cq). +At present, only isolation of PCI devices is supported; i.e., this option +is ignored if +.I bustype +is anything other than \(oqPCI\(cq. +.TP 8 +.B \-keeptty +Prevent the server from detaching its initial controlling terminal. +This option is only useful when debugging the server. Not all platforms +support (or can use) this option. +.TP 8 +.BI \-keyboard " keyboard-name" +Use the __xconfigfile__(__filemansuffix__) file +.B InputDevice +section called +.I keyboard-name +as the core keyboard. This option is ignored when the +.B Layout +section specifies a core keyboard. In the absence of both a Layout +section and this option, the first relevant +.B InputDevice +section is used for the core keyboard. +.TP 8 +.BI \-layout " layout-name" +Use the __xconfigfile__(__filemansuffix__) file +.B Layout +section called +.IR layout-name . +By default the first +.B Layout +section is used. +.TP 8 +.BI \-logfile " filename" +Use the file called +.I filename +as the +.B __xservername__ +server log file. The default log file is +.BI __logdir__/__xservername__. n .log +on most platforms, where +.I n +is the display number of the +.B __xservername__ +server. The default may be in a different directory on some platforms. +This option is only available when the server is run as root (i.e, with +real-uid 0). +.TP 8 +.BR \-logverbose " [\fIn\fP]" +Sets the verbosity level for information printed to the +.B __xservername__ +server log file. If the +.I n +value isn't supplied, each occurrence of this option increments the log +file verbosity level. When the +.I n +value is supplied, the log file verbosity level is set to that value. +The default log file verbosity level is 3. +.TP 8 +.BI \-modulepath " searchpath" +Set the module search path to +.IR searchpath . +.I searchpath +is a comma separated list of directories to search for +.B __xservername__ +server modules. This option is only available when the server is run +as root (i.e, with real-uid 0). +.TP 8 +.B \-nosilk +Disable Silken Mouse support. +.TP 8 +.B \-pixmap24 +Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel. +The default is usually 32 bits per pixel. There is normally little +reason to use this option. Some client applications don't like this +pixmap format, even though it is a perfectly legal format. This is +equivalent to the +.B Pixmap +__xconfigfile__(__filemansuffix__) file option. +.TP 8 +.B \-pixmap32 +Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel. +This is usually the default. This is equivalent to the +.B Pixmap +__xconfigfile__(__filemansuffix__) file option. +.TP 8 +.BI \-pointer " pointer-name" +Use the __xconfigfile__(__filemansuffix__) file +.B InputDevice +section called +.I pointer-name +as the core pointer. This option is ignored when the +.B Layout +section specifies a core pointer. In the absence of both a Layout +section and this option, the first relevant +.B InputDevice +section is used for the core pointer. +.TP 8 +.B \-quiet +Suppress most informational messages at startup. The verbosity level +is set to zero. +.TP 8 +.BI \-rgamma " value" +Set the red gamma correction. +.I value +must be between 0.1 and 10. The default is 1.0. Not all drivers support +this. See also the +.BR \-gamma , +.BR \-bgamma , +and +.B \-ggamma +options. +.TP 8 +.BI \-screen " screen-name" +Use the __xconfigfile__(__filemansuffix__) file +.B Screen +section called +.IR screen-name . +By default the screens referenced by the default +.B Layout +section are used, or the first +.B Screen +section when there are no +.B Layout +sections. +.TP 8 +.B \-showconfig +This is the same as the +.B \-version +option, and is included for compatibility reasons. It may be removed +in a future release, so the +.B \-version +option should be used instead. +.TP 8 +.B \-showDefaultModulePath +Print out the default module path the server was compiled with. +.TP 8 +.B \-showDefaultLibPath +Print out the path libraries should be installed to. +.TP 8 +.B \-showopts +For each driver module installed, print out the list of options and their +argument types. +.TP 8 +.BI \-weight " nnn" +Set RGB weighting at 16 bpp. The default is 565. This applies only to +those drivers which support 16 bpp. +.TP 8 +.BR \-verbose " [\fIn\fP]" +Sets the verbosity level for information printed on stderr. If the +.I n +value isn't supplied, each occurrence of this option increments the +verbosity level. When the +.I n +value is supplied, the verbosity level is set to that value. The default +verbosity level is 0. +.TP 8 +.B \-version +Print out the server version, patchlevel, release date, the operating +system/platform it was built on, and whether it includes module loader +support. +.SH "KEYBOARD" +.PP +The +.B __xservername__ +server is normally configured to recognize various special combinations +of key presses that instruct the server to perform some action, rather +than just sending the key press event to a client application. These actions +depend on the XKB keymap loaded by a particular keyboard device and may or +may not be available on a given configuration. +.PP +The following key combinations are commonly part of the default XKEYBOARD +keymap. +.TP 8 +.B Ctrl+Alt+Backspace +Immediately kills the server -- no questions asked. It can be disabled by +setting the +.B DontZap +__xconfigfile__(__filemansuffix__) file option to a TRUE value. +.PP +.RS 8 +It should be noted that zapping is triggered by the +.B Terminate_Server +action in the keyboard map. This action is not part of the default keymaps +but can be enabled with the XKB option +.B \*qterminate:ctrl_alt_bksp\*q. +.RE +.TP 8 +.B Ctrl+Alt+Keypad-Plus +Change video mode to next one specified in the configuration file. +This can be disabled with the +.B DontZoom +__xconfigfile__(__filemansuffix__) file option. +.TP 8 +.B Ctrl+Alt+Keypad-Minus +Change video mode to previous one specified in the configuration file. +This can be disabled with the +.B DontZoom +__xconfigfile__(__filemansuffix__) file option. +.TP 8 +.B Ctrl+Alt+F1...F12 +For systems with virtual terminal support, these keystroke +combinations are used to switch to virtual terminals 1 through 12, +respectively. This can be disabled with the +.B DontVTSwitch +__xconfigfile__(__filemansuffix__) file option. +.SH CONFIGURATION +.B __xservername__ +typically uses a configuration file called +.B __xconfigfile__ +and configuration files with the suffix +.I .conf +in a directory called +.B __xconfigdir__ +for its initial setup. +Refer to the __xconfigfile__(__filemansuffix__) manual page for information +about the format of this file. +.PP +.B __xservername__ +has a mechanism for automatically generating a built-in configuration +at run-time when no +.B __xconfigfile__ +file or +.B __xconfigdir__ +files are present. The current version of this automatic configuration +mechanism works in two ways. +.PP +The first is via enhancements that have made many components of the +.B __xconfigfile__ +file optional. This means that information that can be probed or +reasonably deduced doesn't need to be specified explicitly, greatly +reducing the amount of built-in configuration information that needs to +be generated at run-time. +.PP +The second is to have "safe" fallbacks for most configuration information. +This maximises the likelihood that the +.B __xservername__ +server will start up in some usable configuration even when information +about the specific hardware is not available. +.PP +The automatic configuration support for __xservername__ is work in progress. +It is currently aimed at the most popular hardware and software platforms +supported by __xservername__. Enhancements are planned for future releases. +.SH FILES +The +.B __xservername__ +server config files can be found in a range of locations. These are +documented fully in the __xconfigfile__(__filemansuffix__) manual page. The +most commonly used locations are shown here. +.TP 30 +.B /etc/X11/__xconfigfile__ +Server configuration file. +.TP 30 +.B /etc/X11/__xconfigfile__-4 +Server configuration file. +.TP 30 +.B /etc/__xconfigfile__ +Server configuration file. +.TP 30 +.B __projectroot__/etc/__xconfigfile__ +Server configuration file. +.TP 30 +.B __projectroot__/lib/X11/__xconfigfile__ +Server configuration file. +.TP 30 +.B /etc/X11/__xconfigdir__ +Server configuration directory. +.TP 30 +.B /etc/X11/__xconfigdir__-4 +Server configuration directory. +.TP 30 +.B /etc/__xconfigdir__ +Server configuration directory. +.TP 30 +.B __projectroot__/etc/__xconfigdir__ +Server configuration directory. +.TP 30 +.B __projectroot__/lib/X11/__xconfigdir__ +Server configuration directory. +.TP 30 +.BI __logdir__/__xservername__. n .log +Server log file for display +.IR n . +.TP 30 +.B __projectroot__/bin/\(** +Client binaries. +.TP 30 +.B __projectroot__/include/\(** +Header files. +.TP 30 +.B __projectroot__/lib/\(** +Libraries. +.TP 30 +.B __datadir__/fonts/X11/\(** +Fonts. +.TP 30 +.B __projectroot__/share/X11/XErrorDB +Client error message database. +.TP 30 +.B __projectroot__/lib/X11/app-defaults/\(** +Client resource specifications. +.TP 30 +.B __mandir__/man?/\(** +Manual pages. +.TP 30 +.BI /etc/X n .hosts +Initial access control list for display +.IR n . +.SH "SEE ALSO" +X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__), +__xconfigfile__(__filemansuffix__), xvidtune(__appmansuffix__), +apm(__drivermansuffix__), +ati(__drivermansuffix__), +chips(__drivermansuffix__), +cirrus(__drivermansuffix__), +cyrix(__drivermansuffix__), +fbdev(__drivermansuffix__), +glide(__drivermansuffix__), +glint(__drivermansuffix__), +i128(__drivermansuffix__), +i740(__drivermansuffix__), +imstt(__drivermansuffix__), +intel(__drivermansuffix__), +mga(__drivermansuffix__), +neomagic(__drivermansuffix__), +nsc(__drivermansuffix__), +nv(__drivermansuffix__), +openchrome (__drivermansuffix__), +r128(__drivermansuffix__), +rendition(__drivermansuffix__), +s3virge(__drivermansuffix__), +siliconmotion(__drivermansuffix__), +sis(__drivermansuffix__), +sunbw2(__drivermansuffix__), +suncg14(__drivermansuffix__), +suncg3(__drivermansuffix__), +suncg6(__drivermansuffix__), +sunffb(__drivermansuffix__), +sunleo(__drivermansuffix__), +suntcx(__drivermansuffix__), +tdfx(__drivermansuffix__), +tga(__drivermansuffix__), +trident(__drivermansuffix__), +tseng(__drivermansuffix__), +v4l(__drivermansuffix__), +vesa(__drivermansuffix__), +vmware(__drivermansuffix__), +.br +Web site +.IR <http://www.x.org> . + +.SH AUTHORS +__xservername__ has many contributors world wide. The names of most of them +can be found in the documentation, ChangeLog files in the source tree, +and in the actual source code. +.PP +__xservername__ was originally based on XFree86 4.4rc2. +That was originally based on \fIX386 1.2\fP by Thomas Roell, which +was contributed to the then X Consortium's X11R5 distribution by SGCS. +.PP +__xservername__ is released by the X.Org Foundation. +.PP +The project that became XFree86 was originally founded in 1992 by +David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat. +.PP +XFree86 was later integrated in the then X Consortium's X11R6 release +by a group of dedicated XFree86 developers, including the following: +.PP +.RS 4 +.nf +Stuart Anderson \fIanderson@metrolink.com\fP +Doug Anson \fIdanson@lgc.com\fP +Gertjan Akkerman \fIakkerman@dutiba.twi.tudelft.nl\fP +Mike Bernson \fImike@mbsun.mlb.org\fP +Robin Cutshaw \fIrobin@XFree86.org\fP +David Dawes \fIdawes@XFree86.org\fP +Marc Evans \fImarc@XFree86.org\fP +Pascal Haible \fIhaible@izfm.uni-stuttgart.de\fP +Matthieu Herrb \fIMatthieu.Herrb@laas.fr\fP +Dirk Hohndel \fIhohndel@XFree86.org\fP +David Holland \fIdavidh@use.com\fP +Alan Hourihane \fIalanh@fairlite.demon.co.uk\fP +Jeffrey Hsu \fIhsu@soda.berkeley.edu\fP +Glenn Lai \fIglenn@cs.utexas.edu\fP +Ted Lemon \fImellon@ncd.com\fP +Rich Murphey \fIrich@XFree86.org\fP +Hans Nasten \fInasten@everyware.se\fP +Mark Snitily \fImark@sgcs.com\fP +Randy Terbush \fIrandyt@cse.unl.edu\fP +Jon Tombs \fItombs@XFree86.org\fP +Kees Verstoep \fIversto@cs.vu.nl\fP +Paul Vixie \fIpaul@vix.com\fP +Mark Weaver \fIMark_Weaver@brown.edu\fP +David Wexelblat \fIdwex@XFree86.org\fP +Philip Wheatley \fIPhilip.Wheatley@ColumbiaSC.NCR.COM\fP +Thomas Wolfram \fIwolf@prz.tu-berlin.de\fP +Orest Zborowski \fIorestz@eskimo.com\fP +.fi +.RE +.PP +__xservername__ source is available from the FTP server +\fI<ftp://ftp.x.org/>\fP, and from the X.Org +server \fI<http://gitweb.freedesktop.org/>\fP. Documentation and other +information can be found from the X.Org web site +\fI<http://www.x.org/>\fP. + +.SH LEGAL +.PP +.B __xservername__ +is copyright software, provided under licenses that permit modification +and redistribution in source and binary form without fee. +.B __xservername__ is copyright by numerous authors and +contributors from around the world. Licensing information can be found +at +.IR <http://www.x.org> . +Refer to the source code for specific copyright notices. +.PP +.B XFree86(TM) +is a trademark of The XFree86 Project, Inc. +.PP +.B X11(TM) +and +.B X Window System(TM) +are trademarks of The Open Group. diff --git a/hw/xfree86/doc/man/xorg.conf.d.man b/hw/xfree86/doc/man/xorg.conf.d.man new file mode 100644 index 0000000..6b3379e --- /dev/null +++ b/hw/xfree86/doc/man/xorg.conf.d.man @@ -0,0 +1 @@ +.so man__filemansuffix__/xorg.conf.__filemansuffix__ diff --git a/hw/xfree86/doc/man/xorg.conf.man b/hw/xfree86/doc/man/xorg.conf.man new file mode 100644 index 0000000..4bec316 --- /dev/null +++ b/hw/xfree86/doc/man/xorg.conf.man @@ -0,0 +1,2485 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH __xconfigfile__ __filemansuffix__ __vendorversion__ +.SH NAME +__xconfigfile__ and __xconfigdir__ \- configuration files for +__xservername__ X server +.SH INTRODUCTION +.B __xservername__ +supports several mechanisms for supplying/obtaining configuration and +run-time parameters: command line options, environment variables, the +__xconfigfile__ and __xconfigdir__ configuration files, auto-detection, +and fallback defaults. When the same information is supplied in more +than one way, the highest precedence mechanism is used. The list of +mechanisms is ordered from highest precedence to lowest. Note that not +all parameters can be supplied via all methods. The available command +line options and environment variables (and some defaults) are +described in the Xserver(__appmansuffix__) and +__xservername__(__appmansuffix__) manual pages. Most configuration file +parameters, with their defaults, are described below. Driver and module +specific configuration parameters are described in the relevant driver +or module manual page. +.SH DESCRIPTION +.B __xservername__ +uses a configuration file called +.I __xconfigfile__ +and files ending in the suffix +.I .conf +from the directory +.I __xconfigdir__ +for its initial setup. +The +.I __xconfigfile__ +configuration file is searched for in the following places when the +server is started as a normal user: +.PP +.RS 4 +.nf +.IR /etc/X11/ <cmdline> +.IR __projectroot__/etc/X11/ <cmdline> +.IB /etc/X11/ $XORGCONFIG +.IB __projectroot__/etc/X11/ $XORGCONFIG +.I /etc/X11/__xconfigfile__ +.I /etc/__xconfigfile__ +.IR __projectroot__/etc/X11/__xconfigfile__. <hostname> +.I __projectroot__/etc/X11/__xconfigfile__ +.IR __projectroot__/lib/X11/__xconfigfile__. <hostname> +.I __projectroot__/lib/X11/__xconfigfile__ +.fi +.RE +.PP +where +.I <cmdline> +is a relative path (with no \(lq..\(rq components) specified with the +.B \-config +command line option, +.B $XORGCONFIG +is the relative path (with no \(lq..\(rq components) specified by that +environment variable, and +.I <hostname> +is the machine's hostname as reported by +.BR gethostname (__libmansuffix__). +.PP +When the __xservername__ server is started by the \(lqroot\(rq user, the config file +search locations are as follows: +.PP +.RS 4 +.nf +<cmdline> +.IR /etc/X11/ <cmdline> +.IR __projectroot__/etc/X11/ <cmdline> +.B $XORGCONFIG +.IB /etc/X11/ $XORGCONFIG +.IB __projectroot__/etc/X11/ $XORGCONFIG +.I /etc/X11/__xconfigfile__ +.I /etc/__xconfigfile__ +.IR __projectroot__/etc/X11/__xconfigfile__. <hostname> +.I __projectroot__/etc/X11/__xconfigfile__ +.IR __projectroot__/lib/X11/__xconfigfile__. <hostname> +.I __projectroot__/lib/X11/__xconfigfile__ +.fi +.RE +.PP +where +.I <cmdline> +is the path specified with the +.B \-config +command line option (which may be absolute or relative), +.B $XORGCONFIG +is the path specified by that +environment variable (absolute or relative), +.B $HOME +is the path specified by that environment variable (usually the home +directory), and +.I <hostname> +is the machine's hostname as reported by +.BR gethostname (__libmansuffix__). +.PP +Additional configuration files are searched for in the following +directories when the server is started as a normal user: +.PP +.RS 4 +.nf +.IR /etc/X11/ <cmdline> +.IR __sysconfdir__/X11/ <cmdline> +.I /etc/X11/__xconfigdir__ +.I __sysconfdir__/X11/__xconfigdir__ +.fi +.RE +.PP +where +.I <cmdline> +is a relative path (with no \(lq..\(rq components) specified with the +.B \-configdir +command line option. +.PP +When the __xservername__ server is started by the \(lqroot\(rq user, the +config directory search locations are as follows: +.PP +.RS 4 +.nf +<cmdline> +.IR /etc/X11/ <cmdline> +.IR __sysconfdir__/X11/ <cmdline> +.I /etc/X11/__xconfigdir__ +.I __sysconfdir__/X11/__xconfigdir__ +.fi +.RE +.PP +where +.I <cmdline> +is the path specified with the +.B \-configdir +command line option (which may be absolute or relative). +.PP +Finally, configuration files will also be searched for in directories +reserved for system use. These are to separate configuration files from +the vendor or 3rd party packages from those of local administration. +These files are found in the following directories: +.PP +.RS 4 +.nf +.I /usr/share/X11/__xconfigdir__ +.I __datadir__/X11/__xconfigdir__ +.fi +.RE +.PP +The +.I __xconfigfile__ +and +.I __xconfigdir__ +files are composed of a number of sections which may be present in any order, +or omitted to use default configuration values. +Each section has the form: +.PP +.RS 4 +.nf +.BI "Section \*q" SectionName \*q +.RI " " SectionEntry + ... +.B EndSection +.fi +.RE +.PP +The section names are: +.PP +.RS 4 +.nf +.BR "Files " "File pathnames" +.BR "ServerFlags " "Server flags" +.BR "Module " "Dynamic module loading" +.BR "Extensions " "Extension enabling" +.BR "InputDevice " "Input device description" +.BR "InputClass " "Input class description" +.BR "Device " "Graphics device description" +.BR "VideoAdaptor " "Xv video adaptor description" +.BR "Monitor " "Monitor description" +.BR "Modes " "Video modes descriptions" +.BR "Screen " "Screen configuration" +.BR "ServerLayout " "Overall layout" +.BR "DRI " "DRI\-specific configuration" +.BR "Vendor " "Vendor\-specific configuration" +.fi +.RE +.PP +The following obsolete section names are still recognised for compatibility +purposes. +In new config files, the +.B InputDevice +section should be used instead. +.PP +.RS 4 +.nf +.BR "Keyboard " "Keyboard configuration" +.BR "Pointer " "Pointer/mouse configuration" +.fi +.RE +.PP +The old +.B XInput +section is no longer recognised. +.PP +The +.B ServerLayout +sections are at the highest level. +They bind together the input and output devices that will be used in a session. +The input devices are described in the +.B InputDevice +sections. +Output devices usually consist of multiple independent components (e.g., +a graphics board and a monitor). +These multiple components are bound together in the +.B Screen +sections, and it is these that are referenced by the +.B ServerLayout +section. +Each +.B Screen +section binds together a graphics board and a monitor. +The graphics boards are described in the +.B Device +sections, and the monitors are described in the +.B Monitor +sections. +.PP +Config file keywords are case\-insensitive, and \(lq_\(rq characters are +ignored. +Most strings (including +.B Option +names) are also case-insensitive, and insensitive to white space and +\(lq_\(rq characters. +.PP +Each config file entry usually takes up a single line in the file. They +consist of a keyword, which is possibly followed by one or more arguments, +with the number and types of the arguments depending on the keyword. +The argument types are: +.PP +.RS 4 +.nf +.BR "Integer " "an integer number in decimal, hex or octal" +.BR "Real " "a floating point number" +.BR "String " "a string enclosed in double quote marks (\*q)" +.fi +.RE +.PP +Note: hex integer values must be prefixed with \(lq0x\(rq, and octal values +with \(lq0\(rq. +.PP +A special keyword called +.B Option +may be used to provide free\-form data to various components of the server. +The +.B Option +keyword takes either one or two string arguments. +The first is the option name, and the optional second argument is the +option value. +Some commonly used option value types include: +.PP +.RS 4 +.nf +.BR "Integer " "an integer number in decimal, hex or octal" +.BR "Real " "a floating point number" +.BR "String " "a sequence of characters" +.BR "Boolean " "a boolean value (see below)" +.BR "Frequency " "a frequency value (see below)" +.fi +.RE +.PP +Note that +.I all +.B Option +values, not just strings, must be enclosed in quotes. +.PP +Boolean options may optionally have a value specified. +When no value is specified, the option's value is +.BR TRUE . +The following boolean option values are recognised as +.BR TRUE : +.PP +.RS 4 +.BR 1 , +.BR on , +.BR true , +.B yes +.RE +.PP +and the following boolean option values are recognised as +.BR FALSE : +.PP +.RS 4 +.BR 0 , +.BR off , +.BR false , +.B no +.RE +.PP +If an option name is prefixed with +.RB \*q No \*q, +then the option value is negated. +.PP +Example: the following option entries are equivalent: +.PP +.RS 4 +.nf +.B "Option \*qAccel\*q \*qOff\*q" +.B "Option \*qNoAccel\*q" +.B "Option \*qNoAccel\*q \*qOn\*q" +.B "Option \*qAccel\*q \*qfalse\*q" +.B "Option \*qAccel\*q \*qno\*q" +.fi +.RE +.PP +Frequency option values consist of a real number that is optionally +followed by one of the following frequency units: +.PP +.RS 4 +.BR Hz , +.BR k , +.BR kHz , +.BR M , +.B MHz +.RE +.PP +When the unit name is omitted, the correct units will be determined from +the value and the expectations of the appropriate range of the value. +It is recommended that the units always be specified when using frequency +option values to avoid any errors in determining the value. +.SH "FILES SECTION" +The +.B Files +section is used to specify some path names required by the server. +Some of these paths can also be set from the command line (see +.BR Xserver (__appmansuffix__) +and +.BR __xservername__ (__appmansuffix__)). +The command line settings override the values specified in the config +file. +The +.B Files +section is optional, as are all of the entries that may appear in it. +.PP +The entries that can appear in this section are: +.TP 7 +.BI "FontPath \*q" path \*q +sets the search path for fonts. +This path is a comma separated list of font path elements which the __xservername__ +server searches for font databases. +Multiple +.B FontPath +entries may be specified, and they will be concatenated to build up the +fontpath used by the server. Font path elements can be absolute +directory paths, catalogue directories or a font server identifier. The +formats of the later two are explained below: +.PP +.RS 7 +Catalogue directories: +.PP +.RS 4 +Catalogue directories can be specified using the prefix \fBcatalogue:\fR +before the directory name. The directory can then be populated with +symlinks pointing to the real font directories, using the following +syntax in the symlink name: +.PP +.RS 4 +.IR <identifier> : [attribute]: pri= <priority> +.RE +.PP +where +.I <identifier> +is an alphanumeric identifier, +.I [attribute] +is an attribute which will be passed to the underlying FPE and +.I <priority> +is a number used to order the fontfile FPEs. Examples: +.PP +.RS 4 +.nf +.I 75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi +.I gscript:pri=60 -> /usr/share/fonts/default/ghostscript +.I misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc +.fi +.PP +.RE .RE .RE +.PP +.RS 7 +Font server identifiers: +.PP +.RS 4 +Font server identifiers have the form: +.RS 4 +.PP +.IR <trans> / <hostname> : <port\-number> +.RE +.PP +where +.I <trans> +is the transport type to use to connect to the font server (e.g., +.B unix +for UNIX\-domain sockets or +.B tcp +for a TCP/IP connection), +.I <hostname> +is the hostname of the machine running the font server, and +.I <port\-number> +is the port number that the font server is listening on (usually 7100). +.RE +.PP +When this entry is not specified in the config file, the server falls back +to the compiled\-in default font path, which contains the following +font path elements (which can be set inside a catalogue directory): +.PP +.RS 4 +.nf +.I __datadir__/fonts/X11/misc/ +.I __datadir__/fonts/X11/TTF/ +.I __datadir__/fonts/X11/OTF/ +.I __datadir__/fonts/X11/Type1/ +.I __datadir__/fonts/X11/100dpi/ +.I __datadir__/fonts/X11/75dpi/ +.fi +.RE +.PP +Font path elements that are found to be invalid are removed from the +font path when the server starts up. +.RE +.TP 7 +.BI "ModulePath \*q" path \*q +sets the search path for loadable __xservername__ server modules. +This path is a comma separated list of directories which the __xservername__ server +searches for loadable modules loading in the order specified. +Multiple +.B ModulePath +entries may be specified, and they will be concatenated to build the +module search path used by the server. The default module path is +.PP +.RS 11 +__modulepath__ +.RE +.\" The LogFile keyword is not currently implemented +.ig +.TP 7 +.BI "LogFile \*q" path \*q +sets the name of the __xservername__ server log file. +The default log file name is +.PP +.RS 11 +.RI __logdir__/__xservername__. <n> .log +.RE +.PP +.RS 7 +where +.I <n> +is the display number for the __xservername__ server. +.. +.TP 7 +.BI "XkbDir \*q" path \*q +sets the base directory for keyboard layout files. The +.B \-xkbdir +command line option can be used to override this. The default directory is +.PP +.RS 11 +__xkbdir__ +.RE +.SH "SERVERFLAGS SECTION" +In addition to options specific to this section (described below), the +.B ServerFlags +section is used to specify some global +__xservername__ server options. +All of the entries in this section are +.BR Options , +although for compatibility purposes some of the old style entries are +still recognised. +Those old style entries are not documented here, and using them is +discouraged. +The +.B ServerFlags +section is optional, as are the entries that may be specified in it. +.PP +.B Options +specified in this section (with the exception of the +.B \*qDefaultServerLayout\*q +.BR Option ) +may be overridden by +.B Options +specified in the active +.B ServerLayout +section. +Options with command line equivalents are overridden when their command +line equivalent is used. +The options recognised by this section are: +.TP 7 +.BI "Option \*qDefaultServerLayout\*q \*q" layout\-id \*q +This specifies the default +.B ServerLayout +section to use in the absence of the +.B \-layout +command line option. +.TP 7 +.BI "Option \*qNoTrapSignals\*q \*q" boolean \*q +This prevents the __xservername__ server from trapping a range of unexpected fatal +signals and exiting cleanly. +Instead, the __xservername__ server will die and drop core where the fault occurred. +The default behaviour is for the __xservername__ server to exit cleanly, but still drop a +core file. +In general you never want to use this option unless you are debugging an __xservername__ +server problem and know how to deal with the consequences. +.TP 7 +.BI "Option \*qUseSIGIO\*q \*q" boolean \*q +This controls whether the __xservername__ server requests that events from +input devices be reported via a SIGIO signal handler (also known as SIGPOLL +on some platforms), or only reported via the standard select(3) loop. +The default behaviour is platform specific. In general you do not want to +use this option unless you are debugging the __xservername__ server, or +working around a specific bug until it is fixed, and understand the +consequences. +.TP 7 +.BI "Option \*qDontVTSwitch\*q \*q" boolean \*q +This disallows the use of the +.BI Ctrl+Alt+F n +sequence (where +.RI F n +refers to one of the numbered function keys). +That sequence is normally used to switch to another \*qvirtual terminal\*q +on operating systems that have this feature. +When this option is enabled, that key sequence has no special meaning and +is passed to clients. +Default: off. +.TP 7 +.BI "Option \*qDontZap\*q \*q" boolean \*q +This disallows the use of the +.B Terminate_Server +XKB action (usually on Ctrl+Alt+Backspace, depending on XKB options). +This action is normally used to terminate the __xservername__ server. +When this option is enabled, the action has no effect. +Default: off. +.TP 7 +.BI "Option \*qDontZoom\*q \*q" boolean \*q +This disallows the use of the +.B Ctrl+Alt+Keypad\-Plus +and +.B Ctrl+Alt+Keypad\-Minus +sequences. +These sequences allows you to switch between video modes. +When this option is enabled, those key sequences have no special meaning +and are passed to clients. +Default: off. +.TP 7 +.BI "Option \*qDisableVidModeExtension\*q \*q" boolean \*q +This disables the parts of the VidMode extension used by the xvidtune client +that can be used to change the video modes. +Default: the VidMode extension is enabled. +.TP 7 +.BI "Option \*qAllowNonLocalXvidtune\*q \*q" boolean \*q +This allows the xvidtune client (and other clients that use the VidMode +extension) to connect from another host. +Default: off. +.TP 7 +.BI "Option \*qAllowMouseOpenFail\*q \*q" boolean \*q +This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__) +drivers to not report failure if the mouse device can't be opened/initialised. +It has no effect on the evdev(__drivermansuffix__) or other drivers. +Default: false. +.TP 7 +.BI "Option \*qVTSysReq\*q \*q" boolean \*q +enables the SYSV\-style VT switch sequence for non\-SYSV systems +which support VT switching. +This sequence is +.B Alt\-SysRq +followed by a function key +.RB ( Fn ). +This prevents the __xservername__ server trapping the +keys used for the default VT switch sequence, which means that clients can +access them. +Default: off. +.TP 7 +.BI "Option \*qBlankTime\*q \*q" time \*q +sets the inactivity timeout for the +.B blank +phase of the screensaver. +.I time +is in minutes. +This is equivalent to the __xservername__ server's +.B \-s +flag, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 10 minutes. +.TP 7 +.BI "Option \*qStandbyTime\*q \*q" time \*q +sets the inactivity timeout for the +.B standby +phase of DPMS mode. +.I time +is in minutes, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 10 minutes. +This is only suitable for VESA DPMS compatible monitors, and may not be +supported by all video drivers. +It is only enabled for screens that have the +.B \*qDPMS\*q +option set (see the MONITOR section below). +.TP 7 +.BI "Option \*qSuspendTime\*q \*q" time \*q +sets the inactivity timeout for the +.B suspend +phase of DPMS mode. +.I time +is in minutes, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 10 minutes. +This is only suitable for VESA DPMS compatible monitors, and may not be +supported by all video drivers. +It is only enabled for screens that have the +.B \*qDPMS\*q +option set (see the MONITOR section below). +.TP 7 +.BI "Option \*qOffTime\*q \*q" time \*q +sets the inactivity timeout for the +.B off +phase of DPMS mode. +.I time +is in minutes, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 10 minutes. +This is only suitable for VESA DPMS compatible monitors, and may not be +supported by all video drivers. +It is only enabled for screens that have the +.B \*qDPMS\*q +option set (see the MONITOR section below). +.TP 7 +.BI "Option \*qPixmap\*q \*q" bpp \*q +This sets the pixmap format to use for depth 24. +Allowed values for +.I bpp +are 24 and 32. +Default: 32 unless driver constraints don't allow this (which is rare). +Note: some clients don't behave well when this value is set to 24. +.TP 7 +.BI "Option \*qPC98\*q \*q" boolean \*q +Specify that the machine is a Japanese PC\-98 machine. +This should not be enabled for anything other than the Japanese\-specific +PC\-98 architecture. +Default: auto\-detected. +.TP 7 +.BI "Option \*qNoPM\*q \*q" boolean \*q +Disables something to do with power management events. +Default: PM enabled on platforms that support it. +.TP 7 +.BI "Option \*qXinerama\*q \*q" boolean \*q +enable or disable XINERAMA extension. +Default is disabled. +.TP 7 +.BI "Option \*qAIGLX\*q \*q" boolean \*q +enable or disable AIGLX. AIGLX is enabled by default. +.TP 7 +.BI "Option \*qDRI2\*q \*q" boolean \*q +enable or disable DRI2. DRI2 is disabled by default. +.TP 7 +.BI "Option \*qGlxVisuals\*q \*q" string \*q +This option controls how many GLX visuals the GLX modules sets up. +The default value is +.BR "typical" , +which will setup up a typical subset of +the GLXFBConfigs provided by the driver as GLX visuals. Other options are +.BR "minimal" , +which will set up the minimal set allowed by the GLX specification and +.BR "all" +which will setup GLX visuals for all GLXFBConfigs. +.TP 7 +.BI "Option \*qUseDefaultFontPath\*q \*q" boolean \*q +Include the default font path even if other paths are specified in +xorg.conf. If enabled, other font paths are included as well. Enabled by +default. +.TP 7 +.BI "Option \*qIgnoreABI\*q \*q" boolean \*q +Allow modules built for a different, potentially incompatible version of +the X server to load. Disabled by default. +.TP 7 +.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q +If this option is disabled, then no devices will be added from HAL events. +Enabled by default. +.TP 7 +.BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q +If this option is disabled, then the devices will be added (and the +DevicePresenceNotify event sent), but not enabled, thus leaving policy up +to the client. +Enabled by default. +.TP 7 +.BI "Option \*qLog\*q \*q" string \*q +This option controls whether the log is flushed and/or synced to disk after +each message. +Possible values are +.B flush +or +.BR sync . +Unset by default. +.SH "MODULE SECTION" +The +.B Module +section is used to specify which __xservername__ server modules should be loaded. +This section is ignored when the __xservername__ server is built in static form. +The type of modules normally loaded in this section are __xservername__ server +extension modules. +Most other module types are loaded automatically when they are needed via +other mechanisms. +The +.B Module +section is optional, as are all of the entries that may be specified in +it. +.PP +Entries in this section may be in two forms. +The first and most commonly used form is an entry that uses the +.B Load +keyword, as described here: +.TP 7 +.BI "Load \*q" modulename \*q +This instructs the server to load the module called +.IR modulename . +The module name given should be the module's standard name, not the +module file name. +The standard name is case\-sensitive, and does not include the \(lqlib\(rq +prefix, or the \(lq.a\(rq, \(lq.o\(rq, or \(lq.so\(rq suffixes. +.PP +.RS 7 +Example: the DRI extension module can be loaded with the following entry: +.PP +.RS 4 +.B "Load \*qdri\*q" +.RE +.RE +.TP 7 +.BI "Disable \*q" modulename \*q +This instructs the server to not load the module called +.IR modulename . +Some modules are loaded by default in the server, and this overrides that +default. If a +.B Load +instruction is given for the same module, it overrides the +.B Disable +instruction and the module is loaded. The module name given should be the +module's standard name, not the module file name. As with the +.B Load +instruction, the standard name is case-sensitive, and does not include the +"lib" prefix, or the ".a", ".o", or ".so" suffixes. +.PP +The second form of entry is a +.BR SubSection, +with the subsection name being the module name, and the contents of the +.B SubSection +being +.B Options +that are passed to the module when it is loaded. +.PP +Example: the extmod module (which contains a miscellaneous group of +server extensions) can be loaded, with the XFree86\-DGA extension +disabled by using the following entry: +.PP +.RS 4 +.nf +.B "SubSection \*qextmod\*q" +.B " Option \*qomit XFree86\-DGA\*q" +.B EndSubSection +.fi +.RE +.PP +Modules are searched for in each directory specified in the +.B ModulePath +search path, and in the drivers, extensions, input, internal, and +multimedia subdirectories of each of those directories. +In addition to this, operating system specific subdirectories of all +the above are searched first if they exist. +.PP +To see what extension modules are available, check the extensions +subdirectory under: +.PP +.RS 4 +.nf +__modulepath__ +.fi +.RE +.PP +The \(lqextmod\(rq, \(lqdbe\(rq, \(lqdri\(rq, \(lqdri2\(rq, \(lqglx\(rq, +and \(lqrecord\(rq extension modules are loaded automatically, if they +are present, unless disabled with \*qDisable\*q entries. +It is recommended +that at very least the \(lqextmod\(rq extension module be loaded. +If it isn't, some commonly used server extensions (like the SHAPE +extension) will not be available. +.SH "EXTENSIONS SECTION" +The +.B Extensions +section is used to specify which X11 protocol extensions should be enabled +or disabled. +The +.B Extensions +section is optional, as are all of the entries that may be specified in +it. +.PP +Entries in this section are listed as Option statements with the name of +the extension as the first argument, and a boolean value as the second. +The extension name is case\-sensitive, and matches the form shown in the output +of \*qXorg -extension ?\*q. +.PP +.RS 7 +Example: the MIT-SHM extension can be disabled with the following entry: +.PP +.RS 4 +.nf +.B "Section \*qExtensions\*q" +.B " Option \*qMIT-SHM\*q \*qDisable\*q" +.B "EndSection" +.fi +.RE +.RE +.SH "INPUTDEVICE SECTION" +The config file may have multiple +.B InputDevice +sections. +Recent X servers employ HAL or udev backends for input device enumeration +and input hotplugging. It is usually not +necessary to provide +.B InputDevice +sections in the xorg.conf if hotplugging is in use. If hotplugging is +enabled, +.B InputDevice +sections using the +.B mouse, kbd +and +.B vmmouse +driver will be ignored. +.PP +If hotplugging is disabled, there will normally +be at least two: one for the core (primary) keyboard +and one for the core pointer. +If either of these two is missing, a default configuration for the missing +ones will be used. In the absence of an explicitly specified core input +device, the first +.B InputDevice +marked as +.B CorePointer +(or +.BR CoreKeyboard ) +is used. +If there is no match there, the first +.B InputDevice +that uses the \(lqmouse\(rq (or \(lqkbd\(rq) driver is used. +The final fallback is to use built\-in default configurations. +Currently the default configuration may not work as expected on all platforms. +.PP +.B InputDevice +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qInputDevice\*q" +.BI " Identifier \*q" name \*q +.BI " Driver \*q" inputdriver \*q +.I " options" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The +.B Identifier +and +.B Driver +entries are required in all +.B InputDevice +sections. +All other entries are optional. +.PP +The +.B Identifier +entry specifies the unique name for this input device. +The +.B Driver +entry specifies the name of the driver to use for this input device. +When using the loadable server, the input driver module +.RI \*q inputdriver \*q +will be loaded for each active +.B InputDevice +section. +An +.B InputDevice +section is considered active if it is referenced by an active +.B ServerLayout +section, if it is referenced by the +.B \-keyboard +or +.B \-pointer +command line options, or if it is selected implicitly as the core pointer +or keyboard device in the absence of such explicit references. +The most commonly used input drivers are +.BR evdev (__drivermansuffix__) +on Linux systems, and +.BR kbd (__drivermansuffix__) +and +.BR mousedrv (__drivermansuffix__) +on other platforms. +.PP +.PP +.B InputDevice +sections recognise some driver\-independent +.BR Options , +which are described here. +See the individual input driver manual pages for a description of the +device\-specific options. +.TP 7 +.BI "Option \*qAutoServerLayout\*q \*q" boolean \*q +Always add the device to the ServerLayout section used by this instance of +the server. This affects implied layouts as well as explicit layouts +specified in the configuration and/or on the command line. +.TP 7 +.BI "Option \*qCorePointer\*q" +Deprecated, see +.B Floating +.TP 7 +.BI "Option \*qCoreKeyboard\*q" +Deprecated, see +.B Floating +.TP 7 +.BI "Option \*qAlwaysCore\*q \*q" boolean \*q +Deprecated, see +.B Floating +.TP 7 +.BI "Option \*qSendCoreEvents\*q \*q" boolean \*q +Deprecated, see +.B Floating + +.TP 7 +.BI "Option \*qFloating\*q \*q" boolean \*q +When enabled, the input device is set up floating and does not +report events through any master device or control a cursor. The device is +only available to clients using the X Input Extension API. This option is +disabled by default. +The options +.B CorePointer, +.B CoreKeyboard, +.B AlwaysCore, +and +.B SendCoreEvents, +are the inverse of option +.B Floating +(i.e. +.B SendCoreEvents \*qon\*q +is equivalent to +.B Floating \*qoff\*q +). + +This option controls the startup behavior only, a device +may be reattached or set floating at runtime. +.PP +For pointing devices, the following options control how the pointer +is accelerated or decelerated with respect to physical device motion. Most of +these can be adjusted at runtime, see the xinput(1) man page for details. Only +the most important acceleration options are discussed here. +.TP 7 +.BI "Option \*qAccelerationProfile\*q \*q" integer \*q +Select the profile. In layman's terms, the profile constitutes the "feeling" of +the acceleration. More formally, it defines how the transfer function (actual +acceleration as a function of current device velocity and acceleration controls) +is constructed. This is mainly a matter of personal preference. +.PP +.RS 6 +.nf +.B " 0 classic (mostly compatible)" +.B "-1 none (only constant deceleration is applied)" +.B " 1 device-dependent" +.B " 2 polynomial (polynomial function)" +.B " 3 smooth linear (soft knee, then linear)" +.B " 4 simple (normal when slow, otherwise accelerated)" +.B " 5 power (power function)" +.B " 6 linear (more speed, more acceleration)" +.B " 7 limited (like linear, but maxes out at threshold)" +.fi +.RE +.TP 7 +.BI "Option \*qConstantDeceleration\*q \*q" real \*q +Makes the pointer go +.B deceleration +times slower than normal. Most useful for high-resolution devices. +.TP 7 +.BI "Option \*qAdaptiveDeceleration\*q \*q" real \*q +Allows to actually decelerate the pointer when going slow. At most, it will be +.B adaptive deceleration +times slower. Enables precise pointer placement without sacrificing speed. +.TP 7 +.BI "Option \*qAccelerationScheme\*q \*q" string \*q +Selects the scheme, which is the underlying algorithm. +.PP +.RS 7 +.nf +.B "predictable default algorithm (behaving more predictable)" +.B "lightweight old acceleration code (as specified in the X protocol spec)" +.B "none no acceleration or deceleration" +.fi +.RE +.TP 7 +.BI "Option \*qAccelerationNumerator\*q \*q" integer \*q +.TP 7 +.BI "Option \*qAccelerationDenominator\*q \*q" integer \*q +Set numerator and denominator of the acceleration factor. The acceleration +factor is a rational which, together with threshold, can be used to tweak +profiles to suit the users needs. The +.B simple +and +.B limited +profiles use it directly (i.e. they accelerate by the factor), for other +profiles it should hold that a higher acceleration factor leads to a faster +pointer. Typically, 1 is unaccelerated and values up to 5 are sensible. +.TP 7 +.BI "Option \*qAccelerationThreshold\*q \*q" integer \*q +Set the threshold, which is roughly the velocity (usually device units per 10 +ms) required for acceleration to become effective. The precise effect varies +with the profile however. + +.SH "INPUTCLASS SECTION" +The config file may have multiple +.B InputClass +sections. +These sections are optional and are used to provide configuration for a +class of input devices as they are automatically added. An input device can +match more than one +.B InputClass +section. Each class can override settings from a previous class, so it is +best to arrange the sections with the most generic matches first. +.PP +.B InputClass +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qInputClass\*q" +.BI " Identifier \*q" name \*q +.I " entries" +.I " ..." +.I " options" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The +.B Identifier +entry is required in all +.B InputClass +sections. +All other entries are optional. +.PP +The +.B Identifier +entry specifies the unique name for this input class. +The +.B Driver +entry specifies the name of the driver to use for this input device. +After all classes have been examined, the +.RI \*q inputdriver \*q +module from the first +.B Driver +entry will be enabled when using the loadable server. +.PP +When an input device is automatically added, its characteristics are +checked against all +.B InputClass +sections. Each section can contain optional entries to narrow the match +of the class. If none of the optional entries appear, the +.B InputClass +section is generic and will match any input device. If more than one of +these entries appear, they all must match for the configuration to apply. +.PP +There are two types of match entries used in +.B InputClass +sections. The first allows various tokens to be matched against attributes +of the device. An entry can be constructed to match attributes from different +devices by separating arguments with a '|' character. Multiple entries of the +same type may be supplied to add multiple matching conditions on the same +attribute. For example: +.PP +.RS 4 +.nf +.B "Section \*qInputClass\*q" +.B " Identifier \*qMy Class\*q" +.B " # product string must contain example and +.B " # either gizmo or gadget +.B " MatchProduct \*qexample\*q +.B " MatchProduct \*qgizmo|gadget\*q +.I " ..." +.B "EndSection" +.fi +.RE +.TP 7 +.BI "MatchProduct \*q" matchproduct \*q +This entry can be used to check if the substring +.RI \*q matchproduct \*q +occurs in the device's product name. +.TP 7 +.BI "MatchVendor \*q" matchvendor \*q +This entry can be used to check if the substring +.RI \*q matchvendor \*q +occurs in the device's vendor name. +.TP 7 +.BI "MatchDevicePath \*q" matchdevice \*q +This entry can be used to check if the device file matches the +.RI \*q matchdevice \*q +pathname pattern. +.TP 7 +.BI "MatchOS \*q" matchos \*q +This entry can be used to check if the operating system matches the +case-insensitive +.RI \*q matchos \*q +string. This entry is only supported on platforms providing the +.BR uname (2) +system call. +.TP 7 +.BI "MatchPnPID \*q" matchpnp \*q +The device's Plug and Play (PnP) ID can be checked against the +.RI \*q matchpnp \*q +shell wildcard pattern. +.TP 7 +.BI "MatchUSBID \*q" matchusb \*q +The device's USB ID can be checked against the +.RI \*q matchusb \*q +shell wildcard pattern. The ID is constructed as lowercase hexadecimal numbers +separated by a ':'. This is the same format as the +.BR lsusb (8) +program. +.TP 7 +.BI "MatchDriver \*q" matchdriver \*q +Check the case-sensitive string +.RI \*q matchdriver \*q +against the currently configured driver of the device. Ordering of sections +using this entry is important since it will not match unless the driver has +been set by the config backend or a previous +.B InputClass +section. +.TP 7 +.BI "MatchTag \*q" matchtag \*q +This entry can be used to check if tags assigned by the config backend +matches the +.RI \*q matchtag \*q +pattern. A match is found if at least one of the tags given in +.RI \*q matchtag \*q +matches at least one of the tags assigned by the backend. +.PP +The second type of entry is used to match device types. These entries take a +boolean argument similar to +.B Option +entries. +.TP 7 +.BI "MatchIsKeyboard \*q" bool \*q +.TP 7 +.BI "MatchIsPointer \*q" bool \*q +.TP 7 +.BI "MatchIsJoystick \*q" bool \*q +.TP 7 +.BI "MatchIsTablet \*q" bool \*q +.TP 7 +.BI "MatchIsTouchpad \*q" bool \*q +.TP 7 +.BI "MatchIsTouchscreen \*q" bool \*q +.PP +When an input device has been matched to the +.B InputClass +section, any +.B Option +entries are applied to the device. One +.B InputClass +specific +.B Option +is recognized. See the +.B InputDevice +section above for a description of the remaining +.B Option +entries. +.TP 7 +.BI "Option \*qIgnore\*q \*q" boolean \*q +This optional entry specifies that the device should be ignored entirely, +and not added to the server. This can be useful when the device is handled +by another program and no X events should be generated. +.SH "DEVICE SECTION" +The config file may have multiple +.B Device +sections. +There must be at least one, for the video card being used. +.PP +.B Device +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qDevice\*q" +.BI " Identifier \*q" name \*q +.BI " Driver \*q" driver \*q +.I " entries" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The +.B Identifier +and +.B Driver +entries are required in all +.B Device +sections. All other entries are optional. +.PP +The +.B Identifier +entry specifies the unique name for this graphics device. +The +.B Driver +entry specifies the name of the driver to use for this graphics device. +When using the loadable server, the driver module +.RI \*q driver \*q +will be loaded for each active +.B Device +section. +A +.B Device +section is considered active if it is referenced by an active +.B Screen +section. +.PP +.B Device +sections recognise some driver\-independent entries and +.BR Options , +which are described here. +Not all drivers make use of these +driver\-independent entries, and many of those that do don't require them +to be specified because the information is auto\-detected. +See the individual graphics driver manual pages for further information +about this, and for a description of the device\-specific options. +Note that most of the +.B Options +listed here (but not the other entries) may be specified in the +.B Screen +section instead of here in the +.B Device +section. +.TP 7 +.BI "BusID \*q" bus\-id \*q +This specifies the bus location of the graphics card. +For PCI/AGP cards, +the +.I bus\-id +string has the form +.BI PCI: bus : device : function +(e.g., \(lqPCI:1:0:0\(rq might be appropriate for an AGP card). +This field is usually optional in single-head configurations when using +the primary graphics card. +In multi-head configurations, or when using a secondary graphics card in a +single-head configuration, this entry is mandatory. +Its main purpose is to make an unambiguous connection between the device +section and the hardware it is representing. +This information can usually be found by running the pciaccess tool +scanpci. +.TP 7 +.BI "Screen " number +This option is mandatory for cards where a single PCI entity can drive more +than one display (i.e., multiple CRTCs sharing a single graphics accelerator +and video memory). +One +.B Device +section is required for each head, and this +parameter determines which head each of the +.B Device +sections applies to. +The legal values of +.I number +range from 0 to one less than the total number of heads per entity. +Most drivers require that the primary screen (0) be present. +.TP 7 +.BI "Chipset \*q" chipset \*q +This usually optional entry specifies the chipset used on the graphics +board. +In most cases this entry is not required because the drivers will probe the +hardware to determine the chipset type. +Don't specify it unless the driver-specific documentation recommends that you +do. +.TP 7 +.BI "Ramdac \*q" ramdac\-type \*q +This optional entry specifies the type of RAMDAC used on the graphics +board. +This is only used by a few of the drivers, and in most cases it is not +required because the drivers will probe the hardware to determine the +RAMDAC type where possible. +Don't specify it unless the driver-specific documentation recommends that you +do. +.TP 7 +.BI "DacSpeed " speed +.TP 7 +.BI "DacSpeed " "speed\-8 speed\-16 speed\-24 speed\-32" +This optional entry specifies the RAMDAC speed rating (which is usually +printed on the RAMDAC chip). +The speed is in MHz. +When one value is given, it applies to all framebuffer pixel sizes. +When multiple values are given, they apply to the framebuffer pixel sizes +8, 16, 24 and 32 respectively. +This is not used by many drivers, and only needs to be specified when the +speed rating of the RAMDAC is different from the defaults built in to +driver, or when the driver can't auto-detect the correct defaults. +Don't specify it unless the driver-specific documentation recommends that you +do. +.TP 7 +.BI "Clocks " "clock ..." +specifies the pixel that are on your graphics board. +The clocks are in MHz, and may be specified as a floating point number. +The value is stored internally to the nearest kHz. +The ordering of the clocks is important. +It must match the order in which they are selected on the graphics board. +Multiple +.B Clocks +lines may be specified, and each is concatenated to form the list. +Most drivers do not use this entry, and it is only required for some older +boards with non-programmable clocks. +Don't specify this entry unless the driver-specific documentation explicitly +recommends that you do. +.TP +.BI "ClockChip \*q" clockchip\-type \*q +This optional entry is used to specify the clock chip type on graphics +boards which have a programmable clock generator. +Only a few __xservername__ drivers support programmable clock chips. +For details, see the appropriate driver manual page. +.TP 7 +.BI "VideoRam " "mem" +This optional entry specifies the amount of video ram that is installed +on the graphics board. +This is measured in kBytes. +In most cases this is not required because the __xservername__ server probes +the graphics board to determine this quantity. +The driver-specific documentation should indicate when it might be needed. +.TP 7 +.BI "BiosBase " "baseaddress" +This optional entry specifies the base address of the video BIOS for +the VGA board. +This address is normally auto-detected, and should only be specified if the +driver-specific documentation recommends it. +.TP 7 +.BI "MemBase " "baseaddress" +This optional entry specifies the memory base address of a graphics +board's linear frame buffer. +This entry is not used by many drivers, and it should only be specified if +the driver-specific documentation recommends it. +.TP 7 +.BI "IOBase " "baseaddress" +This optional entry specifies the IO base address. +This entry is not used by many drivers, and it should only be specified if +the driver-specific documentation recommends it. +.TP 7 +.BI "ChipID " "id" +This optional entry specifies a numerical ID representing the chip type. +For PCI cards, it is usually the device ID. +This can be used to override the auto-detection, but that should only be done +when the driver-specific documentation recommends it. +.TP 7 +.BI "ChipRev " "rev" +This optional entry specifies the chip revision number. +This can be used to override the auto-detection, but that should only be done +when the driver-specific documentation recommends it. +.TP 7 +.BI "TextClockFreq " "freq" +This optional entry specifies the pixel clock frequency that is used +for the regular text mode. +The frequency is specified in MHz. +This is rarely used. +.TP 7 +.BI "Option \*qModeDebug\*q \*q" boolean \*q +Enable printing of additional debugging information about modesetting to +the server log. +.ig +.TP 7 +This optional entry allows an IRQ number to be specified. +.. +.TP 7 +.B Options +Option flags may be specified in the +.B Device +sections. +These include driver\-specific options and driver\-independent options. +The former are described in the driver\-specific documentation. +Some of the latter are described below in the section about the +.B Screen +section, and they may also be included here. + +.SH "VIDEOADAPTOR SECTION" +Nobody wants to say how this works. +Maybe nobody knows ... + +.SH "MONITOR SECTION" +The config file may have multiple +.B Monitor +sections. +There should normally be at least one, for the monitor being used, +but a default configuration will be created when one isn't specified. +.PP +.B Monitor +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qMonitor\*q" +.BI " Identifier \*q" name \*q +.I " entries" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The only mandatory entry in a +.B Monitor +section is the +.B Identifier +entry. +.PP +The +.B Identifier +entry specifies the unique name for this monitor. +The +.B Monitor +section may be used to provide information about the specifications of the +monitor, monitor-specific +.BR Options , +and information about the video modes to use with the monitor. +.PP +With RandR 1.2-enabled drivers, monitor sections may be tied to specific +outputs of the video card. Using the name of the output defined by the video +driver plus the identifier of a monitor section, one associates a monitor +section with an output by adding an option to the Device section in the +following format: + +.B Option \*qMonitor-outputname\*q \*qmonitorsection\*q + +(for example, +.B Option \*qMonitor-VGA\*q \*qVGA monitor\*q +for a VGA output) +.PP +In the absence of specific association of monitor sections to outputs, if a +monitor section is present the server will associate it with an output to +preserve compatibility for previous single-head configurations. +.PP +Specifying video modes is optional because the server will use the DDC or other +information provided by the monitor to automatically configure the list of +modes available. +When modes are specified explicitly in the +.B Monitor +section (with the +.BR Modes , +.BR ModeLine , +or +.B UseModes +keywords), built-in modes with the same names are not included. +Built-in modes with different names are, however, still implicitly included, +when they meet the requirements of the monitor. +.PP +The entries that may be used in +.B Monitor +sections are described below. +.TP 7 +.BI "VendorName \*q" vendor \*q +This optional entry specifies the monitor's manufacturer. +.TP 7 +.BI "ModelName \*q" model \*q +This optional entry specifies the monitor's model. +.TP 7 +.BI "HorizSync " "horizsync\-range" +gives the range(s) of horizontal sync frequencies supported by the +monitor. +.I horizsync\-range +may be a comma separated list of either discrete values or ranges of +values. +A range of values is two values separated by a dash. +By default the values are in units of kHz. +They may be specified in MHz or Hz +if +.B MHz +or +.B Hz +is added to the end of the line. +The data given here is used by the __xservername__ server to determine if video +modes are within the specifications of the monitor. +This information should be available in the monitor's handbook. +If this entry is omitted, a default range of 28\-33kHz is used. +.TP 7 +.BI "VertRefresh " "vertrefresh\-range" +gives the range(s) of vertical refresh frequencies supported by the +monitor. +.I vertrefresh\-range +may be a comma separated list of either discrete values or ranges of +values. +A range of values is two values separated by a dash. +By default the values are in units of Hz. +They may be specified in MHz or kHz +if +.B MHz +or +.B kHz +is added to the end of the line. +The data given here is used by the __xservername__ server to determine if video +modes are within the specifications of the monitor. +This information should be available in the monitor's handbook. +If this entry is omitted, a default range of 43\-72Hz is used. +.TP 7 +.BI "DisplaySize " "width height" +This optional entry gives the width and height, in millimetres, of the +picture area of the monitor. +If given this is used to calculate the horizontal and vertical pitch (DPI) of +the screen. +.TP 7 +.BI "Gamma " "gamma\-value" +.TP 7 +.BI "Gamma " "red\-gamma green\-gamma blue\-gamma" +This is an optional entry that can be used to specify the gamma correction +for the monitor. +It may be specified as either a single value or as three separate RGB values. +The values should be in the range 0.1 to 10.0, and the default is 1.0. +Not all drivers are capable of using this information. +.TP 7 +.BI "UseModes \*q" modesection\-id \*q +Include the set of modes listed in the +.B Modes +section called +.IR modesection\-id. +This makes all of the modes defined in that section available for use by +this monitor. +.TP 7 +.BI "Mode \*q" name \*q +This is an optional multi-line entry that can be used to provide +definitions for video modes for the monitor. +In most cases this isn't necessary because the built-in set of VESA standard +modes will be sufficient. +The +.B Mode +keyword indicates the start of a multi-line video mode description. +The mode description is terminated with the +.B EndMode +keyword. +The mode description consists of the following entries: +.RS 7 +.TP 4 +.BI "DotClock " clock +is the dot (pixel) clock rate to be used for the mode. +.TP 4 +.BI "HTimings " "hdisp hsyncstart hsyncend htotal" +specifies the horizontal timings for the mode. +.TP 4 +.BI "VTimings " "vdisp vsyncstart vsyncend vtotal" +specifies the vertical timings for the mode. +.TP 4 +.BI "Flags \*q" flag \*q " ..." +specifies an optional set of mode flags, each of which is a separate +string in double quotes. +.B \*qInterlace\*q +indicates that the mode is interlaced. +.B \*qDoubleScan\*q +indicates a mode where each scanline is doubled. +.B \*q+HSync\*q +and +.B \*q\-HSync\*q +can be used to select the polarity of the HSync signal. +.B \*q+VSync\*q +and +.B \*q\-VSync\*q +can be used to select the polarity of the VSync signal. +.B \*qComposite\*q +can be used to specify composite sync on hardware where this is supported. +Additionally, on some hardware, +.B \*q+CSync\*q +and +.B \*q\-CSync\*q +may be used to select the composite sync polarity. +.TP 4 +.BI "HSkew " hskew +specifies the number of pixels (towards the right edge of the screen) by +which the display enable signal is to be skewed. +Not all drivers use this information. +This option might become necessary to override the default value supplied +by the server (if any). +\(lqRoving\(rq horizontal lines indicate this value needs to be increased. +If the last few pixels on a scan line appear on the left of the screen, +this value should be decreased. +.TP 4 +.BI "VScan " vscan +specifies the number of times each scanline is painted on the screen. +Not all drivers use this information. +Values less than 1 are treated as 1, which is the default. +Generally, the +.B \*qDoubleScan\*q +.B Flag +mentioned above doubles this value. +.RE +.TP 7 +.BI "ModeLine \*q" name \*q " mode\-description" +This entry is a more compact version of the +.B Mode +entry, and it also can be used to specify video modes for the monitor. +is a single line format for specifying video modes. +In most cases this isn't necessary because the built\-in set of VESA +standard modes will be sufficient. +.PP +.RS 7 +The +.I mode\-description +is in four sections, the first three of which are mandatory. +The first is the dot (pixel) clock. +This is a single number specifying the pixel clock rate for the mode in +MHz. +The second section is a list of four numbers specifying the horizontal +timings. +These numbers are the +.IR hdisp , +.IR hsyncstart , +.IR hsyncend , +and +.I htotal +values. +The third section is a list of four numbers specifying the vertical +timings. +These numbers are the +.IR vdisp , +.IR vsyncstart , +.IR vsyncend , +and +.I vtotal +values. +The final section is a list of flags specifying other characteristics of +the mode. +.B Interlace +indicates that the mode is interlaced. +.B DoubleScan +indicates a mode where each scanline is doubled. +.B +HSync +and +.B \-HSync +can be used to select the polarity of the HSync signal. +.B +VSync +and +.B \-VSync +can be used to select the polarity of the VSync signal. +.B Composite +can be used to specify composite sync on hardware where this is supported. +Additionally, on some hardware, +.B +CSync +and +.B \-CSync +may be used to select the composite sync polarity. +The +.B HSkew +and +.B VScan +options mentioned above in the +.B Modes +entry description can also be used here. +.RE +.TP 7 +.BI "Option " "\*qDPMS\*q " \*qbool\*q +This option controls whether the server should enable the DPMS extension +for power management for this screen. The default is to enable the +extension. +.TP 7 +.BI "Option " "\*qSyncOnGreen\*q " \*qbool\*q +This option controls whether the video card should drive the sync signal +on the green color pin. Not all cards support this option, and most +monitors do not require it. The default is off. +.TP 7 +.BI "Option " "\*qPrimary\*q " \*qbool\*q +This optional entry specifies that the monitor should be treated as the primary +monitor. (RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qPreferredMode\*q " \*qstring\*q +This optional entry specifies a mode to be marked as the preferred initial mode +of the monitor. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qPosition\*q " "\*qx y\*q" +This optional entry specifies the position of the monitor within the X +screen. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qLeftOf\*q " \*qoutput\*q +This optional entry specifies that the monitor should be positioned to the +left of the output (not monitor) of the given name. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qRightOf\*q " \*qoutput\*q +This optional entry specifies that the monitor should be positioned to the +right of the output (not monitor) of the given name. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qAbove\*q " \*qoutput\*q +This optional entry specifies that the monitor should be positioned above the +output (not monitor) of the given name. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qBelow\*q " \*qoutput\*q +This optional entry specifies that the monitor should be positioned below the +output (not monitor) of the given name. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qEnable\*q " \*qbool\*q +This optional entry specifies whether the monitor should be turned on +at startup. By default, the server will attempt to enable all connected +monitors. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qDefaultModes\*q " \*qbool\*q +This optional entry specifies whether the server should add supported default +modes to the list of modes offered on this monitor. By default, the server +will add default modes; you should only disable this if you can guarantee +that EDID will be available at all times, or if you have added custom modelines +which the server can use. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qMinClock\*q " \*qfrequency\*q +This optional entry specifies the minimum dot clock, in kHz, that is supported +by the monitor. +.TP 7 +.BI "Option " "\*qMaxClock\*q " \*qfrequency\*q +This optional entry specifies the maximum dot clock, in kHz, that is supported +by the monitor. +.TP 7 +.BI "Option " "\*qIgnore\*q " \*qbool\*q +This optional entry specifies that the monitor should be ignored entirely, +and not reported through RandR. This is useful if the hardware reports the +presence of outputs that don't exist. +(RandR 1.2-supporting drivers only) +.TP 7 +.BI "Option " "\*qRotate\*q " \*qrotation\*q +This optional entry specifies the initial rotation of the given monitor. +Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and +\*qinverted\*q. +(RandR 1.2-supporting drivers only) + +.SH "MODES SECTION" +The config file may have multiple +.B Modes +sections, or none. +These sections provide a way of defining sets of video modes independently +of the +.B Monitor +sections. +.B Monitor +sections may include the definitions provided in these sections by +using the +.B UseModes +keyword. +In most cases the +.B Modes +sections are not necessary because the built\-in set of VESA standard modes +will be sufficient. +.PP +.B Modes +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qModes\*q" +.BI " Identifier \*q" name \*q +.I " entries" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The +.B Identifier +entry specifies the unique name for this set of mode descriptions. +The other entries permitted in +.B Modes +sections are the +.B Mode +and +.B ModeLine +entries that are described above in the +.B Monitor +section. +.SH "SCREEN SECTION" +The config file may have multiple +.B Screen +sections. +There must be at least one, for the \(lqscreen\(rq being used. +A \(lqscreen\(rq represents the binding of a graphics device +.RB ( Device +section) and a monitor +.RB ( Monitor +section). +A +.B Screen +section is considered \(lqactive\(rq if it is referenced by an active +.B ServerLayout +section or by the +.B \-screen +command line option. +If neither of those is present, the first +.B Screen +section found in the config file is considered the active one. +.PP +.B Screen +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qScreen\*q" +.BI " Identifier \*q" name \*q +.BI " Device \*q" devid \*q +.BI " Monitor \*q" monid \*q +.I " entries" +.I " ..." +.BI " SubSection \*qDisplay\*q" +.I " entries" +.I " ... +.B " EndSubSection" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +The +.B Identifier +and +.B Device +entries are mandatory. +All others are optional. +.PP +The +.B Identifier +entry specifies the unique name for this screen. +The +.B Screen +section provides information specific to the whole screen, including +screen\-specific +.BR Options . +In multi\-head configurations, there will be multiple active +.B Screen +sections, one for each head. +The entries available +for this section are: +.TP 7 +.BI "Device \*q" device\-id \*q +This mandatory entry specifies the +.B Device +section to be used for this screen. +This is what ties a specific graphics card to a screen. +The +.I device\-id +must match the +.B Identifier +of a +.B Device +section in the config file. +.TP 7 +.BI "Monitor \*q" monitor\-id \*q +specifies which monitor description is to be used for this screen. +If a +.B Monitor +name is not specified, a default configuration is used. +Currently the default configuration may not function as expected on all +platforms. +.TP 7 +.BI "VideoAdaptor \*q" xv\-id \*q +specifies an optional Xv video adaptor description to be used with this +screen. +.TP 7 +.BI "DefaultDepth " depth +specifies which color depth the server should use by default. +The +.B \-depth +command line option can be used to override this. +If neither is specified, the default depth is driver\-specific, but in most +cases is 8. +.TP 7 +.BI "DefaultFbBpp " bpp +specifies which framebuffer layout to use by default. +The +.B \-fbbpp +command line option can be used to override this. +In most cases the driver will chose the best default value for this. +The only case where there is even a choice in this value is for depth 24, +where some hardware supports both a packed 24 bit framebuffer layout and a +sparse 32 bit framebuffer layout. +.TP 7 +.B Options +Various +.B Option +flags may be specified in the +.B Screen +section. +Some are driver\-specific and are described in the driver documentation. +Others are driver\-independent, and will eventually be described here. +.\" XXX These should really be in an xaa man page. +.TP 7 +.BI "Option \*qAccel\*q" +Enables XAA (X Acceleration Architecture), a mechanism that makes video cards' +2D hardware acceleration available to the __xservername__ server. +This option is on by default, but it may be necessary to turn it off if +there are bugs in the driver. +There are many options to disable specific accelerated operations, listed +below. +Note that disabling an operation will have no effect if the operation is +not accelerated (whether due to lack of support in the hardware or in the +driver). +.TP 7 +.BI "Option \*qInitPrimary\*q \*q" boolean \*q +Use the Int10 module to initialize the primary graphics card. +Normally, only secondary cards are soft-booted using the Int10 module, as the +primary card has already been initialized by the BIOS at boot time. +Default: false. +.TP 7 +.BI "Option \*qNoInt10\*q \*q" boolean \*q +Disables the Int10 module, a module that uses the int10 call to the BIOS +of the graphics card to initialize it. +Default: false. +.TP 7 +.BI "Option \*qNoMTRR\*q" +Disables MTRR (Memory Type Range Register) support, a feature of modern +processors which can improve video performance by a factor of up to 2.5. +Some hardware has buggy MTRR support, and some video drivers have been +known to exhibit problems when MTRR's are used. +.TP 7 +.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q" +Disables accelerated rectangular expansion blits from source patterns +stored in system memory (using a memory\-mapped aperture). +.TP 7 +.BI "Option \*qXaaNoColor8x8PatternFillRect\*q" +Disables accelerated fills of a rectangular region with a full\-color +pattern. +.TP 7 +.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q" +Disables accelerated fills of a trapezoidal region with a full\-color +pattern. +.TP 7 +.BI "Option \*qXaaNoDashedBresenhamLine\*q" +Disables accelerated dashed Bresenham line draws. +.TP 7 +.BI "Option \*qXaaNoDashedTwoPointLine\*q" +Disables accelerated dashed line draws between two arbitrary points. +.TP 7 +.BI "Option \*qXaaNoImageWriteRect\*q" +Disables accelerated transfers of full\-color rectangular patterns from +system memory to video memory (using a memory\-mapped aperture). +.TP 7 +.BI "Option \*qXaaNoMono8x8PatternFillRect\*q" +Disables accelerated fills of a rectangular region with a monochrome +pattern. +.TP 7 +.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q" +Disables accelerated fills of a trapezoidal region with a monochrome +pattern. +.TP 7 +.BI "Option \*qXaaNoOffscreenPixmaps\*q" +Disables accelerated draws into pixmaps stored in offscreen video memory. +.TP 7 +.BI "Option \*qXaaNoPixmapCache\*q" +Disables caching of patterns in offscreen video memory. +.TP 7 +.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q" +Disables accelerated rectangular expansion blits from source patterns +stored in system memory (one scan line at a time). +.TP 7 +.BI "Option \*qXaaNoScanlineImageWriteRect\*q" +Disables accelerated transfers of full\-color rectangular patterns from +system memory to video memory (one scan line at a time). +.TP 7 +.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q" +Disables accelerated rectangular expansion blits from source patterns +stored in offscreen video memory. +.TP 7 +.BI "Option \*qXaaNoScreenToScreenCopy\*q" +Disables accelerated copies of rectangular regions from one part of +video memory to another part of video memory. +.TP 7 +.BI "Option \*qXaaNoSolidBresenhamLine\*q" +Disables accelerated solid Bresenham line draws. +.TP 7 +.BI "Option \*qXaaNoSolidFillRect\*q" +Disables accelerated solid\-color fills of rectangles. +.TP 7 +.BI "Option \*qXaaNoSolidFillTrap\*q" +Disables accelerated solid\-color fills of Bresenham trapezoids. +.TP 7 +.BI "Option \*qXaaNoSolidHorVertLine\*q" +Disables accelerated solid horizontal and vertical line draws. +.TP 7 +.BI "Option \*qXaaNoSolidTwoPointLine\*q" +Disables accelerated solid line draws between two arbitrary points. +.PP +Each +.B Screen +section may optionally contain one or more +.B Display +subsections. +Those subsections provide depth/fbbpp specific configuration information, +and the one chosen depends on the depth and/or fbbpp that is being used for +the screen. +The +.B Display +subsection format is described in the section below. + +.SH "DISPLAY SUBSECTION" +Each +.B Screen +section may have multiple +.B Display +subsections. +The \(lqactive\(rq +.B Display +subsection is the first that matches the depth and/or fbbpp values being +used, or failing that, the first that has neither a depth or fbbpp value +specified. +The +.B Display +subsections are optional. +When there isn't one that matches the depth and/or fbbpp values being used, +all the parameters that can be specified here fall back to their defaults. +.PP +.B Display +subsections have the following format: +.PP +.RS 4 +.nf +.B " SubSection \*qDisplay\*q" +.BI " Depth " depth +.I " entries" +.I " ..." +.B " EndSubSection" +.fi +.RE +.TP 7 +.BI "Depth " depth +This entry specifies what colour depth the +.B Display +subsection is to be used for. +This entry is usually specified, but it may be omitted to create a match\-all +.B Display +subsection or when wishing to match only against the +.B FbBpp +parameter. +The range of +.I depth +values that are allowed depends on the driver. +Most drivers support 8, 15, 16 and 24. +Some also support 1 and/or 4, and some may support other values (like 30). +Note: +.I depth +means the number of bits in a pixel that are actually used to determine +the pixel colour. +32 is not a valid +.I depth +value. +Most hardware that uses 32 bits per pixel only uses 24 of them to hold the +colour information, which means that the colour depth is 24, not 32. +.TP 7 +.BI "FbBpp " bpp +This entry specifies the framebuffer format this +.B Display +subsection is to be used for. +This entry is only needed when providing depth 24 configurations that allow +a choice between a 24 bpp packed framebuffer format and a 32bpp sparse +framebuffer format. +In most cases this entry should not be used. +.TP 7 +.BI "Weight " "red\-weight green\-weight blue\-weight" +This optional entry specifies the relative RGB weighting to be used +for a screen is being used at depth 16 for drivers that allow multiple +formats. +This may also be specified from the command line with the +.B \-weight +option (see +.BR __xservername__(__appmansuffix__)). +.TP 7 +.BI "Virtual " "xdim ydim" +This optional entry specifies the virtual screen resolution to be used. +.I xdim +must be a multiple of either 8 or 16 for most drivers, and a multiple +of 32 when running in monochrome mode. +The given value will be rounded down if this is not the case. +Video modes which are too large for the specified virtual size will be +rejected. +If this entry is not present, the virtual screen resolution will be set to +accommodate all the valid video modes given in the +.B Modes +entry. +Some drivers/hardware combinations do not support virtual screens. +Refer to the appropriate driver\-specific documentation for details. +.TP 7 +.BI "ViewPort " "x0 y0" +This optional entry sets the upper left corner of the initial display. +This is only relevant when the virtual screen resolution is different +from the resolution of the initial video mode. +If this entry is not given, then the initial display will be centered in +the virtual display area. +.TP 7 +.BI "Modes \*q" mode\-name \*q " ..." +This optional entry specifies the list of video modes to use. +Each +.I mode\-name +specified must be in double quotes. +They must correspond to those specified or referenced in the appropriate +.B Monitor +section (including implicitly referenced built\-in VESA standard modes). +The server will delete modes from this list which don't satisfy various +requirements. +The first valid mode in this list will be the default display mode for +startup. +The list of valid modes is converted internally into a circular list. +It is possible to switch to the next mode with +.B Ctrl+Alt+Keypad\-Plus +and to the previous mode with +.BR Ctrl+Alt+Keypad\-Minus . +When this entry is omitted, the valid modes referenced by the appropriate +.B Monitor +section will be used. If the +.B Monitor +section contains no modes, then the selection will be taken from the +built-in VESA standard modes. +.TP 7 +.BI "Visual \*q" visual\-name \*q +This optional entry sets the default root visual type. +This may also be specified from the command line (see the +.BR Xserver(__appmansuffix__) +man page). +The visual types available for depth 8 are (default is +.BR PseudoColor ): +.PP +.RS 11 +.nf +.B StaticGray +.B GrayScale +.B StaticColor +.B PseudoColor +.B TrueColor +.B DirectColor +.fi +.RE +.PP +.RS 7 +The visual type available for the depths 15, 16 and 24 are (default is +.BR TrueColor ): +.PP +.RS 4 +.nf +.B TrueColor +.B DirectColor +.fi +.RE +.PP +Not all drivers support +.B DirectColor +at these depths. +.PP +The visual types available for the depth 4 are (default is +.BR StaticColor ): +.PP +.RS 4 +.nf +.B StaticGray +.B GrayScale +.B StaticColor +.B PseudoColor +.fi +.RE +.PP +The visual type available for the depth 1 (monochrome) is +.BR StaticGray . +.RE +.TP 7 +.BI "Black " "red green blue" +This optional entry allows the \(lqblack\(rq colour to be specified. +This is only supported at depth 1. +The default is black. +.TP 7 +.BI "White " "red green blue" +This optional entry allows the \(lqwhite\(rq colour to be specified. +This is only supported at depth 1. +The default is white. +.TP 7 +.B Options +Option flags may be specified in the +.B Display +subsections. +These may include driver\-specific options and driver\-independent options. +The former are described in the driver\-specific documentation. +Some of the latter are described above in the section about the +.B Screen +section, and they may also be included here. +.SH "SERVERLAYOUT SECTION" +The config file may have multiple +.B ServerLayout +sections. +A \(lqserver layout\(rq represents the binding of one or more screens +.RB ( Screen +sections) and one or more input devices +.RB ( InputDevice +sections) to form a complete configuration. +In multi\-head configurations, it also specifies the relative layout of the +heads. +A +.B ServerLayout +section is considered \(lqactive\(rq if it is referenced by the +.B \-layout +command line option or by an +.B "Option \*qDefaultServerLayout\*q" +entry in the +.B ServerFlags +section (the former takes precedence over the latter). +If those options are not used, the first +.B ServerLayout +section found in the config file is considered the active one. +If no +.B ServerLayout +sections are present, the single active screen and two active (core) +input devices are selected as described in the relevant sections above. +.PP +.B ServerLayout +sections have the following format: +.PP +.RS 4 +.nf +.B "Section \*qServerLayout\*q" +.BI " Identifier \*q" name \*q +.BI " Screen \*q" screen\-id \*q +.I " ..." +.BI " InputDevice \*q" idev\-id \*q +.I " ..." +.I " options" +.I " ..." +.B "EndSection" +.fi +.RE +.PP +Each +.B ServerLayout +section must have an +.B Identifier +entry and at least one +.B Screen +entry. +.PP +The +.B Identifier +entry specifies the unique name for this server layout. +The +.B ServerLayout +section provides information specific to the whole session, including +session\-specific +.BR Options . +The +.B ServerFlags +options (described above) may be specified here, and ones given here +override those given in the +.B ServerFlags +section. +.PP +The entries that may be used in this section are described here. +.TP 7 +.BI "Screen " "screen\-num" " \*qscreen\-id\*q " "position\-information" +One of these entries must be given for each screen being used in +a session. +The +.I screen\-id +field is mandatory, and specifies the +.B Screen +section being referenced. +The +.I screen\-num +field is optional, and may be used to specify the screen number +in multi\-head configurations. +When this field is omitted, the screens will be numbered in the order that +they are listed in. +The numbering starts from 0, and must be consecutive. +The +.I position\-information +field describes the way multiple screens are positioned. +There are a number of different ways that this information can be provided: +.RS 7 +.TP 4 +.I "x y" +.TP 4 +.BI "Absolute " "x y" +These both specify that the upper left corner's coordinates are +.RI ( x , y ). +The +.B Absolute +keyword is optional. +Some older versions of XFree86 (4.2 and earlier) don't recognise the +.B Absolute +keyword, so it's safest to just specify the coordinates without it. +.TP 4 +.BI "RightOf \*q" screen\-id \*q +.TP 4 +.BI "LeftOf \*q" screen\-id \*q +.TP 4 +.BI "Above \*q" screen\-id \*q +.TP 4 +.BI "Below \*q" screen\-id \*q +.TP 4 +.BI "Relative \*q" screen\-id \*q " x y" +These give the screen's location relative to another screen. +The first four position the screen immediately to the right, left, above or +below the other screen. +When positioning to the right or left, the top edges are aligned. +When positioning above or below, the left edges are aligned. +The +.B Relative +form specifies the offset of the screen's origin (upper left corner) +relative to the origin of another screen. +.RE +.TP 7 +.BI "InputDevice \*q" idev\-id "\*q \*q" option \*q " ..." +One of these entries should be given for each input device being used in +a session. +Normally at least two are required, one each for the core pointer and +keyboard devices. +If either of those is missing, suitable +.B InputDevice +entries are searched for using the method described above in the +.B INPUTDEVICE +section. The +.I idev\-id +field is mandatory, and specifies the name of the +.B InputDevice +section being referenced. +Multiple +.I option +fields may be specified, each in double quotes. +The options permitted here are any that may also be given in the +.B InputDevice +sections. +Normally only session\-specific input device options would be used here. +The most commonly used options are: +.PP +.RS 11 +.nf +.B \*qCorePointer\*q +.B \*qCoreKeyboard\*q +.B \*qSendCoreEvents\*q +.fi +.RE +.PP +.RS 7 +and the first two should normally be used to indicate the core pointer +and core keyboard devices respectively. +.RE +.TP 7 +.B Options +In addition to the following, any option permitted in the +.B ServerFlags +section may also be specified here. +When the same option appears in both places, the value given here overrides +the one given in the +.B ServerFlags +section. +.TP 7 +.BI "Option \*qIsolateDevice\*q \*q" bus\-id \*q +Restrict device resets to the specified +.IR bus\-id . +See the +.B BusID +option (described in +.BR "DEVICE SECTION" , +above) for the format of the +.I bus\-id +parameter. +This option overrides +.BR SingleCard , +if specified. +At present, only PCI devices can be isolated in this manner. +.TP 7 +.BI "Option \*qSingleCard\*q \*q" boolean \*q +As +.BR IsolateDevice , +except that the bus ID of the first device in the layout is used. +.PP +Here is an example of a +.B ServerLayout +section for a dual headed configuration with two mice: +.PP +.RS 4 +.nf +.B "Section \*qServerLayout\*q" +.B " Identifier \*qLayout 1\*q" +.B " Screen \*qMGA 1\*q" +.B " Screen \*qMGA 2\*q RightOf \*qMGA 1\*q" +.B " InputDevice \*qKeyboard 1\*q \*qCoreKeyboard\*q" +.B " InputDevice \*qMouse 1\*q \*qCorePointer\*q" +.B " InputDevice \*qMouse 2\*q \*qSendCoreEvents\*q" +.B " Option \*qBlankTime\*q \*q5\*q" +.B "EndSection" +.fi +.RE +.SH "DRI SECTION" +This optional section is used to provide some information for the +Direct Rendering Infrastructure. +Details about the format of this section can be found on-line at +.IR <http://dri.freedesktop.org/> . +.SH "VENDOR SECTION" +The optional +.B Vendor +section may be used to provide vendor\-specific configuration information. +Multiple +.B Vendor +sections may be present, and they may contain an +.B Identifier +entry and multiple +.B Option +flags. +The data therein is not used in this release. +.PP +.SH "SEE ALSO" +General: +.BR X (__miscmansuffix__), +.BR Xserver (__appmansuffix__), +.BR __xservername__ (__appmansuffix__), +.BR cvt (__appmansuffix__), +.BR gtf (__appmansuffix__). +.PP +.B "Not all modules or interfaces are available on all platforms." +.PP +Display drivers: +.BR apm (__drivermansuffix__), +.BR ati (__drivermansuffix__), +.BR chips (__drivermansuffix__), +.BR cirrus (__drivermansuffix__), +.BR cyrix (__drivermansuffix__), +.BR fbdev (__drivermansuffix__), +.BR glide (__drivermansuffix__), +.BR glint (__drivermansuffix__), +.BR i128 (__drivermansuffix__), +.BR i740 (__drivermansuffix__), +.BR imstt (__drivermansuffix__), +.BR intel (__drivermansuffix__), +.BR mga (__drivermansuffix__), +.BR neomagic (__drivermansuffix__), +.BR nv (__drivermansuffix__), +.BR openchrome (__drivermansuffix__), +.BR r128 (__drivermansuffix__), +.BR radeon (__drivermansuffix__), +.BR rendition (__drivermansuffix__), +.BR savage (__drivermansuffix__), +.BR s3virge (__drivermansuffix__), +.BR siliconmotion (__drivermansuffix__), +.BR sis (__drivermansuffix__), +.BR sisusb (__drivermansuffix__), +.BR sunbw2 (__drivermansuffix__), +.BR suncg14 (__drivermansuffix__), +.BR suncg3 (__drivermansuffix__), +.BR suncg6 (__drivermansuffix__), +.BR sunffb (__drivermansuffix__), +.BR sunleo (__drivermansuffix__), +.BR suntcx (__drivermansuffix__), +.BR tdfx (__drivermansuffix__), +.\" .BR tga (__drivermansuffix__), +.BR trident (__drivermansuffix__), +.BR tseng (__drivermansuffix__), +.BR vesa (__drivermansuffix__), +.BR vmware (__drivermansuffix__), +.BR voodoo (__drivermansuffix__), +.BR wsfb (__drivermansuffix__), +.BR xgi (__drivermansuffix__), +.BR xgixp (__drivermansuffix__). +.PP +Input drivers: +.BR acecad (__drivermansuffix__), +.BR citron (__drivermansuffix__), +.BR elographics (__drivermansuffix__), +.BR evdev (__drivermansuffix__), +.BR fpit (__drivermansuffix__), +.BR joystick (__drivermansuffix__), +.BR kbd (__drivermansuffix__), +.BR mousedrv (__drivermansuffix__), +.BR mutouch (__drivermansuffix__), +.BR penmount (__drivermansuffix__), +.BR synaptics (__drivermansuffix__), +.BR vmmouse (__drivermansuffix__), +.BR void (__drivermansuffix__), +.BR wacom (__drivermansuffix__). +.PP +Other modules and interfaces: +.BR exa (__drivermansuffix__), +.BR fbdevhw (__drivermansuffix__), +.\" .BR shadowfb (__drivermansuffix__), +.BR v4l (__drivermansuffix__). +.br +.SH AUTHORS +This manual page was largely rewritten by David Dawes +.IR <dawes@xfree86.org> . diff --git a/hw/xfree86/doc/sgml/DESIGN.xml b/hw/xfree86/doc/sgml/DESIGN.xml new file mode 100644 index 0000000..08f8bc8 --- /dev/null +++ b/hw/xfree86/doc/sgml/DESIGN.xml @@ -0,0 +1,9394 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs; + <!-- config file keyword markup --> + <!-- specific config file keywords --> + <!ENTITY k.device "<emphasis>Device</emphasis>"> + <!ENTITY k.monitor "<emphasis>Monitor</emphasis>"> + <!ENTITY k.display "<emphasis>Display</emphasis>"> + <!ENTITY k.inputdevice "<emphasis>InputDevice</emphasis>"> + <!ENTITY k.screen "<emphasis>Screen</emphasis>"> + <!ENTITY k.serverlayout "<emphasis>ServerLayout</emphasis>"> + <!ENTITY k.driver "<emphasis>Driver</emphasis>"> + <!ENTITY k.module "<emphasis>Module</emphasis>"> + <!ENTITY k.identifier "<emphasis>Identifier</emphasis>"> + <!ENTITY k.serverflags "<emphasis>ServerFlags</emphasis>"> +] > + +<article> + <articleinfo> + + <title>XFree86 DDX Design (Xorg server version &xserver.version;)</title> + + <authorgroup> + <corpauthor><ulink url="http://www.xfree86.org/"> + The XFree86 Project, Inc.</ulink></corpauthor> + <corpauthor><ulink url="http://www.x.org/"> + The X.Org Foundation, Inc.</ulink></corpauthor> + + <othercredit> + <firstname>Jim</firstname><surname>Gettys</surname> + <contrib>Updates for X11R6.7</contrib> + </othercredit> + </authorgroup> + + <pubdate>&xserver.reldate;</pubdate> + <releaseinfo>Xorg server version &xserver.version;</releaseinfo> + + </articleinfo> + + <note><para> +This document describes software undergoing continual evolution, and +the interfaces described here are subject to change without notice. +This document is intended to cover the interfaces as found in the +xorg-server-&xserver.version; release, but is probably not completely +in sync with the code base. + </para></note> + + + <sect1> + <title>Preface</title> + + <para> +This document was originally the design spec for the DDX layer of the +XFree86 4.0 X server. The X.Org Foundation adopted the XFree86 4.4rc2 +version of that server as the basis of the Xorg server project, and has +evolved the XFree86 DDX layer greatly since forking. This document thus +covers only the current implementation of the XFree86 DDX as found in the +Xorg server &xserver.version; release, and no longer matches the XFree86 +server itself. + </para> + + <para> +The XFree86 Project's broad design principles for XFree86 4.0 were: + <itemizedlist> + <listitem><para>keep it reasonable + <itemizedlist> + <listitem><para>We cannot rewrite the complete server + </para></listitem> + <listitem><para>We don't want to re-invent the wheel + </para></listitem> + </itemizedlist></para></listitem> + <listitem><para>keep it modular + <itemizedlist> + <listitem><para>As many things as possible should go into modules + </para></listitem> + <listitem><para>The basic loader binary should be minimal + </para></listitem> + <listitem><para>A clean design with well defined layering is + important</para></listitem> + <listitem><para>DDX specific global variables are a nono + </para></listitem> + <listitem><para>The structure should be flexible enough to allow + future extensions</para></listitem> + <listitem><para>The structure should minimize duplication of + common code</para></listitem> + </itemizedlist></para></listitem> + <listitem><para>keep important features in mind + <itemizedlist> + <listitem><para>multiple screens, including multiple instances + of drivers</para></listitem> + <listitem><para>mixing different color depths and visuals on + different and ideally even on the same screen + </para></listitem> + <listitem><para>better control of the PCI device used + </para></listitem> + <listitem><para>better config file parser</para></listitem> + <listitem><para>get rid of all VGA compatibility assumptions + </para></listitem> + </itemizedlist></para></listitem> + </itemizedlist> + </para> + + <para> +While the XFree86 project had a goal of avoiding changes to the DIX +layer unless they found major deficiencies there, to avoid divergence from +the X.Org sample implementation they were integrating changes from, the +X.Org developers now maintain both sides, and make changes where they are +most appropriate. This document concentrates on the XFree86 DDX layer used +in the Xorg server itself (the code found in <filename>hw/xfree86</filename> +in the source tree), and developers will also want to refer to the +<filename>Xserver-spec</filename> documentation that covers the DIX layer +routines common to all the X servers in the sample implementation. + </para> + </sect1> + + <sect1> + <title>The xorg.conf File</title> + + <para> +The xorg.conf file format is based on the XF86Config format from XFree86 4.4, +which is in turn similar to the old XFree86 3.x XF86Config format, with the +following changes: + </para> + + <sect2> + <title>&k.device; section</title> + + <para> + The &k.device; sections are similar to what they used to be, and + describe hardware-specific information for a single video card. + &k.device; + Some new keywords are added: + + + <variablelist> + <varlistentry><term>Driver "drivername"</term> + <listitem><para> + Specifies the name of the driver to be used for the card. This + is mandatory. + </para></listitem></varlistentry> + <varlistentry><term>BusID "busslot"</term> + <listitem><para> + Specifies uniquely the location of the card on the bus. The + purpose is to identify particular cards in a multi-headed + configuration. The format of the argument is intentionally + vague, and may be architecture dependent. For a PCI bus, it + is something like "bus:slot:func". + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + A &k.device; section is considered <quote>active</quote> if there is a reference + to it in an active &k.screen; section. + </para> + </sect2> + + <sect2> + <title>&k.screen; section</title> + + <para> + The &k.screen; sections are similar to what they used to be. They + no longer have a &k.driver; keyword, but an &k.identifier; keyword + is added. (The &k.driver; keyword may be accepted in place of the + &k.identifier; keyword for compatibility purposes.) The identifier + can be used to identify which screen is to be active when multiple + &k.screen; sections are present. It is possible to specify the active + screen from the command line. A default is chosen in the absence + of one being specified. A &k.screen; section is considered <quote>active</quote> + if there is a reference to it either from the command line, or from + an active &k.serverlayout; section. + </para> + </sect2> + + <sect2> + <title>&k.inputdevice; section</title> + + <para> + The &k.inputdevice; section is a new section that describes + configuration information for input devices. It replaces the old + <emphasis>Keyboard</emphasis>, <emphasis>Pointer</emphasis> and <emphasis>XInput</emphasis> + sections. Like the &k.device; section, it has two mandatory keywords: + &k.identifier; and &k.driver;. For compatibility purposes the old + <emphasis>Keyboard</emphasis> and <emphasis>Pointer</emphasis> sections are + converted by the parser into &k.inputdevice; sections as follows: + + <variablelist> + <varlistentry><term><emphasis>Keyboard</emphasis></term> + <listitem><literallayout> + &k.identifier; "Implicit Core Keyboard" + &k.driver; "keyboard" + </literallayout></listitem></varlistentry> + <varlistentry><term><emphasis>Pointer</emphasis></term> + <listitem><literallayout> + &k.identifier; "Implicit Core Pointer" + &k.driver; "mouse" + </literallayout></listitem></varlistentry> + </variablelist> + </para> + + <para> + An &k.inputdevice; section is considered active if there is a + reference to it in an active &k.serverlayout; section. An + &k.inputdevice; section may also be referenced implicitly if there + is no &k.serverlayout; section, if the <option>-screen</option> command + line options is used, or if the &k.serverlayout; section doesn't + reference any &k.inputdevice; sections. In this case, the first + sections with drivers "keyboard" and "mouse" are used as the core + keyboard and pointer respectively. + </para> + </sect2> + + <sect2> + <title>&k.serverlayout; section</title> + + <para> + The &k.serverlayout; section is a new section that is used to identify + which &k.screen; sections are to be used in a multi-headed configuration, + and the relative layout of those screens. It also identifies which + &k.inputdevice; sections are to be used. Each &k.serverlayout; section + has an identifier, a list of &k.screen; section identifiers, and a list of + &k.inputdevice; section identifiers. &k.serverflags; options may also be + included in a &k.serverlayout; section, making it possible to override + the global values in the &k.serverflags; section. + </para> + + <para> + A &k.serverlayout; section can be made active by being referenced on + the command line. In the absence of this, a default will be chosen + (the first one found). The screen names may optionally be followed + by a number specifying the preferred screen number, and optionally + by information specifying the physical positioning of the screen, + either in absolute terms or relative to another screen (or screens). + When no screen number is specified, they are numbered according to + the order in which they are listed. The old (now obsolete) method + of providing the positioning information is to give the names of + the four adjacent screens. The order of these is top, bottom, left, + right. Here is an example of a &k.serverlayout; section for two + screens using the old method, with the second located to the right + of the first: + + <programlisting> + Section "ServerLayout" + Identifier "Main Layout" + Screen 0 "Screen 1" "" "" "" "Screen 2" + Screen 1 "Screen 2" + Screen "Screen 3" + EndSection + </programlisting> + </para> + + <para> + The preferred way of specifying the layout is to explicitly specify + the screen's location in absolute terms or relative to another + screen. + </para> + + <para> + In the absolute case, the upper left corner's coordinates are given + after the <emphasis>Absolute</emphasis> keyword. If the coordinates are + omitted, a value of <code>(0,0)</code> is assumed. An example + of absolute positioning follows: + + <programlisting> + Section "ServerLayout" + Identifier "Main Layout" + Screen 0 "Screen 1" Absolute 0 0 + Screen 1 "Screen 2" Absolute 1024 0 + Screen "Screen 3" Absolute 2048 0 + EndSection + </programlisting> + </para> + + <para> + In the relative case, the position is specified by either using one of + the following keywords followed by the name of the reference screen: + + <simplelist type='vert' columns='1'> + <member><emphasis>RightOf</emphasis></member> + <member><emphasis>LeftOf</emphasis></member> + <member><emphasis>Above</emphasis></member> + <member><emphasis>Below</emphasis></member> + <member><emphasis>Relative</emphasis></member> + </simplelist> + </para> + + <para> + When the <emphasis>Relative</emphasis> keyword is used, the reference screen + name is followed by the coordinates of the new screen's origin + relative to reference screen. The following example shows how to use + some of the relative positioning options. + + <programlisting> + Section "ServerLayout" + Identifier "Main Layout" + Screen 0 "Screen 1" + Screen 1 "Screen 2" RightOf "Screen 1" + Screen "Screen 3" Relative "Screen 1" 2048 0 + EndSection + </programlisting> + </para> + </sect2> + + <sect2> + <title>Options</title> + + <para> + Options are used more extensively. They may appear in most sections + now. Options related to drivers can be present in the &k.screen;, + &k.device; and &k.monitor; sections and the &k.display; subsections. + The order of precedence is &k.display;, &k.screen;, &k.monitor;, + &k.device;. Options have been extended to allow an optional value + to be specified in addition to the option name. For more details + about options, see the <link linkend="options">Options</link> section + for details. + </para> + </sect2> + </sect1> + + <sect1> + <title>Driver Interface</title> + + <para> +The driver interface consists of a minimal set of entry points that are +required based on the external events that the driver must react to. +No non-essential structure is imposed on the way they are used beyond +that. This is a significant difference compared with the old design. + </para> + + <para> +The entry points for drawing operations are already taken care of by +the framebuffer code (including, XAA). Extensions and enhancements to +framebuffer code are outside the scope of this document. + </para> + + <para> +This approach to the driver interface provides good flexibility, but does +increase the complexity of drivers. To help address this, the XFree86 +common layer provides a set of <quote>helper</quote> functions to take care of things +that most drivers need. These helpers help minimise the amount of code +duplication between drivers. The use of helper functions by drivers is +however optional, though encouraged. The basic philosophy behind the +helper functions is that they should be useful to many drivers, that +they should balance this against the complexity of their interface. It +is inevitable that some drivers may find some helpers unsuitable and +need to provide their own code. + </para> + + <para> +Events that a driver needs to react to are: + + <variablelist> + <varlistentry><term>ScreenInit</term> + + <listitem><para> + An initialisation function is called from the DIX layer for each + screen at the start of each server generation. + </para></listitem></varlistentry> + + <varlistentry><term>Enter VT</term> + + <listitem><para> + The server takes control of the console. + </para></listitem></varlistentry> + + <varlistentry><term>Leave VT</term> + + <listitem><para> + The server releases control of the console. + </para></listitem></varlistentry> + + <varlistentry><term>Mode Switch</term> + + <listitem><para> + Change video mode. + </para></listitem></varlistentry> + + <varlistentry><term>ViewPort change</term> + + <listitem><para> + Change the origin of the physical view port. + </para></listitem></varlistentry> + + <varlistentry><term>ScreenSaver state change</term> + + <listitem><para> + Screen saver activation/deactivation. + </para></listitem></varlistentry> + + <varlistentry><term>CloseScreen</term> + + <listitem><para> + A close screen function is called from the DIX layer for each screen + at the end of each server generation. + </para></listitem></varlistentry> + </variablelist> + </para> + + + <para> +In addition to these events, the following functions are required by +the XFree86 common layer: + + <variablelist> + <varlistentry><term>Identify</term> + + <listitem><para> + Print a driver identifying message. + </para></listitem></varlistentry> + + <varlistentry><term>Probe</term> + + <listitem><para> + This is how a driver identifies if there is any hardware present that + it knows how to drive. + </para></listitem></varlistentry> + + <varlistentry><term>PreInit</term> + + <listitem><para> + Process information from the xorg.conf file, determine the + full characteristics of the hardware, and determine if a valid + configuration is present. + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> +The VidMode extension also requires: + + <variablelist> + <varlistentry><term>ValidMode</term> + + <listitem><para> + Identify if a new mode is usable with the current configuration. + The PreInit function (and/or helpers it calls) may also make use + of the ValidMode function or something similar. + </para></listitem></varlistentry> + </variablelist> + </para> + + + <para> +Other extensions may require other entry points. The drivers will +inform the common layer of these in such cases. + </para> + </sect1> + + <sect1> + <title>Resource Access Control Introduction</title> + + <para> +Graphics devices are accessed through ranges in I/O or memory space. +While most modern graphics devices allow relocation of such ranges many +of them still require the use of well established interfaces such as +VGA memory and IO ranges or 8514/A IO ranges. With modern buses (like +PCI) it is possible for multiple video devices to share access to these +resources. The RAC (Resource Access Control) subsystem provides a +mechanism for this. + </para> + + <sect2> + <title>Terms and Definitions</title> + + <sect3> + <title>Bus</title> + + <para> + <quote>Bus</quote> is ambiguous as it is used for different things: it may refer + to physical incompatible extension connectors in a computer system. + The RAC system knows two such systems: The ISA bus and the PCI bus. + (On the software level EISA, MCA and VL buses are currently treated + like ISA buses). <quote>Bus</quote> may also refer to logically different + entities on a single bus system which are connected via bridges. A + PCI system may have several distinct PCI buses connecting each other + by PCI-PCI bridges or to the host CPU by HOST-PCI bridges. + </para> + + <para> + Systems that host more than one bus system link these together using + bridges. Bridges are a concern to RAC as they might block or pass + specific resources. PCI-PCI bridges may be set up to pass VGA + resources to the secondary bus. PCI-ISA buses pass any resources not + decoded on the primary PCI bus to the ISA bus. This way VGA resources + (although exclusive on the ISA bus) can be shared by ISA and PCI + cards. Currently HOST-PCI bridges are not yet handled by RAC as they + require specific drivers. + </para> + </sect3> + + <sect3> + <title>Entity</title> + + <para> + The smallest independently addressable unit on a system bus is + referred to as an entity. So far we know ISA and PCI entities. PCI + entities can be located on the PCI bus by an unique ID consisting of + the bus, card and function number. + </para> + </sect3> + + <sect3> + <title>Resource</title> + + <para> + <quote>Resource</quote> refers to a range of memory or I/O addresses an entity + can decode. + </para> + + <para> + If a device is capable of disabling this decoding the resource is + called sharable. For PCI devices a generic method is provided to + control resource decoding. Other devices will have to provide a + device specific function to control decoding. + </para> + + <para> + If the entity is capable of decoding this range at a different + location this resource is considered relocatable. + </para> + + <para> + Resources which start at a specific address and occupy a single + continuous range are called block resources. + </para> + + <para> + Alternatively resource addresses can be decoded in a way that they + satisfy the conditions: + <programlisting> + address & mask == base + </programlisting> + and + <programlisting> + base & mask == base + </programlisting> + Resources addressed in such a way are called sparse resources. + </para> + + </sect3> + + <sect3> + <title>Server States</title> + + <para> + The resource access control system knows two server states: the + SETUP and the OPERATING state. The SETUP state is entered whenever + a mode change takes place or the server exits or does VT switching. + During this state all entity resources are under resource access + control. During OPERATING state only those entities are controlled + which actually have shared resources that conflict with others. + </para> + </sect3> + </sect2> + </sect1> + + <sect1> + <title>Control Flow in the Server and Mandatory Driver Functions</title> + + <para> +At the start of each server generation, <function>main()</function> +(<filename>dix/main.c</filename>) calls the DDX function +<function>InitOutput()</function>. This is the first place that the DDX gets +control. <function>InitOutput()</function> is expected to fill in the global +<structname>screenInfo</structname> struct, and one +<structfield>screenInfo.screen[]</structfield> entry for each screen present. +Here is what <function>InitOutput()</function> does: + </para> + + <sect2> + <title>Parse the xorg.conf file</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + The xorg.conf file is read in full, and the resulting information + stored in data structures. None of the parsed information is + processed at this point. The parser data structures are opaque to + the video drivers and to most of the common layer code. + </para> + + <para> + The entire file is parsed first to remove any section ordering + requirements. + </para> + </sect2> + + + <sect2> + <title>Initial processing of parsed information and command line options + </title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + The initial processing is to determine paths like the + <emphasis>ModulePath</emphasis>, etc, and to determine which &k.serverlayout;, + &k.screen; and &k.device; sections are active. + </para> + </sect2> + + + <sect2> + <title>Enable port I/O access</title> + + <para> + Port I/O access is controlled from the XFree86 common layer, and is + <quote>all or nothing</quote>. It is enabled prior to calling driver probes, at + the start of subsequent server generations, and when VT switching + back to the Xserver. It is disabled at the end of server generations, + and when VT switching away from the Xserver. + </para> + + <para> + The implementation details of this may vary on different platforms. + </para> + </sect2> + + + <sect2> + <title>General bus probe</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + In the case of ix86 machines, this will be a general PCI probe. + The full information obtained here will be available to the drivers. + This information persists for the life of the Xserver. In the PCI + case, the PCI information for all video cards found is available by + calling <function>xf86GetPciVideoInfo()</function>. + </para> + + <blockquote><para> + <programlisting> + pciVideoPtr *xf86GetPciVideoInfo(void); + </programlisting> + <blockquote><para> + returns a pointer to a list of pointers to + <structname>pciVideoRec</structname> entries, of which there is one for + each detected PCI video card. The list is terminated with a + <constant>NULL</constant> pointer. If no PCI video cards were + detected, the return value is <constant>NULL</constant>. + + </para></blockquote> + </para></blockquote> + + <para> + After the bus probe, the resource broker is initialised. + </para> + </sect2> + + + <sect2> + <title>Load initial set of modules</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + The core server contains a list of mandatory modules. These are loaded + first. Currently the only module on this list is the bitmap font module. + </para> + + <para> + The next set of modules loaded are those specified explicitly in the + &k.module; section of the config file. + </para> + + <para> + The final set of initial modules are the driver modules referenced + by the active &k.device; and &k.inputdevice; sections in the config + file. Each of these modules is loaded exactly once. + </para> + </sect2> + + + <sect2> + <title>Register Video and Input Drivers</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + When a driver module is loaded, the loader calls its + <function>Setup</function> function. For video drivers, this function + calls <function>xf86AddDriver()</function> to register the driver's + <structname>DriverRec</structname>, which contains a small set of essential + details and driver entry points required during the early phase of + <function>InitOutput()</function>. <function>xf86AddDriver()</function> + adds it to the global <varname>xf86DriverList[]</varname> array. + </para> + + <para> + The <structname>DriverRec</structname> contains the driver canonical name, + the <function>Identify()</function>, + <function>Probe()</function> and <function>AvailableOptions()</function> + function entry points as well as a pointer + to the driver's module (as returned from the loader when the driver + was loaded) and a reference count which keeps track of how many + screens are using the driver. The entry driver entry points are + those required prior to the driver allocating and filling in its + <structname>ScrnInfoRec</structname>. + </para> + + <para> + For a static server, the <varname>xf86DriverList[]</varname> array is + initialised at build time, and the loading of modules is not done. + </para> + + <para> + A similar procedure is used for input drivers. The input driver's + <function>Setup</function> function calls + <function>xf86AddInputDriver()</function> to register the driver's + <structname>InputDriverRec</structname>, which contains a small set of + essential details and driver entry points required during the early + phase of <function>InitInput()</function>. + <function>xf86AddInputDriver()</function> adds it to the global + <varname>xf86InputDriverList[]</varname> array. For a static server, + the <varname>xf86InputDriverList[]</varname> array is initialised at + build time. + </para> + + <para> + Both the <varname>xf86DriverList[]</varname> and + <varname>xf86InputDriverList[]</varname> arrays have been initialised + by the end of this stage. + </para> + + <para> + Once all the drivers are registered, their + <function>ChipIdentify()</function> functions are called. + </para> + + <blockquote><para> + <programlisting> + void ChipIdentify(int flags); + </programlisting> + <blockquote><para> + This is expected to print a message indicating the driver name, + a short summary of what it supports, and a list of the chipset + names that it supports. It may use the xf86PrintChipsets() helper + to do this. + </para></blockquote> + </para></blockquote> + + <blockquote><para> + <programlisting> + void xf86PrintChipsets(const char *drvname, const char *drvmsg, + SymTabPtr chips); + </programlisting> + <blockquote><para> + This function provides an easy way for a driver's ChipIdentify + function to format the identification message. + </para></blockquote> + </para></blockquote> + </sect2> + + <sect2> + <title>Initialise Access Control</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + The Resource Access Control (RAC) subsystem is initialised before + calling any driver functions that may access hardware. All generic + bus information is probed and saved (for restoration later). All + (shared resource) video devices are disabled at the generic bus + level, and a probe is done to find the <quote>primary</quote> video device. These + devices remain disabled for the next step. + </para> + </sect2> + + + <sect2 id="probe"> + <title>Video Driver Probe</title> + + <para> + This is done at the start of the first server generation only. The + <function>ChipProbe()</function> function of each registered video driver + is called. + </para> + + <blockquote><para> + <programlisting> + Bool ChipProbe(DriverPtr drv, int flags); + </programlisting> + <blockquote><para> + The purpose of this is to identify all instances of hardware + supported by the driver. The flags value is currently either 0, + <constant>PROBE_DEFAULT</constant> or <constant>PROBE_DETECT</constant>. + <constant>PROBE_DETECT</constant> is used if "-configure" or "-probe" + command line arguments are given and indicates to the + <function>Probe()</function> function that it should not configure the + bus entities and that no xorg.conf information is available. + </para> + + <para> + The probe must find the active device sections that match the + driver by calling <function>xf86MatchDevice()</function>. The number + of matches found limits the maximum number of instances for this + driver. If no matches are found, the function should return + <constant>FALSE</constant> immediately. + </para> + + <para> + Devices that cannot be identified by using device-independent + methods should be probed at this stage (keeping in mind that access + to all resources that can be disabled in a device-independent way + are disabled during this phase). The probe must be a minimal + probe. It should just determine if there is a card present that + the driver can drive. It should use the least intrusive probe + methods possible. It must not do anything that is not essential, + like probing for other details such as the amount of memory + installed, etc. It is recommended that the + <function>xf86MatchPciInstances()</function> helper function be used + for identifying matching PCI devices, and similarly the + <function>xf86MatchIsaInstances()</function> for ISA (non-PCI) devices + (see the <link linkend="rac">RAC</link> section). These helpers also + checks and claims the appropriate entity. When not using the + helper, that should be done with <function>xf86CheckPciSlot()</function> + and <function>xf86ClaimPciSlot()</function> for PCI devices and + <function>xf86ClaimIsaSlot()</function> for ISA devices (see the + <link linkend="rac">RAC</link> section). + </para> + + <para> + The probe must register all non-relocatable resources at this + stage. If a resource conflict is found between exclusive resources + the driver will fail immediately. This is usually best done with + the <function>xf86ConfigPciEntity()</function> helper function + for PCI and <function>xf86ConfigIsaEntity()</function> for ISA + (see the <link linkend="rac">RAC</link> section). It is possible to + register some entity specific functions with those helpers. When + not using the helpers, the <function>xf86AddEntityToScreen()</function> + <function>xf86ClaimFixedResources()</function> and + <function>xf86SetEntityFuncs()</function> should be used instead (see + the <link linkend="rac">RAC</link> section). + </para> + + <para> + If a chipset is specified in an active device section which the + driver considers relevant (ie it has no driver specified, or the + driver specified matches the driver doing the probe), the Probe + must return <constant>FALSE</constant> if the chipset doesn't match + one supported by the driver. + </para> + + <para> + If there are no active device sections that the driver considers + relevant, it must return <constant>FALSE</constant>. + </para> + + <para> + Allocate a <structname>ScrnInfoRec</structname> for each active instance of the + hardware found, and fill in the basic information, including the + other driver entry points. This is best done with the + <function>xf86ConfigIsaEntity()</function> helper function for ISA + instances or <function>xf86ConfigPciEntity()</function> for PCI instances. + These functions allocate a <structname>ScrnInfoRec</structname> for active + entities. Optionally <function>xf86AllocateScreen()</function> + function may also be used to allocate the <structname>ScrnInfoRec</structname>. + Any of these functions take care of initialising fields to defined + <quote>unused</quote> values. + </para> + + <para> + Claim the entities for each instance of the hardware found. This + prevents other drivers from claiming the same hardware. + </para> + + <para> + Must leave hardware in the same state it found it in, and must not + do any hardware initialisation. + </para> + + <para> + All detection can be overridden via the config file, and that + parsed information is available to the driver at this stage. + </para> + + <para> + Returns <constant>TRUE</constant> if one or more instances are found, + and <constant>FALSE</constant> otherwise. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int xf86MatchDevice(const char *drivername, + GDevPtr **driversectlist) + </programlisting> + <blockquote><para> + This function takes the name of the driver and returns via + <parameter>driversectlist</parameter> a list of device sections that + match the driver name. The function return value is the number + of matches found. If a fatal error is encountered the return + value is <literal>-1</literal>. + </para> + + <para> + The caller should use <function>xfree()</function> to free + <parameter>*driversectlist</parameter> when it is no longer needed. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags) + </programlisting> + <blockquote><para> + This function allocates a new <structname>ScrnInfoRec</structname> in the + <varname>xf86Screens[]</varname> array. This function is normally + called by the video driver <function>ChipProbe()</function> functions. + The return value is a pointer to the newly allocated + <structname>ScrnInfoRec</structname>. The <structfield>scrnIndex</structfield>, + <structfield>origIndex</structfield>, <structfield>module</structfield> and + <structfield>drv</structfield> fields are initialised. The reference count + in <parameter>drv</parameter> is incremented. The storage for any + currently allocated <quote>privates</quote> pointers is also allocated and + the <structfield>privates</structfield> field initialised (the privates data + is of course not allocated or initialised). This function never + returns on failure. If the allocation fails, the server exits + with a fatal error. The flags value is not currently used, and + should be set to zero. + </para></blockquote> + </para></blockquote> + + <para> + At the completion of this, a list of <structname>ScrnInfoRecs</structname> + have been allocated in the <varname>xf86Screens[]</varname> array, and + the associated entities and fixed resources have been claimed. The + following <structname>ScrnInfoRec</structname> fields must be initialised at + this point: + + <literallayout> + driverVersion + driverName + scrnIndex(*) + origIndex(*) + drv(*) + module(*) + name + Probe + PreInit + ScreenInit + EnterVT + LeaveVT + numEntities + entityList + access + </literallayout> + + <literal>(*)</literal> These are initialised when the <structname>ScrnInfoRec</structname> + is allocated, and not explicitly by the driver. + </para> + + <para> + The following <structname>ScrnInfoRec</structname> fields must be initialised + if the driver is going to use them: + + <literallayout> + SwitchMode + AdjustFrame + FreeScreen + ValidMode + </literallayout> + </para> + </sect2> + + <sect2> + <title>Matching Screens</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + After the Probe phase is finished, there will be some number of + <structname>ScrnInfoRec</structname>s. These are then matched with the active + &k.screen; sections in the xorg.conf, and those not having an active + &k.screen; section are deleted. If the number of remaining screens + is 0, <function>InitOutput()</function> sets + <structfield>screenInfo.numScreens</structfield> to <constant>0</constant> and + returns. + </para> + + <para> + At this point the following fields of the <structname>ScrnInfoRec</structname>s + must be initialised: + + <literallayout> + confScreen + </literallayout> + </para> + + </sect2> + + <sect2> + <title>Allocate non-conflicting resources</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + Before calling the drivers again, the resource information collected + from the Probe phase is processed. This includes checking the extent + of PCI resources for the probed devices, and resolving any conflicts + in the relocatable PCI resources. It also reports conflicts, checks + bus routing issues, and anything else that is needed to enable the + entities for the next phase. + </para> + + <para> + If any drivers registered an <function>EntityInit()</function> function + during the Probe phase, then they are called here. + </para> + + </sect2> + + <sect2> + <title>Sort the Screens and pre-check Monitor Information</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + The list of screens is sorted to match the ordering requested in the + config file. + </para> + + <para> + The list of modes for each active monitor is checked against the + monitor's parameters. Invalid modes are pruned. + </para> + + </sect2> + + <sect2> + <title>PreInit</title> + + <para> + This is done at the start of the first server generation only. + </para> + + <para> + For each <structname>ScrnInfoRec</structname>, enable access to the screens entities and call + the <function>ChipPreInit()</function> function. + </para> + + <blockquote><para> + <programlisting> + Bool ChipPreInit(ScrnInfoRec screen, int flags); + </programlisting> + <blockquote><para> + The purpose of this function is to find out all the information + required to determine if the configuration is usable, and to + initialise those parts of the <structname>ScrnInfoRec</structname> that + can be set once at the beginning of the first server generation. + </para> + + <para> + The number of entities registered for the screen should be checked + against the expected number (most drivers expect only one). The + entity information for each of them should be retrieved (with + <function>xf86GetEntityInfo()</function>) and checked for the correct + bus type and that none of the sharable resources registered during + the Probe phase was rejected. + </para> + + <para> + Access to resources for the entities that can be controlled in a + device-independent way are enabled before this function is called. + If the driver needs to access any resources that it has disabled + in an <function>EntityInit()</function> function that it registered, + then it may enable them here providing that it disables them before + this function returns. + </para> + + <para> + This includes probing for video memory, clocks, ramdac, and all + other HW info that is needed. It includes determining the + depth/bpp/visual and related info. It includes validating and + determining the set of video modes that will be used (and anything + that is required to determine that). + </para> + + <para> + This information should be determined in the least intrusive way + possible. The state of the HW must remain unchanged by this + function. Although video memory (including MMIO) may be mapped + within this function, it must be unmapped before returning. Driver + specific information should be stored in a structure hooked into + the <structname>ScrnInfoRec</structname>'s <structfield>driverPrivate</structfield> + field. Any other modules which require persistent data (ie data + that persists across server generations) should be initialised in + this function, and they should allocate a <quote>privates</quote> index to + hook their data into by calling + <function>xf86AllocateScrnInfoPrivateIndex()</function>. The <quote>privates</quote> + data is persistent. + </para> + + <para> + Helper functions for some of these things are provided at the + XFree86 common level, and the driver can choose to make use of + them. + </para> + + <para> + All additional resources that the screen needs must be registered + here. This should be done with + <function>xf86RegisterResources()</function>. If some of the fixed + resources registered in the Probe phase are not needed or not + decoded by the hardware when in the OPERATING server state, their + status should be updated with + <function>xf86SetOperatingState()</function>. + </para> + + <para> + Modules may be loaded at any point in this function, and all + modules that the driver will need must be loaded before the end + of this function. Either the <function>xf86LoadSubModule()</function> + or the <function>xf86LoadDrvSubModule()</function> function should be + used to load modules depending on whether a + <structname>ScrnInfoRec</structname> has been set up. A driver may unload + a module within this function if it was only needed temporarily, + and the <function>xf86UnloadSubModule()</function> function should be used + to do that. Otherwise there is no need to explicitly unload modules + because the loader takes care of module dependencies and will + unload submodules automatically if/when the driver module is + unloaded. + </para> + + <para> + The bulk of the <structname>ScrnInfoRec</structname> fields should be filled + out in this function. + </para> + + <para> + <function>ChipPreInit()</function> returns <constant>FALSE</constant> when + the configuration is unusable in some way (unsupported depth, no + valid modes, not enough video memory, etc), and <constant>TRUE</constant> + if it is usable. + </para> + + <para> + It is expected that if the <function>ChipPreInit()</function> function + returns <constant>TRUE</constant>, then the only reasons that subsequent + stages in the driver might fail are lack or resources (like xalloc + failures). All other possible reasons for failure should be + determined by the <function>ChipPreInit()</function> function. + </para></blockquote> + </para></blockquote> + + <para> + The <structname>ScrnInfoRec</structname>s for screens where the <function>ChipPreInit()</function> fails are removed. + If none remain, <function>InitOutput()</function> sets <structfield>screenInfo.numScreens</structfield> to <constant>0</constant> and returns. + </para> + + <para> + At this point, further fields of the <structname>ScrnInfoRec</structname>s would normally be + filled in. Most are not strictly mandatory, but many are required + by other layers and/or helper functions that the driver may choose + to use. The documentation for those layers and helper functions + indicates which they require. + </para> + + <para> + The following fields of the <structname>ScrnInfoRec</structname>s should be filled in if the + driver is going to use them: + + <literallayout> + monitor + display + depth + pixmapBPP + bitsPerPixel + weight (>8bpp only) + mask (>8bpp only) + offset (>8bpp only) + rgbBits (8bpp only) + gamma + defaultVisual + maxHValue + maxVValue + virtualX + virtualY + displayWidth + frameX0 + frameY0 + frameX1 + frameY1 + zoomLocked + modePool + modes + currentMode + progClock (TRUE if clock is programmable) + chipset + ramdac + clockchip + numClocks (if not programmable) + clock[] (if not programmable) + videoRam + biosBase + memBase + memClk + driverPrivate + chipID + chipRev + </literallayout> + </para> + + <blockquote><para> + <programlisting> + pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); + and + pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name); + </programlisting> + <blockquote><para> + Load a module that a driver depends on. This function loads the + module <parameter>name</parameter> as a sub module of the driver. The + return value is a handle identifying the new module. If the load + fails, the return value will be <constant>NULL</constant>. If a driver + needs to explicitly unload a module it has loaded in this way, + the return value must be saved and passed to + <function>xf86UnloadSubModule()</function> when unloading. + + </para></blockquote> + </para></blockquote> + + <blockquote><para> + <programlisting> + void xf86UnloadSubModule(pointer module); + </programlisting> + <blockquote><para> + Unloads the module referenced by <parameter>module</parameter>. + <parameter>module</parameter> should be a pointer returned previously + by <function>xf86LoadSubModule()</function> or + <function>xf86LoadDrvSubModule()</function> . + + </para></blockquote> + </para></blockquote> + </sect2> + + <sect2> + <title>Cleaning up Unused Drivers</title> + + <para> + At this point it is known which screens will be in use, and which + drivers are being used. Unreferenced drivers (and modules they + may have loaded) are unloaded here. + </para> + + </sect2> + + <sect2> + <title>Consistency Checks</title> + + <para> + The parameters that must be global to the server, like pixmap formats, + bitmap bit order, bitmap scanline unit and image byte order are + compared for each of the screens. If a mismatch is found, the server + exits with an appropriate message. + </para> + + </sect2> + + <sect2> + <title>Check if Resource Control is Needed</title> + + <para> + Determine if resource access control is needed. This is the case + if more than one screen is used. If necessary the RAC wrapper module + is loaded. + </para> + </sect2> + + <sect2> + <title>AddScreen (ScreenInit)</title> + + <para> + At this point, the valid screens are known. + <function>AddScreen()</function> is called for each of them, passing + <function>ChipScreenInit()</function> as the argument. + <function>AddScreen()</function> is a DIX function that allocates a new + <structfield>screenInfo.screen[]</structfield> entry (aka + <varname>pScreen</varname>), and does some basic initialisation of it. + It then calls the <function>ChipScreenInit()</function> function, with + <parameter>pScreen</parameter> as one of its arguments. If + <function>ChipScreenInit()</function> returns <constant>FALSE</constant>, + <function>AddScreen()</function> returns <constant>-1</constant>. Otherwise + it returns the index of the screen. <function>AddScreen()</function> + should only fail because of programming errors or failure to allocate + resources (like memory). All configuration problems should be + detected BEFORE this point. + </para> + + <blockquote><para> + <programlisting> + Bool ChipScreenInit(int index, ScreenPtr pScreen, + int argc, char **argv); + </programlisting> + <blockquote><para> + This is called at the start of each server generation. + </para> + + <para> + Fill in all of <parameter>pScreen</parameter>, possibly doing some of + this by calling ScreenInit functions from other layers like mi, + framebuffers (cfb, etc), and extensions. + </para> + + <para> + Decide which operations need to be placed under resource access + control. The classes of operations are the frame buffer operations + (<constant>RAC_FB</constant>), the pointer operations + (<constant>RAC_CURSOR</constant>), the viewport change operations + (<constant>RAC_VIEWPORT</constant>) and the colormap operations + (<constant>RAC_COLORMAP</constant>). Any operation that requires + resources which might be disabled during OPERATING state should + be set to use RAC. This can be specified separately for memory + and IO resources (the <structfield>racMemFlags</structfield> and + <structfield>racIoFlags</structfield> fields of the <structname>ScrnInfoRec</structname> + respectively). + </para> + + <para> + Map any video memory or other memory regions. + </para> + + <para> + Save the video card state. Enough state must be saved so that + the original state can later be restored. + </para> + + <para> + Initialise the initial video mode. The <structname>ScrnInfoRec</structname>'s + <structfield>vtSema</structfield> field should be set to <constant>TRUE</constant> + just prior to changing the video hardware's state. + + </para></blockquote> + </para></blockquote> + + + <para> + The <function>ChipScreenInit()</function> function (or functions from other + layers that it calls) should allocate entries in the + <structname>ScreenRec</structname>'s <structfield>devPrivates</structfield> area by + calling <function>AllocateScreenPrivateIndex()</function> if it needs + per-generation storage. Since the <structname>ScreenRec</structname>'s + <structfield>devPrivates</structfield> information is cleared for each server + generation, this is the correct place to initialise it. + </para> + + <para> + After <function>AddScreen()</function> has successfully returned, the + following <structname>ScrnInfoRec</structname> fields are initialised: + + <literallayout> + pScreen + racMemFlags + racIoFlags + </literallayout> + </para> + + <para> + The <function>ChipScreenInit()</function> function should initialise the + <structfield>CloseScreen</structfield> and <structfield>SaveScreen</structfield> fields + of <parameter>pScreen</parameter>. The old value of + <structfield>pScreen->CloseScreen</structfield> should be saved as part of + the driver's per-screen private data, allowing it to be called from + <function>ChipCloseScreen()</function>. This means that the existing + <function>CloseScreen()</function> function is wrapped. + </para> + </sect2> + + <sect2> + <title>Finalising RAC Initialisation</title> + + <para> + After all the <function>ChipScreenInit()</function> functions have been + called, each screen has registered its RAC requirements. This + information is used to determine which shared resources are requested + by more than one driver and set the access functions accordingly. + This is done following these rules: + + <orderedlist> + <listitem><para> + The sharable resources registered by each entity are compared. + If a resource is registered by more than one entity the entity + will be marked to indicate that it needs to share this resources + type (IO or MEM). + </para></listitem> + + <listitem><para> + A resource marked <quote>disabled</quote> during OPERATING state will be + ignored entirely. + </para></listitem> + + <listitem><para> + A resource marked <quote>unused</quote> will only conflict with an overlapping + resource of an other entity if the second is actually in use + during OPERATING state. + </para></listitem> + + <listitem><para> + If an <quote>unused</quote> resource was found to conflict but the entity + does not use any other resource of this type the entire resource + type will be disabled for that entity. + </para></listitem> + </orderedlist> + </para> + + </sect2> + + <sect2> + <title>Finishing InitOutput()</title> + + <para> + At this point <function>InitOutput()</function> is finished, and all the + screens have been setup in their initial video mode. + </para> + + </sect2> + + <sect2> + <title>Mode Switching</title> + + <para> + When a SwitchMode event is received, <function>ChipSwitchMode()</function> + is called (when it exists): + </para> + + <blockquote><para> + <programlisting> + Bool ChipSwitchMode(int index, DisplayModePtr mode, int flags); + </programlisting> + <blockquote><para> + Initialises the new mode for the screen identified by + <parameter>index;</parameter>. The viewport may need to be adjusted + also. + + </para></blockquote> + </para></blockquote> + + </sect2> + + <sect2> + <title>Changing Viewport</title> + + <para> + When a Change Viewport event is received, + <function>ChipAdjustFrame()</function> is called (when it exists): + </para> + + <blockquote><para> + <programlisting> + void ChipAdjustFrame(int index, int x, int y, int flags); + </programlisting> + <blockquote><para> + Changes the viewport for the screen identified by + <parameter>index;</parameter>. + </para> + + <para> + It should be noted that many chipsets impose restrictions on where the + viewport may be placed in the virtual resolution, either for alignment + reasons, or to prevent the start of the viewport from being positioned + within a pixel (as can happen in a 24bpp mode). After calculating the + value the chipset's panning registers need to be set to for non-DGA + modes, this function should recalculate the ScrnInfoRec's + <structfield>frameX0</structfield>, <structfield>frameY0</structfield>, <structfield>frameX1</structfield> + and <structfield>frameY1</structfield> fields to correspond to that value. If + this is not done, switching to another mode might cause the position + of a hardware cursor to change. + + </para></blockquote> + </para></blockquote> + + </sect2> + + <sect2> + <title>VT Switching</title> + + <para> + When a VT switch event is received, <function>xf86VTSwitch()</function> + is called. <function>xf86VTSwitch()</function> does the following: + + <variablelist> + <varlistentry><term>On ENTER:</term> + <listitem> + <itemizedlist> + <listitem><para> + enable port I/O access + </para></listitem> + + <listitem><para> + save and initialise the bus/resource state + </para></listitem> + + <listitem><para> + enter the SETUP server state + </para></listitem> + + <listitem><para> + calls <function>ChipEnterVT()</function> for each screen + </para></listitem> + + <listitem><para> + enter the OPERATING server state + </para></listitem> + + <listitem><para> + validate GCs + </para></listitem> + + <listitem><para> + Restore fb from saved pixmap for each screen + </para></listitem> + + <listitem><para> + Enable all input devices + </para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>On LEAVE:</term> + <listitem> + <itemizedlist> + <listitem><para> + Save fb to pixmap for each screen + </para></listitem> + + <listitem><para> + validate GCs + </para></listitem> + + <listitem><para> + enter the SETUP server state + </para></listitem> + + <listitem><para> + calls <function>ChipLeaveVT()</function> for each screen + </para></listitem> + + <listitem><para> + disable all input devices + </para></listitem> + + <listitem><para> + restore bus/resource state + </para></listitem> + + <listitem><para> + disables port I/O access + </para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + </variablelist> + </para> + + <blockquote><para> + <programlisting> + Bool ChipEnterVT(int index, int flags); + </programlisting> + <blockquote><para> + This function should initialise the current video mode and + initialise the viewport, turn on the HW cursor if appropriate, + etc. + </para> + + <para> + Should it re-save the video state before initialising the video + mode? + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void ChipLeaveVT(int index, int flags); + </programlisting> + <blockquote><para> + This function should restore the saved video state. If + appropriate it should also turn off the HW cursor, and invalidate + any pixmap/font caches. + </para> + + </blockquote></para></blockquote> + + <para> + Optionally, <function>ChipLeaveVT()</function> may also unmap memory + regions. If so, <function>ChipEnterVT()</function> will need to remap + them. Additionally, if an aperture used to access video memory is + unmapped and remapped in this fashion, <function>ChipEnterVT()</function> + will also need to notify the framebuffer layers of the aperture's new + location in virtual memory. This is done with a call to the screen's + <function>ModifyPixmapHeader()</function> function, as follows + </para> + + <blockquote><para> + <programlisting> + (*pScreen->ModifyPixmapHeader)(pScrn->ppix, + -1, -1, -1, -1, -1, NewApertureAddress); + </programlisting> + <blockquote><para> + where the <structfield>ppix</structfield> field in a ScrnInfoRec + points to the pixmap used by the screen's + <function>SaveRestoreImage()</function> function to hold the screen's + contents while switched out. + </para> + + </blockquote></para></blockquote> + + <para> + Other layers may wrap the <function>ChipEnterVT()</function> and + <function>ChipLeaveVT()</function> functions if they need to take some + action when these events are received. + </para> + </sect2> + + <sect2> + <title>End of server generation</title> + + <para> + At the end of each server generation, the DIX layer calls + <function>ChipCloseScreen()</function> for each screen: + </para> + + <blockquote><para> + <programlisting> + Bool ChipCloseScreen(int index, ScreenPtr pScreen); + </programlisting> + <blockquote><para> + This function should restore the saved video state and unmap the + memory regions. + </para> + + <para> + It should also free per-screen data structures allocated by the + driver. Note that the persistent data held in the + <structname>ScrnInfoRec</structname>'s <structfield>driverPrivate</structfield> field + should not be freed here because it is needed by subsequent server + generations. + </para> + + <para> + The <structname>ScrnInfoRec</structname>'s <structfield>vtSema</structfield> field + should be set to <constant>FALSE</constant> once the video HW state + has been restored. + </para> + + <para> + Before freeing the per-screen driver data the saved + <structfield>CloseScreen</structfield> value should be restored to + <structfield>pScreen->CloseScreen</structfield>, and that function should + be called after freeing the data. + + </para></blockquote> + </para></blockquote> + </sect2> + </sect1> + + <sect1> + <title>Optional Driver Functions</title> + + <para> +The functions outlined here can be called from the XFree86 common layer, +but their presence is optional. + </para> + + <sect2> + <title>Mode Validation</title> + + <para> + When a mode validation helper supplied by the XFree86-common layer is + being used, it can be useful to provide a function to check for hw + specific mode constraints: + </para> + + <blockquote><para> + <programlisting> + ModeStatus ChipValidMode(int index, DisplayModePtr mode, + Bool verbose, int flags); + </programlisting> + <blockquote><para> + Check the passed mode for hw-specific constraints, and return the + appropriate status value. + + </para></blockquote> + </para></blockquote> + + <para> +This function may also modify the effective timings and clock of the passed +mode. These have been stored in the mode's <structfield>Crtc*</structfield> and +<structfield>SynthClock</structfield> elements, and have already been adjusted for +interlacing, doublescanning, multiscanning and clock multipliers and dividers. +The function should not modify any other mode field, unless it wants to modify +the mode timings reported to the user by <function>xf86PrintModes()</function>. + </para> + + <para> +The function is called once for every mode in the xorg.conf Monitor section +assigned to the screen, with <parameter>flags</parameter> set to +<constant>MODECHECK_INITIAL</constant>. It is subsequently called for every mode +in the xorg.conf Display subsection assigned to the screen, with +<parameter>flags</parameter> set to <constant>MODECHECK_FINAL</constant>. In the second +case, the mode will have successfully passed all other tests. In addition, +the <structname>ScrnInfoRec</structname>'s <structfield>virtualX</structfield>, +<structfield>virtualY</structfield> and <structfield>displayWidth</structfield> fields will have been +set as if the mode to be validated were to be the last mode accepted. + </para> + + <para> +In effect, calls with MODECHECK_INITIAL are intended for checks that do not +depend on any mode other than the one being validated, while calls with +MODECHECK_FINAL are intended for checks that may involve more than one mode. + </para> + </sect2> + + <sect2> + <title>Free screen data</title> + + <para> + When a screen is deleted prior to the completion of the ScreenInit + phase the <function>ChipFreeScreen()</function> function is called when defined. + </para> + + <blockquote><para> + <programlisting> + void ChipFreeScreen(int scrnindex, int flags); + </programlisting> + <blockquote><para> + Free any driver-allocated data that may have been allocated up to + and including an unsuccessful <function>ChipScreenInit()</function> + call. This would predominantly be data allocated by + <function>ChipPreInit()</function> that persists across server + generations. It would include the <structfield>driverPrivate</structfield>, + and any <quote>privates</quote> entries that modules may have allocated. + + </para></blockquote> + </para></blockquote> + + </sect2> +</sect1> + + <sect1> + <title>Recommended driver functions</title> + + <para> +The functions outlined here are for internal use by the driver only. +They are entirely optional, and are never accessed directly from higher +layers. The sample function declarations shown here are just examples. +The interface (if any) used is up to the driver. + </para> + + <sect2> + <title>Save</title> + + <para> + Save the video state. This could be called from <function>ChipScreenInit()</function> and + (possibly) <function>ChipEnterVT()</function>. + </para> + + <blockquote><para> + <programlisting> + void ChipSave(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + Saves the current state. This will only be saving pre-server + states or states before returning to the server. There is only + one current saved state per screen and it is stored in private + storage in the screen. + + </para></blockquote> + </para></blockquote> + </sect2> + + <sect2> + <title>Restore</title> + + <para> + Restore the original video state. This could be called from the + <function>ChipLeaveVT()</function> and <function>ChipCloseScreen()</function> + functions. + </para> + + <blockquote><para> + <programlisting> + void ChipRestore(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + Restores the saved state from the private storage. Usually only + used for restoring text modes. + + </para></blockquote> + </para></blockquote> + + </sect2> + + <sect2> + <title>Initialise Mode</title> + + <para> + Initialise a video mode. This could be called from the + <function>ChipScreenInit()</function>, <function>ChipSwitchMode()</function> + and <function>ChipEnterVT()</function> functions. + </para> + + <blockquote><para> + <programlisting> + Bool ChipModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); + </programlisting> + <blockquote><para> + Programs the hardware for the given video mode. + + </para></blockquote> + </para></blockquote> + + </sect2> + </sect1> + + <sect1> + <title>Data and Data Structures</title> + + <sect2> + <title>Command line data</title> + + <para> +Command line options are typically global, and are stored in global +variables. These variables are read-only and are available to drivers +via a function call interface. Most of these command line values are +processed via helper functions to ensure that they are treated consistently +by all drivers. The other means of access is provided for cases where +the supplied helper functions might not be appropriate. + </para> + + <para> +Some of them are: + + <literallayout> + xf86Verbose verbosity level + xf86Bpp -bpp from the command line + xf86Depth -depth from the command line + xf86Weight -weight from the command line + xf86Gamma -{r,g,b,}gamma from the command line + xf86FlipPixels -flippixels from the command line + xf86ProbeOnly -probeonly from the command line + defaultColorVisualClass -cc from the command line + </literallayout> + </para> + + <para> +If we ever do allow for screen-specific command line options, we may +need to rethink this. + </para> + + <para> +These can be accessed in a read-only manner by drivers with the following +functions: + </para> + + <blockquote><para> + <programlisting> + int xf86GetVerbosity(); + </programlisting> + <blockquote><para> + Returns the value of <varname>xf86Verbose</varname>. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + int xf86GetDepth(); + </programlisting> + <blockquote><para> + Returns the <option>-depth</option> command line setting. If not + set on the command line, <constant>-1</constant> is returned. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + rgb xf86GetWeight(); + </programlisting> + <blockquote><para> + Returns the <option>-weight</option> command line setting. If not + set on the command line, <literal remap="tt">{0, 0, 0}</literal> is returned. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + Gamma xf86GetGamma(); + </programlisting> + <blockquote><para> + Returns the <option>-gamma</option> or <option>-rgamma</option>, + <option>-ggamma</option>, <option>-bgamma</option> command line settings. + If not set on the command line, <literal remap="tt">{0.0, 0.0, 0.0}</literal> + is returned. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86GetFlipPixels(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if <option>-flippixels</option> is + present on the command line, and <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + const char *xf86GetServerName(); + </programlisting> + <blockquote><para> + Returns the name of the X server from the command line. + </para></blockquote> + + </para></blockquote> + </sect2> + + <sect2> + <title>Data handling</title> + + <para> +Config file data contains parts that are global, and parts that are +Screen specific. All of it is parsed into data structures that neither +the drivers or most other parts of the server need to know about. + </para> + + <para> +The global data is typically not required by drivers, and as such, most +of it is stored in the private <structname>xf86InfoRec</structname>. + </para> + + <para> +The screen-specific data collected from the config file is stored in +screen, device, display, monitor-specific data structures that are separate +from the <varname>ScrnInfoRecs</varname>, with the appropriate elements/fields +hooked into the <varname>ScrnInfoRecs</varname> as required. The screen +config data is held in <structname>confScreenRec</structname>, device data in +the <structname>GDevRec</structname>, monitor data in the <structname>MonRec</structname>, +and display data in the <structname>DispRec</structname>. + </para> + + <para> +The XFree86 common layer's screen specific data (the actual data in use +for each screen) is held in the <varname>ScrnInfoRecs</varname>. As has +been outlined above, the <varname>ScrnInfoRecs</varname> are allocated at probe +time, and it is the responsibility of the Drivers' <function>Probe()</function> +and <function>PreInit()</function> functions to finish filling them in based +on both data provided on the command line and data provided from the +Config file. The precedence for this is: + + <blockquote><para> + command line -> config file -> probed/default data + </para></blockquote> + </para> + + <para> +For most things in this category there are helper functions that the +drivers can use to ensure that the above precedence is consistently +used. + </para> + + <para> +As well as containing screen-specific data that the XFree86 common layer +(including essential parts of the server infrastructure as well as helper +functions) needs to access, it also contains some data that drivers use +internally. When considering whether to add a new field to the +<structname>ScrnInfoRec</structname>, consider the balance between the convenience +of things that lots of drivers need and the size/obscurity of the +<structname>ScrnInfoRec</structname>. + </para> + + <para> +Per-screen driver specific data that cannot be accommodated with the +static <structname>ScrnInfoRec</structname> fields is held in a driver-defined +data structure, a pointer to which is assigned to the +<structname>ScrnInfoRec</structname>'s <structfield>driverPrivate</structfield> field. This +is per-screen data that persists across server generations (as does the +bulk of the static <structname>ScrnInfoRec</structname> data). It would typically +also include the video card's saved state. + </para> + + <para> +Per-screen data for other modules that the driver uses (for example, +the XAA module) that is reset for each server generation is hooked into +the <structname>ScrnInfoRec</structname> through it's <structfield>privates</structfield> +field. + </para> + + <para> +Once it has stabilised, the data structures and variables accessible to +video drivers will be documented here. In the meantime, those things +defined in the <filename>xf86.h</filename> and <filename>xf86str.h</filename> +files are visible to video drivers. Things defined in +<filename>xf86Priv.h</filename> and <filename>xf86Privstr.h</filename> are NOT +intended to be visible to video drivers, and it is an error for a driver +to include those files. + </para> + + </sect2> + + <sect2> + <title>Accessing global data</title> + + <para> +Some other global state information that the drivers may access via +functions is as follows: + </para> + + <blockquote><para> + <programlisting> + Bool xf86ServerIsExiting(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if the server is at the end of a + generation and is in the process of exiting, and + <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86ServerIsResetting(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if the server is at the end of a + generation and is in the process of resetting, and + <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86ServerIsInitialising(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if the server is at the beginning of + a generation and is in the process of initialising, and + <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86ServerIsOnlyProbing(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if the -probeonly command line flag + was specified, and <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86CaughtSignal(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if the server has caught a signal, + and <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + </sect2> + + <sect2> + <title>Allocating private data</title> + + <para> +A driver and any module it uses may allocate per-screen private storage +in either the <structname>ScreenRec</structname> (DIX level) or +<structname>ScrnInfoRec</structname> (XFree86 common layer level). +<structname>ScreenRec</structname> storage persists only for a single server +generation, and <structname>ScrnInfoRec</structname> storage persists across +generations for the lifetime of the server. + </para> + + <para> +The <structname>ScreenRec</structname> <structfield>devPrivates</structfield> data must be +reallocated/initialised at the start of each new generation. This is +normally done from the <function>ChipScreenInit()</function> function, and +Init functions for other modules that it calls. Data allocated in this +way should be freed by the driver's <function>ChipCloseScreen()</function> +functions, and Close functions for other modules that it calls. A new +<structfield>devPrivates</structfield> entry is allocated by calling the +<function>AllocateScreenPrivateIndex()</function> function. + </para> + + <blockquote><para> + <programlisting> + int AllocateScreenPrivateIndex(); + </programlisting> + <blockquote><para> + This function allocates a new element in the + <structfield>devPrivates</structfield> field of all currently existing + <literal remap="tt">ScreenRecs</literal>. The return value is the index of this + new element in the <structfield>devPrivates</structfield> array. The + <structfield>devPrivates</structfield> field is of type + <structname>DevUnion</structname>: + + <programlisting> + typedef union _DevUnion { + pointer ptr; + long val; + unsigned long uval; + pointer (*fptr)(void); + } DevUnion; + </programlisting> + + which allows the element to be used for any of the above types. + It is commonly used as a pointer to data that the caller allocates + after the new index has been allocated. + </para> + + <para> + This function will return <constant>-1</constant> when there is an + error allocating the new index. + </para> + + </blockquote> + </para></blockquote> + + <para> +The <structname>ScrnInfoRec</structname> <structfield>privates</structfield> data persists +for the life of the server, so only needs to be allocated once. This +should be done from the <function>ChipPreInit()</function> function, and Init +functions for other modules that it calls. Data allocated in this way +should be freed by the driver's <function>ChipFreeScreen()</function> functions, +and Free functions for other modules that it calls. A new +<structfield>privates</structfield> entry is allocated by calling the +<function>xf86AllocateScrnInfoPrivateIndex()</function> function. + </para> + + <blockquote><para> + <programlisting> + int xf86AllocateScrnInfoPrivateIndex(); + </programlisting> + <blockquote><para> + This function allocates a new element in the <structfield>privates</structfield> + field of all currently existing <varname>ScrnInfoRecs</varname>. + The return value is the index of this new element in the + <structfield>privates</structfield> array. The <structfield>privates</structfield> + field is of type <structfield>DevUnion</structfield>: + + <programlisting> + typedef union _DevUnion { + pointer ptr; + long val; + unsigned long uval; + pointer (*fptr)(void); + } DevUnion; + </programlisting> + + which allows the element to be used for any of the above types. + It is commonly used as a pointer to data that the caller allocates + after the new index has been allocated. + </para> + + <para> + This function will not return when there is an error allocating + the new index. When there is an error it will cause the server + to exit with a fatal error. The similar function for allocation + privates in the <structname>ScreenRec</structname> + (<function>AllocateScreenPrivateIndex()</function>) differs in this + respect by returning <constant>-1</constant> when the allocation fails. + </para> + + </blockquote> + </para></blockquote> + </sect2> + </sect1> + + <sect1 id="rac"> + <title>Keeping Track of Bus Resources</title> + + <sect2> + <title>Theory of Operation</title> + + <para> +The XFree86 common layer has knowledge of generic access control mechanisms +for devices on certain bus systems (currently the PCI bus) as well as +of methods to enable or disable access to the buses itself. Furthermore +it can access information on resources decoded by these devices and if +necessary modify it. + </para> + + <para> +When first starting the Xserver collects all this information, saves it +for restoration, checks it for consistency, and if necessary, corrects +it. Finally it disables all resources on a generic level prior to +calling any driver function. + </para> + + <para> +When the <function>Probe()</function> function of each driver is called the +device sections are matched against the devices found in the system. +The driver may probe devices at this stage that cannot be identified by +using device independent methods. Access to all resources that can be +controlled in a device independent way is disabled. The +<function>Probe()</function> function should register all non-relocatable +resources at this stage. If a resource conflict is found between +exclusive resources the driver will fail immediately. Optionally the +driver might specify an <function>EntityInit()</function>, +<function>EntityLeave()</function> and <function>EntityEnter()</function> function. + </para> + + <para> +<function>EntityInit()</function> can be used to disable any shared resources +that are not controlled by the generic access control functions. It is +called prior to the PreInit phase regardless if an entity is active or +not. When calling the <function>EntityInit()</function>, +<function>EntityEnter()</function> and <function>EntityLeave()</function> functions +the common level will disable access to all other entities on a generic +level. Since the common level has no knowledge of device specific +methods to disable access to resources it cannot be guaranteed that +certain resources are not decoded by any other entity until the +<function>EntityInit()</function> or <function>EntityEnter()</function> phase is +finished. Device drivers should therefore register all those resources +which they are going to disable. If these resources are never to be +used by any driver function they may be flagged <constant>ResInit</constant> +so that they can be removed from the resource list after processing all +<function>EntityInit()</function> functions. <function>EntityEnter()</function> +should disable decoding of all resources which are not registered as +exclusive and which are not handled by the generic access control in +the common level. The difference to <function>EntityInit()</function> is +that the latter one is only called once during lifetime of the server. +It can therefore be used to set up variables prior to disabling resources. +<function>EntityLeave()</function> should restore the original state when +exiting the server or switching to a different VT. It also needs to +disable device specific access functions if they need to be disabled on +server exit or VT switch. The default state is to enable them before +giving up the VT. + </para> + + <para> +In <function>PreInit()</function> phase each driver should check if any +sharable resources it has registered during <function>Probe()</function> has +been denied and take appropriate action which could simply be to fail. +If it needs to access resources it has disabled during +<function>EntitySetup()</function> it can do so provided it has registered +these and will disable them before returning from +<function>PreInit()</function>. This also applies to all other driver +functions. Several functions are provided to request resource ranges, +register these, correct PCI config space and add replacements for the +generic access functions. Resources may be marked <quote>disabled</quote> or +<quote>unused</quote> during OPERATING stage. Although these steps could also be +performed in <function>ScreenInit()</function>, this is not desirable. + </para> + + <para> +Following <function>PreInit()</function> phase the common level determines +if resource access control is needed. This is the case if more than +one screen is used. If necessary the RAC wrapper module is loaded. In +<function>ScreenInit()</function> the drivers can decide which operations +need to be placed under RAC. Available are the frame buffer operations, +the pointer operations and the colormap operations. Any operation that +requires resources which might be disabled during OPERATING state should +be set to use RAC. This can be specified separately for memory and IO +resources. + </para> + + <para> +When <function>ScreenInit()</function> phase is done the common level will +determine which shared resources are requested by more than one driver +and set the access functions accordingly. This is done following these +rules: + + <orderedlist> + <listitem><para> + The sharable resources registered by each entity are compared. If + a resource is registered by more than one entity the entity will be + marked to need to share this resources type (<constant>IO</constant> or + <constant>MEM</constant>). + </para></listitem> + + <listitem><para> + A resource marked <quote>disabled</quote> during OPERATING state will be ignored + entirely. + </para></listitem> + + <listitem><para> + A resource marked <quote>unused</quote> will only conflicts with an overlapping + resource of an other entity if the second is actually in use during + OPERATING state. + </para></listitem> + + <listitem><para> + If an <quote>unused</quote> resource was found to conflict however the entity + does not use any other resource of this type the entire resource type + will be disabled for that entity. + </para></listitem> + </orderedlist> + </para> + + <para> +The driver has the choice among different ways to control access to +certain resources: + + <orderedlist> + <listitem><para> + It can rely on the generic access functions. This is probably the + most common case. Here the driver only needs to register any resource + it is going to use. + </para></listitem> + + <listitem><para> + It can replace the generic access functions by driver specific + ones. This will mostly be used in cases where no generic access + functions are available. In this case the driver has to make sure + these resources are disabled when entering the <function>PreInit()</function> + stage. Since the replacement functions are registered in + <function>PreInit()</function> the driver will have to enable these + resources itself if it needs to access them during this state. The + driver can specify if the replacement functions can control memory + and/or I/O resources separately. + </para></listitem> + + <listitem><para> + The driver can enable resources itself when it needs them. Each + driver function enabling them needs to disable them before it will + return. This should be used if a resource which can be controlled + in a device dependent way is only required during SETUP state. This + way it can be marked <quote>unused</quote> during OPERATING state. + </para></listitem> + </orderedlist> + </para> + + <para> +A resource which is decoded during OPERATING state however never accessed +by the driver should be marked unused. + </para> + + <para> +Since access switching latencies are an issue during Xserver operation, +the common level attempts to minimize the number of entities that need +to be placed under RAC control. When a wrapped operation is called, +the <function>EnableAccess()</function> function is called before control is +passed on. <function>EnableAccess()</function> checks if a screen is under +access control. If not it just establishes bus routing and returns. +If the screen needs to be under access control, +<function>EnableAccess()</function> determines which resource types +(<literal remap="tt">MEM</literal>, <literal remap="tt">IO</literal>) are required. Then it tests +if this access is already established. If so it simply returns. If +not it disables the currently established access, fixes bus routing and +enables access to all entities registered for this screen. + </para> + + <para> +Whenever a mode switch or a VT-switch is performed the common level will +return to SETUP state. + </para> + </sect2> + + <sect2> + <title>Resource Types</title> + + <para> +Resource have certain properties. When registering resources each range +is accompanied by a flag consisting of the ORed flags of the different +properties the resource has. Each resource range may be classified +according to + + <itemizedlist> + <listitem><para> + its physical properties i.e., if it addresses + memory (<constant>ResMem</constant>) or + I/O space (<constant>ResIo</constant>), + </para></listitem> + <listitem><para> + if it addresses a + block (<constant>ResBlock</constant>) or + sparse (<constant>ResSparse</constant>) + range, + </para></listitem> + <listitem><para> + its access properties. + </para></listitem> + </itemizedlist> + </para> + + <para> +There are two known access properties: + + <itemizedlist> + <listitem><para> + <constant>ResExclusive</constant> + for resources which may not be shared with any other device and + </para></listitem> + <listitem><para> + <constant>ResShared</constant> + for resources which can be disabled and therefore can be shared. + </para></listitem> + </itemizedlist> + </para> + + <para> +If it is necessary to test a resource against any type a generic access +type <constant>ResAny</constant> is provided. If this is set the resource +will conflict with any resource of a different entity intersecting its +range. Further it can be specified that a resource is decoded however +never used during any stage (<constant>ResUnused</constant>) or during +OPERATING state (<constant>ResUnusedOpr</constant>). A resource only visible +during the init functions (ie. <function>EntityInit()</function>, +<function>EntityEnter()</function> and <function>EntityLeave()</function> should +be registered with the flag <constant>ResInit</constant>. A resource that +might conflict with background resource ranges may be flagged with +<constant>ResBios</constant>. This might be useful when registering resources +ranges that were assigned by the system Bios. + </para> + + <para> +Several predefined resource lists are available for VGA and 8514/A +resources in <filename>common/xf86Resources.h</filename>. + </para> + </sect2> + + <sect2 id="avail"> + <title>Available Functions</title> + + <para> +The functions provided for resource management are listed in their order +of use in the driver. + </para> + + <sect3> + <title>Probe Phase</title> + + <para> +In this phase each driver detects those resources it is able to drive, +creates an entity record for each of them, registers non-relocatable +resources and allocates screens and adds the resources to screens. + </para> + + <para> +Two helper functions are provided for matching device sections in the +xorg.conf file to the devices: + </para> + + <blockquote><para> + <programlisting> + int xf86MatchPciInstances(const char *driverName, int vendorID, + SymTabPtr chipsets, PciChipsets *PCIchipsets, + GDevPtr *devList, int numDevs, DriverPtr drvp, + int **foundEntities); + </programlisting> + <blockquote><para> + This function finds matches between PCI cards that a driver supports + and config file device sections. It is intended for use in the + <function>ChipProbe()</function> function of drivers for PCI cards. + Only probed PCI devices with a vendor ID matching + <parameter>vendorID</parameter> are considered. <parameter>devList</parameter> + and <parameter>numDevs</parameter> are typically those found from + calling <function>xf86MatchDevice()</function>, and represent the active + config file device sections relevant to the driver. + <parameter>PCIchipsets</parameter> is a table that provides a mapping + between the PCI device IDs, the driver's internal chipset tokens + and a list of fixed resources. + </para> + + <para> + When a device section doesn't have a <emphasis>BusID</emphasis> entry it + can only match the primary video device. Secondary devices are + only matched with device sections that have a matching + <emphasis>BusID</emphasis> entry. + </para> + + <para> + Once the preliminary matches have been found, a final match is + confirmed by checking if the chipset override, ChipID override or + probed PCI chipset type match one of those given in the + <parameter>chipsets</parameter> and <parameter>PCIchipsets</parameter> lists. + The <parameter>PCIchipsets</parameter> list includes a list of the PCI + device IDs supported by the driver. The list should be terminated + with an entry with PCI ID <constant>-1</constant>". The + <parameter>chipsets</parameter> list is a table mapping the driver's + internal chipset tokens to names, and should be terminated with + a <constant>NULL</constant> entry. Only those entries with a + corresponding entry in the <parameter>PCIchipsets</parameter> list are + considered. The order of precedence is: config file chipset, + config file ChipID, probed PCI device ID. + </para> + + <para> + In cases where a driver handles PCI chipsets with more than one + vendor ID, it may set <parameter>vendorID</parameter> to + <constant>0</constant>, and OR each devID in the list with (the + vendor ID << 16). + </para> + + <para> + Entity index numbers for confirmed matches are returned as an + array via <parameter>foundEntities</parameter>. The PCI information, + chipset token and device section for each match are found in the + <structname>EntityInfoRec</structname> referenced by the indices. + </para> + + <para> + The function return value is the number of confirmed matches. A + return value of <constant>-1</constant> indicates an internal error. + The returned <parameter>foundEntities</parameter> array should be freed + by the driver with <function>xfree()</function> when it is no longer + needed in cases where the return value is greater than zero. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int xf86MatchIsaInstances(const char *driverName, + SymTabPtr chipsets, IsaChipsets *ISAchipsets, + DriverPtr drvp, FindIsaDevProc FindIsaDevice, + GDevPtr *devList, int numDevs, + int **foundEntities); + </programlisting> + <blockquote><para> + This function finds matches between ISA cards that a driver supports + and config file device sections. It is intended for use in the + <function>ChipProbe()</function> function of drivers for ISA cards. + <parameter>devList</parameter> and <parameter>numDevs</parameter> are + typically those found from calling <function>xf86MatchDevice()</function>, + and represent the active config file device sections relevant to + the driver. <parameter>ISAchipsets</parameter> is a table that provides + a mapping between the driver's internal chipset tokens and the + resource classes. <parameter>FindIsaDevice</parameter> is a + driver-provided function that probes the hardware and returns the + chipset token corresponding to what was detected, and + <constant>-1</constant> if nothing was detected. + </para> + + <para> + If the config file device section contains a chipset entry, then + it is checked against the <parameter>chipsets</parameter> list. When + no chipset entry is present, the <parameter>FindIsaDevice</parameter> + function is called instead. + </para> + + <para> + Entity index numbers for confirmed matches are returned as an + array via <parameter>foundEntities</parameter>. The chipset token and + device section for each match are found in the + <structname>EntityInfoRec</structname> referenced by the indices. + </para> + + <para> + The function return value is the number of confirmed matches. A + return value of <constant>-1</constant> indicates an internal error. + The returned <parameter>foundEntities</parameter> array should be freed + by the driver with <function>xfree()</function> when it is no longer + needed in cases where the return value is greater than zero. + </para> + + </blockquote></para></blockquote> + + <para> +These two helper functions make use of several core functions that are +available at the driver level: + </para> + + <blockquote><para> + <programlisting> + Bool xf86ParsePciBusString(const char *busID, int *bus, + int *device, int *func); + </programlisting> + <blockquote><para> + Takes a <parameter>BusID</parameter> string, and if it is in the correct + format, returns the PCI <parameter>bus</parameter>, <parameter>device</parameter>, + <parameter>func</parameter> values that it indicates. The format of the + string is expected to be "PCI:bus:device:func" where each of <quote>bus</quote>, + <quote>device</quote> and <quote>func</quote> are decimal integers. The ":func" part may + be omitted, and the func value assumed to be zero, but this isn't + encouraged. The "PCI" prefix may also be omitted. The prefix + "AGP" is currently equivalent to the "PCI" prefix. If the string + isn't a valid PCI BusID, the return value is <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86ComparePciBusString(const char *busID, int bus, + int device, int func); + </programlisting> + <blockquote><para> + Compares a <parameter>BusID</parameter> string with PCI <parameter>bus</parameter>, + <parameter>device</parameter>, <parameter>func</parameter> values. If they + match <constant>TRUE</constant> is returned, and <constant>FALSE</constant> + if they don't. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86ParseIsaBusString(const char *busID); + </programlisting> + <blockquote><para> + Compares a <parameter>BusID</parameter> string with the ISA bus ID string + ("ISA" or "ISA:"). If they match <constant>TRUE</constant> is returned, + and <constant>FALSE</constant> if they don't. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86CheckPciSlot(int bus, int device, int func); + </programlisting> + <blockquote><para> + Checks if the PCI slot <literal remap="tt">bus:device:func</literal> has been + claimed. If so, it returns <constant>FALSE</constant>, and otherwise + <constant>TRUE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp, + int chipset, GDevPtr dev, Bool active); + </programlisting> + <blockquote><para> + This function is used to claim a PCI slot, allocate the associated + entity record and initialise their data structures. The return + value is the index of the newly allocated entity record, or + <constant>-1</constant> if the claim fails. This function should always + succeed if <function>xf86CheckPciSlot()</function> returned + <constant>TRUE</constant> for the same PCI slot. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86IsPrimaryPci(void); + </programlisting> + <blockquote><para> + This function returns <constant>TRUE</constant> if the primary card is + a PCI device, and <constant>FALSE</constant> otherwise. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, + GDevPtr dev, Bool active); + </programlisting> + <blockquote><para> + This allocates an entity record entity and initialise the data + structures. The return value is the index of the newly allocated + entity record. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86IsPrimaryIsa(void); + </programlisting> + <blockquote><para> + This function returns <constant>TRUE</constant> if the primary card is + an ISA (non-PCI) device, and <constant>FALSE</constant> otherwise. + </para> + + </blockquote></para></blockquote> + + <para> +Two helper functions are provided to aid configuring entities: + </para> + + <blockquote><para> + <programlisting> + ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, + int scrnFlag, int entityIndex, + PciChipsets *p_chip, + resList res, EntityProc init, + EntityProc enter, EntityProc leave, + pointer private); + + ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, + int scrnFlag, int entityIndex, + IsaChipsets *i_chip, + resList res, EntityProc init, + EntityProc enter, EntityProc leave, + pointer private); + </programlisting> + <blockquote><para> + These functions are used to register the non-relocatable resources + for an entity, and the optional entity-specific <parameter>Init</parameter>, <parameter>Enter</parameter> and + <parameter>Leave</parameter> functions. Usually the list of fixed resources is obtained + from the Isa/PciChipsets lists. However an additional list of + resources may be passed. Generally this is not required. + For active entities a <structname>ScrnInfoRec</structname> is allocated + if the <parameter>pScrn</parameter> argument is <constant>NULL</constant>. +The + return value is <constant>TRUE</constant> when successful. The init, enter, leave + functions are defined as follows: + + <blockquote><para> + <programlisting> + typedef void (*EntityProc)(int entityIndex, + pointer private); + </programlisting> + </para></blockquote> + + They are passed the entity index and a pointer to a private scratch + area. This can be set up during <function>Probe()</function> and + its address can be passed to + <function>xf86ConfigIsaEntity()</function> and + <function>xf86ConfigPciEntity()</function> as the last argument. + </para> + + </blockquote></para></blockquote> + + <para> +These two helper functions make use of several core functions that are +available at the driver level: + + <blockquote><para> + <programlisting> + void xf86ClaimFixedResources(resList list, int entityIndex); + </programlisting> + <blockquote><para> + This function registers the non-relocatable resources which cannot + be disabled and which therefore would cause the server to fail + immediately if they were found to conflict. It also records + non-relocatable but sharable resources for processing after the + <function>Probe()</function> phase. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, + EntityProc enter, EntityProc leave, pointer); + </programlisting> + <blockquote><para> + This function registers with an entity the <parameter>init</parameter>, + <parameter>enter</parameter>, <parameter>leave</parameter> functions along + with the pointer to their private area. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex); + </programlisting> + <blockquote><para> + This function associates the entity referenced by + <parameter>entityIndex</parameter> with the screen. + </para> + + </blockquote></para></blockquote> + </para> + </sect3> + + <sect3> + <title>PreInit Phase</title> + + <para> +During this phase the remaining resources should be registered. +<function>PreInit()</function> should call <function>xf86GetEntityInfo()</function> +to obtain a pointer to an <structname>EntityInfoRec</structname> for each entity +it is able to drive and check if any resource are listed in its +<structfield>resources</structfield> field. If resources registered in the Probe +phase have been rejected in the post-Probe phase +(<structfield>resources</structfield> is non-<constant>NULL</constant>), then the driver should +decide if it can continue without using these or if it should fail. + </para> + + <blockquote><para> + <programlisting> + EntityInfoPtr xf86GetEntityInfo(int entityIndex); + </programlisting> + <blockquote><para> + This function returns a pointer to the <structname>EntityInfoRec</structname> + referenced by <parameter>entityIndex</parameter>. The returned + <structname>EntityInfoRec</structname> should be freed with + <function>xfree()</function> when no longer needed. + </para> + + </blockquote></para></blockquote> + + <para> +Several functions are provided to simplify resource registration: + <blockquote><para> + <programlisting> + Bool xf86IsEntityPrimary(int entityIndex); + </programlisting> + <blockquote><para> + This function returns <constant>TRUE</constant> if the entity referenced + by <parameter>entityIndex</parameter> is the primary display device (i.e., + the one initialised at boot time and used in text mode). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86IsScreenPrimary(int scrnIndex); + </programlisting> + <blockquote><para> + This function returns <constant>TRUE</constant> if the primary entity + is registered with the screen referenced by + <parameter>scrnIndex</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + pciVideoPtr xf86GetPciInfoForEntity(int entityIndex); + </programlisting> + <blockquote><para> + This function returns a pointer to the <structname>pciVideoRec</structname> + for the specified entity. If the entity is not a PCI device, + <constant>NULL</constant> is returned. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +The primary function for registration of resources is: + <blockquote><para> + <programlisting> + resPtr xf86RegisterResources(int entityIndex, resList list, + int access); + </programlisting> + <blockquote><para> + This function tries to register the resources in + <parameter>list</parameter>. If list is <constant>NULL</constant> it tries + to determine the resources automatically. This only works for + entities that provide a generic way to read out the resource ranges + they decode. So far this is only the case for PCI devices. By + default the PCI resources are registered as shared + (<constant>ResShared</constant>) if the driver wants to set a different + access type it can do so by specifying the access flags in the + third argument. A value of <constant>0</constant> means to use the + default settings. If for any reason the resource broker is not + able to register some of the requested resources the function will + return a pointer to a list of the failed ones. In this case the + driver may be able to move the resource to different locations. + In case of PCI bus entities this is done by passing the list of + failed resources to <function>xf86ReallocatePciResources()</function>. + When the registration succeeds, the return value is + <constant>NULL</constant>. + </para> + + </blockquote></para></blockquote> + </para> + + <blockquote><para> + <programlisting> + resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes); + </programlisting> + <blockquote><para> + This function takes a list of PCI resources that need to be + reallocated and returns <constant>NULL</constant> when all relocations are + successful. + <function>xf86RegisterResources()</function> should be called again to + register the relocated resources with the broker. + If the reallocation fails, a list of the resources that could not be + relocated is returned. + </para> + + </blockquote></para></blockquote> + +<para> +Two functions are provided to obtain a resource range of a given type: + <blockquote><para> + <programlisting> + resRange xf86GetBlock(long type, memType size, + memType window_start, memType window_end, + memType align_mask, resPtr avoid); + </programlisting> + <blockquote><para> + This function tries to find a block range of size + <parameter>size</parameter> and type <parameter>type</parameter> in a window + bound by <parameter>window_start</parameter> and <parameter>window_end</parameter> + with the alignment specified in <parameter>align_mask</parameter>. + Optionally a list of resource ranges which should be avoided within + the window can be supplied. On failure a zero-length range of + type <constant>ResEnd</constant> will be returned. + </para> + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + resRange xf86GetSparse(long type, memType fixed_bits, + memType decode_mask, memType address_mask, + resPtr avoid); + </programlisting> + <blockquote><para> + This function is like the previous one, but attempts to find a + sparse range instead of a block range. Here three values have to + be specified: the <parameter>address_mask</parameter> which marks all + bits of the mask part of the address, the <parameter>decode_mask</parameter> + which masks out the bits which are hardcoded and are therefore + not available for relocation and the values of the fixed bits. + The function tries to find a base that satisfies the given condition. + If the function fails it will return a zero range of type + <constant>ResEnd</constant>. Optionally it might be passed a list of + resource ranges to avoid. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +Some PCI devices are broken in the sense that they return invalid size +information for a certain resource. In this case the driver can supply +the correct size and make sure that the resource range allocated for +the card is large enough to hold the address range decoded by the card. +The function <function>xf86FixPciResource()</function> can be used to do this: + <blockquote><para> + <programlisting> + Bool xf86FixPciResource(int entityIndex, unsigned int prt, + CARD32 alignment, long type); + </programlisting> + <blockquote><para> + This function fixes a PCI resource allocation. The + <parameter>prt</parameter> parameter contains the number of the PCI base + register that needs to be fixed (<constant>0-5</constant>, and + <constant>6</constant> for the BIOS base register). The size is + specified by the alignment. Since PCI resources need to span an + integral range of size <literal remap="tt">2ˆn</literal>, the alignm ent also + specifies the number of addresses that will be decoded. If the + driver specifies a type mask it can override the default type for + PCI resources which is <constant>ResShared</constant>. The resource + broker needs to know that to find a matching resource range. This + function should be called before calling + <function>xf86RegisterResources()</function>. The return value is + <constant>TRUE</constant> when the function succeeds. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base); + </programlisting> + <blockquote><para> + This function checks that the memory base address specified matches + one of the PCI base address register values for the given PCI + device. This is mostly used to check that an externally provided + base address (e.g., from a config file) matches an actual value + allocated to a device. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +The driver may replace the generic access control functions for an entity. +This is done with the <function>xf86SetAccessFuncs()</function>: + <blockquote><para> + <programlisting> + void xf86SetAccessFuncs(EntityInfoPtr pEnt, + xf86SetAccessFuncPtr funcs, + xf86SetAccessFuncPtr oldFuncs); + </programlisting> + with: + <programlisting> + typedef struct { + xf86AccessPtr mem; + xf86AccessPtr io; + xf86AccessPtr io_mem; + } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr; + </programlisting> + <blockquote><para> + The driver can pass three functions: one for I/O access, one for + memory access and one for combined memory and I/O access. If the + memory access and combined access functions are identical the + common level assumes that the memory access cannot be controlled + independently of I/O access, if the I/O access function and the + combined access functions are the same it is assumed that I/O can + not be controlled independently. If memory and I/O have to be + controlled together all three values should be the same. If a + non <constant>NULL</constant> value is passed as third argument it is + interpreted as an address where to store the old access record. + If the third argument is <constant>NULL</constant> it will be assumed + that the generic access should be enabled before replacing the + access functions. Otherwise it will be disabled. The driver may + enable them itself using the returned values. It should do this + from its replacement access functions as the generic access may + be disabled by the common level on certain occasions. If replacement + functions are specified they must control all resources of the + specific type registered for the entity. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +To find out if a specific resource range conflicts with another +resource the <function>xf86ChkConflict()</function> function may be used: + <blockquote><para> + <programlisting> + memType xf86ChkConflict(resRange *rgp, int entityIndex); + </programlisting> + <blockquote><para> + This function checks if the resource range <parameter>rgp</parameter> of + for the specified entity conflicts with with another resource. + If a conflict is found, the address of the start of the conflict + is returned. The return value is zero when there is no conflict. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +The OPERATING state properties of previously registered fixed resources +can be set with the <function>xf86SetOperatingState()</function> function: + <blockquote><para> + <programlisting> + resPtr xf86SetOperatingState(resList list, int entityIndex, + int mask); + </programlisting> + <blockquote><para> + This function is used to set the status of a resource during + OPERATING state. <parameter>list</parameter> holds a list to which + <parameter>mask</parameter> is to be applied. The parameter + <parameter>mask</parameter> may have the value <constant>ResUnusedOpr</constant> + and <constant>ResDisableOpr</constant>. The first one should be used + if a resource isn't used by the driver during OPERATING state + although it is decoded by the device, while the latter one indicates + that the resource is not decoded during OPERATING state. Note + that the resource ranges have to match those specified during + registration. If a range has been specified starting at + <literal remap="tt">A</literal> and ending at <literal remap="tt">B</literal> and suppose + <literal remap="tt">C</literal> us a value satisfying + <literal remap="tt">A < C < B</literal> one may not + specify the resource range <literal remap="tt">(A,B)</literal> by splitting it + into two ranges <literal remap="tt">(A,C)</literal> and <literal remap="tt">(C,B)</literal>. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +The following two functions are provided for special cases: + <blockquote><para> + <programlisting> + void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex); + </programlisting> + <blockquote><para> + This function may be used to remove an entity from a screen. This + only makes sense if a screen has more than one entity assigned or + the screen is to be deleted. No test is made if the screen has + any entities left. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86DeallocateResourcesForEntity(int entityIndex, long type); + </programlisting> + <blockquote><para> + This function deallocates all resources of a given type registered + for a certain entity from the resource broker list. + </para> + + </blockquote></para></blockquote> + </para> + + </sect3> + + <sect3> + <title>ScreenInit Phase</title> + + <para> +All that is required in this phase is to setup the RAC flags. Note that +it is also permissible to set these flags up in the PreInit phase. The +RAC flags are held in the <structfield>racIoFlags</structfield> and <structfield>racMemFlags</structfield> fields of the +<structname>ScrnInfoRec</structname> for each screen. They specify which graphics operations +might require the use of shared resources. This can be specified +separately for memory and I/O resources. The available flags are defined +in <filename>rac/xf86RAC.h</filename>. They are: + + <variablelist> + <varlistentry><term><constant>RAC_FB</constant></term> + <listitem><para> + for framebuffer operations (including hw acceleration) + </para></listitem></varlistentry> + <varlistentry><term><constant>RAC_CURSOR</constant></term> + <listitem><para> + for Cursor operations + (??? I'm not sure if we need this for SW cursor it depends + on which level the sw cursor is drawn) + </para></listitem></varlistentry> + <varlistentry><term><constant>RAC_COLORMAP</constant></term> + <listitem><para> + for colormap operations + </para></listitem></varlistentry> + <varlistentry><term><constant>RAC_VIEWPORT</constant></term> + <listitem><para> + for the call to <function>ChipAdjustFrame()</function> + </para></listitem></varlistentry> + </variablelist> + + +The flags are ORed together. + </para> + </sect3> + </sect2> + </sect1> + + <sect1 id="options"> + <title>Config file <quote>Option</quote> entries</title> + + <para> +Option entries are permitted in most sections and subsections of the +config file. There are two forms of option entries: + + <variablelist> + <varlistentry><term>Option "option-name"</term> + <listitem><para> + A boolean option. + </para></listitem></varlistentry> + <varlistentry><term>Option "option-name" "option-value"</term> + <listitem><para> + An option with an arbitrary value. + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> +The option entries are handled by the parser, and a list of the parsed +options is included with each of the appropriate data structures that +the drivers have access to. The data structures used to hold the option +information are opaque to the driver, and a driver must not access the +option data directly. Instead, the common layer provides a set of +functions that may be used to access, check and manipulate the option +data. + </para> + + <para> +First, the low level option handling functions. In most cases drivers +would not need to use these directly. + </para> + + <blockquote><para> + <programlisting> + pointer xf86FindOption(pointer options, const char *name); + </programlisting> + <blockquote><para> + Takes a list of options and an option name, and returns a handle + for the first option entry in the list matching the name. Returns + <constant>NULL</constant> if no match is found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + char *xf86FindOptionValue(pointer options, const char *name); + </programlisting> + <blockquote><para> + Takes a list of options and an option name, and returns the value + associated with the first option entry in the list matching the + name. If the matching option has no value, an empty string + (<constant>""</constant>) is returned. Returns <constant>NULL</constant> + if no match is found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86MarkOptionUsed(pointer option); + </programlisting> + <blockquote><para> + Takes a handle for an option, and marks that option as used. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86MarkOptionUsedByName(pointer options, const char *name); + </programlisting> + <blockquote><para> + Takes a list of options and an option name and marks the first + option entry in the list matching the name as used. + </para> + + </blockquote></para></blockquote> + + <para> +Next, the higher level functions that most drivers would use. + </para> + <blockquote><para> + <programlisting> + void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts); + </programlisting> + <blockquote><para> + Collect the options from each of the config file sections used by + the screen (<parameter>pScrn</parameter>) and return the merged list as + <structfield>pScrn->options</structfield>. This function requires that + <structfield>pScrn->confScreen</structfield>, <structfield>pScrn->display</structfield>, + <structfield>pScrn->monitor</structfield>, + <structfield>pScrn->numEntities</structfield>, and + <structfield>pScrn->entityList</structfield> are initialised. + <parameter>extraOpts</parameter> may optionally be set to an additional + list of options to be combined with the others. The order of + precedence for options is <parameter>extraOpts</parameter>, display, + confScreen, monitor, device. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86ProcessOptions(int scrnIndex, pointer options, + OptionInfoPtr optinfo); + </programlisting> + <blockquote><para> + Processes a list of options according to the information in the + array of <structname>OptionInfoRecs</structname> (<parameter>optinfo</parameter>). + The resulting information is stored in the <structfield>value</structfield> + fields of the appropriate <parameter>optinfo</parameter> entries. The + <structfield>found</structfield> fields are set to <constant>TRUE</constant> + when an option with a value of the correct type if found, and + <constant>FALSE</constant> otherwise. The <structfield>type</structfield> field + is used to determine the expected value type for each option. + Each option in the list of options for which there is a name match + (but not necessarily a value type match) is marked as used. + Warning messages are printed when option values don't match the + types specified in the optinfo data. + </para> + + <para> + NOTE: If this function is called before a driver's screen number + is known (e.g., from the <function>ChipProbe()</function> function) a + <parameter>scrnIndex</parameter> value of <constant>-1</constant> should be + used. + </para> + + <para> + NOTE 2: Given that this function stores into the + <literal remap="tt">OptionInfoRecs</literal> pointed to by <parameter>optinfo</parameter>, + the caller should ensure the <literal remap="tt">OptionInfoRecs</literal> are + (re-)initialised before the call, especially if the caller expects + to use the predefined option values as defaults. + </para> + + <para> + The <structname>OptionInfoRec</structname> is defined as follows: + + <programlisting> + typedef struct { + double freq; + int units; + } OptFrequency; + + typedef union { + unsigned long num; + char * str; + double realnum; + Bool bool; + OptFrequency freq; + } ValueUnion; + + typedef enum { + OPTV_NONE = 0, + OPTV_INTEGER, + OPTV_STRING, /* a non-empty string */ + OPTV_ANYSTR, /* Any string, including an empty one */ + OPTV_REAL, + OPTV_BOOLEAN, + OPTV_PERCENT, + OPTV_FREQ + } OptionValueType; + + typedef enum { + OPTUNITS_HZ = 1, + OPTUNITS_KHZ, + OPTUNITS_MHZ + } OptFreqUnits; + + typedef struct { + int token; + const char* name; + OptionValueType type; + ValueUnion value; + Bool found; + } OptionInfoRec, *OptionInfoPtr; + </programlisting> + </para> + <para> + <constant>OPTV_FREQ</constant> can be used for options values that are + frequencies. These values are a floating point number with an + optional unit name appended. The unit name can be one of "Hz", + "kHz", "k", "MHz", "M". The multiplier associated with the unit + is stored in <structfield>freq.units</structfield>, and the scaled frequency + is stored in <structfield>freq.freq</structfield>. When no unit is specified, + <structfield>freq.units</structfield> is set to <constant>0</constant>, and + <structfield>freq.freq</structfield> is unscaled. + </para> + + <para> + <constant>OPTV_PERCENT</constant> can be used for option values that are + specified in percent (e.g. "20%"). These values are a floating point + number with a percent sign appended. If the percent sign is missing, + the parser will fail to match the value. + </para> + + <para> + Typical usage is to setup an array of + <structname>OptionInfoRec</structname>s with all fields initialised. + The <structfield>value</structfield> and <structfield>found</structfield> fields get + set by <function>xf86ProcessOptions()</function>. For cases where the + value parsing is more complex, the driver should specify + <constant>OPTV_STRING</constant>, and parse the string itself. An + example of using this option handling is included in the + <link linkend="sample">Sample Driver</link> section. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86ShowUnusedOptions(int scrnIndex, pointer options); + </programlisting> + <blockquote><para> + Prints out warning messages for each option in the list of options + that isn't marked as used. This is intended to show options that + the driver hasn't recognised. It would normally be called near + the end of the <function>ChipScreenInit()</function> function, but only + when <code>serverGeneration == 1</code> + </para> + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, + int token); + </programlisting> + <blockquote><para> + Returns a pointer to the <structname>OptionInfoRec</structname> in + <parameter>table</parameter> with a token field matching + <parameter>token</parameter>. Returns <constant>NULL</constant> if no match + is found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86IsOptionSet(const OptionInfoRec *table, int token); + </programlisting> + <blockquote><para> + Returns the <literal remap="tt">found</literal> field of the + <structname>OptionInfoRec</structname> in <parameter>table</parameter> with a + <structfield>token</structfield> field matching <parameter>token</parameter>. This + can be used for options of all types. Note that for options of + type <constant>OPTV_BOOLEAN</constant>, it isn't sufficient to check + this to determine the value of the option. Returns + <constant>FALSE</constant> if no match is found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + char *xf86GetOptValString(const OptionInfoRec *table, int token); + </programlisting> + <blockquote><para> + Returns the <structfield>value.str</structfield> field of the + <structname>OptionInfoRec</structname> in <parameter>table</parameter> with a + token field matching <parameter>token</parameter>. Returns + <constant>NULL</constant> if no match is found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, + + int *value); + </programlisting> + <blockquote><para> + Returns via <parameter>*value</parameter> the <structfield>value.num</structfield> + field of the <structname>OptionInfoRec</structname> in <parameter>table</parameter> + with a <structfield>token</structfield> field matching <parameter>token</parameter>. + <parameter>*value</parameter> is only changed when a match is found so + it can be safely initialised with a default prior to calling this + function. The function return value is as for + <function>xf86IsOptionSet()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86GetOptValULong(const OptionInfoRec *table, int token, + unsigned long *value); + </programlisting> + <blockquote><para> + Like <function>xf86GetOptValInteger()</function>, except the value is + treated as an <type>unsigned long</type>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86GetOptValReal(const OptionInfoRec *table, int token, + double *value); + </programlisting> + <blockquote><para> + Like <function>xf86GetOptValInteger()</function>, except that + <structfield>value.realnum</structfield> is used. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86GetOptValFreq(const OptionInfoRec *table, int token, + OptFreqUnits expectedUnits, double *value); + </programlisting> + <blockquote><para> + Like <function>xf86GetOptValInteger()</function>, except that the + <structfield>value.freq</structfield> data is returned. The frequency value + is scaled to the units indicated by <parameter>expectedUnits</parameter>. + The scaling is exact when the units were specified explicitly in + the option's value. Otherwise, the <parameter>expectedUnits</parameter> + field is used as a hint when doing the scaling. In this case, + values larger than <constant>1000</constant> are assumed to have be + specified in the next smallest units. For example, if the Option + value is "10000" and expectedUnits is <constant>OPTUNITS_MHZ</constant>, + the value returned is <constant>10</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value); + </programlisting> + <blockquote><para> + This function is used to check boolean options + (<constant>OPTV_BOOLEAN</constant>). If the function return value is + <constant>FALSE</constant>, it means the option wasn't set. Otherwise + <parameter>*value</parameter> is set to the boolean value indicated by + the option's value. No option <parameter>value</parameter> is interpreted + as <constant>TRUE</constant>. Option values meaning <constant>TRUE</constant> + are "1", "yes", "on", "true", and option values meaning + <constant>FALSE</constant> are "0", "no", "off", "false". Option names + both with the "no" prefix in their names, and with that prefix + removed are also checked and handled in the obvious way. + <parameter>*value</parameter> is not changed when the option isn't present. + It should normally be set to a default value before calling this + function. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def); + </programlisting> + <blockquote><para> + This function is used to check boolean options + (<constant>OPTV_BOOLEAN</constant>). If the option is set, its value + is returned. If the options is not set, the default value specified + by <parameter>def</parameter> is returned. The option interpretation is + the same as for <function>xf86GetOptValBool()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int xf86NameCmp(const char *s1, const char *s2); + </programlisting> + <blockquote><para> + This function should be used when comparing strings from the config + file with expected values. It works like <function>strcmp()</function>, + but is not case sensitive and space, tab, and <quote><literal>_</literal></quote> characters + are ignored in the comparison. The use of this function isn't + restricted to parsing option values. It may be used anywhere + where this functionality required. + </para> + + </blockquote></para></blockquote> + </sect1> + + <sect1> + <title>Modules, Drivers, Include Files and Interface Issues</title> + + <para> +NOTE: this section is incomplete. + </para> + + + <sect2> + <title>Include files</title> + + <para> +The following include files are typically required by video drivers: + + <blockquote><para> + All drivers should include these: + <literallayout><filename> + "xf86.h" + "xf86_OSproc.h" + "xf86_ansic.h" + "xf86Resources.h" + </filename></literallayout> + Wherever inb/outb (and related things) are used the following should be + included: + <literallayout><filename> + "compiler.h" + </filename></literallayout> + Note: in drivers, this must be included after <filename>"xf86_ansic.h"</filename>. + </para> + + <para> + Drivers that need to access PCI vendor/device definitions need this: + <literallayout><filename> + "xf86PciInfo.h" + </filename></literallayout> + </para> + + <para> + Drivers that need to access the PCI config space need this: + <literallayout><filename> + "xf86Pci.h" + </filename></literallayout> + </para> + + <para> + Drivers that initialise a SW cursor need this: + <literallayout><filename> + "mipointer.h" + </filename></literallayout> + </para> + + <para> + All drivers implementing backing store need this: + <literallayout><filename> + "mibstore.h" + </filename></literallayout> + </para> + + <para> + All drivers using the mi colourmap code need this: + <literallayout><filename> + "micmap.h" + </filename></literallayout> + </para> + + <para> + If a driver uses the vgahw module, it needs this: + <literallayout><filename> + "vgaHW.h" + </filename></literallayout> + </para> + + <para> + Drivers supporting VGA or Hercules monochrome screens need: + <literallayout><filename> + "xf1bpp.h" + </filename></literallayout> + </para> + + <para> + Drivers supporting VGA or EGC 16-colour screens need: + <literallayout><filename> + "xf4bpp.h" + </filename></literallayout> + </para> + + <para> + Drivers using cfb need: + <programlisting> + #define PSZ 8 + #include "cfb.h" + #undef PSZ + </programlisting> + </para> + + <para> + Drivers supporting bpp 16, 24 or 32 with cfb need one or more of: + <literallayout><filename> + "cfb16.h" + "cfb24.h" + "cfb32.h" + </filename></literallayout> + </para> + + <para> + If a driver uses XAA, it needs these: + <literallayout><filename> + "xaa.h" + "xaalocal.h" + </filename></literallayout> + </para> + + <para> + If a driver uses the fb manager, it needs this: + <literallayout><filename> + "xf86fbman.h" + </filename></literallayout> + </para> + </blockquote> + </para> + + <para> +Non-driver modules should include <filename>"xf86_ansic.h"</filename> to get the correct +wrapping of ANSI C/libc functions. + </para> + + <para> +All modules must NOT include any system include files, or the following: + + <literallayout><filename> + "xf86Priv.h" + "xf86Privstr.h" + "xf86_OSlib.h" + "Xos.h" + </filename></literallayout> + </para> + + <para> +In addition, "xf86_libc.h" must not be included explicitly. It is +included implicitly by "xf86_ansic.h". + </para> + + </sect2> + </sect1> + + <sect1> + <title>Offscreen Memory Manager</title> + + <para> +Management of offscreen video memory may be handled by the XFree86 +framebuffer manager. Once the offscreen memory manager is running, +drivers or extensions may allocate, free or resize areas of offscreen +video memory using the following functions (definitions taken from +<filename>xf86fbman.h</filename>): + + <programlisting> + typedef struct _FBArea { + ScreenPtr pScreen; + BoxRec box; + int granularity; + void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*) + void (*RemoveAreaCallback)(struct _FBArea*) + DevUnion devPrivate; + } FBArea, *FBAreaPtr; + + typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr from, FBAreaPtr to) + typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr) + + FBAreaPtr xf86AllocateOffscreenArea ( + ScreenPtr pScreen, + int width, int height, + int granularity, + MoveAreaCallbackProcPtr MoveAreaCallback, + RemoveAreaCallbackProcPtr RemoveAreaCallback, + pointer privData + ) + + void xf86FreeOffscreenArea (FBAreaPtr area) + + Bool xf86ResizeOffscreenArea ( + FBAreaPtr area + int w, int h + ) + </programlisting> + </para> + + <para> +The function: + <programlisting> + Bool xf86FBManagerRunning(ScreenPtr pScreen); + </programlisting> + +can be used by an extension to check if the driver has initialized +the memory manager. The manager is not available if this returns +<constant>FALSE</constant> and the functions above will all fail. + </para> + + + <para> +<function>xf86AllocateOffscreenArea()</function> can be used to request a +rectangle of dimensions <parameter>width</parameter> × <parameter>height</parameter> +(in pixels) from unused offscreen memory. <parameter>granularity</parameter> +specifies that the leftmost edge of the rectangle must lie on some +multiple of <parameter>granularity</parameter> pixels. A granularity of zero +means the same thing as a granularity of one - no alignment preference. +A <parameter>MoveAreaCallback</parameter> can be provided to notify the requester +when the offscreen area is moved. If no <parameter>MoveAreaCallback</parameter> +is supplied then the area is considered to be immovable. The +<parameter>privData</parameter> field will be stored in the manager's internal +structure for that allocated area and will be returned to the requester +in the <parameter>FBArea</parameter> passed via the +<parameter>MoveAreaCallback</parameter>. An optional +<parameter>RemoveAreaCallback</parameter> is provided. If the driver provides +this it indicates that the area should be allocated with a lower priority. +Such an area may be removed when a higher priority request (one that +doesn't have a <parameter>RemoveAreaCallback</parameter>) is made. When this +function is called, the driver will have an opportunity to do whatever +cleanup it needs to do to deal with the loss of the area, but it must +finish its cleanup before the function exits since the offscreen memory +manager will free the area immediately after. + </para> + + <para> +<function>xf86AllocateOffscreenArea()</function> returns <constant>NULL</constant> +if it was unable to allocate the requested area. When no longer needed, +areas should be freed with <function>xf86FreeOffscreenArea()</function>. + </para> + + <para> +<function>xf86ResizeOffscreenArea()</function> resizes an existing +<literal remap="tt">FBArea</literal>. <function>xf86ResizeOffscreenArea()</function> +returns <constant>TRUE</constant> if the resize was successful. If +<function>xf86ResizeOffscreenArea()</function> returns <constant>FALSE</constant>, +the original <literal remap="tt">FBArea</literal> is left unmodified. Resizing an +area maintains the area's original <literal remap="tt">granularity</literal>, +<literal remap="tt">devPrivate</literal>, and <literal remap="tt">MoveAreaCallback</literal>. +<function>xf86ResizeOffscreenArea()</function> has considerably less overhead +than freeing the old area then reallocating the new size, so it should +be used whenever possible. + </para> + + <para> +The function: + <programlisting> + Bool xf86QueryLargestOffscreenArea( + ScreenPtr pScreen, + int *width, int *height, + int granularity, + int preferences, + int priority + ); + </programlisting> + +is provided to query the width and height of the largest single +<structname>FBArea</structname> allocatable given a particular priority. +<parameter>preferences</parameter> can be one of the following to indicate +whether width, height or area should be considered when determining +which is the largest single <structname>FBArea</structname> available. + + <programlisting> + FAVOR_AREA_THEN_WIDTH + FAVOR_AREA_THEN_HEIGHT + FAVOR_WIDTH_THEN_AREA + FAVOR_HEIGHT_THEN_AREA + </programlisting> + </para> + + <para> +<parameter>priority</parameter> is one of the following: + + <blockquote> + <para> + <constant>PRIORITY_LOW</constant> + <blockquote><para> + Return the largest block available without stealing anyone else's + space. This corresponds to the priority of allocating a + <structname>FBArea</structname> when a <function>RemoveAreaCallback</function> + is provided. + </para></blockquote> + </para> + + <para> + <constant>PRIORITY_NORMAL</constant> + <blockquote><para> + Return the largest block available if it is acceptable to steal a + lower priority area from someone. This corresponds to the priority + of allocating a <structname>FBArea</structname> without providing a + <function>RemoveAreaCallback</function>. + </para></blockquote> + </para> + + <para> + <constant>PRIORITY_EXTREME</constant> + <blockquote><para> + Return the largest block available if all <structname>FBArea</structname>s + that aren't locked down were expunged from memory first. This + corresponds to any allocation made directly after a call to + <function>xf86PurgeUnlockedOffscreenAreas()</function>. + </para></blockquote> + </para> + + </blockquote> + </para> + + + <para> +The function: + + <programlisting> + Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen); + </programlisting> + +is provided as an extreme method to free up offscreen memory. This +will remove all removable <structname>FBArea</structname> allocations. + </para> + + + <para> +Initialization of the XFree86 framebuffer manager is done via + + <programlisting> + Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox); + </programlisting> + +<parameter>FullBox</parameter> represents the area of the framebuffer that the +manager is allowed to manage. This is typically a box with a width of +<structfield>pScrn->displayWidth</structfield> and a height of as many lines as +can be fit within the total video memory, however, the driver can reserve +areas at the extremities by passing a smaller area to the manager. + </para> + + <para> +<function>xf86InitFBManager()</function> must be called before XAA is +initialized since XAA uses the manager for it's pixmap cache. + </para> + + <para> +An alternative function is provided to allow the driver to initialize +the framebuffer manager with a Region rather than a box. + + <programlisting> + Bool xf86InitFBManagerRegion(ScreenPtr pScreen, + RegionPtr FullRegion); + </programlisting> + +<function>xf86InitFBManagerRegion()</function>, unlike +<function>xf86InitFBManager()</function>, does not remove the area used for +the visible screen so that area should not be included in the region +passed to the function. <function>xf86InitFBManagerRegion()</function> is +useful when non-contiguous areas are available to be managed, and is +required when multiple framebuffers are stored in video memory (as in +the case where an overlay of a different depth is stored as a second +framebuffer in offscreen memory). + </para> + + </sect1> + + <sect1 id="cmap"> + <title>Colormap Handling</title> + + <para> +A generic colormap handling layer is provided within the XFree86 common +layer. This layer takes care of most of the details, and only requires +a function from the driver that loads the hardware palette when required. +To use the colormap layer, a driver calls the +<function>xf86HandleColormaps()</function> function. + + <blockquote><para> + <programlisting> + Bool xf86HandleColormaps(ScreenPtr pScreen, int maxColors, + int sigRGBbits, LoadPaletteFuncPtr loadPalette, + SetOverscanFuncPtr setOverscan, + unsigned int flags); + </programlisting> + <blockquote><para> + This function must be called after the default colormap has been + initialised. The <structfield>pScrn->gamma</structfield> field must also + be initialised, preferably by calling <function>xf86SetGamma()</function>. + <parameter>maxColors</parameter> is the number of entries in the palette. + <parameter>sigRGBbits</parameter> is the size in bits of each color + component in the DAC's palette. <parameter>loadPalette</parameter> + is a driver-provided function for loading a colormap into the + hardware, and is described below. <parameter>setOverscan</parameter> is + an optional function that may be provided when the overscan color + is an index from the standard LUT and when it needs to be adjusted + to keep it as close to black as possible. The + <parameter>setOverscan</parameter> function programs the overscan index. + It shouldn't normally be used for depths other than 8. + <parameter>setOverscan</parameter> should be set to <constant>NULL</constant> + when it isn't needed. <parameter>flags</parameter> may be set to the + following (which may be ORed together): + + <variablelist> + <varlistentry> + <term><constant>CMAP_PALETTED_TRUECOLOR</constant></term> + <listitem><para> + the TrueColor visual is paletted and is + just a special case of DirectColor. + This flag is only valid for + <code>bpp > 8</code>. + + </para></listitem></varlistentry> + <varlistentry> + <term><constant>CMAP_RELOAD_ON_MODE_SWITCH</constant></term> + <listitem><para> + reload the colormap automatically + after mode switches. This is useful + for when the driver is resetting the + hardware during mode switches and + corrupting or erasing the hardware + palette. + + </para></listitem></varlistentry> + <varlistentry> + <term><constant>CMAP_LOAD_EVEN_IF_OFFSCREEN</constant></term> + <listitem><para> + reload the colormap even if the screen + is switched out of the server's VC. + The palette is <emphasis>not</emphasis> reloaded when + the screen is switched back in, nor after + mode switches. This is useful when the + driver needs to keep track of palette + changes. + + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + The colormap layer normally reloads the palette after VT enters so it + is not necessary for the driver to save and restore the palette + when switching VTs. The driver must, however, still save the + initial palette during server start up and restore it during + server exit. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, + LOCO *colors, VisualPtr pVisual); + </programlisting> + <blockquote><para> + <function>LoadPalette()</function> is a driver-provided function for + loading a colormap into hardware. <parameter>colors</parameter> is the + array of RGB values that represent the full colormap. + <parameter>indices</parameter> is a list of index values into the colors + array. These indices indicate the entries that need to be updated. + <parameter>numColors</parameter> is the number of the indices to be + updated. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void SetOverscan(ScrnInfoPtr pScrn, int overscan); + </programlisting> + <blockquote><para> + <function>SetOverscan()</function> is a driver-provided function for + programming the <parameter>overscan</parameter> index. As described + above, it is normally only appropriate for LUT modes where all + colormap entries are available for the display, but where one of + them is also used for the overscan (typically 8bpp for VGA compatible + LUTs). It isn't required in cases where the overscan area is + never visible. + </para> + + </blockquote></para> + </blockquote></para> + + </sect1> + + <sect1> + <title>DPMS Extension</title> + + <para> +Support code for the DPMS extension is included in the XFree86 common layer. +This code provides an interface between the main extension code, and a means +for drivers to initialise DPMS when they support it. One function is +available to drivers to do this initialisation, and it is always available, +even when the DPMS extension is not supported by the core server (in +which case it returns a failure result). + </para> + + <blockquote><para> + <programlisting> + Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags); + </programlisting> + <blockquote><para> + This function registers a driver's DPMS level programming function + <parameter>set</parameter>. It also checks + <structfield>pScrn->options</structfield> for the "dpms" option, and when + present marks DPMS as being enabled for that screen. The + <parameter>set</parameter> function is called whenever the DPMS level + changes, and is used to program the requested level. + <parameter>flags</parameter> is currently not used, and should be + <constant>0</constant>. If the initialisation fails for any reason, + including when there is no DPMS support in the core server, the + function returns <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + + <para> +Drivers that implement DPMS support must provide the following function, +that gets called when the DPMS level is changed: + + + <blockquote><para> + <programlisting> + void ChipDPMSSet(ScrnInfoPtr pScrn, int level, int flags); + </programlisting> + <blockquote><para> + Program the DPMS level specified by <parameter>level</parameter>. Valid + values of <parameter>level</parameter> are <constant>DPMSModeOn</constant>, + <constant>DPMSModeStandby</constant>, <constant>DPMSModeSuspend</constant>, + <constant>DPMSModeOff</constant>. These values are defined in + <filename>"extensions/dpms.h"</filename>. + </para> + + </blockquote></para></blockquote> + </para> + + </sect1> + + <sect1> + <title>DGA Extension</title> + + <para> +Drivers can support the XFree86 Direct Graphics Architecture (DGA) by +filling out a structure of function pointers and a list of modes and +passing them to DGAInit. + </para> + + <blockquote><para> + <programlisting> + Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, + DGAModePtr modes, int num); + +/** The DGAModeRec **/ + +typedef struct { + int num; + DisplayModePtr mode; + int flags; + int imageWidth; + int imageHeight; + int pixmapWidth; + int pixmapHeight; + int bytesPerScanline; + int byteOrder; + int depth; + int bitsPerPixel; + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + int viewportWidth; + int viewportHeight; + int xViewportStep; + int yViewportStep; + int maxViewportX; + int maxViewportY; + int viewportFlags; + int offset; + unsigned char *address; + int reserved1; + int reserved2; +} DGAModeRec, *DGAModePtr; + </programlisting> + + <variablelist> + <varlistentry> + <term><structfield>num</structfield></term> + <listitem><para> + Can be ignored. The DGA DDX will assign these numbers. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>mode</structfield></term> + <listitem><para> + A pointer to the <structname>DisplayModeRec</structname> for this mode. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>flags</structfield></term> + <listitem><para> + The following flags are defined and may be OR'd together: + + <variablelist> + <varlistentry> + <term><constant>DGA_CONCURRENT_ACCESS</constant></term> + <listitem><para> + Indicates that the driver supports concurrent graphics + accelerator and linear framebuffer access. + + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>DGA_FILL_RECT + DGA_BLIT_RECT + DGA_BLIT_RECT_TRANS</constant></term> + <listitem><para> + Indicates that the driver supports the FillRect, BlitRect + or BlitTransRect functions in this mode. + + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>DGA_PIXMAP_AVAILABLE</constant></term> + <listitem><para> + Indicates that Xlib may be used on the framebuffer. + This flag will usually be set unless the driver wishes + to prohibit this for some reason. + + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>DGA_INTERLACED + DGA_DOUBLESCAN</constant></term> + <listitem><para> + Indicates that these are interlaced or double scan modes. + + </para></listitem></varlistentry> + </variablelist> + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>imageWidth + imageHeight</structfield></term> + <listitem><para> + These are the dimensions of the linear framebuffer + accessible by the client. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>pixmapWidth + pixmapHeight</structfield></term> + <listitem><para> + These are the dimensions of the area of the + framebuffer accessible by the graphics accelerator. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>bytesPerScanline</structfield></term> + <listitem><para> + Pitch of the framebuffer in bytes. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>byteOrder</structfield></term> + <listitem><para> + Usually the same as + <structfield>pScrn->imageByteOrder</structfield>. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>depth</structfield></term> + <listitem><para> + The depth of the framebuffer in this mode. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>bitsPerPixel</structfield></term> + <listitem><para> + The number of bits per pixel in this mode. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>red_mask</structfield></term> + <term><structfield>green_mask</structfield></term> + <term><structfield>blue_mask</structfield></term> + <listitem><para> + The RGB masks for this mode, if applicable. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>viewportWidth</structfield></term> + <term><structfield>viewportHeight</structfield></term> + <listitem><para> + Dimensions of the visible part of the framebuffer. + Usually <structfield>mode->HDisplay</structfield> and + <structfield>mode->VDisplay</structfield>. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>xViewportStep + yViewportStep</structfield></term> + <listitem><para> + The granularity of x and y viewport positions that + the driver supports in this mode. + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>maxViewportX + maxViewportY</structfield></term> + <listitem><para> + The maximum viewport position supported by the + driver in this mode. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>viewportFlags</structfield></term> + <listitem><para> + The following may be OR'd together: + + <variablelist> + <varlistentry> + <term><constant>DGA_FLIP_IMMEDIATE</constant></term> + <listitem><para> + The driver supports immediate viewport changes. + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>DGA_FLIP_RETRACE</constant></term> + + <listitem><para> + The driver supports viewport changes at retrace. + </para></listitem></varlistentry> + </variablelist> + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>offset</structfield></term> + <listitem><para> + The offset into the linear framebuffer that corresponds to + pixel (0,0) for this mode. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>address</structfield></term> + <listitem><para> + The virtual address of the framebuffer as mapped by the driver. + This is needed when DGA_PIXMAP_AVAILABLE is set. + </para></listitem></varlistentry> + + </variablelist> + + <programlisting> +/** The DGAFunctionRec **/ + +typedef struct { + Bool (*OpenFramebuffer)( + ScrnInfoPtr pScrn, + char **name, + unsigned char **mem, + int *size, + int *offset, + int *extra + ); + void (*CloseFramebuffer)(ScrnInfoPtr pScrn); + Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode); + void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags); + int (*GetViewport)(ScrnInfoPtr pScrn); + void (*Sync)(ScrnInfoPtr); + void (*FillRect)( + ScrnInfoPtr pScrn, + int x, int y, int w, int h, + unsigned long color + ); + void (*BlitRect)( + ScrnInfoPtr pScrn, + int srcx, int srcy, + int w, int h, + int dstx, int dsty + ); + void (*BlitTransRect)( + ScrnInfoPtr pScrn, + int srcx, int srcy, + int w, int h, + int dstx, int dsty, + unsigned long color + ); +} DGAFunctionRec, *DGAFunctionPtr; + </programlisting> + + + <blockquote><para> + <programlisting> + Bool OpenFramebuffer (pScrn, name, mem, size, offset, extra); + </programlisting> + <blockquote><para> + <function>OpenFramebuffer()</function> should pass the client everything + it needs to know to be able to open the framebuffer. These + parameters are OS specific and their meanings are to be interpreted + by an OS specific client library. + + <variablelist> + <varlistentry> + <term><parameter>name</parameter></term> + <listitem><para> + The name of the device to open or <constant>NULL</constant> if + there is no special device to open. A <constant>NULL</constant> + name tells the client that it should open whatever device + one would usually open to access physical memory. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>mem</parameter></term> + <listitem><para> + The physical address of the start of the framebuffer. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>size</parameter></term> + <listitem><para> + The size of the framebuffer in bytes. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>offset</parameter></term> + <listitem><para> + Any offset into the device, if applicable. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem><para> + Any additional information that the client may need. + Currently, only the <constant>DGA_NEED_ROOT</constant> flag is + defined. + </para></listitem></varlistentry> + + </variablelist> + </para></blockquote> + </para></blockquote> + + <blockquote><para> + <programlisting> + void CloseFramebuffer (pScrn); + </programlisting> + <blockquote><para> + <function>CloseFramebuffer()</function> merely informs the driver (if it + even cares) that client no longer needs to access the framebuffer + directly. This function is optional. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool SetMode (pScrn, pMode); + </programlisting> + <blockquote><para> + <function>SetMode()</function> tells the driver to initialize the mode + passed to it. If <parameter>pMode</parameter> is <constant>NULL</constant>, + then the driver should restore the original pre-DGA mode. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void SetViewport (pScrn, x, y, flags); + </programlisting> + <blockquote><para> + <function>SetViewport()</function> tells the driver to make the upper + left-hand corner of the visible screen correspond to coordinate + <literal remap="tt">(x,y)</literal> on the framebuffer. <parameter>flags</parameter> + currently defined are: + + <variablelist> + <varlistentry> + <term><constant>DGA_FLIP_IMMEDIATE</constant></term> + <listitem><para> + The viewport change should occur immediately. + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>DGA_FLIP_RETRACE</constant></term> + <listitem><para> + The viewport change should occur at the + vertical retrace, but this function should + return sooner if possible. + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + The <literal remap="tt">(x,y)</literal> locations will be passed as the client + specified them, however, the driver is expected to round these + locations down to the next supported location as specified by the + <structfield>xViewportStep</structfield> and <structfield>yViewportStep</structfield> + for the current mode. + </para> + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int GetViewport (pScrn); + </programlisting> + <blockquote><para> + <function>GetViewport()</function> gets the current page flip status. + Set bits in the returned int correspond to viewport change requests + still pending. For instance, set bit zero if the last SetViewport + request is still pending, bit one if the one before that is still + pending, etc. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void Sync (pScrn); + </programlisting> + <blockquote><para> + This function should ensure that any graphics accelerator operations + have finished. This function should not return until the graphics + accelerator is idle. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void FillRect (pScrn, x, y, w, h, color); + </programlisting> + <blockquote><para> + This optional function should fill a rectangle + <parameter>w × h</parameter> located at + <parameter>(x,y)</parameter> in the given color. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void BlitRect (pScrn, srcx, srcy, w, h, dstx, dsty); + </programlisting> + <blockquote><para> + This optional function should copy an area + <parameter>w × h</parameter> located at + <parameter>(srcx,srcy)</parameter> to location <parameter>(dstx,dsty)</parameter>. + This function will need to handle copy directions as appropriate. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void BlitTransRect (pScrn, srcx, srcy, w, h, dstx, dsty, color); + </programlisting> + <blockquote><para> + This optional function is the same as BlitRect except that pixels + in the source corresponding to the color key <parameter>color</parameter> + should be skipped. + </para> + + </blockquote></para></blockquote> + </para></blockquote> + + </sect1> + + <sect1> + <title>The XFree86 X Video Extension (Xv) Device Dependent Layer</title> + + <para> +XFree86 offers the X Video Extension which allows clients to treat video +as any another primitive and <quote>Put</quote> video into drawables. By default, +the extension reports no video adaptors as being available since the +DDX layer has not been initialized. The driver can initialize the DDX +layer by filling out one or more <literal remap="tt">XF86VideoAdaptorRecs</literal> +as described later in this document and passing a list of +<literal remap="tt">XF86VideoAdaptorPtr</literal> pointers to the following function: + + <programlisting> + Bool xf86XVScreenInit(ScreenPtr pScreen, + XF86VideoAdaptorPtr *adaptPtrs, + int num); + </programlisting> + </para> + + <para> +After doing this, the extension will report video adaptors as being +available, providing the data in their respective +<literal remap="tt">XF86VideoAdaptorRecs</literal> was valid. +<function>xf86XVScreenInit()</function> <emphasis>copies</emphasis> data from the structure +passed to it so the driver may free it after the initialization. At +the moment, the DDX only supports rendering into Window drawables. +Pixmap rendering will be supported after a sufficient survey of suitable +hardware is completed. + </para> + + <para> +The <structname>XF86VideoAdaptorRec</structname>: + + <programlisting> +typedef struct { + unsigned int type; + int flags; + char *name; + int nEncodings; + XF86VideoEncodingPtr pEncodings; + int nFormats; + XF86VideoFormatPtr pFormats; + int nPorts; + DevUnion *pPortPrivates; + int nAttributes; + XF86AttributePtr pAttributes; + int nImages; + XF86ImagePtr pImages; + PutVideoFuncPtr PutVideo; + PutStillFuncPtr PutStill; + GetVideoFuncPtr GetVideo; + GetStillFuncPtr GetStill; + StopVideoFuncPtr StopVideo; + SetPortAttributeFuncPtr SetPortAttribute; + GetPortAttributeFuncPtr GetPortAttribute; + QueryBestSizeFuncPtr QueryBestSize; + PutImageFuncPtr PutImage; + QueryImageAttributesFuncPtr QueryImageAttributes; +} XF86VideoAdaptorRec, *XF86VideoAdaptorPtr; + </programlisting></para> + + <para> +Each adaptor will have its own XF86VideoAdaptorRec. The fields are +as follows: + + <variablelist> + <varlistentry> + <term><structfield>type</structfield></term> + <listitem><para> + This can be any of the following flags OR'd together. + + <variablelist> + <varlistentry> + <term><constant>XvInputMask</constant> + <constant>XvOutputMask</constant></term> + <listitem><para> + These refer to the target drawable and are similar to a Window's + class. <literal remap="tt">XvInputMask</literal> indicates that the adaptor + can put video into a drawable. <literal remap="tt">XvOutputMask</literal> + indicates that the adaptor can get video from a drawable. + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>XvVideoMask</constant> + <constant>XvStillMask</constant> + <constant>XvImageMask</constant></term> + <listitem><para> + These indicate that the adaptor supports video, still or + image primitives respectively. + </para></listitem></varlistentry> + + <varlistentry> + <term><constant>XvWindowMask</constant> + <constant>XvPixmapMask</constant></term> + <listitem><para> + These indicate the types of drawables the adaptor is capable + of rendering into. At the moment, Pixmap rendering is not + supported and the <constant>XvPixmapMask</constant> flag is ignored. + </para></listitem></varlistentry> + </variablelist> + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>flags</structfield></term> + <listitem><para> + Currently, the following flags are defined: + + <variablelist> + <varlistentry> + <term><constant>VIDEO_NO_CLIPPING</constant></term> + <listitem><para> + This indicates that the video adaptor does not support + clipping. The driver will never receive <quote>Put</quote> requests + where less than the entire area determined by + <parameter>drw_x</parameter>, <parameter>drw_y</parameter>, + <parameter>drw_w</parameter> and <parameter>drw_h</parameter> is visible. + This flag does not apply to <quote>Get</quote> requests. Hardware + that is incapable of clipping <quote>Gets</quote> may punt or get + the extents of the clipping region passed to it. + </para></listitem> + + </varlistentry> + + <varlistentry> + <term><constant>VIDEO_INVERT_CLIPLIST</constant></term> + <listitem><para> + This indicates that the video driver requires the clip + list to contain the regions which are obscured rather + than the regions which are are visible. + </para></listitem> + + </varlistentry> + + <varlistentry> + <term><constant>VIDEO_OVERLAID_STILLS</constant></term> + <listitem><para> + Implementing PutStill for hardware that does video as an + overlay can be awkward since it's unclear how long to leave + the video up for. When this flag is set, StopVideo will be + called whenever the destination gets clipped or moved so that + the still can be left up until then. + </para></listitem> + + </varlistentry> + + <varlistentry> + <term><constant>VIDEO_OVERLAID_IMAGES</constant></term> + <listitem><para> + Same as <constant>VIDEO_OVERLAID_STILLS</constant> but for images. + </para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>VIDEO_CLIP_TO_VIEWPORT</constant></term> + <listitem><para> + Indicates that the clip region passed to the driver functions + should be clipped to the visible portion of the screen in the + case where the viewport is smaller than the virtual desktop. + </para></listitem></varlistentry> + + </variablelist> + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>name</structfield></term> + <listitem><para> + The name of the adaptor. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>nEncodings</structfield> + <structfield>pEncodings</structfield></term> + <listitem><para> + The number of encodings the adaptor is capable of and pointer + to the <structname>XF86VideoEncodingRec</structname> array. The + <structname>XF86VideoEncodingRec</structname> is described later on. + For drivers that only support XvImages there should be an encoding + named "XV_IMAGE" and the width and height should specify + the maximum size source image supported. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>nFormats</structfield> + <structfield>pFormats</structfield></term> + <listitem><para> + The number of formats the adaptor is capable of and pointer to + the <structname>XF86VideoFormatRec</structname> array. The + <structname>XF86VideoFormatRec</structname> is described later on. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>nPorts</structfield> + <structfield>pPortPrivates</structfield></term> + <listitem><para> + The number of ports is the number of separate data streams which + the adaptor can handle simultaneously. If you have more than + one port, the adaptor is expected to be able to render into more + than one window at a time. <structfield>pPortPrivates</structfield> is + an array of pointers or ints - one for each port. A port's + private data will be passed to the driver any time the port is + requested to do something like put the video or stop the video. + In the case where there may be many ports, this enables the + driver to know which port the request is intended for. Most + commonly, this will contain a pointer to the data structure + containing information about the port. In Xv, all ports on + a particular adaptor are expected to be identical in their + functionality. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>nAttributes</structfield> + <structfield>pAttributes</structfield></term> + <listitem><para> + The number of attributes recognized by the adaptor and a pointer to + the array of <structname>XF86AttributeRecs</structname>. The + <structname>XF86AttributeRec</structname> is described later on. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>nImages</structfield> + <structfield>pImages</structfield></term> + <listitem><para> + The number of <structname>XF86ImageRecs</structname> supported by the adaptor + and a pointer to the array of <structname>XF86ImageRecs</structname>. The + <structname>XF86ImageRec</structname> is described later on. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield> + PutVideo PutStill GetVideo GetStill StopVideo + SetPortAttribute GetPortAttribute QueryBestSize PutImage + QueryImageAttributes + </structfield></term> + <listitem><para> + These functions define the DDX->driver interface. In each + case, the pointer <parameter>data</parameter> is passed to the driver. + This is the port private for that port as described above. All + fields are required except under the following conditions: + + <orderedlist> + <listitem><para> + <structfield>PutVideo</structfield>, <structfield>PutStill</structfield> and + the image routines <structfield>PutImage</structfield> and + <structfield>QueryImageAttributes</structfield> are not required when the + adaptor type does not contain <constant>XvInputMask</constant>. + </para></listitem> + + <listitem><para> + <structfield>GetVideo</structfield> and <structfield>GetStill</structfield> + are not required when the adaptor type does not contain + <constant>XvOutputMask</constant>. + </para></listitem> + + <listitem><para> + <structfield>GetVideo</structfield> and <structfield>PutVideo</structfield> + are not required when the adaptor type does not contain + <constant>XvVideoMask</constant>. + </para></listitem> + + <listitem><para> + <structfield>GetStill</structfield> and <structfield>PutStill</structfield> + are not required when the adaptor type does not contain + <constant>XvStillMask</constant>. + </para></listitem> + + <listitem><para> + <structfield>PutImage</structfield> and <structfield>QueryImageAttributes</structfield> + are not required when the adaptor type does not contain + <constant>XvImageMask</constant>. + </para></listitem> + + </orderedlist> + + </para> + + <para> + With the exception of <structfield>QueryImageAttributes</structfield>, these + functions should return <constant>Success</constant> if the operation was + completed successfully. They can return <constant>XvBadAlloc</constant> + otherwise. <structfield>QueryImageAttributes</structfield> returns the size + of the XvImage queried. + </para> + + <para> + If the <constant>VIDEO_NO_CLIPPING</constant> + flag is set, the <literal remap="tt">clipBoxes</literal> may be ignored by + the driver. <literal remap="tt">ClipBoxes</literal> is an <literal remap="tt">X-Y</literal> + banded region identical to those used throughout the server. + The clipBoxes represent the visible portions of the area determined + by <literal remap="tt">drw_x</literal>, <literal remap="tt">drw_y</literal>, + <literal remap="tt">drw_w</literal> and <literal remap="tt">drw_h</literal> in the Get/Put + function. The boxes are in screen coordinates, are guaranteed + not to overlap and an empty region will never be passed. + If the driver has specified <constant>VIDEO_INVERT_CLIPLIST</constant>, + <literal remap="tt">clipBoxes</literal> will indicate the areas of the primitive + which are obscured rather than the areas visible. + + </para></listitem></varlistentry> + </variablelist> + + <blockquote><para> + <programlisting> + typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn, + short vid_x, short vid_y, short drw_x, short drw_y, + short vid_w, short vid_h, short drw_w, short drw_h, + RegionPtr clipBoxes, pointer data ); + </programlisting> + <blockquote><para> + This indicates that the driver should take a subsection + <parameter>vid_w</parameter> by <parameter>vid_h</parameter> at location + <parameter>(vid_x,vid_y)</parameter> from the video stream and direct + it into the rectangle <parameter>drw_w</parameter> by <parameter>drw_h</parameter> + at location <parameter>(drw_x,drw_y)</parameter> on the screen, scaling as + necessary. Due to the large variations in capabilities of + the various hardware expected to be used with this extension, + it is not expected that all hardware will be able to do this + exactly as described. In that case the driver should just do + <quote>the best it can,</quote> scaling as closely to the target rectangle + as it can without rendering outside of it. In the worst case, + the driver can opt to just not turn on the video. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn, + short vid_x, short vid_y, short drw_x, short drw_y, + short vid_w, short vid_h, short drw_w, short drw_h, + RegionPtr clipBoxes, pointer data ); + </programlisting> + <blockquote><para> + This is same as <structfield>PutVideo</structfield> except that the driver + should place only one frame from the stream on the screen. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn, + short vid_x, short vid_y, short drw_x, short drw_y, + short vid_w, short vid_h, short drw_w, short drw_h, + RegionPtr clipBoxes, pointer data ); + </programlisting> + <blockquote><para> + This is same as <structfield>PutVideo</structfield> except that the driver + gets video from the screen and outputs it. The driver should + do the best it can to get the requested dimensions correct + without reading from an area larger than requested. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn, + short vid_x, short vid_y, short drw_x, short drw_y, + short vid_w, short vid_h, short drw_w, short drw_h, + RegionPtr clipBoxes, pointer data ); + </programlisting> + <blockquote><para> + This is the same as <literal remap="tt">GetVideo</literal> except that the + driver should place only one frame from the screen into the + output stream. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, + pointer data, Bool cleanup); + </programlisting> + <blockquote><para> + This indicates the driver should stop displaying the video. + This is used to stop both input and output video. The + <parameter>cleanup</parameter> field indicates that the video is + being stopped because the client requested it to stop or + because the server is exiting the current VT. In that case + the driver should deallocate any offscreen memory areas (if + there are any) being used to put the video to the screen. If + <parameter>cleanup</parameter> is not set, the video is being stopped + temporarily due to clipping or moving of the window, etc... + and video will likely be restarted soon so the driver should + not deallocate any offscreen areas associated with that port. + </para> + + </blockquote></para></blockquote> + <blockquote><para> + <programlisting> + typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, + Atom attribute,INT32 value, pointer data); + </programlisting> + + <programlisting> + typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, + Atom attribute,INT32 *value, pointer data); + </programlisting> + <blockquote><para> + A port may have particular attributes such as hue, + saturation, brightness or contrast. Xv clients set and + get these attribute values by sending attribute strings + (Atoms) to the server. Such requests end up at these + driver functions. It is recommended that the driver provide + at least the following attributes mentioned in the Xv client + library docs: + <literallayout><constant> + XV_ENCODING + XV_HUE + XV_SATURATION + XV_BRIGHTNESS + XV_CONTRAST + </constant></literallayout> + but the driver may recognize as many atoms as it wishes. If + a requested attribute is unknown by the driver it should return + <constant>BadMatch</constant>. <constant>XV_ENCODING</constant> is the + attribute intended to let the client specify which video + encoding the particular port should be using (see the description + of <structname>XF86VideoEncodingRec</structname> below). If the + requested encoding is unsupported, the driver should return + <constant>XvBadEncoding</constant>. If the value lies outside the + advertised range <constant>BadValue</constant> may be returned. + <constant>Success</constant> should be returned otherwise. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn, + Bool motion, short vid_w, short vid_h, + short drw_w, short drw_h, + unsigned int *p_w, unsigned int *p_h, pointer data); + </programlisting> + <blockquote><para> + <function>QueryBestSize</function> provides the client with a way + to query what the destination dimensions would end up being + if they were to request that an area + <parameter>vid_w</parameter> by <parameter>vid_h</parameter> from the video + stream be scaled to rectangle of + <parameter>drw_w</parameter> by <parameter>drw_h</parameter> on the screen. + Since it is not expected that all hardware will be able to + get the target dimensions exactly, it is important that the + driver provide this function. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn, + short src_x, short src_y, short drw_x, short drw_y, + short src_w, short src_h, short drw_w, short drw_h, + int image, char *buf, short width, short height, + Bool sync, RegionPtr clipBoxes, pointer data ); + </programlisting> + <blockquote><para> + This is similar to <structfield>PutStill</structfield> except that the + source of the video is not a port but the data stored in a system + memory buffer at <parameter>buf</parameter>. The data is in the format + indicated by the <parameter>image</parameter> descriptor and represents a + source of size <parameter>width</parameter> by <parameter>height</parameter>. + If <parameter>sync</parameter> is TRUE the driver should not return + from this function until it is through reading the data + from <parameter>buf</parameter>. Returning when <parameter>sync</parameter> + is TRUE indicates that it is safe for the data at <parameter>buf</parameter> + to be replaced, freed, or modified. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + typedef int (* QueryImageAttributesFuncPtr)( ScrnInfoPtr pScrn, + int image, short *width, short *height, + int *pitches, int *offsets); + </programlisting> + <blockquote><para> + This function is called to let the driver specify how data for + a particular <parameter>image</parameter> of size <parameter>width</parameter> + by <parameter>height</parameter> should be stored. Sometimes only + the size and corrected width and height are needed. In that + case <parameter>pitches</parameter> and <parameter>offsets</parameter> are + NULL. The size of the memory required for the image is returned + by this function. The <parameter>width</parameter> and + <parameter>height</parameter> of the requested image can be altered by + the driver to reflect format limitations (such as component + sampling periods that are larger than one). If + <parameter>pitches</parameter> and <parameter>offsets</parameter> are not NULL, + these will be arrays with as many elements in them as there + are planes in the <parameter>image</parameter> format. The driver + should specify the pitch (in bytes) of each scanline in the + particular plane as well as the offset to that plane (in bytes) + from the beginning of the image. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +The XF86VideoEncodingRec: + + <blockquote><para> + <programlisting> +typedef struct { + int id; + char *name; + unsigned short width, height; + XvRationalRec rate; +} XF86VideoEncodingRec, *XF86VideoEncodingPtr; + + </programlisting> + <blockquote><para> + The <structname>XF86VideoEncodingRec</structname> specifies what encodings + the adaptor can support. Most of this data is just informational + and for the client's benefit, and is what will be reported by + <function>XvQueryEncodings</function>. The <parameter>id</parameter> field is + expected to be a unique identifier to allow the client to request a + certain encoding via the <constant>XV_ENCODING</constant> attribute string. + + </para> + </blockquote></para></blockquote> + </para> + + <para> +The XF86VideoFormatRec: + + <blockquote><para> + <programlisting> +typedef struct { + char depth; + short class; +} XF86VideoFormatRec, *XF86VideoFormatPtr; + + </programlisting> + <blockquote><para> + This specifies what visuals the video is viewable in. + <parameter>depth</parameter> is the depth of the visual (not bpp). + <parameter>class</parameter> is the visual class such as + <constant>TrueColor</constant>, <constant>DirectColor</constant> or + <constant>PseudoColor</constant>. Initialization of an adaptor will fail + if none of the visuals on that screen are supported. + </para> + + </blockquote></para></blockquote> + </para> + + <para> +The XF86AttributeRec: + + <blockquote><para> + <programlisting> +typedef struct { + int flags; + int min_value; + int max_value; + char *name; +} XF86AttributeListRec, *XF86AttributeListPtr; + + </programlisting> + <blockquote><para> + Each adaptor may have an array of these advertising the attributes + for its ports. Currently defined flags are <literal remap="tt">XvGettable</literal> + and <literal remap="tt">XvSettable</literal> which may be OR'd together indicating that + attribute is <quote>gettable</quote> or <quote>settable</quote> by the client. The + <literal remap="tt">min</literal> and <literal remap="tt">max</literal> field specify the valid range + for the value. <literal remap="tt">Name</literal> is a text string describing the + attribute by name. + </para> + + </blockquote></para></blockquote> + + </para> + + <para> +The XF86ImageRec: + + <blockquote><para> + <programlisting> +typedef struct { + int id; + int type; + int byte_order; + char guid[16]; + int bits_per_pixel; + int format; + int num_planes; + + /* for RGB formats */ + int depth; + unsigned int red_mask; + unsigned int green_mask; + unsigned int blue_mask; + + /* for YUV formats */ + unsigned int y_sample_bits; + unsigned int u_sample_bits; + unsigned int v_sample_bits; + unsigned int horz_y_period; + unsigned int horz_u_period; + unsigned int horz_v_period; + unsigned int vert_y_period; + unsigned int vert_u_period; + unsigned int vert_v_period; + char component_order[32]; + int scanline_order; +} XF86ImageRec, *XF86ImagePtr; + + </programlisting> + <blockquote><para> + XF86ImageRec describes how video source data is laid out in memory. + The fields are as follows: + + <variablelist> + <varlistentry> + <term><structfield>id</structfield></term> + <listitem><para> + This is a unique descriptor for the format. It is often good to + set this value to the FOURCC for the format when applicable. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>type</structfield></term> + <listitem><para> + This is <constant>XvRGB</constant> or <constant>XvYUV</constant>. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>byte_order</structfield></term> + <listitem><para> + This is <constant>LSBFirst</constant> or <constant>MSBFirst</constant>. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>guid</structfield></term> + <listitem><para> + This is the Globally Unique IDentifier for the format. When + not applicable, all characters should be NULL. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>bits_per_pixel</structfield></term> + <listitem><para> + The number of bits taken up (but not necessarily used) by each + pixel. Note that for some planar formats which have fractional + bits per pixel (such as IF09) this number may be rounded _down_. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>format</structfield></term> + <listitem><para> + This is <constant>XvPlanar</constant> or <constant>XvPacked</constant>. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>num_planes</structfield></term> + <listitem><para> + The number of planes in planar formats. This should be set to + one for packed formats. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>depth</structfield></term> + <listitem><para> + The significant bits per pixel in RGB formats (analgous to the + depth of a pixmap format). + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>red_mask</structfield></term> + <term><structfield>green_mask</structfield></term> + <term><structfield>blue_mask</structfield></term> + <listitem><para> + The red, green and blue bitmasks for packed RGB formats. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>y_sample_bits</structfield></term> + <term><structfield>u_sample_bits</structfield></term> + <term><structfield>v_sample_bits</structfield></term> + <listitem><para> + The y, u and v sample sizes (in bits). + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>horz_y_period</structfield></term> + <term><structfield>horz_u_period</structfield></term> + <term><structfield>horz_v_period</structfield></term> + <listitem><para> + The y, u and v sampling periods in the horizontal direction. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>vert_y_period</structfield></term> + <term><structfield>vert_u_period</structfield></term> + <term><structfield>vert_v_period</structfield></term> + <listitem><para> + The y, u and v sampling periods in the vertical direction. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>component_order</structfield></term> + <listitem><para> + Uppercase ascii characters representing the order that + samples are stored within packed formats. For planar formats + this represents the ordering of the planes. Unused characters + in the 32 byte string should be set to NULL. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>scanline_order</structfield></term> + <listitem><para> + This is <constant>XvTopToBottom</constant> or <constant>XvBottomToTop</constant>. + </para></listitem></varlistentry> + + </variablelist> + </para> + + <para> + Since some formats (particular some planar YUV formats) may not +be completely defined by the parameters above, the guid, when +available, should provide the most accurate description of the +format. + </para> + + </blockquote></para></blockquote> + </para> + </sect1> + + <sect1> + <title>The Loader</title> + + <para> +This section describes the interfaces to the module loader. The loader +interfaces can be divided into two groups: those that are only available to +the XFree86 common layer, and those that are also available to modules. + </para> + + <sect2> + <title>Loader Overview</title> + + <para> +The loader is capable of loading modules in a range of object formats, +and knowledge of these formats is built in to the loader. Knowledge of +new object formats can be added to the loader in a straightforward +manner. This makes it possible to provide OS-independent modules (for +a given CPU architecture type). In addition to this, the loader can +load modules via the OS-provided <function>dlopen(3)</function> service where +available. Such modules are not platform independent, and the semantics +of <function>dlopen()</function> on most systems results in significant +limitations in the use of modules of this type. Support for +<function>dlopen()</function> modules in the loader is primarily for +experimental and development purposes. + </para> + + <para> +Symbols exported by the loader (on behalf of the core X server) to +modules are determined at compile time. Only those symbols explicitly +exported are available to modules. All external symbols of loaded +modules are exported to other modules, and to the core X server. The +loader can be requested to check for unresolved symbols at any time, +and the action to be taken for unresolved symbols can be controlled by +the caller of the loader. Typically the caller identifies which symbols +can safely remain unresolved and which cannot. + </para> + + <para> +NOTE: Now that ISO-C allows pointers to functions and pointers to data to +have different internal representations, some of the following interfaces +will need to be revisited. + </para> + </sect2> + + <sect2> + <title>Semi-private Loader Interface</title> + + <para> +The following is the semi-private loader interface that is available to the +XFree86 common layer. + </para> + + <blockquote><para> + <programlisting> + void LoaderInit(void); + </programlisting> + <blockquote><para> + The <function>LoaderInit()</function> function initialises the loader, + and it must be called once before calling any other loader functions. + This function initialises the tables of exported symbols, and anything + else that might need to be initialised. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoaderSetPath(const char *path); + </programlisting> + <blockquote><para> + The <function>LoaderSetPath()</function> function initialises a default + module search path. This must be called if calls to other functions + are to be made without explicitly specifying a module search path. + The search path <parameter>path</parameter> must be a string of one or more + comma separated absolute paths. Modules are expected to be located + below these paths, possibly in subdirectories of these paths. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + pointer LoadModule(const char *module, const char *path, + const char **subdirlist, const char **patternlist, + pointer options, const XF86ModReqInfo * modreq, + int *errmaj, int *errmin); + </programlisting> + <blockquote><para> + The <function>LoadModule()</function> function loads the module called + <parameter>module</parameter>. The return value is a module handle, and + may be used in future calls to the loader that require a reference + to a loaded module. The module name <parameter>module</parameter> is + normally the module's canonical name, which doesn't contain any + directory path information, or any object/library file prefixes of + suffixes. Currently a full pathname and/or filename is also accepted. + This might change. The other parameters are: + + <variablelist> + <varlistentry> + <term><parameter>path</parameter></term> + <listitem><para> + An optional comma-separated list of module search paths. + When <constant>NULL</constant>, the default search path is used. + </para></listitem></varlistentry> + + + <varlistentry> + <term><parameter>subdirlist</parameter></term> + <listitem><para> + An optional <constant>NULL</constant> terminated list of + subdirectories to search. When <constant>NULL</constant>, + the default built-in list is used (refer to + <varname>stdSubdirs</varname> in <filename>loadmod.c</filename>). + The default list is also substituted for entries in + <parameter>subdirlist</parameter> with the value + <constant>DEFAULT_LIST</constant>. This makes is possible + to augment the default list instead of replacing it. + Subdir elements must be relative, and must not contain + <literal remap="tt">".."</literal>. If any violate this requirement, + the load fails. + </para></listitem></varlistentry> + + + <varlistentry> + <term><parameter>patternlist</parameter></term> + <listitem><para> + An optional <constant>NULL</constant> terminated list of + POSIX regular expressions used to connect module + filenames with canonical module names. Each regex + should contain exactly one subexpression that corresponds + to the canonical module name. When <constant>NULL</constant>, + the default built-in list is used (refer to + <varname>stdPatterns</varname> in + <filename>loadmod.c</filename>). The default list is also + substituted for entries in <parameter>patternlist</parameter> + with the value <constant>DEFAULT_LIST</constant>. This + makes it possible to augment the default list instead + of replacing it. + </para></listitem></varlistentry> + + + <varlistentry> + <term><parameter>options</parameter></term> + <listitem><para> + An optional parameter that is passed to the newly + loaded module's <literal remap="tt">SetupProc</literal> function + (if it has one). This argument is normally a + <constant>NULL</constant> terminated list of + <structname>Options</structname>, and must be interpreted that + way by modules loaded directly by the XFree86 common + layer. However, it may be used for application-specific + parameter passing in other situations. + </para> + + <para> + When loading <quote>external</quote> modules (modules that don't + have the standard entry point, for example a + special shared library) the options parameter can be + set to <constant>EXTERN_MODULE</constant> to tell the + loader not to reject the module when it doesn't find + the standard entry point. + </para></listitem></varlistentry> + + + <varlistentry> + <term><parameter>modreq</parameter></term> + <listitem><para> + An optional <structname>XF86ModReqInfo*</structname> containing + version/ABI/vendor information to requirements to + check the newly loaded module against. The main + purpose of this is to allow the loader to verify that + a module of the correct type/version before running + its <function>SetupProc</function> function. + </para> + + <para> + The <literal remap="tt">XF86ModReqInfo</literal> struct is defined + as follows: + <programlisting> +typedef struct { + CARD8 majorversion; /* MAJOR_UNSPEC */ + CARD8 minorversion; /* MINOR_UNSPEC */ + CARD16 patchlevel; /* PATCH_UNSPEC */ + const char * abiclass; /* ABI_CLASS_NONE */ + CARD32 abiversion; /* ABI_VERS_UNSPEC */ + const char * moduleclass; /* MOD_CLASS_NONE */ +} XF86ModReqInfo; + </programlisting> + + The information here is compared against the equivalent + information in the module's + <structname>XF86ModuleVersionInfo</structname> record (which + is described below). The values in comments above + indicate <quote>don't care</quote> settings for each of the fields. + The comparisons made are as follows: + + <variablelist> + <varlistentry> + <term><structfield>majorversion</structfield></term> + <listitem><para> + Must match the module's majorversion + exactly. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>minorversion</structfield></term> + <listitem><para> + The module's minor version must be + no less than this value. This + comparison is only made if + <structfield>majorversion</structfield> is + specified and matches. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>patchlevel</structfield></term> + <listitem><para> + The module's patchlevel must be no + less than this value. This comparison + is only made if + <structfield>minorversion</structfield> is + specified and matches. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>abiclass</structfield></term> + <listitem><para> + String must match the module's abiclass + string. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>abiversion</structfield></term> + <listitem><para> + Must be consistent with the module's + abiversion (major equal, minor no + older). + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>moduleclass</structfield></term> + <listitem><para> + String must match the module's + moduleclass string. + </para></listitem></varlistentry> + + </variablelist> + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>errmaj</parameter></term> + <listitem><para> + An optional pointer to a variable holding the major + part or the error code. When provided, + <parameter>*errmaj</parameter> is filled in when + <function>LoadModule()</function> fails. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>errmin</parameter></term> + <listitem><para> + Like <parameter>errmaj</parameter>, but for the minor part + of the error code. + </para></listitem></varlistentry> + + </variablelist> + + </para></blockquote> + </para></blockquote> + + <blockquote><para> + <programlisting> + void UnloadModule(pointer mod); + </programlisting> + <blockquote><para> + This function unloads the module referred to by the handle mod. + All child modules are also unloaded recursively. This function must + not be used to directly unload modules that are child modules (i.e., + those that have been loaded with the <function>LoadSubModule()</function> + described below). + </para> + + </blockquote></para></blockquote> + </sect2> + + <sect2> + <title>Module Requirements</title> + + <para> +Modules must provide information about themselves to the loader, and +may optionally provide entry points for "setup" and "teardown" functions +(those two functions are referred to here as <function>SetupProc</function> +and <function>TearDownProc</function>). + </para> + + <para> +The module information is contained in the +<structname>XF86ModuleVersionInfo</structname> struct, which is defined as follows: + + <programlisting> +typedef struct { + const char * modname; /* name of module, e.g. "foo" */ + const char * vendor; /* vendor specific string */ + CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */ + CARD32 _modinfo2_; /* infoarea with a binary editor/sign tool */ + CARD32 xf86version; /* contains XF86_VERSION_CURRENT */ + CARD8 majorversion; /* module-specific major version */ + CARD8 minorversion; /* module-specific minor version */ + CARD16 patchlevel; /* module-specific patch level */ + const char * abiclass; /* ABI class that the module uses */ + CARD32 abiversion; /* ABI version */ + const char * moduleclass; /* module class */ + CARD32 checksum[4]; /* contains a digital signature of the */ + /* version info structure */ +} XF86ModuleVersionInfo; + </programlisting> + +The fields are used as follows: + + <variablelist> + <varlistentry> + <term><structfield>modname</structfield></term> + <listitem><para> + The module's name. This field is currently only for + informational purposes, but the loader may be modified + in future to require it to match the module's canonical + name. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>vendor</structfield></term> + <listitem><para> + The module vendor. This field is for informational purposes + only. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>_modinfo1_</structfield></term> + <listitem><para> + This field holds the first part of a signature that can + be used to locate this structure in the binary. It should + always be initialised to <constant>MODINFOSTRING1</constant>. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>_modinfo2_</structfield></term> + <listitem><para> + This field holds the second part of a signature that can + be used to locate this structure in the binary. It should + always be initialised to <constant>MODINFOSTRING2</constant>. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>xf86version</structfield></term> + <listitem><para> + The XFree86 version against which the module was compiled. + This is mostly for informational/diagnostic purposes. It + should be initialised to <constant>XF86_VERSION_CURRENT</constant>, which is + defined in <filename>xf86Version.h</filename>. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>majorversion</structfield></term> + <listitem><para> + The module-specific major version. For modules where this + version is used for more than simply informational + purposes, the major version should only change (be + incremented) when ABI incompatibilities are introduced, + or ABI components are removed. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>minorversion</structfield></term> + <listitem><para> + The module-specific minor version. For modules where this + version is used for more than simply informational + purposes, the minor version should only change (be + incremented) when ABI additions are made in a backward + compatible way. It should be reset to zero when the major + version is increased. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>patchlevel</structfield></term> + <listitem><para> + The module-specific patch level. The patch level should + increase with new revisions of the module where there + are no ABI changes, and it should be reset to zero when + the minor version is increased. + </para></listitem></varlistentry> + + + <varlistentry> + <term><structfield>abiclass</structfield></term> + <listitem><para> + The ABI class that the module requires. The class is + specified as a string for easy extensibility. It should + indicate which (if any) of the X server's built-in ABI + classes that the module relies on, or a third-party ABI + if appropriate. Built-in ABI classes currently defined are: + + <variablelist> + <varlistentry> + <term><constant>ABI_CLASS_NONE</constant></term> + <listitem><para>no class + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ABI_CLASS_ANSIC</constant></term> + <listitem><para>only requires the ANSI C interfaces + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ABI_CLASS_VIDEODRV</constant></term> + <listitem><para>requires the video driver ABI + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ABI_CLASS_XINPUT</constant></term> + <listitem><para>requires the XInput driver ABI + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ABI_CLASS_EXTENSION</constant></term> + <listitem><para>requires the extension module ABI + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ABI_CLASS_FONT</constant></term> + <listitem><para>requires the font module ABI + </para></listitem></varlistentry> + </variablelist> + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>abiversion</structfield></term> + <listitem><para> + The version of abiclass that the module requires. The + version consists of major and minor components. The + major version must match and the minor version must be + no newer than that provided by the server or parent + module. Version identifiers for the built-in classes + currently defined are: + + <literallayout><constant> + ABI_ANSIC_VERSION + ABI_VIDEODRV_VERSION + ABI_XINPUT_VERSION + ABI_EXTENSION_VERSION + ABI_FONT_VERSION + </constant></literallayout> + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>moduleclass</structfield></term> + <listitem><para> + This is similar to the abiclass field, except that it + defines the type of module rather than the ABI it + requires. For example, although all video drivers require + the video driver ABI, not all modules that require the + video driver ABI are video drivers. This distinction + can be made with the moduleclass. Currently pre-defined + module classes are: + + <literallayout><constant> + MOD_CLASS_NONE + MOD_CLASS_VIDEODRV + MOD_CLASS_XINPUT + MOD_CLASS_FONT + MOD_CLASS_EXTENSION + </constant></literallayout> + + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>checksum</structfield></term> + <listitem><para> + Not currently used. + </para></listitem></varlistentry> + + </variablelist> + </para> + + <para> +The module version information, and the optional <function>SetupProc</function> +and <function>TearDownProc</function> entry points are found by the loader +by locating a data object in the module called "modnameModuleData", +where "modname" is the canonical name of the module. Modules must +contain such a data object, and it must be declared with global scope, +be compile-time initialised, and is of the following type: + + <programlisting> +typedef struct { + XF86ModuleVersionInfo * vers; + ModuleSetupProc setup; + ModuleTearDownProc teardown; +} XF86ModuleData; + </programlisting> + </para> + + <para> +The vers parameter must be initialised to a pointer to a correctly +initialised <structname>XF86ModuleVersionInfo</structname> struct. The other +two parameter are optional, and should be initialised to +<constant>NULL</constant> when not required. The other parameters are defined +as + + <blockquote><para> + <programlisting> + typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *); + + typedef void (*ModuleTearDownProc)(pointer); + + pointer SetupProc(pointer module, pointer options, + int *errmaj, int *errmin); + </programlisting> + <blockquote><para> + When defined, this function is called by the loader after successfully + loading a module. module is a handle for the newly loaded module, + and maybe used by the <function>SetupProc</function> if it calls other + loader functions that require a reference to it. The remaining + arguments are those that were passed to the + <function>LoadModule()</function> (or <function>LoadSubModule()</function>), + and are described above. When the <function>SetupProc</function> is + successful it must return a non-<constant>NULL</constant> value. The + loader checks this, and if it is <constant>NULL</constant> it unloads + the module and reports the failure to the caller of + <function>LoadModule()</function>. If the <function>SetupProc</function> + does things that need to be undone when the module is unloaded, + it should define a <function>TearDownProc</function>, and return a + pointer that the <function>TearDownProc</function> can use to undo what + has been done. + </para> + + <para> + When a module is loaded multiple times, the <function>SetupProc</function> + is called once for each time it is loaded. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void TearDownProc(pointer tearDownData); + </programlisting> + <blockquote><para> + When defined, this function is called when the loader unloads a + module. The <parameter>tearDownData</parameter> parameter is the return + value of the <function>SetupProc()</function> that was called when the + module was loaded. The purpose of this function is to clean up + before the module is unloaded (for example, by freeing allocated + resources). + </para> + + </blockquote></para></blockquote> + </para> + </sect2> + + <sect2> + <title>Public Loader Interface</title> + + <para> +The following is the Loader interface that is available to any part of +the server, and may also be used from within modules. + </para> + + <blockquote><para> + <programlisting> + pointer LoadSubModule(pointer parent, const char *module, + const char **subdirlist, const char **patternlist, + pointer options, const XF86ModReqInfo * modreq, + int *errmaj, int *errmin); + </programlisting> + <blockquote><para> + This function is like the <function>LoadModule()</function> function + described above, except that the module loaded is registered as a + child of the calling module. The <parameter>parent</parameter> parameter + is the calling module's handle. Modules loaded with this function + are automatically unloaded when the parent module is unloaded. The + other difference is that the path parameter may not be specified. + The module search path used for modules loaded with this function + is the default search path as initialised with + <function>LoaderSetPath()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void UnloadSubModule(pointer module); + </programlisting> + <blockquote><para> + This function unloads the module with handle <parameter>module</parameter>. + If that module itself has children, they are also unloaded. It is + like <function>UnloadModule()</function>, except that it is safe to use + for unloading child modules. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + pointer LoaderSymbol(const char *symbol); + </programlisting> + <blockquote><para> + This function returns the address of the symbol with name + <parameter>symbol</parameter>. This may be used to locate a module entry + point with a known name. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + char **LoaderlistDirs(const char **subdirlist, + const char **patternlist); + </programlisting> + <blockquote><para> + This function returns a <constant>NULL</constant> terminated list of + canonical modules names for modules found in the default module + search path. The <parameter>subdirlist</parameter> and + <parameter>patternlist</parameter> parameters are as described above, and + can be used to control the locations and names that are searched. + If no modules are found, the return value is <constant>NULL</constant>. + The returned list should be freed by calling + <function>LoaderFreeDirList()</function> when it is no longer needed. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoaderFreeDirList(char **list); + </programlisting> + <blockquote><para> + This function frees a module list created by + <function>LoaderlistDirs()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoaderReqSymLists(const char **list0, ...); + </programlisting> + <blockquote><para> + This function allows the registration of required symbols with the + loader. It is normally used by a caller of + <function>LoadSubModule()</function>. If any symbols registered in this + way are found to be unresolved when + <function>LoaderCheckUnresolved()</function> is called then + <function>LoaderCheckUnresolved()</function> will report a failure. + The function takes one or more <constant>NULL</constant> terminated + lists of symbols. The end of the argument list is indicated by a + <constant>NULL</constant> argument. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoaderReqSymbols(const char *sym0, ...); + </programlisting> + <blockquote><para> + This function is like <function>LoaderReqSymLists()</function> except + that its arguments are symbols rather than lists of symbols. This + function is more convenient when single functions are to be registered, + especially when the single function might depend on runtime factors. + The end of the argument list is indicated by a <constant>NULL</constant> + argument. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoaderRefSymLists(const char **list0, ...); + </programlisting> + <blockquote><para> + This function allows the registration of possibly unresolved symbols + with the loader. When <function>LoaderCheckUnresolved()</function> is + run it won't generate warnings for symbols registered in this way + unless they were also registered as required symbols. + The function takes one or more <constant>NULL</constant> terminated + lists of symbols. The end of the argument list is indicated by a + <constant>NULL</constant> argument. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoaderRefSymbols(const char *sym0, ...); + </programlisting> + <blockquote><para> + This function is like <function>LoaderRefSymLists()</function> except + that its arguments are symbols rather than lists of symbols. This + function is more convenient when single functions are to be registered, + especially when the single function might depend on runtime factors. + The end of the argument list is indicated by a <constant>NULL</constant> + argument. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int LoaderCheckUnresolved(int delayflag); + </programlisting> + <blockquote><para> + This function checks for unresolved symbols. It generates warnings + for unresolved symbols that have not been registered with + <function>LoaderRefSymLists()</function>, and maps them to a dummy + function. This behaviour may change in future. If unresolved + symbols are found that have been registered with + <function>LoaderReqSymLists()</function> or + <function>LoaderReqSymbols()</function> then this function returns a + non-zero value. If none of these symbols are unresolved the return + value is zero, indicating success. + </para> + + <para> + The <parameter>delayflag</parameter> parameter should normally be set to + <constant>LD_RESOLV_IFDONE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + LoaderErrorMsg(const char *name, const char *modname, + int errmaj, int errmin); + </programlisting> + <blockquote><para> + This function prints an error message that includes the text <quote>Failed + to load module</quote>, the module name <parameter>modname</parameter>, a message + specific to the <parameter>errmaj</parameter> value, and the value if + <parameter>errmin</parameter>. If <parameter>name</parameter> is + non-<constant>NULL</constant>, it is printed as an identifying prefix + to the message (followed by a <quote>:</quote>). + </para> + + </blockquote></para></blockquote> + </sect2> + + <sect2> + <title>Special Registration Functions</title> + + <para> +The loader contains some functions for registering some classes of modules. +These may be moved out of the loader at some point. + </para> + + <blockquote><para> + <programlisting> + void LoadExtension(ExtensionModule *ext); + </programlisting> + <blockquote><para> + This registers the entry points for the extension identified by + <parameter>ext</parameter>. The <structname>ExtensionModule</structname> struct is + defined as: + + <programlisting> +typedef struct { + InitExtension initFunc; + char * name; + Bool *disablePtr; + InitExtension setupFunc; +} ExtensionModule; + </programlisting> + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void LoadFont(FontModule *font); + </programlisting> + <blockquote><para> + This registers the entry points for the font rasteriser module + identified by <parameter>font</parameter>. The <structname>FontModule</structname> + struct is defined as: + + <programlisting> + typedef struct { + InitFont initFunc; + char * name; + pointer module; +} FontModule; + </programlisting> + </para> + + </blockquote></para></blockquote> + + </sect2> + + </sect1> + + <sect1> + <title>Helper Functions</title> + + <para> +This section describe <quote>helper</quote> functions that video driver +might find useful. While video drivers are not required to use any of +these to be considered <quote>compliant</quote>, the use of appropriate helpers is +strongly encouraged to improve the consistency of driver behaviour. + </para> + + <sect2> + <title>Functions for printing messages</title> + + <blockquote><para> + <programlisting> + ErrorF(const char *format, ...); + </programlisting> + <blockquote><para> + This is the basic function for writing to the error log (typically + stderr and/or a log file). Video drivers should usually avoid + using this directly in favour of the more specialised functions + described below. This function is useful for printing messages + while debugging a driver. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + FatalError(const char *format, ...); + </programlisting> + <blockquote><para> + This prints a message and causes the Xserver to abort. It should + rarely be used within a video driver, as most error conditions + should be flagged by the return values of the driver functions. + This allows the higher layers to decide how to proceed. In rare + cases, this can be used within a driver if a fatal unexpected + condition is found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + xf86ErrorF(const char *format, ...); + </programlisting> + <blockquote><para> + This is like <function>ErrorF()</function>, except that the message is + only printed when the Xserver's verbosity level is set to the + default (<constant>1</constant>) or higher. It means that the messages + are not printed when the server is started with the + <option>-quiet</option> flag. Typically this function would only be + used for continuing messages started with one of the more specialised + functions described below. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + xf86ErrorFVerb(int verb, const char *format, ...); + </programlisting> + <blockquote><para> + Like <function>xf86ErrorF()</function>, except the minimum verbosity + level for which the message is to be printed is given explicitly. + Passing a <parameter>verb</parameter> value of zero means the message + is always printed. A value higher than <constant>1</constant> can be + used for information would normally not be needed, but which might + be useful when diagnosing problems. + </para> + + </blockquote></para></blockquote> + + + <blockquote><para> + <programlisting> + xf86Msg(MessageType type, const char *format, ...); + </programlisting> + <blockquote><para> + This is like <function>xf86ErrorF()</function>, except that the message + is prefixed with a marker determined by the value of + <parameter>type</parameter>. The marker is used to indicate the type of + message (warning, error, probed value, config value, etc). Note + the <varname>xf86Verbose</varname> value is ignored for messages of + type <constant>X_ERROR</constant>. + </para> + + <para> + The marker values are: + + <variablelist> + <varlistentry> + <term><constant>X_PROBED</constant></term> + <listitem><para>Value was probed. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_CONFIG</constant></term> + <listitem><para>Value was given in the config file. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_DEFAULT</constant></term> + <listitem><para>Value is a default. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_CMDLINE</constant></term> + <listitem><para>Value was given on the command line. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_NOTICE</constant></term> + <listitem><para>Notice. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_ERROR</constant></term> + <listitem><para>Error message. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_WARNING</constant></term> + <listitem><para>Warning message. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_INFO</constant></term> + <listitem><para>Informational message. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_NONE</constant></term> + <listitem><para>No prefix. + </para></listitem></varlistentry> + <varlistentry> + <term><constant>X_NOT_IMPLEMENTED</constant></term> + <listitem><para>The message relates to functionality + that is not yetimplemented. + </para></listitem></varlistentry> + </variablelist> + + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + xf86MsgVerb(MessageType type, int verb, const char *format, ...); + </programlisting> + <blockquote><para> + Like <function>xf86Msg()</function>, but with the verbosity level given + explicitly. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...); + </programlisting> + <blockquote><para> + This is like <function>xf86Msg()</function> except that the driver's + name (the <structfield>name</structfield> field of the + <structname>ScrnInfoRec</structname>) followed by the + <parameter>scrnIndex</parameter> in parentheses is printed following the + prefix. This should be used by video drivers in most cases as it + clearly indicates which driver/screen the message is for. If + <parameter>scrnIndex</parameter> is negative, this function behaves + exactly like <function>xf86Msg()</function>. + </para> + + <para> + NOTE: This function can only be used after the + <structname>ScrnInfoRec</structname> and its <structfield>name</structfield> field + have been allocated. Normally, this means that it can not be + used before the END of the <function>ChipProbe()</function> function. + Prior to that, use <function>xf86Msg()</function>, providing the + driver's name explicitly. No screen number can be supplied at + that point. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, + const char *format, ...); + </programlisting> + <blockquote><para> + Like <function>xf86DrvMsg()</function>, but with the verbosity level + given explicitly. + </para> + + </blockquote></para></blockquote> + </sect2> + + + <sect2> + <title>Functions for setting values based on command line and config file</title> + + <blockquote><para> + <programlisting> + Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, + + int fbbpp, int depth24flags); + </programlisting> + <blockquote><para> + This function sets the <structfield>depth</structfield>, <structfield>pixmapBPP</structfield> and <structfield>bitsPerPixel</structfield> fields + of the <structname>ScrnInfoRec</structname>. It also determines the defaults for display-wide + attributes and pixmap formats the screen will support, and finds + the Display subsection that matches the depth/bpp. This function + should normally be called very early from the + <function>ChipPreInit()</function> function. + </para> + + <para> + It requires that the <structfield>confScreen</structfield> field of the <structname>ScrnInfoRec</structname> be + initialised prior to calling it. This is done by the XFree86 + common layer prior to calling <function>ChipPreInit()</function>. + </para> + + <para> + The parameters passed are: + + <variablelist> + <varlistentry> + <term><parameter>depth</parameter></term> + <listitem><para> + driver's preferred default depth if no other is given. + If zero, use the overall server default. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>bpp</parameter></term> + <listitem><para> + Same, but for the pixmap bpp. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>fbbpp</parameter></term> + <listitem><para> + Same, but for the framebuffer bpp. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>depth24flags</parameter></term> + <listitem><para> + Flags that indicate the level of 24/32bpp support + and whether conversion between different framebuffer + and pixmap formats is supported. The flags for this + argument are defined as follows, and multiple flags + may be ORed together: + + <variablelist> + <varlistentry> + <term><constant>NoDepth24Support</constant></term> + <listitem><para>No depth 24 formats supported + </para></listitem></varlistentry> + <varlistentry> + <term><constant>Support24bppFb</constant></term> + <listitem><para>24bpp framebuffer supported + </para></listitem></varlistentry> + <varlistentry> + <term><constant>Support32bppFb</constant></term> + <listitem><para>32bpp framebuffer supported + </para></listitem></varlistentry> + <varlistentry> + <term><constant>SupportConvert24to32</constant></term> + <listitem><para>Can convert 24bpp pixmap to 32bpp fb + </para></listitem></varlistentry> + <varlistentry> + <term><constant>SupportConvert32to24</constant></term> + <listitem><para>Can convert 32bpp pixmap to 24bpp fb + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ForceConvert24to32</constant></term> + <listitem><para>Force 24bpp pixmap to 32bpp fb conversion + </para></listitem></varlistentry> + <varlistentry> + <term><constant>ForceConvert32to24</constant></term> + <listitem><para>Force 32bpp pixmap to 24bpp fb conversion + </para></listitem></varlistentry> + </variablelist> + </para></listitem></varlistentry> + + </variablelist> + </para> + + <para> + It uses the command line, config file, and default values in the + correct order of precedence to determine the depth and bpp values. + It is up to the driver to check the results to see that it supports + them. If not the <function>ChipPreInit()</function> function should + return <constant>FALSE</constant>. + </para> + + <para> + If only one of depth/bpp is given, the other is set to a reasonable + (and consistent) default. + </para> + + <para> + If a driver finds that the initial <parameter>depth24flags</parameter> + it uses later results in a fb format that requires more video + memory than is available it may call this function a second time + with a different <parameter>depth24flags</parameter> setting. + </para> + + <para> + On success, the return value is <constant>TRUE</constant>. On failure + it prints an error message and returns <constant>FALSE</constant>. + </para> + + <para> + The following fields of the <structname>ScrnInfoRec</structname> are + initialised by this function: + + <blockquote><para> +<structfield>depth</structfield>, <structfield>bitsPerPixel</structfield>, +<structfield>display</structfield>, <structfield>imageByteOrder</structfield>, +<structfield>bitmapScanlinePad</structfield>, +<structfield>bitmapScanlineUnit</structfield>, <structfield>bitmapBitOrder</structfield>, +<structfield>numFormats</structfield>, <structfield>formats</structfield>, +<structfield>fbFormat</structfield>. + </para></blockquote> + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86PrintDepthBpp(scrnInfoPtr scrp); + </programlisting> + <blockquote><para> + This function can be used to print out the depth and bpp settings. + It should be called after the final call to + <function>xf86SetDepthBpp()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask); + </programlisting> + <blockquote><para> + This function sets the <structfield>weight</structfield>, <structfield>mask</structfield>, + <structfield>offset</structfield> and <structfield>rgbBits</structfield> fields of the + <structname>ScrnInfoRec</structname>. It would normally be called fairly + early in the <function>ChipPreInit()</function> function for + depths > 8bpp. + </para> + + <para> + It requires that the <structfield>depth</structfield> and + <structfield>display</structfield> fields of the <structname>ScrnInfoRec</structname> + be initialised prior to calling it. + </para> + + <para> + The parameters passed are: + + <variablelist> + <varlistentry> + <term><parameter>weight</parameter></term> + <listitem><para> + driver's preferred default weight if no other is given. + If zero, use the overall server default. + + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>mask</parameter></term> + <listitem><para> + Same, but for mask. + + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + It uses the command line, config file, and default values in the + correct order of precedence to determine the weight value. It + derives the mask and offset values from the weight and the defaults. + It is up to the driver to check the results to see that it supports + them. If not the <function>ChipPreInit()</function> function should + return <constant>FALSE</constant>. + </para> + + <para> + On success, this function prints a message showing the weight + values selected, and returns <constant>TRUE</constant>. + </para> + + <para> + On failure it prints an error message and returns <constant>FALSE</constant>. + </para> + + <para> + The following fields of the <structname>ScrnInfoRec</structname> are + initialised by this function: + + <blockquote><para> + <structfield>weight</structfield>, + <structfield>mask</structfield>, + <structfield>offset</structfield>. + </para></blockquote> + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual); + </programlisting> + <blockquote><para> + This function sets the <structfield>defaultVisual</structfield> field of the + <structname>ScrnInfoRec</structname>. It would normally be called fairly + early from the <function>ChipPreInit()</function> function. + </para> + + <para> + It requires that the <structfield>depth</structfield> and + <structfield>display</structfield> fields of the <structname>ScrnInfoRec</structname> + be initialised prior to calling it. + </para> + + <para> + The parameters passed are: + + <variablelist> + <varlistentry> + <term><parameter>visual</parameter></term> + <listitem><para> + driver's preferred default visual if no other is given. + If <constant>-1</constant>, use the overall server default. + </para></listitem></varlistentry> + + </variablelist> + </para> + + <para> + It uses the command line, config file, and default values in the + correct order of precedence to determine the default visual value. + It is up to the driver to check the result to see that it supports + it. If not the <function>ChipPreInit()</function> function should + return <constant>FALSE</constant>. + </para> + + <para> + On success, this function prints a message showing the default visual + selected, and returns <constant>TRUE</constant>. + </para> + + <para> + On failure it prints an error message and returns <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma); + </programlisting> + <blockquote><para> + This function sets the <structfield>gamma</structfield> field of the + <structname>ScrnInfoRec</structname>. It would normally be called fairly + early from the <function>ChipPreInit()</function> function in cases + where the driver supports gamma correction. + </para> + + <para> + It requires that the <structfield>monitor</structfield> field of the + <structname>ScrnInfoRec</structname> be initialised prior to calling it. + </para> + + <para> + The parameters passed are: + + <variablelist> + <varlistentry> + <term><parameter>gamma</parameter></term> + <listitem><para> + driver's preferred default gamma if no other is given. + If zero (<code>< 0.01</code>), use the overall server + default. + </para></listitem></varlistentry> + + </variablelist> + </para> + + <para> + It uses the command line, config file, and default values in the + correct order of precedence to determine the gamma value. It is + up to the driver to check the results to see that it supports + them. If not the <function>ChipPreInit()</function> function should + return <constant>FALSE</constant>. + </para> + + <para> + On success, this function prints a message showing the gamma + value selected, and returns <constant>TRUE</constant>. + </para> + + <para> + On failure it prints an error message and returns <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + + <blockquote><para> + <programlisting> + void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y); + </programlisting> + <blockquote><para> + This function sets the <structfield>xDpi</structfield> and <structfield>yDpi</structfield> + fields of the <structname>ScrnInfoRec</structname>. The driver can specify + preferred defaults by setting <parameter>x</parameter> and <parameter>y</parameter> + to non-zero values. The <option>-dpi</option> command line option + overrides all other settings. Otherwise, if the + <emphasis>DisplaySize</emphasis> entry is present in the screen's &k.monitor; + config file section, it is used together with the virtual size to + calculate the dpi values. This function should be called after + all the mode resolution has been done. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86SetBlackWhitePixels(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + This functions sets the <structfield>blackPixel</structfield> and + <structfield>whitePixel</structfield> fields of the <structname>ScrnInfoRec</structname> + according to whether or not the <option>-flipPixels</option> command + line options is present. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + const char *xf86GetVisualName(int visual); + </programlisting> + <blockquote><para> + Returns a printable string with the visual name matching the + numerical visual class provided. If the value is outside the + range of valid visual classes, <constant>NULL</constant> is returned. + </para> + + </blockquote></para></blockquote> + + </sect2> + + <sect2> + <title>Primary Mode functions</title> + + <para> +The primary mode helper functions are those which would normally be +used by a driver, unless it has unusual requirements which cannot +be catered for the by the helpers. + </para> + + <blockquote><para> + <programlisting> + int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, + char **modeNames, ClockRangePtr clockRanges, + int *linePitches, int minPitch, int maxPitch, + int pitchInc, int minHeight, int maxHeight, + int virtualX, int virtualY, + unsigned long apertureSize, + LookupModeFlags strategy); + </programlisting> + <blockquote><para> + This function basically selects the set of modes to use based on + those available and the various constraints. It also sets some + other related parameters. It is normally called near the end of + the <function>ChipPreInit()</function> function. + </para> + + <para> + The parameters passed to the function are: + + <variablelist> + <varlistentry> + <term><parameter>availModes</parameter></term> + <listitem><para> + List of modes available for the monitor. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>modeNames</parameter></term> + <listitem><para> + List of mode names that the screen is requesting. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>clockRanges</parameter></term> + <listitem><para> + A list of clock ranges allowed by the driver. Each + range includes whether interlaced or multiscan modes + are supported for that range. See below for more on + <parameter>clockRanges</parameter>. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>linePitches</parameter></term> + <listitem><para> + List of line pitches supported by the driver. + This is optional and should be <constant>NULL</constant> when + not used. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>minPitch</parameter></term> + <listitem><para> + Minimum line pitch supported by the driver. This must + be supplied when <parameter>linePitches</parameter> is + <constant>NULL</constant>, and is ignored otherwise. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>maxPitch</parameter></term> + <listitem><para> + Maximum line pitch supported by the driver. This is + required when <parameter>minPitch</parameter> is required. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>pitchInc</parameter></term> + <listitem><para> + Granularity of horizontal pitch values as supported by + the chipset. This is expressed in bits. This must be + supplied. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>minHeight</parameter></term> + <listitem><para> + minimum virtual height allowed. If zero, no limit is + imposed. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>maxHeight</parameter></term> + <listitem><para> + maximum virtual height allowed. If zero, no limit is + imposed. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>virtualX</parameter></term> + <listitem><para> + If greater than zero, this is the virtual width value + that will be used. Otherwise, the virtual width is + chosen to be the smallest that can accommodate the modes + selected. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>virtualY</parameter></term> + <listitem><para> + If greater than zero, this is the virtual height value + that will be used. Otherwise, the virtual height is + chosen to be the smallest that can accommodate the modes + selected. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>apertureSize</parameter></term> + <listitem><para> + The size (in bytes) of the aperture used to access video + memory. + </para></listitem></varlistentry> + + <varlistentry> + <term><parameter>strategy</parameter></term> + <listitem><para> + The strategy to use when choosing from multiple modes + with the same name. The options are: + + <variablelist> + <varlistentry> + <term><constant>LOOKUP_DEFAULT</constant></term> + <listitem><para>??? + </para></listitem></varlistentry> + <varlistentry> + <term><constant>LOOKUP_BEST_REFRESH</constant></term> + <listitem><para>mode with best refresh rate + </para></listitem></varlistentry> + <varlistentry> + <term><constant>LOOKUP_CLOSEST_CLOCK</constant></term> + <listitem><para>mode with closest matching clock + </para></listitem></varlistentry> + <varlistentry> + <term><constant>LOOKUP_LIST_ORDER</constant></term> + <listitem><para>first usable mode in list + </para></listitem></varlistentry> + </variablelist> + + The following options can also be combined (OR'ed) with + one of the above: + + <variablelist> + <varlistentry> + <term><constant>LOOKUP_CLKDIV2</constant></term> + <listitem><para>Allow halved clocks + </para></listitem></varlistentry> + <varlistentry> + <term><constant>LOOKUP_OPTIONAL_TOLERANCES</constant></term> + <listitem><para> + Allow missing horizontal sync and/or vertical refresh + ranges in the xorg.conf Monitor section + </para></listitem></varlistentry> + </variablelist> + + <constant>LOOKUP_OPTIONAL_TOLERANCES</constant> should only be + specified when the driver can ensure all modes it generates + can sync on, or at least not damage, the monitor or digital + flat panel. Horizontal sync and/or vertical refresh ranges + specified by the user will still be honoured (and acted upon). + + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + This function requires that the following fields of the + <structname>ScrnInfoRec</structname> are initialised prior to calling it: + + <variablelist> + <varlistentry> + <term><structfield>clock[]</structfield></term> + <listitem><para> + List of discrete clocks (when non-programmable) + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>numClocks</structfield></term> + <listitem><para> + Number of discrete clocks (when non-programmable) + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>progClock</structfield></term> + <listitem><para> + Whether the clock is programmable or not + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>monitor</structfield></term> + <listitem><para> + Pointer to the applicable xorg.conf monitor section + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>fdFormat</structfield></term> + <listitem><para> + Format of the screen buffer + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>videoRam</structfield></term> + <listitem><para> + total video memory size (in bytes) + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>maxHValue</structfield></term> + <listitem><para> + Maximum horizontal timing value allowed + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>maxVValue</structfield></term> + <listitem><para> + Maximum vertical timing value allowed + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>xInc</structfield></term> + <listitem><para> + Horizontal timing increment in pixels (defaults to 8) + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + This function fills in the following <structname>ScrnInfoRec</structname> + fields: + + <variablelist> + <varlistentry> + <term><structfield>modePool</structfield></term> + <listitem><para> + A subset of the modes available to the monitor which + are compatible with the driver. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>modes</structfield></term> + <listitem><para> + One mode entry for each of the requested modes, with + the status field of each filled in to indicate if + the mode has been accepted or not. This list of + modes is a circular list. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>virtualX</structfield></term> + <listitem><para> + The resulting virtual width. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>virtualY</structfield></term> + <listitem><para> + The resulting virtual height. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>displayWidth</structfield></term> + <listitem><para> + The resulting line pitch. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>virtualFrom</structfield></term> + <listitem><para> + Where the virtual size was determined from. + </para></listitem></varlistentry> + + </variablelist> + </para> + + <para> + The first stage of this function checks that the + <parameter>virtualX</parameter> and <parameter>virtualY</parameter> values + supplied (if greater than zero) are consistent with the line pitch + and <parameter>maxHeight</parameter> limitations. If not, an error + message is printed, and the return value is <constant>-1</constant>. + </para> + + <para> + The second stage sets up the mode pool, eliminating immediately + any modes that exceed the driver's line pitch limits, and also + the virtual width and height limits (if greater than zero). For + each mode removed an informational message is printed at verbosity + level <constant>2</constant>. If the mode pool ends up being empty, + a warning message is printed, and the return value is + <constant>0</constant>. + </para> + + <para> + The final stage is to lookup each mode name, and fill in the remaining + parameters. If an error condition is encountered, a message is + printed, and the return value is <constant>-1</constant>. Otherwise, + the return value is the number of valid modes found + (<constant>0</constant> if none are found). + </para> + + <para> + Even if the supplied mode names include duplicates, no two names will + ever match the same mode. Furthermore, if the supplied mode names do not + yield a valid mode (including the case where no names are passed at all), + the function will continue looking through the mode pool until it finds + a mode that survives all checks, or until the mode pool is exhausted. + </para> + + <para> + A message is only printed by this function when a fundamental + problem is found. It is intended that this function may be called + more than once if there is more than one set of constraints that + the driver can work within. + </para> + + <para> + If this function returns <constant>-1</constant>, the + <function>ChipPreInit()</function> function should return + <constant>FALSE</constant>. + </para> + + <para> + <parameter>clockRanges</parameter> is a linked list of clock ranges + allowed by the driver. If a mode doesn't fit in any of the defined + <parameter>clockRanges</parameter>, it is rejected. The first + <literal remap="tt">clockRange</literal> that matches all requirements is used. + This structure needs to be initialized to NULL when allocated. + </para> + + <para> + <parameter>clockRanges</parameter> contains the following fields: + + <variablelist> + <varlistentry> + <term><structfield>minClock</structfield></term> + <term><structfield>maxClock</structfield></term> + <listitem><para> + The lower and upper mode clock bounds for which the rest + of the <structname>clockRange</structname> parameters apply. + Since these are the mode clocks, they are not scaled + with the <structfield>ClockMulFactor</structfield> and + <structfield>ClockDivFactor</structfield>. It is up to the driver + to adjust these values if they depend on the clock + scaling factors. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>clockIndex</structfield></term> + <listitem><para> + (not used yet) <constant>-1</constant> for programmable clocks + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>interlaceAllowed</structfield></term> + <listitem><para> + <constant>TRUE</constant> if interlacing is allowed for this + range + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>doubleScanAllowed</structfield></term> + <listitem><para> + <constant>TRUE</constant> if doublescan or multiscan is allowed + for this range + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>ClockMulFactor</structfield></term> + <term><structfield>ClockDivFactor</structfield></term> + <listitem><para> + Scaling factors that are applied to the mode clocks ONLY + before selecting a clock index (when there is no + programmable clock) or a <structfield>SynthClock</structfield> + value. This is useful for drivers that support pixel + multiplexing or that need to scale the clocks because + of hardware restrictions (like sending 24bpp data to an + 8 bit RAMDAC using a tripled clock). + </para> + + <para> + Note that these parameters describe what must be done + to the mode clock to achieve the data transport clock + between graphics controller and RAMDAC. For example + for <literal remap="tt">2:1</literal> pixel multiplexing, two pixels + are sent to the RAMDAC on each clock. This allows the + RAMDAC clock to be half of the actual pixel clock. + Hence, <code>ClockMulFactor=1</code> and + <code>ClockDivFactor=2</code>. This means that the + clock used for clock selection (ie, determining the + correct clock index from the list of discrete clocks) + or for the <structfield>SynthClock</structfield> field in case of + a programmable clock is: (<code>mode->Clock * + ClockMulFactor) / ClockDivFactor</code>. + </para></listitem></varlistentry> + + <varlistentry> + <term><structfield>PrivFlags</structfield></term> + <listitem><para> + This field is copied into the + <literal remap="tt">mode->PrivFlags</literal> field when this + <literal remap="tt">clockRange</literal> is selected by + <function>xf86ValidateModes()</function>. It allows the + driver to find out what clock range was selected, so it + knows it needs to set up pixel multiplexing or any other + range-dependent feature. This field is purely + driver-defined: it may contain flag bits, an index or + anything else (as long as it is an <literal remap="tt">INT</literal>). + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + Note that the <structfield>mode->SynthClock</structfield> field is always + filled in by <function>xf86ValidateModes()</function>: it will contain + the <quote>data transport clock</quote>, which is the clock that will have + to be programmed in the chip when it has a programmable clock, or + the clock that will be picked from the clocks list when it is not + a programmable one. Thus: + + <programlisting> + mode->SynthClock = (mode->Clock * ClockMulFactor) / ClockDivFactor + </programlisting> + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86PruneDriverModes(ScrnInfoPtr scrp); + </programlisting> + <blockquote><para> + This function deletes modes in the modes field of the + <structname>ScrnInfoRec</structname> that have been marked as invalid. + This is normally run after having run + <function>xf86ValidateModes()</function> for the last time. For each + mode that is deleted, a warning message is printed out indicating + the reason for it being deleted. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags); + </programlisting> + <blockquote><para> + This function fills in the <structname>Crtc*</structname> fields for all + the modes in the <structfield>modes</structfield> field of the + <structname>ScrnInfoRec</structname>. The <parameter>adjustFlags</parameter> + parameter determines how the vertical CRTC values are scaled for + interlaced modes. They are halved if it is + <constant>INTERLACE_HALVE_V</constant>. The vertical CRTC values are + doubled for doublescan modes, and are further multiplied by the + <literal remap="tt">VScan</literal> value. + </para> + + <para> + This function is normally called after calling + <function>xf86PruneDriverModes()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86PrintModes(ScrnInfoPtr scrp); + </programlisting> + <blockquote><para> + This function prints out the virtual size setting, and the line + pitch being used. It also prints out two lines for each mode being + used. The first line includes the mode's pixel clock, horizontal sync + rate, refresh rate, and whether it is interlaced, doublescanned and/or + multi-scanned. The second line is the mode's Modeline. + </para> + + <para> + This function is normally called after calling + <function>xf86SetCrtcForModes()</function>. + </para> + + </blockquote></para></blockquote> + + </sect2> + + <sect2> + <title>Secondary Mode functions</title> + + <para> +The secondary mode helper functions are functions which are normally +used by the primary mode helper functions, and which are not normally +called directly by a driver. If a driver has unusual requirements +and needs to do its own mode validation, it might be able to make +use of some of these secondary mode helper functions. + </para> + + <blockquote><para> + <programlisting> + int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2, + int *divider); + </programlisting> + <blockquote><para> + This function returns the index of the closest clock to the + frequency <parameter>freq</parameter> given (in kHz). It assumes that + the number of clocks is greater than zero. It requires that the + <structfield>numClocks</structfield> and <structfield>clock</structfield> fields of the + <structname>ScrnInfoRec</structname> are initialised. The + <structfield>allowDiv2</structfield> field determines if the clocks can be + halved. The <parameter>*divider</parameter> return value indicates + whether clock division is used when determining the clock returned. + </para> + + <para> + This function is only for non-programmable clocks. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + const char *xf86ModeStatusToString(ModeStatus status); + </programlisting> + <blockquote><para> + This function converts the <parameter>status</parameter> value to a + descriptive printable string. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, + ClockRangePtr clockRanges, LookupModeFlags strategy); + </programlisting> + <blockquote><para> + This function takes a pointer to a mode with the name filled in, + and looks for a mode in the <structfield>modePool</structfield> list which + matches. The parameters of the matching mode are filled in to + <parameter>*modep</parameter>. The <parameter>clockRanges</parameter> and + <parameter>strategy</parameter> parameters are as for the + <function>xf86ValidateModes()</function> function above. + </para> + + <para> + This function requires the <structfield>modePool</structfield>, + <structfield>clock[]</structfield>, <structfield>numClocks</structfield> and + <structfield>progClock</structfield> fields of the <structname>ScrnInfoRec</structname> + to be initialised before being called. + </para> + + <para> + The return value is <constant>MODE_OK</constant> if a mode was found. + Otherwise it indicates why a matching mode could not be found. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, + DisplayModePtr mode, ClockRangePtr clockRanges, + LookupModeFlags strategy, int maxPitch, + int virtualX, int virtualY); + </programlisting> + <blockquote><para> + This function checks the passed mode against some basic driver + constraints. Apart from the ones passed explicitly, the + <structfield>maxHValue</structfield> and <structfield>maxVValue</structfield> fields of + the <structname>ScrnInfoRec</structname> are also used. If the + <structfield>ValidMode</structfield> field of the <structname>ScrnInfoRec</structname> + is set, that function is also called to check the mode. Next, the + mode is checked against the monitor's constraints. + </para> + + <para> + If the mode is consistent with all constraints, the return value + is <constant>MODE_OK</constant>. Otherwise the return value indicates + which constraint wasn't met. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode); + </programlisting> + <blockquote><para> + This function deletes the <parameter>mode</parameter> given from the + <parameter>modeList</parameter>. It never prints any messages, so it is + up to the caller to print a message if required. + </para> + + </blockquote></para></blockquote> + </sect2> + + <sect2> + <title>Functions for handling strings and tokens</title> + + <para> + Tables associating strings and numerical tokens combined with the + following functions provide a compact way of handling strings from + the config file, and for converting tokens into printable strings. + The table data structure is: + + <programlisting> +typedef struct { + int token; + const char * name; +} SymTabRec, *SymTabPtr; + </programlisting> + </para> + + <para> + A table is an initialised array of <structname>SymTabRec</structname>. The + tokens must be non-negative integers. Multiple names may be mapped + to a single token. The table is terminated with an element with a + <structfield>token</structfield> value of <constant>-1</constant> and + <constant>NULL</constant> for the <structfield>name</structfield>. + </para> + + <blockquote><para> + <programlisting> + const char *xf86TokenToString(SymTabPtr table, int token); + </programlisting> + <blockquote><para> + This function returns the first string in <parameter>table</parameter> + that matches <parameter>token</parameter>. If no match is found, + <constant>NULL</constant> is returned (NOTE, older versions of this + function would return the string "unknown" when no match is found). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + int xf86StringToToken(SymTabPtr table, const char *string); + </programlisting> + <blockquote><para> + This function returns the first token in <parameter>table</parameter> + that matches <parameter>string</parameter>. The + <function>xf86NameCmp()</function> function is used to determine the + match. If no match is found, <constant>-1</constant> is returned. + </para> + + </blockquote></para></blockquote> + + </sect2> + + <sect2> + <title>Functions for finding which config file entries to use</title> + + <para> + These functions can be used to select the appropriate config file + entries that match the detected hardware. They are described above + in the <link linkend="probe">Probe</link> and + <link linkend="avail">Available Functions</link> sections. + </para> + + </sect2> + + <sect2> + <title>Probing discrete clocks on old hardware</title> + + <para> + The <function>xf86GetClocks()</function> function may be used to assist + in finding the discrete pixel clock values on older hardware. + </para> + + <blockquote><para> + <programlisting> + void xf86GetClocks(ScrnInfoPtr pScrn, int num, + Bool (*ClockFunc)(ScrnInfoPtr, int), + void (*ProtectRegs)(ScrnInfoPtr, Bool), + void (*BlankScreen)(ScrnInfoPtr, Bool), + int vertsyncreg, int maskval, int knownclkindex, + int knownclkvalue); + </programlisting> + <blockquote><para> + This function uses a comparative sampling method to measure the + discrete pixel clock values. The number of discrete clocks to + measure is given by <parameter>num</parameter>. <parameter>clockFunc</parameter> + is a function that selects the <parameter>n</parameter>'th clock. It + should also save or restore any state affected by programming the + clocks when the index passed is <constant>CLK_REG_SAVE</constant> or + <constant>CLK_REG_RESTORE</constant>. <parameter>ProtectRegs</parameter> is + a function that does whatever is required to protect the hardware + state while selecting a new clock. <parameter>BlankScreen</parameter> + is a function that blanks the screen. <parameter>vertsyncreg</parameter> + and <parameter>maskval</parameter> are the register and bitmask to + check for the presence of vertical sync pulses. + <parameter>knownclkindex</parameter> and <parameter>knownclkvalue</parameter> + are the index and value of a known clock. These are the known + references on which the comparative measurements are based. The + number of clocks probed is set in <structfield>pScrn->numClocks</structfield>, + and the probed clocks are set in the <structfield>pScrn->clock[]</structfield> + array. All of the clock values are in units of kHz. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from); + </programlisting> + <blockquote><para> + Print out the pixel clocks <parameter>scrp->clock[]</parameter>. + <parameter>from</parameter> indicates whether the clocks were probed + or from the config file. + </para> + + </blockquote></para></blockquote> + </sect2> + + <sect2> + <title>Other helper functions</title> + + <blockquote><para> + <programlisting> + Bool xf86IsUnblank(int mode); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> when the screen saver mode specified + by <parameter>mode</parameter> requires the screen be unblanked, + and <constant>FALSE</constant> otherwise. The screen saver modes that + require blanking are <constant>SCREEN_SAVER_ON</constant> and + <constant>SCREEN_SAVER_CYCLE</constant>, and the screen saver modes that + require unblanking are <constant>SCREEN_SAVER_OFF</constant> and + <constant>SCREEN_SAVER_FORCER</constant>. Drivers may call this helper + from their <function>SaveScreen()</function> function to interpret the + screen saver modes. + </para> + + </blockquote></para></blockquote> + </sect2> + </sect1> + + <sect1> + <title>The vgahw module</title> + + <para> +The vgahw modules provides an interface for saving, restoring and +programming the standard VGA registers, and for handling VGA colourmaps. + </para> + + <sect2> + <title>Data Structures</title> + + <para> + The public data structures used by the vgahw module are + <structname>vgaRegRec</structname> and <structname>vgaHWRec</structname>. They are + defined in <filename>vgaHW.h.</filename> + </para> + + </sect2> + + <sect2> + <title>General vgahw Functions</title> + + <blockquote><para> + <programlisting> + Bool vgaHWGetHWRec(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + This function allocates a <structname>vgaHWRec</structname> structure, and + hooks it into the <structname>ScrnInfoRec</structname>'s + <structfield>privates</structfield>. Like all information hooked into the + <structfield>privates</structfield>, it is persistent, and only needs to be + allocated once per screen. This function should normally be called + from the driver's <function>ChipPreInit()</function> function. The + <structname>vgaHWRec</structname> is zero-allocated, and the following + fields are explicitly initialised: + + <variablelist> + <varlistentry> + <term><structfield>ModeReg.DAC[]</structfield></term> + <listitem><para>initialised with a default colourmap + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>ModeReg.Attribute[0x11]</structfield></term> + <listitem><para>initialised with the default overscan index + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>ShowOverscan</structfield></term> + <listitem><para>initialised according to the "ShowOverscan" option + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>paletteEnabled</structfield></term> + <listitem><para>initialised to FALSE + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>cmapSaved</structfield></term> + <listitem><para>initialised to FALSE + </para></listitem></varlistentry> + <varlistentry> + <term><structfield>pScrn</structfield></term> + <listitem><para>initialised to pScrn + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + In addition to the above, <function>vgaHWSetStdFuncs()</function> is + called to initialise the register access function fields with the + standard VGA set of functions. + </para> + + <para> + Once allocated, a pointer to the <structname>vgaHWRec</structname> can be + obtained from the <literal remap="tt">ScrnInfoPtr</literal> with the + <literal remap="tt">VGAHWPTR(pScrn)</literal> macro. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWFreeHWRec(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + This function frees a <structname>vgaHWRec</structname> structure. It + should be called from a driver's <function>ChipFreeScreen()</function> + function. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool vgaHWSetRegCounts(ScrnInfoPtr pScrn, int numCRTC, + int numSequencer, int numGraphics, int numAttribute); + </programlisting> + <blockquote><para> + This function allows the number of CRTC, Sequencer, Graphics and + Attribute registers to be changed. This makes it possible for + extended registers to be saved and restored with + <function>vgaHWSave()</function> and <function>vgaHWRestore()</function>. + This function should be called after a <structname>vgaHWRec</structname> + has been allocated with <function>vgaHWGetHWRec()</function>. The + default values are defined in <filename>vgaHW.h</filename> as follows: + + <programlisting> +#define VGA_NUM_CRTC 25 +#define VGA_NUM_SEQ 5 +#define VGA_NUM_GFX 9 +#define VGA_NUM_ATTR 21 + </programlisting> + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src); + </programlisting> + <blockquote><para> + This function copies the contents of the VGA saved registers in + <parameter>src</parameter> to <parameter>dst</parameter>. Note that it isn't + possible to simply do this with <function>memcpy()</function> (or + similar). This function returns <constant>TRUE</constant> unless there + is a problem allocating space for the <structfield>CRTC</structfield> and + related fields in <parameter>dst</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSetStdFuncs(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + This function initialises the register access function fields of + <parameter>hwp</parameter> with the standard VGA set of functions. This + is called by <function>vgaHWGetHWRec()</function>, so there is usually + no need to call this explicitly. The register access functions + are described below. If the registers are shadowed in some other + port I/O space (for example a PCI I/O region), these functions + can be used to access the shadowed registers if + <structfield>hwp->PIOOffset</structfield> is initialised with + <literal remap="tt">offset</literal>, calculated in such a way that when the + standard VGA I/O port value is added to it the correct offset into + the PIO area results. This value is initialised to zero in + <function>vgaHWGetHWRec()</function>. (Note: the PIOOffset functionality + is present in XFree86 4.1.0 and later.) + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset); + </programlisting> + <blockquote><para> + This function initialised the register access function fields of + hwp with a generic MMIO set of functions. + <structfield>hwp->MMIOBase</structfield> is initialised with + <parameter>base</parameter>, which must be the virtual address that the + start of MMIO area is mapped to. <structfield>hwp->MMIOOffset</structfield> + is initialised with <parameter>offset</parameter>, which must be calculated + in such a way that when the standard VGA I/O port value is added + to it the correct offset into the MMIO area results. That means + that these functions are only suitable when the VGA I/O ports are + made available in a direct mapping to the MMIO space. If that is + not the case, the driver will need to provide its own register + access functions. The register access functions are described + below. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool vgaHWMapMem(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + This function maps the VGA memory window. It requires that the + <structname>vgaHWRec</structname> be allocated. If a driver requires + non-default <structfield>MapPhys</structfield> or <structfield>MapSize</structfield> + settings (the physical location and size of the VGA memory window) + then those fields of the <structname>vgaHWRec</structname> must be initialised + before calling this function. Otherwise, this function initialiases + the default values of <constant>0xA0000</constant> for + <structfield>MapPhys</structfield> and <code>(64 * 1024)</code> for + <structfield>MapSize</structfield>. This function must be called before + attempting to save or restore the VGA state. If the driver doesn't + call it explicitly, the <function>vgaHWSave()</function> and + <function>vgaHWRestore()</function> functions may call it if they need + to access the VGA memory (in which case they will also call + <function>vgaHWUnmapMem()</function> to unmap the VGA memory before + exiting). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWUnmapMem(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + This function unmaps the VGA memory window. It must only be called + after the memory has been mapped. The <structfield>Base</structfield> field + of the <structname>vgaHWRec</structname> field is set to <constant>NULL</constant> + to indicate that the memory is no longer mapped. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWGetIOBase(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + This function initialises the <structfield>IOBase</structfield> field of the + <structname>vgaHWRec</structname>. This function must be called before + using any other functions that access the video hardware. + </para> + + <para> + A macro <function>VGAHW_GET_IOBASE()</function> is also available in + <filename>vgaHW.h</filename> that returns the I/O base, and this may + be used when the vgahw module is not loaded (for example, in the + <function>ChipProbe()</function> function). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWUnlock(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + This function unlocks the VGA <literal remap="tt">CRTC[0-7]</literal> registers, + and must be called before attempting to write to those registers. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWLock(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + This function locks the VGA <literal remap="tt">CRTC[0-7]</literal> registers. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWEnable(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + This function enables the VGA subsystem. (Note, this function is + present in XFree86 4.1.0 and later.). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWDisable(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + This function disables the VGA subsystem. (Note, this function is + present in XFree86 4.1.0 and later.). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags); + </programlisting> + <blockquote><para> + This function saves the VGA state. The state is written to the + <structname>vgaRegRec</structname> pointed to by <parameter>save</parameter>. + <parameter>flags</parameter> is set to one or more of the following flags + ORed together: + + <variablelist> + <varlistentry> + <term><constant>VGA_SR_MODE</constant></term> + <listitem><para>the mode setting registers are saved + </para></listitem></varlistentry> + <varlistentry> + <term><constant>VGA_SR_FONTS</constant></term> + <listitem><para>the text mode font/text data is saved + </para></listitem></varlistentry> + <varlistentry> + <term><constant>VGA_SR_CMAP</constant></term> + <listitem><para>the colourmap (LUT) is saved + </para></listitem></varlistentry> + <varlistentry> + <term><constant>VGA_SR_ALL</constant></term> + <listitem><para>all of the above are saved + </para></listitem></varlistentry> + </variablelist> + </para> + + <para> + The <structname>vgaHWRec</structname> and its <structfield>IOBase</structfield> fields + must be initialised before this function is called. If + <constant>VGA_SR_FONTS</constant> is set in <parameter>flags</parameter>, the + VGA memory window must be mapped. If it isn't then + <function>vgaHWMapMem()</function> will be called to map it, and + <function>vgaHWUnmapMem()</function> will be called to unmap it + afterwards. <function>vgaHWSave()</function> uses the three functions + below in the order <function>vgaHWSaveColormap()</function>, + <function>vgaHWSaveMode()</function>, <function>vgaHWSaveFonts()</function> to + carry out the different save phases. It is undecided at this + stage whether they will remain part of the vgahw module's public + interface or not. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSaveMode(ScrnInfoPtr pScrn, vgaRegPtr save); + </programlisting> + <blockquote><para> + This function saves the VGA mode registers. They are saved to + the <structname>vgaRegRec</structname> pointed to by <parameter>save</parameter>. + The registers saved are: + + <literallayout> + MiscOut + CRTC[0-0x18] + Attribute[0-0x14] + Graphics[0-8] + Sequencer[0-4] + </literallayout> + </para> + + <para> + The number of registers actually saved may be modified by a prior call + to <function>vgaHWSetRegCounts()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSaveFonts(ScrnInfoPtr pScrn, vgaRegPtr save); + </programlisting> + <blockquote><para> + This function saves the text mode font and text data held in the + video memory. If called while in a graphics mode, no save is + done. The VGA memory window must be mapped with + <function>vgaHWMapMem()</function> before to calling this function. + </para> + + <para> + On some platforms, one or more of the font/text plane saves may be + no-ops. This is the case when the platform's VC driver already + takes care of this. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSaveColormap(ScrnInfoPtr pScrn, vgaRegPtr save); + </programlisting> + <blockquote><para> + This function saves the VGA colourmap (LUT). Before saving it, it + attempts to verify that the colourmap is readable. In rare cases + where it isn't readable, a default colourmap is saved instead. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWRestore(ScrnInfoPtr pScrn, vgaRegPtr restore, int flags); + </programlisting> + <blockquote><para> + This function programs the VGA state. The state programmed is + that contained in the <structname>vgaRegRec</structname> pointed to by + <parameter>restore</parameter>. <parameter>flags</parameter> is the same + as described above for the <function>vgaHWSave()</function> function. + </para> + + <para> + The <structname>vgaHWRec</structname> and its <structfield>IOBase</structfield> fields + must be initialised before this function is called. If + <constant>VGA_SR_FONTS</constant> is set in <parameter>flags</parameter>, the + VGA memory window must be mapped. If it isn't then + <function>vgaHWMapMem()</function> will be called to map it, and + <function>vgaHWUnmapMem()</function> will be called to unmap it + afterwards. <function>vgaHWRestore()</function> uses the three functions + below in the order <function>vgaHWRestoreFonts()</function>, + <function>vgaHWRestoreMode()</function>, + <function>vgaHWRestoreColormap()</function> to carry out the different + restore phases. It is undecided at this stage whether they will + remain part of the vgahw module's public interface or not. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWRestoreMode(ScrnInfoPtr pScrn, vgaRegPtr restore); + </programlisting> + <blockquote><para> + This function restores the VGA mode registers. They are restored + from the data in the <structname>vgaRegRec</structname> pointed to by + <parameter>restore</parameter>. The registers restored are: + + <literallayout> + MiscOut + CRTC[0-0x18] + Attribute[0-0x14] + Graphics[0-8] + Sequencer[0-4] + </literallayout> + </para> + + <para> + The number of registers actually restored may be modified by a prior call + to <function>vgaHWSetRegCounts()</function>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWRestoreFonts(ScrnInfoPtr pScrn, vgaRegPtr restore); + </programlisting> + <blockquote><para> + This function restores the text mode font and text data to the + video memory. The VGA memory window must be mapped with + <function>vgaHWMapMem()</function> before to calling this function. + </para> + + <para> + On some platforms, one or more of the font/text plane restores + may be no-ops. This is the case when the platform's VC driver + already takes care of this. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWRestoreColormap(ScrnInfoPtr pScrn, vgaRegPtr restore); + </programlisting> + <blockquote><para> + This function restores the VGA colourmap (LUT). + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWInit(ScrnInfoPtr pScrn, DisplayModePtr mode); + </programlisting> + <blockquote><para> + This function fills in the <structname>vgaHWRec</structname>'s + <structfield>ModeReg</structfield> field with the values appropriate for + programming the given video mode. It requires that the + <structname>ScrnInfoRec</structname>'s <structfield>depth</structfield> field is + initialised, which determines how the registers are programmed. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWSeqReset(vgaHWPtr hwp, Bool start); + </programlisting> + <blockquote><para> + Do a VGA sequencer reset. If start is <constant>TRUE</constant>, the + reset is started. If start is <constant>FALSE</constant>, the reset + is ended. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWProtect(ScrnInfoPtr pScrn, Bool on); + </programlisting> + <blockquote><para> + This function protects VGA registers and memory from corruption + during loads. It is typically called with on set to + <constant>TRUE</constant> before programming, and with on set to + <constant>FALSE</constant> after programming. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode); + </programlisting> + <blockquote><para> + This function blanks and unblanks the screen. It is blanked when + <parameter>mode</parameter> is <constant>SCREEN_SAVER_ON</constant> or + <constant>SCREEN_SAVER_CYCLE</constant>, and unblanked when + <parameter>mode</parameter> is <constant>SCREEN_SAVER_OFF</constant> or + <constant>SCREEN_SAVER_FORCER</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on); + </programlisting> + <blockquote><para> + This function blanks and unblanks the screen. It is blanked when + <parameter>on</parameter> is <constant>FALSE</constant>, and unblanked when + <parameter>on</parameter> is <constant>TRUE</constant>. This function is + provided for use in cases where the <structname>ScrnInfoRec</structname> + can't be derived from the <structname>ScreenRec</structname> (while probing + for clocks, for example). + </para> + + </blockquote></para></blockquote> + + </sect2> + + <sect2> + <title>VGA Colormap Functions</title> + + <para> + The vgahw module uses the standard colormap support (see the + <link linkend="cmap">Colormap Handling</link> section. This is initialised + with the following function: + + <blockquote><para> + <programlisting> + Bool vgaHWHandleColormaps(ScreenPtr pScreen); + </programlisting> + </para></blockquote> + </para> + + </sect2> + + <sect2> + <title>VGA Register Access Functions</title> + + <para> + The vgahw module abstracts access to the standard VGA registers by + using a set of functions held in the <structname>vgaHWRec</structname>. When + the <structname>vgaHWRec</structname> is created these function pointers are + initialised with the set of standard VGA I/O register access functions. + In addition to these, the vgahw module includes a basic set of MMIO + register access functions, and the <structname>vgaHWRec</structname> function + pointers can be initialised to these by calling the + <function>vgaHWSetMmioFuncs()</function> function described above. Some + drivers/platforms may require a different set of functions for VGA + access. The access functions are described here. + </para> + + + <blockquote><para> + <programlisting> + void writeCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to CRTC register <parameter>index</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readCrtc(vgaHWPtr hwp, CARD8 index); + </programlisting> + <blockquote><para> + Return the value read from CRTC register <parameter>index</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeGr(vgaHWPtr hwp, CARD8 index, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to Graphics Controller register + <parameter>index</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readGR(vgaHWPtr hwp, CARD8 index); + </programlisting> + <blockquote><para> + Return the value read from Graphics Controller register + <parameter>index</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeSeq(vgaHWPtr hwp, CARD8 index, CARD8, value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to Sequencer register + <parameter>index</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readSeq(vgaHWPtr hwp, CARD8 index); + </programlisting> + <blockquote><para> + Return the value read from Sequencer register <parameter>index</parameter>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeAttr(vgaHWPtr hwp, CARD8 index, CARD8, value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to Attribute Controller register + <parameter>index</parameter>. When writing out the index value this + function should set bit 5 (<constant>0x20</constant>) according to the + setting of <structfield>hwp->paletteEnabled</structfield> in order to + preserve the palette access state. It should be cleared when + <structfield>hwp->paletteEnabled</structfield> is <constant>TRUE</constant> + and set when it is <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readAttr(vgaHWPtr hwp, CARD8 index); + </programlisting> + <blockquote><para> + Return the value read from Attribute Controller register + <parameter>index</parameter>. When writing out the index value this + function should set bit 5 (<constant>0x20</constant>) according to the + setting of <structfield>hwp->paletteEnabled</structfield> in order to + preserve the palette access state. It should be cleared when + <structfield>hwp->paletteEnabled</structfield> is <constant>TRUE</constant> + and set when it is <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeMiscOut(vgaHWPtr hwp, CARD8 value); + </programlisting> + <blockquote><para> + Write <quote><parameter>value</parameter></quote> to the Miscellaneous Output register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readMiscOut(vgwHWPtr hwp); + </programlisting> + <blockquote><para> + Return the value read from the Miscellaneous Output register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void enablePalette(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + Clear the palette address source bit in the Attribute Controller + index register and set <literal remap="tt">hwp->paletteEnabled</literal> to + <constant>TRUE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void disablePalette(vgaHWPtr hwp); + </programlisting> + <blockquote><para> + Set the palette address source bit in the Attribute Controller + index register and set <literal remap="tt">hwp->paletteEnabled</literal> to + <constant>FALSE</constant>. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeDacMask(vgaHWPtr hwp, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to the DAC Mask register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readDacMask(vgaHWptr hwp); + </programlisting> + <blockquote><para> + Return the value read from the DAC Mask register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeDacReadAddress(vgaHWPtr hwp, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to the DAC Read Address register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeDacWriteAddress(vgaHWPtr hwp, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to the DAC Write Address register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeDacData(vgaHWPtr hwp, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to the DAC Data register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readDacData(vgaHWptr hwp); + </programlisting> + <blockquote><para> + Return the value read from the DAC Data register. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + CARD8 readEnable(vgaHWptr hwp); + </programlisting> + <blockquote><para> + Return the value read from the VGA Enable register. (Note: This + function is present in XFree86 4.1.0 and later.) + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> + void writeEnable(vgaHWPtr hwp, CARD8 value); + </programlisting> + <blockquote><para> + Write <parameter>value</parameter> to the VGA Enable register. (Note: This + function is present in XFree86 4.1.0 and later.) + </para> + + </blockquote></para></blockquote> + </sect2> + </sect1> + + <sect1 id="sample"> + <title>Some notes about writing a driver</title> + + <note><para>NOTE: some parts of this are not up to date</para></note> + + <para> +The following is an outline for writing a basic unaccelerated driver +for a PCI video card with a linear mapped framebuffer, and which has a +VGA core. It is includes some general information that is relevant to +most drivers (even those which don't fit that basic description). + </para> + + <para> +The information here is based on the initial conversion of the Matrox +Millennium driver to the <quote>new design</quote>. For a fleshing out and sample +implementation of some of the bits outlined here, refer to that driver. +Note that this is an example only. The approach used here will not be +appropriate for all drivers. + </para> + + <para> +Each driver must reserve a unique driver name, and a string that is used +to prefix all of its externally visible symbols. This is to avoid name +space clashes when loading multiple drivers. The examples here are for +the <quote>ZZZ</quote> driver, which uses the <quote>ZZZ</quote> or <quote>zzz</quote> prefix for its externally +visible symbols. + </para> + + <sect2> + <title>Include files</title> + + <para> + All drivers normally include the following headers: + <literallayout><filename> + "xf86.h" + "xf86_OSproc.h" + "xf86_ansic.h" + "xf86Resources.h" + </filename></literallayout> + Wherever inb/outb (and related things) are used the following should be + included: + <literallayout><filename> + "compiler.h" + </filename></literallayout> + Note: in drivers, this must be included after <filename>"xf86_ansic.h"</filename>. + </para> + + <para> + Drivers that need to access PCI vendor/device definitions need this: + <literallayout><filename> + "xf86PciInfo.h" + </filename></literallayout> + </para> + + <para> + Drivers that need to access the PCI config space need this: + <literallayout><filename> + "xf86Pci.h" + </filename></literallayout> + </para> + + <para> + Drivers using the mi banking wrapper need: + + <literallayout><filename> + "mibank.h" + </filename></literallayout> + </para> + + <para> + Drivers that initialise a SW cursor need this: + <literallayout><filename> + "mipointer.h" + </filename></literallayout> + </para> + + <para> + All drivers implementing backing store need this: + <literallayout><filename> + "mibstore.h" + </filename></literallayout> + </para> + + <para> + All drivers using the mi colourmap code need this: + <literallayout><filename> + "micmap.h" + </filename></literallayout> + </para> + + <para> + If a driver uses the vgahw module, it needs this: + <literallayout><filename> + "vgaHW.h" + </filename></literallayout> + </para> + + <para> + Drivers supporting VGA or Hercules monochrome screens need: + <literallayout><filename> + "xf1bpp.h" + </filename></literallayout> + </para> + + <para> + Drivers supporting VGA or EGC 16-colour screens need: + <literallayout><filename> + "xf4bpp.h" + </filename></literallayout> + </para> + + <para> + Drivers using cfb need: + <programlisting> + #define PSZ 8 + #include "cfb.h" + #undef PSZ + </programlisting> + </para> + + <para> + Drivers supporting bpp 16, 24 or 32 with cfb need one or more of: + <literallayout><filename> + "cfb16.h" + "cfb24.h" + "cfb32.h" + </filename></literallayout> + </para> + + <para> + The driver's own header file: + <literallayout><filename> + "zzz.h" + </filename></literallayout> + </para> + + <para> + Drivers must NOT include the following: + + <literallayout><filename> + "xf86Priv.h" + "xf86Privstr.h" + "xf86_libc.h" + "xf86_OSlib.h" + "Xos.h"</filename> + any OS header + </literallayout> + </para> + + </sect2> + + <sect2> + <title>Data structures and initialisation</title> + + <itemizedlist> + <listitem> + <para>The following macros should be defined: + <programlisting> +#define VERSION <version-as-an-int> +#define ZZZ_NAME "ZZZ" /* the name used to prefix messages */ +#define ZZZ_DRIVER_NAME "zzz" /* the driver name as used in config file */ +#define ZZZ_MAJOR_VERSION <int> +#define ZZZ_MINOR_VERSION <int> +#define ZZZ_PATCHLEVEL <int> + </programlisting> + </para> + <para> + NOTE: <constant>ZZZ_DRIVER_NAME</constant> should match the name of the + driver module without things like the "lib" prefix, the "_drv" suffix + or filename extensions. + </para> + </listitem> + + <listitem> + <para> + A DriverRec must be defined, which includes the functions required + at the pre-probe phase. The name of this DriverRec must be an + upper-case version of ZZZ_DRIVER_NAME (for the purposes of static + linking). + <programlisting> +DriverRec ZZZ = { + VERSION, + ZZZ_DRIVER_NAME, + ZZZIdentify, + ZZZProbe, + ZZZAvailableOptions, + NULL, + 0 +}; + </programlisting> + </para> + </listitem> + + <listitem> + <para>Define list of supported chips and their matching ID: + <programlisting> +static SymTabRec ZZZChipsets[] = { + { PCI_CHIP_ZZZ1234, "zzz1234a" }, + { PCI_CHIP_ZZZ5678, "zzz5678a" }, + { -1, NULL } +}; + </programlisting> + </para> + <para> + The token field may be any integer value that the driver may use to + uniquely identify the supported chipsets. For drivers that support + only PCI devices using the PCI device IDs might be a natural choice, + but this isn't mandatory. For drivers that support both PCI and other + devices (like ISA), some other ID should probably used. When other + IDs are used as the tokens it is recommended that the names be + defined as an <type>enum</type> type. + </para> + </listitem> + + <listitem> + <para> + If the driver uses the <function>xf86MatchPciInstances()</function> + helper (recommended for drivers that support PCI cards) a list that + maps PCI IDs to chip IDs and fixed resources must be defined: + <programlisting> +static PciChipsets ZZZPciChipsets[] = { + { PCI_CHIP_ZZZ1234, PCI_CHIP_ZZZ1234, RES_SHARED_VGA }, + { PCI_CHIP_ZZZ5678, PCI_CHIP_ZZZ5678, RES_SHARED_VGA }, + { -1, -1, RES_UNDEFINED } +} + </programlisting> + </para> + </listitem> + + <listitem> + <para> + Define the <structname>XF86ModuleVersionInfo</structname> struct for the + driver. This is required for the dynamically loaded version: + <programlisting> +static XF86ModuleVersionInfo zzzVersRec = +{ + "zzz", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + ZZZ_MAJOR_VERSION, ZZZ_MINOR_VERSION, ZZZ_PATCHLEVEL, + ABI_CLASS_VIDEODRV, + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + {0,0,0,0} +}; + </programlisting> + </para> + </listitem> + + <listitem> + <para> + Define a data structure to hold the driver's screen-specific data. + This must be used instead of global variables. This would be defined + in the <filename>"zzz.h"</filename> file, something like: + <programlisting> +typedef struct { + type1 field1; + type2 field2; + int fooHack; + Bool pciRetry; + Bool noAccel; + Bool hwCursor; + CloseScreenProcPtr CloseScreen; + OptionInfoPtr Options; + ... +} ZZZRec, *ZZZPtr; + </programlisting> + </para> + </listitem> + + <listitem> + <para> + Define the list of config file Options that the driver accepts. For + consistency between drivers those in the list of <quote>standard</quote> options + should be used where appropriate before inventing new options. + + <programlisting> +typedef enum { + OPTION_FOO_HACK, + OPTION_PCI_RETRY, + OPTION_HW_CURSOR, + OPTION_NOACCEL +} ZZZOpts; + +static const OptionInfoRec ZZZOptions[] = { + { OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE }, + { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } +}; + </programlisting> + </para> + </listitem> + </itemizedlist> + </sect2> + + <sect2> + <title>Functions</title> + + + <sect3> + <title>SetupProc</title> + + <para> + For dynamically loaded modules, a <varname>ModuleData</varname> + variable is required. It is should be the name of the driver + prepended to "ModuleData". A <function>Setup()</function> function is + also required, which calls <function>xf86AddDriver()</function> to add + the driver to the main list of drivers. + </para> + + <programlisting> +static MODULESETUPPROTO(zzzSetup); + +XF86ModuleData zzzModuleData = { &zzzVersRec, zzzSetup, NULL }; + +static pointer +zzzSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + static Bool setupDone = FALSE; + + /* This module should be loaded only once, but check to be sure. */ + + if (!setupDone) { + /* + * Modules that this driver always requires may be loaded + * here by calling LoadSubModule(). + */ + + setupDone = TRUE; + xf86AddDriver(&MGA, module, 0); + + /* + * The return value must be non-NULL on success even though + * there is no TearDownProc. + */ + return (pointer)1; + } else { + if (errmaj) *errmaj = LDR_ONCEONLY; + return NULL; + } +} + </programlisting> + </sect3> + + <sect3> + <title>GetRec, FreeRec</title> + + <para> + A function is usually required to allocate the driver's + screen-specific data structure and hook it into the + <structname>ScrnInfoRec</structname>'s <structfield>driverPrivate</structfield> field. + The <structname>ScrnInfoRec</structname>'s <structfield>driverPrivate</structfield> is + initialised to <constant>NULL</constant>, so it is easy to check if the + initialisation has already been done. After allocating it, initialise + the fields. By using <function>xnfcalloc()</function> to do the allocation + it is zeroed, and if the allocation fails the server exits. + </para> + + <para> + NOTE: + When allocating structures from inside the driver which are defined + on the common level it is important to initialize the structure to + zero. + Only this guarantees that the server remains source compatible to + future changes in common level structures. + </para> + + <programlisting> +static Bool +ZZZGetRec(ScrnInfoPtr pScrn) +{ + if (pScrn->driverPrivate != NULL) + return TRUE; + pScrn->driverPrivate = xnfcalloc(sizeof(ZZZRec), 1); + /* Initialise as required */ + ... + return TRUE; +} + </programlisting> + + <para> + Define a macro in <filename>"zzz.h"</filename> which gets a pointer to + the <structname>ZZZRec</structname> when given <parameter>pScrn</parameter>: + + <programlisting> +#define ZZZPTR(p) ((ZZZPtr)((p)->driverPrivate)) + </programlisting> + </para> + + <para> + Define a function to free the above, setting it to <constant>NULL</constant> + once it has been freed: + + <programlisting> +static void +ZZZFreeRec(ScrnInfoPtr pScrn) +{ + if (pScrn->driverPrivate == NULL) + return; + xfree(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; +} + </programlisting> + </para> + </sect3> + + <sect3> + <title>Identify</title> + + <para> + Define the <function>Identify()</function> function. It is run before + the Probe, and typically prints out an identifying message, which + might include the chipsets it supports. This function is mandatory: + + <programlisting> +static void +ZZZIdentify(int flags) +{ + xf86PrintChipsets(ZZZ_NAME, "driver for ZZZ Tech chipsets", + ZZZChipsets); +} + </programlisting> + </para> + </sect3> + + <sect3> + <title>Probe</title> + + <para> + Define the <function>Probe()</function> function. The purpose of this + is to find all instances of the hardware that the driver supports, + and for the ones not already claimed by another driver, claim the + slot, and allocate a <structname>ScrnInfoRec</structname>. This should be + a minimal probe, and it should under no circumstances leave the + state of the hardware changed. Because a device is found, don't + assume that it will be used. Don't do any initialisations other + than the required <structname>ScrnInfoRec</structname> initialisations. + Don't allocate any new data structures. + </para> + + <para> + This function is mandatory. + </para> + + <para> + NOTE: The <function>xf86DrvMsg()</function> functions cannot be used from + the Probe. + </para> + + <programlisting> +static Bool +ZZZProbe(DriverPtr drv, int flags) +{ + Bool foundScreen = FALSE; + int numDevSections, numUsed; + GDevPtr *devSections; + int *usedChips; + int i; + + /* + * Find the config file Device sections that match this + * driver, and return if there are none. + */ + if ((numDevSections = xf86MatchDevice(ZZZ_DRIVER_NAME, + &devSections)) <= 0) { + return FALSE; + } + + /* + * Since this is a PCI card, "probing" just amounts to checking + * the PCI data that the server has already collected. If there + * is none, return. + * + * Although the config file is allowed to override things, it + * is reasonable to not allow it to override the detection + * of no PCI video cards. + * + * The provided xf86MatchPciInstances() helper takes care of + * the details. + */ + /* test if PCI bus present */ + if (xf86GetPciVideoInfo()) { + + numUsed = xf86MatchPciInstances(ZZZ_NAME, PCI_VENDOR_ZZZ, + ZZZChipsets, ZZZPciChipsets, devSections, + numDevSections, drv, &usedChips); + + for (i = 0; i < numUsed; i++) { + ScrnInfoPtr pScrn = NULL; + if ((pScrn = xf86ConfigPciEntity(pScrn, flags, usedChips[i], + ZZZPciChipsets, NULL, NULL, + NULL, NULL, NULL))) { + /* Allocate a ScrnInfoRec */ + pScrn->driverVersion = VERSION; + pScrn->driverName = ZZZ_DRIVER_NAME; + pScrn->name = ZZZ_NAME; + pScrn->Probe = ZZZProbe; + pScrn->PreInit = ZZZPreInit; + pScrn->ScreenInit = ZZZScreenInit; + pScrn->SwitchMode = ZZZSwitchMode; + pScrn->AdjustFrame = ZZZAdjustFrame; + pScrn->EnterVT = ZZZEnterVT; + pScrn->LeaveVT = ZZZLeaveVT; + pScrn->FreeScreen = ZZZFreeScreen; + pScrn->ValidMode = ZZZValidMode; + foundScreen = TRUE; + /* add screen to entity */ + } + } + xfree(usedChips); + } + +#ifdef HAS_ISA_DEVS + /* + * If the driver supports ISA hardware, the following block + * can be included too. + */ + numUsed = xf86MatchIsaInstances(ZZZ_NAME, ZZZChipsets, + ZZZIsaChipsets, drv, ZZZFindIsaDevice, + devSections, numDevSections, &usedChips); + for (i = 0; i < numUsed; i++) { + ScrnInfoPtr pScrn = NULL; + if ((pScrn = xf86ConfigIsaEntity(pScrn, flags, usedChips[i], + ZZZIsaChipsets, NULL, NULL, NULL, + NULL, NULL))) { + pScrn->driverVersion = VERSION; + pScrn->driverName = ZZZ_DRIVER_NAME; + pScrn->name = ZZZ_NAME; + pScrn->Probe = ZZZProbe; + pScrn->PreInit = ZZZPreInit; + pScrn->ScreenInit = ZZZScreenInit; + pScrn->SwitchMode = ZZZSwitchMode; + pScrn->AdjustFrame = ZZZAdjustFrame; + pScrn->EnterVT = ZZZEnterVT; + pScrn->LeaveVT = ZZZLeaveVT; + pScrn->FreeScreen = ZZZFreeScreen; + pScrn->ValidMode = ZZZValidMode; + foundScreen = TRUE; + } + } + xfree(usedChips); +#endif /* HAS_ISA_DEVS */ + + xfree(devSections); + return foundScreen; + </programlisting> + </sect3> + + <sect3> + <title>AvailableOptions</title> + + <para> + Define the <function>AvailableOptions()</function> function. The purpose + of this is to return the available driver options back to the + -configure option, so that an xorg.conf file can be built and the + user can see which options are available for them to use. + </para> + </sect3> + + <sect3> + <title>PreInit</title> + + <para> + Define the <function>PreInit()</function> function. The purpose of + this is to find all the information required to determine if the + configuration is usable, and to initialise those parts of the + <structname>ScrnInfoRec</structname> that can be set once at the beginning + of the first server generation. The information should be found in + the least intrusive way possible. + </para> + + <para> + This function is mandatory. + </para> + + <para> + NOTES: + <orderedlist> + <listitem><para> + The <function>PreInit()</function> function is only called once + during the life of the X server (at the start of the first + generation). + </para></listitem> + + <listitem><para> + Data allocated here must be of the type that persists for + the life of the X server. This means that data that hooks into + the <structname>ScrnInfoRec</structname>'s <structfield>privates</structfield> + field should be allocated here, but data that hooks into the + <structname>ScreenRec</structname>'s <structfield>devPrivates</structfield> field + should not be allocated here. The <structfield>driverPrivate</structfield> + field should also be allocated here. + </para></listitem> + + <listitem><para> + Although the <structname>ScrnInfoRec</structname> has been allocated + before this function is called, the <structname>ScreenRec</structname> + has not been allocated. That means that things requiring it + cannot be used in this function. + </para></listitem> + + <listitem><para> + Very little of the <structname>ScrnInfoRec</structname> has been + initialised when this function is called. It is important to + get the order of doing things right in this function. + </para></listitem> + + </orderedlist> + </para> + + <programlisting> +static Bool +ZZZPreInit(ScrnInfoPtr pScrn, int flags) +{ + /* Fill in the monitor field */ + pScrn->monitor = pScrn->confScreen->monitor; + + /* + * If using the vgahw module, it will typically be loaded + * here by calling xf86LoadSubModule(pScrn, "vgahw"); + */ + + /* + * Set the depth/bpp. Use the globally preferred depth/bpp. If the + * driver has special default depth/bpp requirements, the defaults should + * be specified here explicitly. + * We support both 24bpp and 32bpp framebuffer layouts. + * This sets pScrn->display also. + */ + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, + Support24bppFb | Support32bppFb)) { + return FALSE; + } else { + if (depth/bpp isn't one we support) { + print error message; + return FALSE; + } + } + /* Print out the depth/bpp that was set */ + xf86PrintDepthBpp(pScrn); + + /* Set bits per RGB for 8bpp */ + if (pScrn->depth <= 8) { + /* Take into account a dac_6_bit option here */ + pScrn->rgbBits = 6 or 8; + } + + /* + * xf86SetWeight() and xf86SetDefaultVisual() must be called + * after pScrn->display is initialised. + */ + + /* Set weight/mask/offset for depth > 8 */ + if (pScrn->depth > 8) { + if (!xf86SetWeight(pScrn, defaultWeight, defaultMask)) { + return FALSE; + } else { + if (weight isn't one we support) { + print error message; + return FALSE; + } + } + } + + /* Set the default visual. */ + if (!xf86SetDefaultVisual(pScrn, -1)) { + return FALSE; + } else { + if (visual isn't one we support) { + print error message; + return FALSE; + } + } + + /* If the driver supports gamma correction, set the gamma. */ + if (!xf86SetGamma(pScrn, default_gamma)) { + return FALSE; + } + + /* This driver uses a programmable clock */ + pScrn->progClock = TRUE; + + /* Allocate the ZZZRec driverPrivate */ + if (!ZZZGetRec(pScrn)) { + return FALSE; + } + + pZzz = ZZZPTR(pScrn); + + /* Collect all of the option flags (fill in pScrn->options) */ + xf86CollectOptions(pScrn, NULL); + + /* + * Process the options based on the information in ZZZOptions. + * The results are written to pZzz->Options. If all of the options + * processing is done within this function a local variable "options" + * can be used instead of pZzz->Options. + */ + if (!(pZzz->Options = xalloc(sizeof(ZZZOptions)))) + return FALSE; + (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options); + + /* + * Set various fields of ScrnInfoRec and/or ZZZRec based on + * the options found. + */ + from = X_DEFAULT; + pZzz->hwCursor = FALSE; + if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) { + from = X_CONFIG; + pZzz->hwCursor = TRUE; + } + xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", + pZzz->hwCursor ? "HW" : "SW"); + if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) { + pZzz->noAccel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Acceleration disabled\n"); + } else { + pZzz->noAccel = FALSE; + } + if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) { + pZzz->UsePCIRetry = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); + } + pZzz->fooHack = 0; + if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK, + &pZzz->fooHack)) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n", + pZzz->fooHack); + } + + /* + * Find the PCI slot(s) that this screen claimed in the probe. + * In this case, exactly one is expected, so complain otherwise. + * Note in this case we're not interested in the card types so + * that parameter is set to NULL. + */ + if ((i = xf86GetPciInfoForScreen(pScrn->scrnIndex, &pciList, NULL)) + != 1) { + print error message; + ZZZFreeRec(pScrn); + if (i > 0) + xfree(pciList); + return FALSE; + } + /* Note that pciList should be freed below when no longer needed */ + + /* + * Determine the chipset, allowing config file chipset and + * chipid values to override the probed information. The config + * chipset value has precedence over its chipid value if both + * are present. + * + * It isn't necessary to fill in pScrn->chipset if the driver + * keeps track of the chipset in its ZZZRec. + */ + + ... + + /* + * Determine video memory, fb base address, I/O addresses, etc, + * allowing the config file to override probed values. + * + * Set the appropriate pScrn fields (videoRam is probably the + * most important one that other code might require), and + * print out the settings. + */ + + ... + + /* Initialise a clockRanges list. */ + + ... + + /* Set any other chipset specific things in the ZZZRec */ + + ... + + /* Select valid modes from those available */ + + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + NULL, minPitch, maxPitch, rounding, + minHeight, maxHeight, + pScrn->display->virtualX, + pScrn->display->virtualY, + pScrn->videoRam * 1024, + LOOKUP_BEST_REFRESH); + if (i == -1) { + ZZZFreeRec(pScrn); + return FALSE; + } + + /* Prune the modes marked as invalid */ + + xf86PruneDriverModes(pScrn); + + /* If no valid modes, return */ + + if (i == 0 || pScrn->modes == NULL) { + print error message; + ZZZFreeRec(pScrn); + return FALSE; + } + + /* + * Initialise the CRTC fields for the modes. This driver expects + * vertical values to be halved for interlaced modes. + */ + xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); + + /* Set the current mode to the first in the list. */ + pScrn->currentMode = pScrn->modes; + + /* Print the list of modes being used. */ + xf86PrintModes(pScrn); + + /* Set the DPI */ + xf86SetDpi(pScrn, 0, 0); + + /* Load bpp-specific modules */ + switch (pScrn->bitsPerPixel) { + case 1: + mod = "xf1bpp"; + break; + case 4: + mod = "xf4bpp"; + break; + case 8: + mod = "cfb"; + break; + case 16: + mod = "cfb16"; + break; + case 24: + mod = "cfb24"; + break; + case 32: + mod = "cfb32"; + break; + } + if (mod && !xf86LoadSubModule(pScrn, mod)) + ZZZFreeRec(pScrn); + return FALSE; + + /* Load XAA if needed */ + if (!pZzz->noAccel || pZzz->hwCursor) + if (!xf86LoadSubModule(pScrn, "xaa")) { + ZZZFreeRec(pScrn); + return FALSE; + } + + /* Done */ + return TRUE; +} + </programlisting> + </sect3> + + <sect3> + <title>MapMem, UnmapMem</title> + + <para> + Define functions to map and unmap the video memory and any other + memory apertures required. These functions are not mandatory, but + it is often useful to have such functions. + </para> + + <programlisting> +static Bool +ZZZMapMem(ScrnInfoPtr pScrn) +{ + /* Call xf86MapPciMem() to map each PCI memory area */ + ... + return TRUE or FALSE; +} + +static Bool +ZZZUnmapMem(ScrnInfoPtr pScrn) +{ + /* Call xf86UnMapVidMem() to unmap each memory area */ + ... + return TRUE or FALSE; +} + </programlisting> + </sect3> + + <sect3> + <title>Save, Restore</title> + + <para> + Define functions to save and restore the original video state. These + functions are not mandatory, but are often useful. + </para> + + <programlisting> +static void +ZZZSave(ScrnInfoPtr pScrn) +{ + /* + * Save state into per-screen data structures. + * If using the vgahw module, vgaHWSave will typically be + * called here. + */ + ... +} + +static void +ZZZRestore(ScrnInfoPtr pScrn) +{ + /* + * Restore state from per-screen data structures. + * If using the vgahw module, vgaHWRestore will typically be + * called here. + */ + ... +} + </programlisting> + </sect3> + + <sect3> + <title>ModeInit</title> + + <para> + Define a function to initialise a new video mode. This function isn't + mandatory, but is often useful. + </para> + + <programlisting> +static Bool +ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + /* + * Program a video mode. If using the vgahw module, + * vgaHWInit and vgaRestore will typically be called here. + * Once up to the point where there can't be a failure + * set pScrn->vtSema to TRUE. + */ + ... +} + </programlisting> + </sect3> + + <sect3> + <title>ScreenInit</title> + + <para> + Define the <function>ScreenInit()</function> function. This is called + at the start of each server generation, and should fill in as much + of the <structname>ScreenRec</structname> as possible as well as any other + data that is initialised once per generation. It should initialise + the framebuffer layers it is using, and initialise the initial video + mode. + </para> + + <para> + This function is mandatory. + </para> + + <para> + NOTE: The <structname>ScreenRec</structname> (<parameter>pScreen</parameter>) is + passed to this driver, but it and the + <varname>ScrnInfoRecs</varname> are not yet hooked into each + other. This means that in this function, and functions it + calls, one cannot be found from the other. + </para> + + <programlisting> +static Bool +ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +{ + /* Get the ScrnInfoRec */ + pScrn = xf86Screens[pScreen->myNum]; + + /* + * If using the vgahw module, its data structures and related + * things are typically initialised/mapped here. + */ + + /* Save the current video state */ + ZZZSave(pScrn); + + /* Initialise the first mode */ + ZZZModeInit(pScrn, pScrn->currentMode); + + /* Set the viewport if supported */ + + ZZZAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + + /* + * Setup the screen's visuals, and initialise the framebuffer + * code. + */ + + /* Reset the visual list */ + miClearVisualTypes(); + + /* + * Setup the visuals supported. This driver only supports + * TrueColor for bpp > 8, so the default set of visuals isn't + * acceptable. To deal with this, call miSetVisualTypes with + * the appropriate visual mask. + */ + + if (pScrn->bitsPerPixel > 8) { + if (!miSetVisualTypes(pScrn->depth, TrueColorMask, + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + } else { + if (!miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + } + + /* + * Initialise the framebuffer. + */ + + switch (pScrn->bitsPerPixel) { + case 1: + ret = xf1bppScreenInit(pScreen, FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth); + break; + case 4: + ret = xf4bppScreenInit(pScreen, FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth); + break; + case 8: + ret = cfbScreenInit(pScreen, FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth); + break; + case 16: + ret = cfb16ScreenInit(pScreen, FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth); + break; + case 24: + ret = cfb24ScreenInit(pScreen, FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth); + break; + case 32: + ret = cfb32ScreenInit(pScreen, FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth); + break; + default: + print a message about an internal error; + ret = FALSE; + break; + } + + if (!ret) + return FALSE; + + /* Override the default mask/offset settings */ + if (pScrn->bitsPerPixel > 8) { + for (i = 0, visual = pScreen->visuals; + i < pScreen->numVisuals; i++, visual++) { + if ((visual->class | DynamicClass) == DirectColor) { + visual->offsetRed = pScrn->offset.red; + visual->offsetGreen = pScrn->offset.green; + visual->offsetBlue = pScrn->offset.blue; + visual->redMask = pScrn->mask.red; + visual->greenMask = pScrn->mask.green; + visual->blueMask = pScrn->mask.blue; + } + } + } + + /* + * If banking is needed, initialise an miBankInfoRec (defined in + * "mibank.h"), and call miInitializeBanking(). + */ + if (!miInitializeBanking(pScreen, pScrn->virtualX, pScrn->virtualY, + pScrn->displayWidth, pBankInfo)) + return FALSE; + + /* + * If backing store is to be supported (as is usually the case), + * initialise it. + */ + miInitializeBackingStore(pScreen); + + /* + * Set initial black & white colourmap indices. + */ + xf86SetBlackWhitePixels(pScreen); + + /* + * Install colourmap functions. If using the vgahw module, + * vgaHandleColormaps would usually be called here. + */ + + ... + + /* + * Initialise cursor functions. This example is for the mi + * software cursor. + */ + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + + /* Initialise the default colourmap */ + switch (pScrn->depth) { + case 1: + if (!xf1bppCreateDefColormap(pScreen)) + return FALSE; + break; + case 4: + if (!xf4bppCreateDefColormap(pScreen)) + return FALSE; + break; + default: + if (!cfbCreateDefColormap(pScreen)) + return FALSE; + break; + } + + /* + * Wrap the CloseScreen vector and set SaveScreen. + */ + ZZZPTR(pScrn)->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = ZZZCloseScreen; + pScreen->SaveScreen = ZZZSaveScreen; + + /* Report any unused options (only for the first generation) */ + if (serverGeneration == 1) { + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + } + + /* Done */ + return TRUE; +} + </programlisting> + </sect3> + + <sect3> + <title>SwitchMode</title> + + <para> + Define the <function>SwitchMode()</function> function if mode switching + is supported by the driver. + </para> + + <programlisting> +static Bool +ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +{ + return ZZZModeInit(xf86Screens[scrnIndex], mode); +} + </programlisting> + </sect3> + + <sect3> + <title>AdjustFrame</title> + + <para> + Define the <function>AdjustFrame()</function> function if the driver + supports this. + </para> + + <programlisting> +static void +ZZZAdjustFrame(int scrnIndex, int x, int y, int flags) +{ + /* Adjust the viewport */ +} + </programlisting> + </sect3> + + <sect3> + <title>EnterVT, LeaveVT</title> + + <para> + Define the <function>EnterVT()</function> and <function>LeaveVT()</function> + functions. + </para> + + <para> + These functions are mandatory. + </para> + + <programlisting> +static Bool +ZZZEnterVT(int scrnIndex, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + return ZZZModeInit(pScrn, pScrn->currentMode); +} + +static void +ZZZLeaveVT(int scrnIndex, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ZZZRestore(pScrn); +} + </programlisting> + </sect3> + + <sect3> + <title>CloseScreen</title> + + <para> + Define the <function>CloseScreen()</function> function: + </para> + + <para> + This function is mandatory. Note that it unwraps the previously + wrapped <structfield>pScreen->CloseScreen</structfield>, and finishes by + calling it. + </para> + + <programlisting> +static Bool +ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + if (pScrn->vtSema) { + ZZZRestore(pScrn); + ZZZUnmapMem(pScrn); + } + pScrn->vtSema = FALSE; + pScreen->CloseScreen = ZZZPTR(pScrn)->CloseScreen; + return (*pScreen->CloseScreen)(scrnIndex, pScreen); +} + </programlisting> + </sect3> + + <sect3> + <title>SaveScreen</title> + + <para> + Define the <function>SaveScreen()</function> function (the screen + blanking function). When using the vgahw module, this will typically + be: + + <programlisting> +static Bool +ZZZSaveScreen(ScreenPtr pScreen, int mode) +{ + return vgaHWSaveScreen(pScreen, mode); +} + </programlisting> + </para> + + <para> + This function is mandatory. Before modifying any hardware register + directly this function needs to make sure that the Xserver is active + by checking if <parameter>pScrn</parameter> is non-NULL and for + <literal remap="tt">pScrn->vtSema == TRUE</literal>. + </para> + </sect3> + + <sect3> + <title>FreeScreen</title> + + <para> + Define the <function>FreeScreen()</function> function. This function + is optional. It should be defined if the <structname>ScrnInfoRec</structname> + <structfield>driverPrivate</structfield> field is used so that it can be freed + when a screen is deleted by the common layer for reasons possibly + beyond the driver's control. This function is not used in during + normal (error free) operation. The per-generation data is freed by + the <function>CloseScreen()</function> function. + </para> + + <programlisting> +static void +ZZZFreeScreen(int scrnIndex, int flags) +{ + /* + * If the vgahw module is used vgaHWFreeHWRec() would be called + * here. + */ + ZZZFreeRec(xf86Screens[scrnIndex]); +} + + </programlisting> + + </sect3> + + </sect2> + + </sect1> + +</article> diff --git a/hw/xfree86/doc/sgml/Makefile.am b/hw/xfree86/doc/sgml/Makefile.am new file mode 100644 index 0000000..10eca86 --- /dev/null +++ b/hw/xfree86/doc/sgml/Makefile.am @@ -0,0 +1,27 @@ +# Copyright 2005 Red Hat, Inc. +# +# 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 Red Hat +# not be used in advertising or publicity pertaining to distribution +# of the software without specific, written prior permission. Red +# Hat makes no representations about the suitability of this software +# for any purpose. It is provided "as is" without express or implied +# warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +# NO EVENT SHALL RED HAT 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. + +doc_sources = DESIGN.xml + +# Developer's documentation is not installed +if ENABLE_DEVEL_DOCS +include $(top_srcdir)/doc/xml/xmlrules-noinst.in +endif diff --git a/hw/xfree86/doc/sgml/Makefile.in b/hw/xfree86/doc/sgml/Makefile.in new file mode 100644 index 0000000..b71bbc7 --- /dev/null +++ b/hw/xfree86/doc/sgml/Makefile.in @@ -0,0 +1,656 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +# Copyright 2005 Red Hat, Inc. +# +# 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 Red Hat +# not be used in advertising or publicity pertaining to distribution +# of the software without specific, written prior permission. Red +# Hat makes no representations about the suitability of this software +# for any purpose. It is provided "as is" without express or implied +# warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +# NO EVENT SHALL RED HAT 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. + +# The doc_sources variable contains one or more DocBook/XML source file. +# The generated documents will NOT be installed in $(docdir), +# The DocBook/XML files will always be included in the tarball + +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +# This file provides pattern rules to generate html/pdf/txt from DocBook/XML +# A stylesheet is used if xorg-sgml-doctools is installed +# This file is included by xmlrules-inst.in for installable user's documentation +# It is included by xmlrules-noinst for non installable developer's documentation +# If the server version or release date changes, autogen && make + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@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@ +DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/doc/xml/xmlrules-noinst.in \ + $(top_srcdir)/doc/xml/xmlrules.in +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_FOP_TRUE@@HAVE_XMLTO_TRUE@am__append_1 = $(doc_sources:.xml=.pdf) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TEXT_TRUE@@HAVE_XMLTO_TRUE@am__append_2 = $(doc_sources:.xml=.txt) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@am__append_3 = -m $(XSL_STYLESHEET) \ +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_STYLESHEETS_TRUE@@HAVE_XMLTO_TRUE@ --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css + +subdir = hw/xfree86/doc/sgml +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/ax_tls.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/xorg-config.h \ + $(top_builddir)/include/xkb-config.h \ + $(top_builddir)/include/xwin-config.h \ + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +am__dist_noinst_DATA_DIST = DESIGN.xml +DATA = $(dist_noinst_DATA) $(noinst_DATA) +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ +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@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DARWIN_LIBS = @DARWIN_LIBS@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ +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@ +DIX_LIB = @DIX_LIB@ +DLLTOOL = @DLLTOOL@ +DLOPEN_LIBS = @DLOPEN_LIBS@ +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@ +DOXYGEN = @DOXYGEN@ +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_CFLAGS = @DRI_CFLAGS@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONT100DPIDIR = @FONT100DPIDIR@ +FONT75DPIDIR = @FONT75DPIDIR@ +FONTMISCDIR = @FONTMISCDIR@ +FONTOTFDIR = @FONTOTFDIR@ +FONTROOTDIR = @FONTROOTDIR@ +FONTTTFDIR = @FONTTTFDIR@ +FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ +GLX_DEFINES = @GLX_DEFINES@ +GLX_TLS = @GLX_TLS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +HAL_CFLAGS = @HAL_CFLAGS@ +HAL_LIBS = @HAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +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_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +LD = @LD@ +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@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCCLD = @OBJCCLD@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJCLINK = @OBJCLINK@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +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@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PROJECTROOT = @PROJECTROOT@ +RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ +RELEASE_DATE = @RELEASE_DATE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHA1_CFLAGS = @SHA1_CFLAGS@ +SHA1_LIBS = @SHA1_LIBS@ +SHELL = @SHELL@ +SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ +SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ +STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ +SYSCONFDIR = @SYSCONFDIR@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ +VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ +VERSION = @VERSION@ +WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ +WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ +WINDRES = @WINDRES@ +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@ +XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ +XEPHYR_INCS = @XEPHYR_INCS@ +XEPHYR_LIBS = @XEPHYR_LIBS@ +XF86CONFIGDIR = @XF86CONFIGDIR@ +XF86CONFIGFILE = @XF86CONFIGFILE@ +XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ +XF86VIDMODE_LIBS = @XF86VIDMODE_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@ +XMLTO = @XMLTO@ +XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ +XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ +XNEST_LIBS = @XNEST_LIBS@ +XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_INCS = @XORG_INCS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ +XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ +XORG_OS = @XORG_OS@ +XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XORG_SYS_LIBS = @XORG_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ +XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ +XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_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@ +XSL_STYLESHEET = @XSL_STYLESHEET@ +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@ +__XCONFIGDIR__ = @__XCONFIGDIR__@ +__XCONFIGFILE__ = @__XCONFIGFILE__@ +abi_ansic = @abi_ansic@ +abi_extension = @abi_extension@ +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_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +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@ +symbol_visibility = @symbol_visibility@ +sysconfdir = @sysconfdir@ +sysconfigdir = @sysconfigdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +doc_sources = DESIGN.xml +@ENABLE_DEVEL_DOCS_TRUE@dist_noinst_DATA = $(doc_sources) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@noinst_DATA = $(doc_sources:.xml=.html) \ +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_1) \ +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_2) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@CLEANFILES = $(noinst_DATA) +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@XML_ENT_DIR = $(abs_top_builddir)/doc/xml +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@SUFFIXES = .xml .txt .html .pdf +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@XMLTO_FLAGS = --searchpath \ +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(XML_ENT_DIR) \ +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(am__append_3) +all: all-am + +.SUFFIXES: +.SUFFIXES: .xml .txt .html .pdf +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/doc/xml/xmlrules-noinst.in $(top_srcdir)/doc/xml/xmlrules.in $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/doc/sgml/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hw/xfree86/doc/sgml/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 +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +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 "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(DATA) +installdirs: +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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + 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-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@%.txt: %.xml $(XML_ENT_DIR)/xserver.ent +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $< + +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@%.html: %.xml $(XML_ENT_DIR)/xserver.ent +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< + +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@%.pdf: %.xml $(XML_ENT_DIR)/xserver.ent +@ENABLE_DEVEL_DOCS_TRUE@@HAVE_XMLTO_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $< + +# Developer's documentation is not installed + +# 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: |