Initial Commit

This commit is contained in:
Westendarp 2023-08-04 10:44:43 +02:00
parent d761c43572
commit 5639f9d14d
227 changed files with 204472 additions and 0 deletions

View File

@ -0,0 +1,12 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
# Copyright 2005 Adam Jackson.
#
# 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
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON 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.
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src man
if BUILD_LINUXDOC
README.ati: README.ati.sgml
$(MAKE_TEXT) README.ati.sgml && mv README.ati.txt README.ati
README.r128: README.r128.sgml
$(MAKE_TEXT) README.r128.sgml && mv README.r128.txt README.r128
endif
EXTRA_DIST = README.ati README.r128 README.ati.sgml README.r128.sgml ChangeLog
# Always regenerate the changelog
CLEANFILES = ChangeLog
ChangeLog: FORCE
git-log > ChangeLog
FORCE:

View File

@ -0,0 +1,687 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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 Adam Jackson.
#
# 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
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON 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.
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
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__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure COPYING ChangeLog compile config.guess \
config.sub depcomp install-sh ltmain.sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
ATIMISC_CPIO_FALSE = @ATIMISC_CPIO_FALSE@
ATIMISC_CPIO_TRUE = @ATIMISC_CPIO_TRUE@
ATIMISC_DGA_FALSE = @ATIMISC_DGA_FALSE@
ATIMISC_DGA_TRUE = @ATIMISC_DGA_TRUE@
ATIMISC_NON_PCI_FALSE = @ATIMISC_NON_PCI_FALSE@
ATIMISC_NON_PCI_TRUE = @ATIMISC_NON_PCI_TRUE@
ATIMISC_TV_OUT_FALSE = @ATIMISC_TV_OUT_FALSE@
ATIMISC_TV_OUT_TRUE = @ATIMISC_TV_OUT_TRUE@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@
BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@
BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@
BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LINUXDOC = @LINUXDOC@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAKE_HTML = @MAKE_HTML@
MAKE_PDF = @MAKE_PDF@
MAKE_PS = @MAKE_PS@
MAKE_TEXT = @MAKE_TEXT@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PS2PDF = @PS2PDF@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_EXA_FALSE = @USE_EXA_FALSE@
USE_EXA_TRUE = @USE_EXA_TRUE@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
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@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
moduledir = @moduledir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src man
EXTRA_DIST = README.ati README.r128 README.ati.sgml README.r128.sgml ChangeLog
# Always regenerate the changelog
CLEANFILES = ChangeLog
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# 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):
@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; \
(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"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@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; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (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; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
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 || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(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; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(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; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
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:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-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: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-libtool clean-recursive \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am uninstall-info-am
@BUILD_LINUXDOC_TRUE@README.ati: README.ati.sgml
@BUILD_LINUXDOC_TRUE@ $(MAKE_TEXT) README.ati.sgml && mv README.ati.txt README.ati
@BUILD_LINUXDOC_TRUE@README.r128: README.r128.sgml
@BUILD_LINUXDOC_TRUE@ $(MAKE_TEXT) README.r128.sgml && mv README.r128.txt README.r128
ChangeLog: FORCE
git-log > ChangeLog
FORCE:
# 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:

View File

@ -0,0 +1,828 @@
$Id$ Based on
XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v
3.42 2003/01/20 03:43:07 dawes Exp ATI Adapters README file
Marc Aurele La France
2002 February 12
This is the README for the XAA ATI driver included in this release.
______________________________________________________________________
Table of Contents
1. Statement of intent
2. A note on acceleration
3. Current implementation for ATI adapters
4. Current implementation of generic VGA support for non-ATI adapters
5. xorg.conf specifications
5.1 Driver ``ati''
5.2 ChipSet ``name''
5.3 ChipID & ChipRev specifications
5.4 IOBase
5.5 BusID
5.6 Clocks
5.6.1 Clocks for supported programmable clock generators
5.6.2 Clocks for unsupported programmable clock generators
5.6.3 Clocks for fixed clock generators on ATI adapters
5.6.4 Clocks for non-ATI adapters
5.7 Option ``nopanel_display''
5.8 Option ``crt_display''
5.9 Option ``noaccel''
5.10 Option ``nolinear''
5.11 Option ``HWCursor'' and Option ``SWCursor''
5.12 Option ``SilkenMouse''
5.13 Option ``shadowfb''
5.14 Option ``dpms''
5.15 Option ``backingstore''
5.16 MemBase address
5.17 Option ``ReferenceClock'' ``frequency''
5.18 ClockChip ``name''
6. Video modes
7. Known problems and limitations
8. Reporting problems
9. Driver history
10. Driver versions
______________________________________________________________________
1. Statement of intent
Generally speaking, the driver is intended for all ATI video adapters,
providing maximum video function within hardware limitations. The
driver is also intended to optionally provide the same level of
support for generic VGA or 8514/A adapters. This driver is still
being actively developed, meaning that it currently does not yet fully
meet these goals.
The driver will provide
+o accelerated support if an ATI accelerator is detected and the user
has not requested that this support be disabled; otherwise
+o accelerated support if a non-ATI 8514/A-capable adapter is detected
and the user has requested such support; otherwise
+o unaccelerated SuperVGA support if an ATI VGA-capable adapter is
detected; otherwise
+o generic VGA support if a non-ATI VGA-capable adapter is detected
and the user has requested such support.
Thus, the level of support provided not only depends on what the
driver detects in the system, but also, on what the user specifies
in the xorg.conf file. See the ``xorg.conf specifications''
section below for details.
If none of the above conditions are met, the ATI driver will
essentially disable itself to allow other drivers to examine the
system.
Note that I am currently considering removing the driver's support for
generic VGA. If you have any concerns about this, please contact me
at <tsi@xfree86.org>.
2. A note on acceleration
The meaning of ``acceleration'', as used in this document, needs to be
clarified. Two of the many components in an accelerator are the CRT
controller (CRTC) and the Draw Engine. This is in addition to another
CRTC that, generally, is also present in the system (often in the same
chip) and typically provides EGA, VGA or SuperVGA functionality.
A CRTC is the component of a graphics controller that is responsible
for reading video memory for output to the screen. A Draw Engine is
an accelerator component that can be programmed to manipulate video
memory contents, thus freeing the CPU for other tasks.
When the VGA CRTC is used, all drawing operations into video memory
are the responsibility of the system's CPU, i.e. no Draw Engine can be
used. On the other hand, if the accelerator's CRTC is chosen to drive
the screen, the Draw Engine can also be used for drawing operations,
although the CPU can still be used for this purpose if it can access
the accelerator's video memory.
Video acceleration refers to the programming of an accelerator's Draw
Engine to offload drawing operations from the CPU, and thus also
implies the use of the accelerator's CRTC.
3. Current implementation for ATI adapters
The driver currently supports the SuperVGA capabilities of all ATI
adapters except some early Mach8 and Mach32 adapters that do not
provide the required functionality. This support works for
monochrome, 16-colour and 256-colour video modes, if one of the
following ATI graphics controller chips is present:
VGAWonder series: 18800, 18800-1, 28800-2, 28800-4, 28800-5, 28800-6
Mach32 series: 68800-3, 68800-6, 68800AX, 68800LX
Mach64 series: 88800GX-C, 88800GX-D, 88800GX-E, 88800GX-F, 88800CX,
264CT, 264ET, 264VT, 264GT (3D Rage), 264VT-B, 264VT3,
264VT4, 264GT-B (3D Rage II), 3D Rage IIc, 3D Rage Pro,
3D Rage LT, 3D Rage LT Pro, 3D Rage XL, 3D Rage XC,
3D Rage Mobility (including the -M and -P variants)
The driver also supports 32K, 64K and 16M-colour modes on the 264xT
and 3D Rage series of adapters using the accelerator CRTC (but not the
VGA CRTC).
The newer Rage 128 and Radeon chips are not yet supported by this
driver. Rage 128's and Radeon's are, however, supported by separate
drivers, and owners of such adapters should consult the documentation
provided with these drivers. This driver will also invoke the
appropriate driver if it finds Rage 128 and/or Radeon adapter(s) in
the system.
Adapters based on the above chips have been marketed under a rather
large number of names over the years. Among them are:
VGAWonder series: VGAWonder V3, VGAWonder V4, VGAWonder V5, VGAWonder+,
VGAWonder XL, VGAWonder XL24, VGAWonder VLB, VGA Basic,
VGA Basic 16, VGA Edge, VGA Edge 16, VGA Integra,
VGA Charger, VGAStereo F/X, VGA 640, VGA 800, VGA 1024,
VGA 1024D, VGA 1024 XL, VGA 1024 DXL, VGA 1024 VLB
Mach8 series: Graphics Ultra, Graphics Vantage, VGAWonder GT
(None of the 8514/Ultra and 8514 Vantage series is
supported at this time)
Mach32 series: Graphics Ultra+, Graphics Ultra Pro, Graphics Wonder,
Graphics Ultra XLR, Graphics Ultra AXO, VLB mach32-D,
PCI mach32-D, ISA mach32
Mach64 series: Graphics Xpression, Graphics Pro Turbo, WinBoost,
WinTurbo, Graphics Pro Turbo 1600, Video Xpression,
3D Xpression, Video Xpression+, 3D Xpression+,
3D Charger, Video Charger, WinCharger, All-In-Wonder,
All-In-Wonder PRO, 3D Pro Turbo, XPERT@Play,
XPERT@Play 98, XPERT@Work, XPERT 98, XPERT LCD,
XPERT XL
Also, a number of mainboards, laptops and notebooks harbour a Mach32
or Mach64 controller.
VGAWonder, Mach8 and Mach32 ISA adapters are available with or without
a mouse.
These adapters are available with a variety of clock generators and
RAMDACs. The 264xT and 3D Rage series of chips are integrated
controllers, meaning that they include a programmable clock generator
and a RAMDAC.
For all but Mach64 adapters, this driver still does not provide
support for accelerated drawing to the screen. This means that all
drawing is done by the CPU, rather than by any accelerator present in
the system. This can make opaque moves, for example, quite ``jerky''.
Also, given that IBM 8514/A and ATI Mach8 do not allow CPU access to
their frame buffer, the driver will currently ignore these
accelerators. Most Mach32 adapters provide both accelerated function
and SuperVGA functionality, but the driver currently only uses the
VGA.
The driver does however support the accelerator CRTC present in all
ATI Mach64 adapters. For 256-colour, and higher depth modes, this
support will be used by default, although an xorg.conf option can be
specified to use the SuperVGA CRTC instead. A linear video memory
aperture is also available in 256-colour and higher depth modes and
enabled by default if a 264xT or 3D Rage controller is detected or, on
88800 controllers, if the accelerator CRTC is used. xorg.conf options
are available to disable this aperture, or (for non-PCI adapters)
enable it or move it to some other address.
By default, the driver provides some acceleration for Mach64 if the
accelerator CRTC is used, and modes whose colour depth greater than or
equal to 8 are to be used. This support is as yet incomplete and can
be disabled entirely with an xorg.conf option.
On non-Intel platforms, the driver can, currently, only support PCI
Mach64 adapters.
4. Current implementation of generic VGA support for non-ATI adapters
Support for generic VGA with non-ATI adapters is also implemented, but
has undergone only limited testing. The driver will intentionally
disallow the use of this support with ATI adapters. This support must
be explicitly requested through an xorg.conf ChipSet specification.
This prevents the current VGA generic driver from being disabled.
This driver's generic VGA support is intended as an extension of that
provided by the current generic driver. Specifically, within the
architectural bounds defined by IBM's VGA standard, this driver will
allow the use of any 256-colour mode, and any dot clock frequencies
both of which allow for many more mode possibilities.
The driver will enforce the following limitations derived from IBM's
original VGA implementation:
+o There can only be a set of four (non-programmable) clocks to choose
from.
+o Video memory is limited to 256kB in monochrome and 16-colour modes.
+o Video memory is limited to 64kB in 256-colour modes.
+o Interlaced modes are not available.
+o Colour depths higher than 8 are not available.
5. xorg.conf specifications
The driver recognises a number of xorg.conf options. In general, all
such options should be specified in a ``Device'' section, and affect
only that ``Device'' section.
Those options that affect how the driver associates adapters with
``Device'' sections are described first. The driver will ignore (with
a message) a ``Device'' section if the section cannot be associated
with exactly one adapter in the system. Similarly, the driver will
ignore, or disable, (with a message) any adapter that cannot be
associated with exactly one ``Device'' section. Thus, these options
will be required in those uncommon cases where such unique
associations cannot automatically be made by the driver.
Other options affect the driver's operation once an adapter has been
assigned to the ``Device'' section which contains them.
5.1. Driver ``ati''
The use of this specification is highly recommended if the ``Device''
section is to be recognised by the driver. In fact, it is almost (but
not quite) mandatory, particularly when using the loader server as it
indicates what driver is to be loaded and associated with the
``Device'' section.
5.2. ChipSet ``name''
The default ChipSet name for this driver is ``ati''. In this case,
any ATI adapter can be associated with the ``Device'' section. If an
ATI accelerator is detected and the driver supports it, the
accelerator's CRTC will be used to drive the screen. Otherwise, the
driver will programme the adapter's SuperVGA CRTC.
If ``ativga'' is specified instead, the driver will ignore any ATI
accelerator it detects, but otherwise operate as if ``ati'' had been
specified. This specification ensures the VGA CRTC is used.
A ChipSet name of ``ibmvga'' causes any VGA-capable adapter in the
system to be associated with the ``Device'' section. It enables the
driver's generic VGA support, but only for non-ATI adapters. If an
ATI adapter is associated with the ``Device'' section, the driver will
operate as if ``ativga'' had been specified instead.
A ChipSet name of ``vgawonder'' is equivalent to ``ativga'', except
that only VGAWonder-capable adapters can be assigned to the ``Device''
section. This specifically excludes the newer integrated Mach64
controllers.
In some PCI or AGP systems, the driver will not, by default, probe for
non-PCI Mach32's or Mach64's. This is because, before doing any such
probe, the driver attempts to determine if the probe can cause a
lockup. If the driver has enough information to determine that a
lockup would occur, it will skip the probe. In some situations, this
determination cannot be accurate, and the driver will err on the side
of caution, skipping the probe. Specifying a ChipSet name of
``mach32'' or ``mach64'', as appropriate, will force the driver to
probe for the non-PCI adapter. These ChipSet names should, therefore,
only be used when there is in fact such an adapter in the system.
They are otherwise equivalent to ``ati''.
On non-Intel platforms, only ``ati'' and ``mach64'' ChipSet values are
operative.
5.3. ChipID & ChipRev specifications
These specifications will cause the driver to associate the ``Device''
section only with an adapter having the same attributes, or an adapter
whose PCI device ID the driver does not recognise. In the second
case, these options cause the driver to treat the adapter as if it was
one with the specified PCI device ID or revision. ChipID can only be
used with Mach32 or Mach64 adapters, and, thus, specifically excludes
any other adapter from matching the ``Device'' section. ChipRev is
meaningful only with Mach64 adapters, and then only if ChipID is also
specified in the same ``Device'' section.
5.4. IOBase
This option limits the adapters that can be associated with the
``Device'' section to the one with the specified I/O base. This
option only applies to Mach64 adapters and specifically excludes other
adapters.
5.5. BusID
This option limits the adapters that can be associated with the
``Device'' section to the one with the specified PCI Bus ID. This
specification excludes non-PCI adapters.
5.6. Clocks
For the purpose of specifying a clock line in your xorg.conf, one of
four different situations can occur, as follows.
Those configuring the driver's generic VGA support for a non-ATI
adapter, can skip ahead to the ``Clocks for non-ATI adapters'' section
below. Those not trying to configure the driver for a Mach64 adapter,
can skip ahead to the ``Clocks for fixed clock generators on ATI
adapters'' section below.
The very earliest Mach64 adapters use fixed (i.e. non-programmable)
clock generators. Very few of these (mostly prototypes) are known to
exist, but if you have one of these, you can also skip ahead to the
``Clocks for fixed clock generators on ATI adapters'' section below.
The two cases that are left deal with programmable clock generators,
which are used on the great majority of Mach64 adapters.
If you are uncertain which situation applies to your adapter, you can
run a clock probe with the command ``X -probeonly''.
5.6.1. Clocks for supported programmable clock generators
At bootup, video BIOS initialisation programmes an initial set of
frequencies. Two of these are reserved to allow the setting of modes
that do not use a frequency from this initial set. One of these
reserved slots is used by the BIOS mode set routine, the other by the
particular driver used (e.g. MS-Windows, AutoCAD, X, etc.). The clock
numbers reserved in this way are dependent on the particular clock
generator used by the adapter.
The driver currently supports all programmable clock generators known
to exist on Mach64 adapters. In this case, the driver will completely
ignore any xorg.conf clock specification, and programme the clock
generator as needed by the modes used during the X session.
5.6.2. Clocks for unsupported programmable clock generators
This case is unlikely to occur, but is documented for the sake of
completeness.
In this situation, the driver will probe the adapter for clock
frequencies unless xorg.conf clocks are already specified. In either
case, the driver will then attempt to normalise the clocks to one of
the following specifications:
BIOS setting 1:
Clocks 0.000 110.000 126.000 135.000 50.350 56.640 63.000 72.000
0.000 80.000 75.000 65.000 40.000 44.900 49.500 50.000
0.000 55.000 63.000 67.500 25.180 28.320 31.500 36.000
0.000 40.000 37.500 32.500 20.000 22.450 24.750 25.000
BIOS setting 2:
Clocks 0.000 110.000 126.000 135.000 25.180 28.320 31.500 36.000
0.000 80.000 75.000 65.000 40.000 44.900 49.500 50.000
0.000 55.000 63.000 67.500 12.590 14.160 15.750 18.000
0.000 40.000 37.500 32.500 20.000 22.450 24.750 25.000
BIOS setting 3:
Clocks 0.000 0.000 0.000 0.000 25.180 28.320 0.000 0.000
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
0.000 0.000 0.000 0.000 12.590 14.160 0.000 0.000
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
If the driver matches the clocks to the third setting above, function-
ality will be extremely limited (assuming the driver works at all).
5.6.3. Clocks for fixed clock generators on ATI adapters
This section applies to all VGAWonder and Mach32 adapters, and to
early Mach64 prototypes.
One of the following clocks specifications (or an initial subset
thereof) can be used depending on what the adapter uses to generate
dot clocks:
Crystals (VGA Wonder V3 and V4 adapters only):
Clocks 50.000 56.644 0.000 44.900 44.900 50.000 0.000 36.000
25.000 28.322 0.000 22.450 22.450 25.000 0.000 18.000
16.667 18.881 0.000 14.967 14.967 16.667 0.000 12.000
12.500 14.161 0.000 11.225 11.225 12.500 0.000 9.000
ATI 18810 clock generator:
Clocks 30.240 32.000 37.500 39.000 42.954 48.771 0.000 36.000
40.000 0.000 75.000 65.000 50.350 56.640 0.000 44.900
15.120 16.000 18.750 19.500 21.477 24.386 0.000 18.000
20.000 0.000 37.500 32.500 25.175 28.320 0.000 22.450
10.080 10.667 12.500 13.000 14.318 16.257 0.000 12.000
13.333 0.000 25.000 21.667 16.783 18.880 0.000 14.967
7.560 8.000 9.375 9.750 10.739 12.193 0.000 9.000
10.000 0.000 18.750 16.250 12.586 14.160 0.000 11.225
ATI 18811-0 and ATI 18812-0 clock generators:
Clocks 30.240 32.000 110.000 80.000 42.954 48.771 92.400 36.000
39.910 44.900 75.000 65.000 50.350 56.640 0.000 44.900
15.120 16.000 55.000 40.000 21.477 24.386 46.200 18.000
19.955 22.450 37.500 32.500 25.175 28.320 0.000 22.450
10.080 10.667 36.667 26.667 14.318 16.257 30.800 12.000
13.303 14.967 25.000 21.667 16.783 18.880 0.000 14.967
7.560 8.000 27.500 20.000 10.739 12.193 23.100 9.000
9.978 11.225 18.750 16.250 12.588 14.160 0.000 11.225
ATI 18811-1 and ATI 18811-2 clock generators:
Clocks 135.000 32.000 110.000 80.000 100.000 126.000 92.400 36.000
39.910 44.900 75.000 65.000 50.350 56.640 0.000 44.900
67.500 16.000 55.000 40.000 50.000 63.000 46.200 18.000
19.955 22.450 37.500 32.500 25.175 28.320 0.000 22.450
45.000 10.667 36.667 26.667 33.333 42.000 30.800 12.000
13.303 14.967 25.000 21.667 16.783 18.880 0.000 14.967
33.750 8.000 27.500 20.000 25.000 31.500 23.100 9.000
9.978 11.225 18.750 16.250 12.588 14.160 0.000 11.225
ICS 2494-AM clock generators (found on some Dell motherboards):
Clocks 75.000 77.500 80.000 90.000 25.175 28.322 31.500 36.000
100.000 110.000 126.000 135.000 40.000 44.900 50.000 65.000
37.500 38.750 40.000 45.000 12.588 14.161 15.750 18.000
50.000 55.000 63.000 67.500 20.000 22.450 25.000 32.500
25.000 25.833 26.667 30.000 8.392 9.441 10.500 12.000
33.333 36.667 42.000 45.000 13.333 14.767 16.667 21.667
18.750 19.375 20.000 22.500 6.294 7.081 7.875 9.000
25.000 27.500 31.500 33.750 10.000 11.225 12.500 16.250
VGAWonder VLB, VGA 1024 VLB, Mach32 and Mach64 owners should only
specify up to the first 32 frequencies. Any more will be ignored.
Other clock generators that have been used on ATI adapters (which can
all be said to be clones of one of the above) might generate non-zero
frequencies for those that are zero above, or vice-versa.
The order of the clocks is very important, although the driver will
reorder the specified clocks if it deems it appropriate to do so.
Mach32 and Mach64 owners should note that this order is different than
what they would use for previous accelerated servers.
5.6.4. Clocks for non-ATI adapters
If no clocks are specified in the xorg.conf, the driver will probe for
four clocks, the second of which will be assumed to be 28.322 MHz.
The first clock will typically be 25.175 MHz, but there are
exceptions. You can include up to four clock frequencies in your
xorg.conf to specify the actual values used by the adapter. Any more
will be ignored.
5.7. Option ``nopanel_display''
This specification is only effective when the driver detects that the
adapter's BIOS has initialised both the digital flat panel and CRT
interfaces. In such a situation, the driver will normally drive both
the panel and the CRT. This specification causes the driver to
disable the digital flat panel and display the screen image on the CRT
instead, which could potentially allow for larger physical resolutions
than the panel can handle.
5.8. Option ``crt_display''
This specification is only effective when the driver detects that the
adapter's BIOS has initialised the digital flat panel interface, but
has disabled the CRT interface. In such a situation the driver will
normally drive only the panel. This specification causes the driver
to instead display the same image on both the panel and the CRT.
5.9. Option ``noaccel''
By default, the driver will accelerate draw operations if a Mach64
CRTC is used to drive the display. As implemented in this driver,
acceleration does not require a linear video memory aperture. This
option disables this acceleration.
5.10. Option ``nolinear''
By default, the driver will enable a linear video memory aperture for
256-colour and higher depth modes if it is also using a Mach64
accelerator CRTC or an integrated Mach64 graphics chip. This option
disables this linear aperture.
On non-Intel platforms, the driver requires a linear aperture and, so,
this option is ignored.
5.11. Option ``HWCursor'' and Option ``SWCursor''
Option ``HWCursor'', which is the default, specifies that hardware
facilities are to be used to paint the mouse pointer on the screen.
Option ``SWCursor'' specifies that the mouse pointer is to be drawn by
software, which is much slower. If both options are specified, option
``SWCursor'' prevails. Currently, these options are only acted upon
for 256-colour or higher depth modes, if a Mach64 accelerator CRTC, or
a Mach64 integrated controller is being used. In all other
situations, a software cursor will be used, regardless of what these
options specify.
5.12. Option ``SilkenMouse''
This option is only acted upon when a hardware cursor is being used.
It specifies that the cursor's position on the screen is to be updated
as quickly as possible when the mouse is moved. This is the default
behaviour. If this option is negated, the cursor may lag the mouse
when the X server is very busy.
5.13. Option ``shadowfb''
If this option is enabled, the driver will cause the CPU to do each
drawing operation first into a shadow frame buffer in system virtual
memory and then copy the result into video memory. If this option is
not active, the CPU will draw directly into video memory. Enabling
this option is beneficial for those systems where reading from video
memory is, on average, slower than the corresponding read/modify/write
operation in system virtual memory. This is normally the case for PCI
or AGP adapters, and, so, this option is enabled by default. For
other bus types, the default behaviour is to disable this option.
Note that, due to various limitations, this option is forcibly
disabled when a linear video memory aperture is not enabled, when the
frame buffer depth is less than 8, or when acceleration is used.
5.14. Option ``dpms''
This option enables the driver's support for VESA's Display Power
Management Specification.
5.15. Option ``backingstore''
This is not specifically a driver option. It is used to enable the
server's support for backing store, a mechanism by which pixel data
for occluded window regions is remembered by the server thereby
alleviating the need to send expose events to X clients when the data
needs to be redisplayed.
5.16. MemBase address
This specification is only effective for non-PCI Mach64 adapters, and
is used to override the CPU address at which the adapter will map its
video memory. Normally, for non-PCI adapters, this address is set by
a DOS install utility provided with the adapter. The MemBase option
can also be used to enable the linear aperture in those cases where
ATI's utility was not, or can not be, used.
For PCI and AGP adapters, this address is determined at system bootup
according to the PCI Plug'n'Play specification which arbitrates the
resource requirements of most devices in the system. This means the
driver can not easily change the linear aperture address.
5.17. Option ``ReferenceClock'' ``frequency''
This option is only applicable to non-Intel platforms, where an
adapter BIOS is not available to the driver. The option specifies the
reference frequency used by the adapter's clock generator. The
default is 14.318 MHz, and other typical values are 28.636, or 29.5
MHz.
5.18. ClockChip ``name''
This option is only applicable to non-Intel platforms, where an
adapter BIOS is not available to the driver, and the driver cannot
reliably determine whether the clock generator the adapter uses is a
variant of an ATI 18818 (a.k.a. ICS 2595) or an unsupported clock
generator. The only values that are acted upon are ``ATI 18818-0'' or
``ATI 18818-1''. From this specification, the driver derives a
reference divider of 43 or 46 (respectively) for use in clock
programming calculations. The driver's default behaviour, in this
case, is to assume an unsupported clock generator, which means it will
treat it as a fixed-frequency clock generator, as described under the
heading ``Clocks for unsupported programmable clock generators''
above.
6. Video modes
Mode timings can be derived from the information in X's doc
subdirectory. However, it is no longer required to specify such
timings in an xorg.conf's ``Monitor'' section(s), if only standard
mode timings are to be used. The server automatically inserts VESA
standard mode timings in every ``Monitor'' section, and these modes
will be checked first for mode constraints (monitor sync tolerances,
video memory size, etc.).
Furthermore, it is also no longer required to specify mode names in
``Display'' subsections. Should no mode names be specified (or those
specified do not yield a usable mode), the server will automatically
select as a default resolution the largest usable mode, whether or not
the chosen mode is specified in the corresponding ``Monitor'' section.
For a digital flat panel, any sync tolerances should be removed from
the corresponding ``Monitor'' section. The driver will automatically
calculate these from the mode that is active on server entry. The
driver also inserts timings for a mode called "Native panel mode" that
represents the panel's native resolution.
7. Known problems and limitations
There are several known problems or limitations related to the ATI
driver. They include:
+o When using a Mach64's accelerator CRTC, the virtual resolution must
be less than 8192 pixels wide. The VGA CRTC further limits the
virtual resolution width to less than 4096 pixels, or to less than
2048 pixels for adapters based on 18800-x's (with 256kB of memory)
and on Mach64 integrated controllers. These are hardware limits
that cannot be circumvented.
+o Virtual resolutions requiring more than 1MB of video memory (256kB
in the monochrome case) are not supported by the VGA CRTC on
88800GX and 88800CX adapters. This is a hardware limit that cannot
be circumvented.
+o Due to hardware limitations, doublescanned modes are not supported
by the accelerator CRTC in 88800GX, 88800CX, 264CT and 264ET
adapters.
+o The ``VScan'' modeline parameter is only supported when using the
VGA CRTC.
+o Interlaced modes are not supported on 18800-x and 28800-x adapters
when using a virtual resolution that is 2048 pixels or wider. When
using a 18800-x with 256kB of video memory in 256-colour modes,
this limit is reduced to 1024. This is yet another hardware
limitation that cannot be circumvented.
+o Video memory banking does not work in monochrome and 16-colour
modes on 18800-x adapters. This appears to be another hardware
limit, but this conclusion cannot be confirmed at this time. The
driver's default behaviour in this case is to limit video memory to
256kB.
+o Video memory corruption can still occur during mode switches on
18800-x adapters. Symptoms of this problem include garbled fonts
on return to text mode, and various effects (snow, dashed lines,
etc) on initial entry into a graphics mode. In the first case, the
workaround is to use some other means of restoring the text font.
On Linux, this can be accomplished with the kbd or svgalib
packages. In the second case, xrefresh(1) will usually clean up
the image. No complete solution to this problem is currently
known. It appears this corruption occurs due to either video
memory bandwidth or RAMDAC limitations, and so the driver will
limit mode clocks to 40MHz.
+o There is some controversy over what the maximum allowed clock
frequency should be on 264xT and 3D Rage adapters. For now, clocks
will, by default, be limited to 80MHz, 135MHz, 170MHz, 200MHz or
230MHz, depending on the specific controller. This limit can only
be increased (up to a driver-calculated absolute maximum) through
the DACSpeed specification in xorg.conf. Be aware however that
doing so is untested and might damage the adapter.
+o Except as in the previous items, clocks are limited to 80MHz on
most adapters, although many are capable of higher frequencies.
This will eventually be fixed in a future release.
+o The use of a laptop's hot-keys to switch displays while this driver
is active can cause lockups and/or other woes, and is therefore not
recommended. It is not currently possible to solve this problem.
+o In situations where the driver is to simultaneously display on both
a panel and a CRT, the same image will be seen on both. In
particular, this means the CRT must be able to synchronise with the
timings of the panel's native resolution. This is quite evident
when the panel has ``odd-ball'' dimensions, such as 1400x1050, a
resolution not commonly possible on CRTs or projection equipment.
Also, the display of independent images on the panel and CRT is not
currently implemented, and might never be, pending resolution of
the previous item.
Support for the following will be added in a future release:
+o Mach32's accelerator CRTC. This support is the first step towards
accelerated support for Mach32's, Mach8's, 8514/A's and other
clones.
+o Colour depth greater than 8 on non-integrated controllers, where
permitted by the hardware.
+o Mach32, Mach8 and 8514/A Draw Engines.
+o Hardware cursors where implemented by hardware. This has already
been done for Mach64 integrated controllers.
+o TVOut, i.e. the ability to use a television screen as a monitor.
+o Motion Video, i.e. displaying an asynchronous data stream (TV
signal, DVD, etc.) in a window or full-screen.
+o 3D operations.
8. Reporting problems
If you are experiencing problems that are not already recorded in this
document, first ensure that you have the latest current release of
this driver and the Xorg X server.. Check the server's log (usually
found in /var/log/Xorg.0.log) and ftp://ftp.freedesktop.org/pub/Xorg
if you are uncertain.
Secondly, please check Xorg's doc directory for additional
information.
Thirdly, a scan through the comp.windows.x.i386unix and
comp.os.linux.x newsgroups and the xorg mailing list using your
favourite archiving service can also prove useful in resolving
problems.
If you are still experiencing problems, you can send me non-HTMLised
e-mail at <tsi@xfree86.org>. Please be as specific as possible when
describing the problem(s), and include an unedited copy of the
server's log and the xorg.conf file used.
9. Driver history
The complete history of the driver is rather cloudy. The following is
more than likely to be incomplete and inaccurate.
Apparently, Per Lindqvist first got a driver working with an early ATI
adapter under X386 1.1a. This original driver might have actually
been based on a non-functional ATI driver written by Thomas Roell
(currently of Xi Graphics).
Then Doug Evans added support for the ATI VGA Wonder XL, trying in the
process to make the driver work with all other ATI adapters available
at the time.
Rik Faith obtained the X11R4 driver from Doug Evans in the summer of
1992 and ported the code to the X386 part of X11R5. This subsequently
became part of XFree86.
I (Marc Aurele La France) took over development and maintenance of the
driver in the fall of 1993 after Rik got rid of his VGA Wonder
adapter.
10. Driver versions
Due to the introduction of loadable drivers in XFree86 4.0, it has
become necessary to track driver versions separately. Driver releases
use the following version numbering scheme.
Version 1 of this driver is the one I inherited from Rik Faith. This
is the version found in XFree86 2.0 and 2.1.
Version 2 is my first rewrite of this code which only ended up being a
partially unsuccessful attempt at generalising the driver for all VGA
Wonder, Mach32, and early Mach64 adapters. Various releases of this
version of the driver can be found in XFree86 2.1.1, 3.1, 3.1.1 and
3.1.2.
Version 3 represents my second rewrite (although a rather lame one as
rewrites go). Into version 3, I introduced clock programming for
Mach64 adapters and merged in the old ati_test debugging tool. This
is the version found in XFree86 3.2, 3.3 and 3.3.1.
Version 4 is a rather major restructuring of version 3, which became
larger than I could comfortably handle in one source file. This is
the version found in XFree86 3.3.2, 3.3.3, 3.3.3.1, 3.3.3.2, 3.3.4,
3.3.5 and 3.3.6.
Version 5 is an almost complete restructuring of version 4 to fit in
the newer driver API of XFree86 4.0 and later.
The introduction of version 6 is a first swipe at porting the driver
to non-Intel architectures.

View File

@ -0,0 +1,648 @@
<!DOCTYPE linuxdoc PUBLIC "-//Xorg//DTD linuxdoc//EN"[
<!ENTITY % defs SYSTEM "defs.ent"> %defs;
]>
<article>
<!-- Title information -->
<title>ATI Adapters README file
<author>Marc Aurele La France
<date>2002 February 12
<ident>
$Id$
Based on XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.42 2003/01/20 03:43:07 dawes Exp
</ident>
<abstract>
This is the README for the XAA ATI driver included in this release.
</abstract>
<!-- Table of contents -->
<toc>
<!-- Begin the document -->
<sect>Statement of intent<p>
Generally speaking, the driver is intended for all ATI video adapters
based on the Mach64 series or older chipsets,
providing maximum video function within hardware limitations.
The driver is also intended to optionally provide the same level of support for
generic VGA or 8514/A adapters.
The newer Rage 128 and Radeon chips are not yet supported by this driver.
Rage 128's and Radeon's are, however, supported by separate drivers, and
owners of such adapters should consult the documentation provided with these
drivers.
This driver will also invoke the appropriate driver if it finds Rage 128 and/or
Radeon adapter(s) in the system.
This driver is still being actively developed, meaning that it currently does
not yet fully meet these goals.<p>
The driver will provide
<itemize>
<item>accelerated support if an ATI accelerator is detected <it>and</it> the
user has not requested that this support be disabled; otherwise
<item>accelerated support if a non-ATI 8514/A-capable adapter is detected
<it>and</it> the user has requested such support; otherwise
<item>unaccelerated SuperVGA support if an ATI VGA-capable adapter is detected;
otherwise
<item>generic VGA support if a non-ATI VGA-capable adapter is detected
<it>and</it> the user has requested such support.
</itemize>
Thus, the level of support provided not only depends on what the driver detects
in the system, but also, on what the user specifies in the xorg.conf file.
See the <bf>``xorg.conf specifications''</bf> section below for details.<p>
If none of the above conditions are met, the ATI driver will essentially
disable itself to allow other drivers to examine the system.<p>
<!--
Note that I am currently considering removing the driver's support for generic
VGA.
If you have any concerns about this, please contact me at
<email>tsi@xfree86.org</email>.
-->
<sect>A note on acceleration<p>
The meaning of ``acceleration'', as used in this document, needs to be
clarified.
Two of the many components in an accelerator are the CRT controller (CRTC) and
the Draw Engine.
This is in addition to another CRTC that, generally, is also present in the
system (often in the same chip) and typically provides EGA, VGA or SuperVGA
functionality.<p>
A CRTC is the component of a graphics controller that is responsible for
reading video memory for output to the screen.
A Draw Engine is an accelerator component that can be programmed to manipulate
video memory contents, thus freeing the CPU for other tasks.<p>
When the VGA CRTC is used, all drawing operations into video memory are the
responsibility of the system's CPU, i.e. no Draw Engine can be used.
On the other hand, if the accelerator's CRTC is chosen to drive the screen,
the Draw Engine can also be used for drawing operations, although the CPU can
still be used for this purpose if it can access the accelerator's video
memory.<p>
Video acceleration refers to the programming of an accelerator's Draw Engine to
offload drawing operations from the CPU, and thus also implies the use of the
accelerator's CRTC.<p>
<sect>Current implementation for ATI adapters<p>
The driver currently supports the SuperVGA capabilities of all ATI adapters
except some early Mach8 and Mach32 adapters that do not provide the required
functionality.
This support works for monochrome, 16-colour and 256-colour video modes, if one
of the following ATI graphics controller chips is present:
<verb>
VGAWonder series: 18800, 18800-1, 28800-2, 28800-4, 28800-5, 28800-6
Mach32 series: 68800-3, 68800-6, 68800AX, 68800LX
Mach64 series: 88800GX-C, 88800GX-D, 88800GX-E, 88800GX-F, 88800CX,
264CT, 264ET, 264VT, 264GT (3D Rage), 264VT-B, 264VT3,
264VT4, 264GT-B (3D Rage II), 3D Rage IIc, 3D Rage Pro,
3D Rage LT, 3D Rage LT Pro, 3D Rage XL, 3D Rage XC,
3D Rage Mobility (including the -M and -P variants)</verb>
The driver also supports 32K, 64K and 16M-colour modes on the 264xT and 3D Rage
series of adapters using the accelerator CRTC (but not the VGA CRTC).<p>
The newer Rage 128 and Radeon chips are not yet supported by this driver.
Rage 128's and Radeon's are, however, supported by separate drivers, and
owners of such adapters should consult the documentation provided with these
drivers.
This driver will also invoke the appropriate driver if it finds Rage 128 and/or
Radeon adapter(s) in the system.<p>
Adapters based on the above chips have been marketed under a rather large
number of names over the years.
Among them are:
<verb>
VGAWonder series: VGAWonder V3, VGAWonder V4, VGAWonder V5, VGAWonder+,
VGAWonder XL, VGAWonder XL24, VGAWonder VLB, VGA Basic,
VGA Basic 16, VGA Edge, VGA Edge 16, VGA Integra,
VGA Charger, VGAStereo F/X, VGA 640, VGA 800, VGA 1024,
VGA 1024D, VGA 1024 XL, VGA 1024 DXL, VGA 1024 VLB
Mach8 series: Graphics Ultra, Graphics Vantage, VGAWonder GT
(None of the 8514/Ultra and 8514 Vantage series is
supported at this time)
Mach32 series: Graphics Ultra+, Graphics Ultra Pro, Graphics Wonder,
Graphics Ultra XLR, Graphics Ultra AXO, VLB mach32-D,
PCI mach32-D, ISA mach32
Mach64 series: Graphics Xpression, Graphics Pro Turbo, WinBoost,
WinTurbo, Graphics Pro Turbo 1600, Video Xpression,
3D Xpression, Video Xpression+, 3D Xpression+,
3D Charger, Video Charger, WinCharger, All-In-Wonder,
All-In-Wonder PRO, 3D Pro Turbo, XPERT@Play,
XPERT@Play 98, XPERT@Work, XPERT 98, XPERT LCD,
XPERT XL</verb>
Also, a number of mainboards, laptops and notebooks harbour a Mach32 or Mach64
controller.<p>
VGAWonder, Mach8 and Mach32 ISA adapters are available with or without a
mouse.<p>
These adapters are available with a variety of clock generators and RAMDACs.
The 264xT and 3D Rage series of chips are integrated controllers, meaning that
they include a programmable clock generator and a RAMDAC.<p>
For all but Mach64 adapters, this driver still does not provide support for
accelerated drawing to the screen.
This means that all drawing is done by the CPU, rather than by any accelerator
present in the system.
This can make opaque moves, for example, quite ``jerky''.
Also, given that IBM 8514/A and ATI Mach8 do not allow CPU access to their
frame buffer, the driver will currently ignore these accelerators.
Most Mach32 adapters provide both accelerated function and SuperVGA
functionality, but the driver currently only uses the VGA.<p>
The driver <it>does</it> however support the accelerator CRTC present in all
ATI Mach64 adapters.
For 256-colour, and higher depth modes, this support will be used by default,
although an xorg.conf option can be specified to use the SuperVGA CRTC
instead.
A linear video memory aperture is also available in 256-colour and higher depth
modes and enabled by default if a 264xT or 3D Rage controller is detected or,
on 88800 controllers, if the accelerator CRTC is used.
xorg.conf options are available to disable this aperture, or (for non-PCI
adapters) enable it or move it to some other address.<p>
By default, the driver provides some acceleration for Mach64 if the accelerator
CRTC is used, and modes whose colour depth greater than or equal to 8 are to be
used.
This support is as yet incomplete and can be disabled entirely with an
xorg.conf option.<p>
On non-Intel platforms, the driver can, currently, only support PCI Mach64
adapters.<p>
<sect>Current implementation of generic VGA support for non-ATI adapters<p>
Support for generic VGA with non-ATI adapters is also implemented, but has
undergone only limited testing.
The driver will intentionally disallow the use of this support with ATI
adapters.
This support must be explicitly requested through an xorg.conf ChipSet
specification.
This prevents the current VGA generic driver from being disabled.<p>
This driver's generic VGA support is intended as an extension of that provided
by the current generic driver.
Specifically, within the architectural bounds defined by IBM's VGA standard,
this driver will allow the use of any 256-colour mode, and any dot clock
frequencies both of which allow for many more mode possibilities.<p>
The driver will enforce the following limitations derived from IBM's original
VGA implementation:
<itemize>
<item>There can only be a set of four (non-programmable) clocks to choose from.
<item>Video memory is limited to 256kB in monochrome and 16-colour modes.
<item>Video memory is limited to 64kB in 256-colour modes.
<item>Interlaced modes are not available.
<item>Colour depths higher than 8 are not available.
</itemize>
<sect>xorg.conf specifications<p>
The driver recognises a number of xorg.conf options.
In general, all such options should be specified in a ``Device'' section, and
affect only that ``Device'' section.<p>
Those options that affect how the driver associates adapters with ``Device''
sections are described first.
The driver will ignore (with a message) a ``Device'' section if the section
cannot be associated with exactly one adapter in the system.
Similarly, the driver will ignore, or disable, (with a message) any adapter
that cannot be associated with exactly one ``Device'' section.
Thus, these options will be required in those uncommon cases where such unique
associations cannot automatically be made by the driver.<p>
Other options affect the driver's operation once an adapter has been assigned
to the ``Device'' section which contains them.<p>
<sect1>Driver ``ati''<p>
The use of this specification is highly recommended if the ``Device'' section
is to be recognised by the driver.
In fact, it is almost (but not quite) mandatory, particularly when using the
loader server as it indicates what driver is to be loaded and associated with
the ``Device'' section.<p>
<sect1>ChipSet ``name''<p>
The default ChipSet name for this driver is ``<it>ati</it>''.
In this case, any ATI adapter can be associated with the ``Device'' section.
If an ATI accelerator is detected and the driver supports it, the accelerator's
CRTC will be used to drive the screen.
Otherwise, the driver will programme the adapter's SuperVGA CRTC.<p>
If ``<it>ativga</it>'' is specified instead, the driver will ignore any ATI
accelerator it detects, but otherwise operate as if ``<it>ati</it>'' had been
specified.
This specification ensures the VGA CRTC is used.<p>
A ChipSet name of ``<it>ibmvga</it>'' causes any VGA-capable adapter in the
system to be associated with the ``Device'' section.
It enables the driver's generic VGA support, but only for non-ATI adapters.
If an ATI adapter is associated with the ``Device'' section, the driver will
operate as if ``<it>ativga</it>'' had been specified instead.<p>
A ChipSet name of ``<it>vgawonder</it>'' is equivalent to ``<it>ativga</it>'',
except that only VGAWonder-capable adapters can be assigned to the ``Device''
section.
This specifically excludes the newer integrated Mach64 controllers.<p>
In some PCI or AGP systems, the driver will not, by default, probe for non-PCI
Mach32's or Mach64's.
This is because, before doing any such probe, the driver attempts to determine
if the probe can cause a lockup.
If the driver has enough information to determine that a lockup would occur, it
will skip the probe.
In some situations, this determination cannot be accurate, and the driver will
err on the side of caution, skipping the probe.
Specifying a ChipSet name of ``<it>mach32</it>'' or ``<it>mach64</it>'', as
appropriate, will force the driver to probe for the non-PCI adapter.
These ChipSet names should, therefore, only be used when there is in fact such
an adapter in the system.
They are otherwise equivalent to ``<it>ati</it>''.<p>
On non-Intel platforms, only ``<it>ati</it>'' and ``<it>mach64</it>'' ChipSet
values are operative.<p>
<sect1>ChipID & ChipRev specifications<p>
These specifications will cause the driver to associate the ``Device'' section
only with an adapter having the same attributes, or an adapter whose PCI device
ID the driver does not recognise.
In the second case, these options cause the driver to treat the adapter as if
it was one with the specified PCI device ID or revision.
ChipID can only be used with Mach32 or Mach64 adapters, and, thus, specifically
excludes any other adapter from matching the ``Device'' section.
ChipRev is meaningful only with Mach64 adapters, and then only if ChipID is
also specified in the same ``Device'' section.<p>
<sect1>IOBase<p>
This option limits the adapters that can be associated with the ``Device''
section to the one with the specified I/O base.
This option only applies to Mach64 adapters and specifically excludes other
adapters.<p>
<sect1>BusID<p>
This option limits the adapters that can be associated with the ``Device''
section to the one with the specified PCI Bus ID.
This specification excludes non-PCI adapters.<p>
<sect1>Clocks<p>
For the purpose of specifying a clock line in your xorg.conf, one of four
different situations can occur, as follows.<p>
Those configuring the driver's generic VGA support for a non-ATI adapter,
can skip ahead to the <bf>``Clocks for non-ATI adapters''</bf> section below.
Those <it>not</it> trying to configure the driver for a Mach64 adapter, can
skip ahead to the <bf>``Clocks for fixed clock generators on ATI
adapters''</bf> section below.<p>
The very earliest Mach64 adapters use fixed (i.e. non-programmable) clock
generators.
Very few of these (mostly prototypes) are known to exist, but if you have one
of these, you can also skip ahead to the <bf>``Clocks for fixed clock
generators on ATI adapters''</bf> section below.<p>
The two cases that are left deal with programmable clock generators, which are
used on the great majority of Mach64 adapters.<p>
If you are uncertain which situation applies to your adapter, you can run a
clock probe with the command ``<tt>X -probeonly</tt>''.<p>
<sect2>Clocks for supported programmable clock generators<p>
At bootup, video BIOS initialisation programmes an initial set of frequencies.
Two of these are reserved to allow the setting of modes that do not use a
frequency from this initial set.
One of these reserved slots is used by the BIOS mode set routine, the other by
the particular driver used (e.g. MS-Windows, AutoCAD, X, etc.).
The clock numbers reserved in this way are dependent on the particular clock
generator used by the adapter.<p>
The driver currently supports all programmable clock generators known to exist
on Mach64 adapters.
In this case, the driver will completely ignore any xorg.conf clock
specification, and programme the clock generator as needed by the modes used
during the X session.<p>
<sect2>Clocks for unsupported programmable clock generators<p>
This case is unlikely to occur, but is documented for the sake of
completeness.<p>
In this situation, the driver will probe the adapter for clock frequencies
unless xorg.conf clocks are already specified.
In either case, the driver will then attempt to normalise the clocks to one of
the following specifications:
<verb>
BIOS setting 1:
Clocks 0.000 110.000 126.000 135.000 50.350 56.640 63.000 72.000
0.000 80.000 75.000 65.000 40.000 44.900 49.500 50.000
0.000 55.000 63.000 67.500 25.180 28.320 31.500 36.000
0.000 40.000 37.500 32.500 20.000 22.450 24.750 25.000</verb>
<verb>
BIOS setting 2:
Clocks 0.000 110.000 126.000 135.000 25.180 28.320 31.500 36.000
0.000 80.000 75.000 65.000 40.000 44.900 49.500 50.000
0.000 55.000 63.000 67.500 12.590 14.160 15.750 18.000
0.000 40.000 37.500 32.500 20.000 22.450 24.750 25.000</verb>
<verb>
BIOS setting 3:
Clocks 0.000 0.000 0.000 0.000 25.180 28.320 0.000 0.000
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
0.000 0.000 0.000 0.000 12.590 14.160 0.000 0.000
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000</verb>
If the driver matches the clocks to the third setting above, functionality will
be <it>extremely</it> limited (assuming the driver works at all).<p>
<sect2>Clocks for fixed clock generators on ATI adapters<p>
This section applies to all VGAWonder and Mach32 adapters, and to early Mach64
prototypes.<p>
One of the following clocks specifications (or an initial subset thereof) can
be used depending on what the adapter uses to generate dot clocks:
<verb>
Crystals (VGA Wonder V3 and V4 adapters only):
Clocks 50.000 56.644 0.000 44.900 44.900 50.000 0.000 36.000
25.000 28.322 0.000 22.450 22.450 25.000 0.000 18.000
16.667 18.881 0.000 14.967 14.967 16.667 0.000 12.000
12.500 14.161 0.000 11.225 11.225 12.500 0.000 9.000</verb>
<verb>
ATI 18810 clock generator:
Clocks 30.240 32.000 37.500 39.000 42.954 48.771 0.000 36.000
40.000 0.000 75.000 65.000 50.350 56.640 0.000 44.900
15.120 16.000 18.750 19.500 21.477 24.386 0.000 18.000
20.000 0.000 37.500 32.500 25.175 28.320 0.000 22.450
10.080 10.667 12.500 13.000 14.318 16.257 0.000 12.000
13.333 0.000 25.000 21.667 16.783 18.880 0.000 14.967
7.560 8.000 9.375 9.750 10.739 12.193 0.000 9.000
10.000 0.000 18.750 16.250 12.586 14.160 0.000 11.225</verb>
<verb>
ATI 18811-0 and ATI 18812-0 clock generators:
Clocks 30.240 32.000 110.000 80.000 42.954 48.771 92.400 36.000
39.910 44.900 75.000 65.000 50.350 56.640 0.000 44.900
15.120 16.000 55.000 40.000 21.477 24.386 46.200 18.000
19.955 22.450 37.500 32.500 25.175 28.320 0.000 22.450
10.080 10.667 36.667 26.667 14.318 16.257 30.800 12.000
13.303 14.967 25.000 21.667 16.783 18.880 0.000 14.967
7.560 8.000 27.500 20.000 10.739 12.193 23.100 9.000
9.978 11.225 18.750 16.250 12.588 14.160 0.000 11.225</verb>
<verb>
ATI 18811-1 and ATI 18811-2 clock generators:
Clocks 135.000 32.000 110.000 80.000 100.000 126.000 92.400 36.000
39.910 44.900 75.000 65.000 50.350 56.640 0.000 44.900
67.500 16.000 55.000 40.000 50.000 63.000 46.200 18.000
19.955 22.450 37.500 32.500 25.175 28.320 0.000 22.450
45.000 10.667 36.667 26.667 33.333 42.000 30.800 12.000
13.303 14.967 25.000 21.667 16.783 18.880 0.000 14.967
33.750 8.000 27.500 20.000 25.000 31.500 23.100 9.000
9.978 11.225 18.750 16.250 12.588 14.160 0.000 11.225</verb>
<verb>
ICS 2494-AM clock generators (found on some Dell motherboards):
Clocks 75.000 77.500 80.000 90.000 25.175 28.322 31.500 36.000
100.000 110.000 126.000 135.000 40.000 44.900 50.000 65.000
37.500 38.750 40.000 45.000 12.588 14.161 15.750 18.000
50.000 55.000 63.000 67.500 20.000 22.450 25.000 32.500
25.000 25.833 26.667 30.000 8.392 9.441 10.500 12.000
33.333 36.667 42.000 45.000 13.333 14.767 16.667 21.667
18.750 19.375 20.000 22.500 6.294 7.081 7.875 9.000
25.000 27.500 31.500 33.750 10.000 11.225 12.500 16.250</verb>
VGAWonder VLB, VGA 1024 VLB, Mach32 and Mach64 owners should only specify up to
the first 32 frequencies.
Any more will be ignored.<p>
Other clock generators that have been used on ATI adapters (which can all be
said to be clones of one of the above) might generate non-zero frequencies for
those that are zero above, or vice-versa.<p>
The order of the clocks <it>is</it> very important, although the driver will
reorder the specified clocks if it deems it appropriate to do so.
Mach32 and Mach64 owners should note that this order is different than what
they would use for previous accelerated servers.<p>
<sect2>Clocks for non-ATI adapters<p>
If no clocks are specified in the xorg.conf, the driver will probe for four
clocks, the second of which will be assumed to be 28.322 MHz.
The first clock will typically be 25.175 MHz, but there are exceptions.
You can include up to four clock frequencies in your xorg.conf to specify the
actual values used by the adapter.
Any more will be ignored.<p>
<sect1>Option <it>``nopanel_display''</it><p>
This specification is only effective when the driver detects that the adapter's
BIOS has initialised both the digital flat panel and CRT interfaces.
In such a situation, the driver will normally drive both the panel and the CRT.
This specification causes the driver to disable the digital flat panel and
display the screen image on the CRT instead, which could potentially allow for
larger physical resolutions than the panel can handle.<p>
<sect1>Option <it>``crt_display''</it><p>
This specification is only effective when the driver detects that the adapter's
BIOS has initialised the digital flat panel interface, but has disabled the
CRT interface.
In such a situation the driver will normally drive only the panel.
This specification causes the driver to instead display the same image on both
the panel and the CRT.<p>
<sect1>Option <it>``noaccel''</it><p>
By default, the driver will accelerate draw operations if a Mach64 CRTC is used
to drive the display.
As implemented in this driver, acceleration does not require a linear video
memory aperture.
This option disables this acceleration.<p>
<sect1>Option <it>``nolinear''</it><p>
By default, the driver will enable a linear video memory aperture for
256-colour and higher depth modes if it is also using a Mach64 accelerator CRTC
or an integrated Mach64 graphics chip.
This option disables this linear aperture.<p>
On non-Intel platforms, the driver requires a linear aperture and, so, this
option is ignored.<p>
<sect1>Option <it>``HWCursor''</it> and Option <it>``SWCursor''</it><p>
Option <it>``HWCursor''</it>, which is the default, specifies that hardware
facilities are to be used to paint the mouse pointer on the screen.
Option <it>``SWCursor''</it> specifies that the mouse pointer is to be drawn by
software, which is much slower.
If both options are specified, option <it>``SWCursor''</it> prevails.
Currently, these options are only acted upon for 256-colour or higher depth
modes, if a Mach64 accelerator CRTC, or a Mach64 integrated controller is being
used.
In all other situations, a software cursor will be used, regardless of what
these options specify.<p>
<sect1>Option <it>``SilkenMouse''</it><p>
This option is only acted upon when a hardware cursor is being used.
It specifies that the cursor's position on the screen is to be updated as
quickly as possible when the mouse is moved.
This is the default behaviour.
If this option is negated, the cursor may lag the mouse when the X server is
very busy.<p>
<sect1>Option <it>``shadowfb''</it><p>
If this option is enabled, the driver will cause the CPU to do each drawing
operation first into a shadow frame buffer in system virtual memory and then
copy the result into video memory.
If this option is not active, the CPU will draw directly into video memory.
Enabling this option is beneficial for those systems where reading from video
memory is, on average, slower than the corresponding read/modify/write
operation in system virtual memory.
This is normally the case for PCI or AGP adapters, and, so, this option is
enabled by default.
For other bus types, the default behaviour is to disable this option.<p>
Note that, due to various limitations, this option is forcibly disabled when a
linear video memory aperture is not enabled, when the frame buffer depth is
less than 8, or when acceleration is used.<p>
<sect1>Option <it>``dpms''</it><p>
This option enables the driver's support for VESA's Display Power Management
Specification.<p>
<sect1>Option <it>``backingstore''</it><p>
This is not specifically a driver option.
It is used to enable the server's support for backing store, a mechanism by
which pixel data for occluded window regions is remembered by the server
thereby alleviating the need to send expose events to X clients when the data
needs to be redisplayed.<p>
<sect1>MemBase <it>address</it><p>
This specification is only effective for non-PCI Mach64 adapters, and is used
to override the CPU address at which the adapter will map its video memory.
Normally, for non-PCI adapters, this address is set by a DOS install utility
provided with the adapter.
The MemBase option can also be used to enable the linear aperture in those
cases where ATI's utility was not, or can not be, used.<p>
For PCI and AGP adapters, this address is determined at system bootup according
to the PCI Plug'n'Play specification which arbitrates the resource requirements
of most devices in the system.
This means the driver can not easily change the linear aperture address.<p>
<sect1>Option <it>``ReferenceClock''</it> ``frequency''<p>
This option is only applicable to non-Intel platforms, where an adapter BIOS is
not available to the driver.
The option specifies the reference frequency used by the adapter's clock
generator.
The default is 14.318 MHz, and other typical values are 28.636, or 29.5 MHz.<p>
<sect1>ClockChip <it>``name''</it><p>
This option is only applicable to non-Intel platforms, where an adapter BIOS is
not available to the driver, and the driver cannot reliably determine whether
the clock generator the adapter uses is a variant of an ATI 18818 (a.k.a.
ICS 2595) or an unsupported clock generator.
The only values that are acted upon are <it>``ATI 18818-0''</it> or
<it>``ATI 18818-1''</it>.
From this specification, the driver derives a reference divider of 43 or 46
(respectively) for use in clock programming calculations.
The driver's default behaviour, in this case, is to assume an unsupported clock
generator, which means it will treat it as a fixed-frequency clock generator,
as described under the heading <bf>``Clocks for unsupported programmable clock
generators''</bf> above.<p>
<sect>Video modes<p>
Mode timings can be derived from the information in X's doc subdirectory.
However, it is no longer required to specify such timings in an xorg.conf's
``Monitor'' section(s), if only standard mode timings are to be used.
The server automatically inserts VESA standard mode timings in every
``Monitor'' section, and these modes will be checked first for mode constraints
(monitor sync tolerances, video memory size, etc.).<p>
Furthermore, it is also no longer required to specify mode names in ``Display''
subsections.
Should no mode names be specified (or those specified do not yield a usable
mode), the server will automatically select as a default resolution the largest
usable mode, whether or not the chosen mode is specified in the corresponding
``Monitor'' section.<p>
For a digital flat panel, any sync tolerances should be removed from the
corresponding ``Monitor'' section.
The driver will automatically calculate these from the mode that is active on
server entry.
The driver also inserts timings for a mode called <it>"Native panel mode"</it>
that represents the panel's native resolution.<p>
<sect>Known problems and limitations<p>
There are several known problems or limitations related to the ATI
driver.
They include:<p>
<itemize>
<item>When using a Mach64's accelerator CRTC, the virtual resolution must be
less than 8192 pixels wide.
The VGA CRTC further limits the virtual resolution width to less than 4096
pixels, or to less than 2048 pixels for adapters based on 18800-x's (with 256kB
of memory) and on Mach64 integrated controllers.
These are hardware limits that cannot be circumvented.
<item>Virtual resolutions requiring more than 1MB of video memory (256kB in the
monochrome case) are not supported by the VGA CRTC on 88800GX and 88800CX
adapters.
This is a hardware limit that cannot be circumvented.
<item>Due to hardware limitations, doublescanned modes are not supported by the
accelerator CRTC in 88800GX, 88800CX, 264CT and 264ET adapters.
<item>The ``VScan'' modeline parameter is only supported when using the VGA
CRTC.
<item>Interlaced modes are not supported on 18800-x and 28800-x adapters when
using a virtual resolution that is 2048 pixels or wider.
When using a 18800-x with 256kB of video memory in 256-colour modes, this limit
is reduced to 1024.
This is yet another hardware limitation that cannot be circumvented.
<item>Video memory banking does not work in monochrome and 16-colour modes on
18800-x adapters.
This appears to be another hardware limit, but this conclusion cannot be
confirmed at this time.
The driver's default behaviour in this case is to limit video memory to 256kB.
<item>Video memory corruption can still occur during mode switches on 18800-x
adapters.
Symptoms of this problem include garbled fonts on return to text mode, and
various effects (snow, dashed lines, etc) on initial entry into a graphics
mode.
In the first case, the workaround is to use some other means of restoring the
text font.
On Linux, this can be accomplished with the kbd or svgalib packages.
In the second case, <htmlurl name="xrefresh(1)" url="xrefresh.1.html">
will usually clean up the image.
No complete solution to this problem is currently known.
It appears this corruption occurs due to either video memory bandwidth or
RAMDAC limitations, and so the driver will limit mode clocks to 40MHz.
<item>There is some controversy over what the maximum allowed clock frequency
should be on 264xT and 3D Rage adapters.
For now, clocks will, by default, be limited to 80MHz, 135MHz, 170MHz, 200MHz
or 230MHz, depending on the specific controller.
This limit can only be increased (up to a driver-calculated absolute maximum)
through the DACSpeed specification in xorg.conf.
Be aware however that doing so is untested and might damage the adapter.
<item>Except as in the previous items, clocks are limited to 80MHz on most
adapters, although many are capable of higher frequencies.
This will eventually be fixed in a future release.
<item>The use of a laptop's hot-keys to switch displays while this driver is
active can cause lockups and/or other woes, and is therefore not recommended.
It is not currently possible to solve this problem.<p>
<item>In situations where the driver is to simultaneously display on both a
panel and a CRT, the same image will be seen on both.
In particular, this means the CRT must be able to synchronise with the timings
of the panel's native resolution.
This is quite evident when the panel has ``odd-ball'' dimensions, such as
1400x1050, a resolution not commonly possible on CRTs or projection
equipment.<p>
Also, the display of independent images on the panel and CRT is not currently
implemented, and might never be, pending resolution of the previous item.<p>
</itemize>
Support for the following will be added in a future release:
<itemize>
<item>Mach32's accelerator CRTC.
This support is the first step towards accelerated support for Mach32's,
Mach8's, 8514/A's and other clones.
<item>Colour depth greater than 8 on non-integrated controllers, where
permitted by the hardware.
<item>Mach32, Mach8 and 8514/A Draw Engines.
<item>Hardware cursors where implemented by hardware.
This has already been done for Mach64 integrated controllers.
<item>TVOut, i.e. the ability to use a television screen as a monitor.
<item>Motion Video, i.e. displaying an asynchronous data stream (TV signal,
DVD, etc.) in a window or full-screen.
<item>3D operations.
</itemize>
<sect>Reporting problems<p>
If you are experiencing problems that are not already recorded in this
document, first ensure that you have the latest current release of this driver
and the Xorg X server.
Check the server's log (usually found in /var/log/Xorg.0.log) and <htmlurl
name="ftp://ftp.freedesktop.org/pub/Xorg"
url="ftp://ftp.freedesktop.org/pub/Xorg"> if you are uncertain.<p>
Secondly, please check Xorg's doc directory for additional information.<p>
Thirdly, a scan through the comp.windows.x.i386unix and comp.os.linux.x
newsgroups, the xorg mailing list archives at <htmlurl
name="http://lists.freedesktop.org/mailman/listinfo/xorg"
url="http://lists.freedesktop.org/mailman/listinfo/xorg">, and
the Xorg bug database at <htmlurl
name="https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
url="https://bugs.freedesktop.org/enter_bug.cgi?product=xorg">
can also prove useful in resolving problems.<p>
If you are still experiencing problems, you can send <it>non-HTMLised</it>
e-mail to <email>xorg@lists.fredesktop.org</email>.
Please be as specific as possible when describing the problem(s), and include
an <it>unedited</it> copy of the server's log and the xorg.conf file used.<p>
<sect>Driver history<p>
The complete history of the driver is rather cloudy.
The following is more than likely to be incomplete and inaccurate.<p>
Apparently, Per Lindqvist first got a driver working with an early ATI adapter
under X386 1.1a.
This original driver might have actually been based on a non-functional ATI
driver written by Thomas Roell (currently of Xi Graphics).<p>
Then Doug Evans added support for the ATI VGA Wonder XL, trying in the process
to make the driver work with all other ATI adapters available at the time.<p>
Rik Faith obtained the X11R4 driver from Doug Evans in the summer of 1992 and
ported the code to the X386 part of X11R5.
This subsequently became part of XFree86.<p>
Marc Aurele La France took over development and maintenance of the driver
in the fall of 1993 after Rik got rid of his VGA Wonder adapter.<p>
<sect>Driver versions<p>
Due to the introduction of loadable drivers in XFree86 4.0, it has become
necessary to track driver versions separately.
Driver releases use the following version numbering scheme.<p>
Version 1 of this driver is the one I inherited from Rik Faith.
This is the version found in XFree86 2.0 and 2.1.<p>
Version 2 is my first rewrite of this code which only ended up being a
partially unsuccessful attempt at generalising the driver for all VGA Wonder,
Mach32, and early Mach64 adapters.
Various releases of this version of the driver can be found in XFree86 2.1.1,
3.1, 3.1.1 and 3.1.2.<p>
Version 3 represents my second rewrite (although a rather lame one as rewrites
go).
Into version 3, I introduced clock programming for Mach64 adapters and merged
in the old ati_test debugging tool.
This is the version found in XFree86 3.2, 3.3 and 3.3.1.<p>
Version 4 is a rather major restructuring of version 3, which became larger
than I could comfortably handle in one source file.
This is the version found in XFree86 3.3.2, 3.3.3, 3.3.3.1, 3.3.3.2, 3.3.4,
3.3.5 and 3.3.6.<p>
Version 5 is an almost complete restructuring of version 4 to fit in the newer
driver API of XFree86 4.0 and later.<p>
The introduction of version 6 is a first swipe at porting the driver to
non-Intel architectures.<p>
</article>

View File

@ -0,0 +1,160 @@
Information for ATI Rage 128 Users
Precision Insight, Inc., SuSE GmbH
13 June 2000
____________________________________________________________
Table of Contents
1. Supported Hardware
2. Features
3. Technical Notes
4. Reported Working Video Cards
5. Configuration
6. Driver Options
7. Known Limitations
8. Authors
______________________________________________________________________
1. Supported Hardware
+o ATI Rage 128 based cards
2. Features
+o Full support (including hardware accelerated 2D drawing) for 8, 15,
16, 24 bit pixel depths.
+o Hardware cursor support to reduce sprite flicker.
+o Support for high resolution video modes up to 1800x1440 @ 70Hz.
+o Support for doublescan video modes (e.g., 320x200 and 320x240).
+o Support for gamma correction at all pixel depths.
+o Fully programmable clock supported.
+o Robust text mode restore for VT switching.
3. Technical Notes
+o None
4. Reported Working Video Cards
+o Rage Fury AGP 32MB
+o XPERT 128 AGP 16MB
+o XPERT 99 AGP 8MB
5. Configuration
The driver auto-detects all device information necessary to initialize
the card. The only lines you need in the "Device" section of your
xorg.conf file are:
Section "Device"
Identifier "Rage 128"
Driver "r128"
EndSection
or let xorgconfig do this for you.
However, if you have problems with auto-detection, you can specify:
+o VideoRam - in kilobytes
+o MemBase - physical address of the linear framebuffer
+o IOBase - physical address of the memory mapped IO registers
+o ChipID - PCI DEVICE ID
6. Driver Options
+o "hw_cursor" - request hardware cursor (default)
+o "sw_cursor" - software cursor only
+o "no_accel" - software rendering only
+o "dac_8_bit" - use color weight 888 in 8 bpp mode (default)
+o "dac_6_bit" - use color weight 666 in 8 bpp mode (VGA emulation)
7. Known Limitations
+o None
8. Authors
The X11R6.8 driver was originally part of XFree86 4.4 rc2.
The XFree86 4 driver was ported from XFree86 3.3.x and enhanced by:
+o Rickard E. (Rik) Faith <faith@precisioninsight.com>
+o Kevin E. Martin <kevin@precisioninsight.com>
The XFree86 4 driver was funded by ATI and was donated to The XFree86
Project by:
Precision Insight, Inc.
Cedar Park, TX
USA
The XFree86 3.3.x driver used for the port was written by:
+o Rickard E. (Rik) Faith <faith@precisioninsight.com>
+o Kevin E. Martin <kevin@precisioninsight.com>
The XFree86 3.3.x driver was funded by ATI and was donated to The
XFree86 Project by Precision Insight, Inc. It was based in part on
an earlier driver that was written by:
+o Alan Hourihane <alanh@fairlite.demon.co.uk>
+o Dirk Hohndel <hohndel@suse.de>
This early driver was funded and donated to The XFree86 Project by:
SuSE GmbH
Schanzaekerstr. 10
90443 Nuernberg
Germany
http://www.precisioninsight.com
http://www.suse.com

View File

@ -0,0 +1,138 @@
<!DOCTYPE linuxdoc PUBLIC "-//Xorg//DTD linuxdoc//EN"[
<!ENTITY % defs SYSTEM "defs.ent"> %defs;
]>
<article>
<title>Information for ATI Rage 128 Users
<author>Precision Insight, Inc., SuSE GmbH
<date>13 June 2000
<ident>
</ident>
<toc>
<sect>Supported Hardware
<p>
<itemize>
<item>ATI Rage 128 based cards
</itemize>
<sect>Features
<p>
<itemize>
<item>Full support (including hardware accelerated 2D drawing) for 8, 15,
16, 24 bit pixel depths.
<item>Hardware cursor support to reduce sprite flicker.
<item>Support for high resolution video modes up to 1800x1440 @ 70Hz.
<item>Support for doublescan video modes (e.g., 320x200 and 320x240).
<item>Support for gamma correction at all pixel depths.
<item>Fully programmable clock supported.
<item>Robust text mode restore for VT switching.
</itemize>
<sect>Technical Notes
<p>
<itemize>
<item>None
</itemize>
<sect>Reported Working Video Cards
<p>
<itemize>
<item>Rage Fury AGP 32MB
<item>XPERT 128 AGP 16MB
<item>XPERT 99 AGP 8MB
</itemize>
<sect>Configuration
<p>
The driver auto-detects all device information necessary to
initialize the card. The only lines you need in the "Device"
section of your xorg.conf file are:
<verb>
Section "Device"
Identifier "Rage 128"
Driver "r128"
EndSection
</verb>
or let <tt>xorgconfig</tt> do this for you.
However, if you have problems with auto-detection, you can specify:
<itemize>
<item>VideoRam - in kilobytes
<item>MemBase - physical address of the linear framebuffer
<item>IOBase - physical address of the memory mapped IO registers
<item>ChipID - PCI DEVICE ID
</itemize>
<sect>Driver Options
<p>
<itemize>
<item>"hw_cursor" - request hardware cursor (default)
<item>"sw_cursor" - software cursor only
<item>"no_accel" - software rendering only
<item>"dac_8_bit" - use color weight 888 in 8 bpp mode (default)
<item>"dac_6_bit" - use color weight 666 in 8 bpp mode (VGA emulation)
</itemize>
<sect>Known Limitations
<p>
<itemize>
<item>None
</itemize>
<sect>Authors
<p>
The X11R&relvers; driver was originally part of XFree86 4.4 rc2.
The XFree86 4 driver was ported from XFree86 3.3.x and enhanced by:
<itemize>
<item>Rickard E. (Rik) Faith <email>faith@precisioninsight.com</email>
<item>Kevin E. Martin <email>kevin@precisioninsight.com</email>
</itemize>
<p>
The XFree86 4 driver was funded by ATI and was donated to The XFree86
Project by:
<verb>
Precision Insight, Inc.
Cedar Park, TX
USA
</verb>
<p>
The XFree86 3.3.x driver used for the port was written by:
<itemize>
<item>Rickard E. (Rik) Faith <email>faith@precisioninsight.com</email>
<item>Kevin E. Martin <email>kevin@precisioninsight.com</email>
</itemize>
The XFree86 3.3.x driver was funded by ATI and was donated to The XFree86
Project by Precision Insight, Inc. It was based in part on an earlier
driver that was written by:
<itemize>
<item>Alan Hourihane <email>alanh@fairlite.demon.co.uk</email>
<item>Dirk Hohndel <email>hohndel@suse.de</email>
</itemize>
<p>This early driver was funded and donated to The XFree86 Project by:
<verb>
SuSE GmbH
Schanzaekerstr. 10
90443 Nuernberg
Germany
</verb>
<p>
<htmlurl name="http://www.precisioninsight.com"
url="http://www.precisioninsight.com">
<p>
<htmlurl name="http://www.suse.com"
url="http://www.suse.com">
</article>

7819
xf86-video-ati-6.6.3/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,142 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-02-03.08
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

1411
xf86-video-ati-6.6.3/config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,90 @@
/* config.h.in. Generated from configure.ac by autoheader. */
#include "xorg-server.h"
/* Major version */
#undef ATI_VERSION_MAJOR
/* Minor version */
#undef ATI_VERSION_MINOR
/* Patch version */
#undef ATI_VERSION_PATCH
/* Avoid PIO and use MMIO for atimisc. */
#undef AVOID_CPIO
/* Do not build DGA support. */
#undef AVOID_DGA
/* Only probe PCI cards; do not probe ISA. */
#undef AVOID_NON_PCI
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Build TV-Out support for atimisc. */
#undef TV_OUT
/* Build support for Exa */
#undef USE_EXA
/* Build support for XAA */
#undef USE_XAA
/* Version number of package */
#undef VERSION
/* Enable DRI driver support */
#undef XF86DRI
/* Enable developmental DRI driver support */
#undef XF86DRI_DEVEL

1500
xf86-video-ati-6.6.3/config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

22685
xf86-video-ati-6.6.3/configure vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,236 @@
# Copyright 2005 Adam Jackson.
#
# 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
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON 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.
#
# Process this file with autoconf to produce a configure script
AC_PREREQ(2.57)
AC_INIT([xf86-video-ati],
6.6.3,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-ati)
AC_DEFINE_UNQUOTED([ATI_VERSION_MAJOR],
[$(echo $PACKAGE_VERSION | sed -e 's/^\([[0-9]]\)\.[[0-9]]\.[[0-9]]/\1/')],
[Major version])
AC_DEFINE_UNQUOTED([ATI_VERSION_MINOR],
[$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]\.\([[0-9]]\)\.[[0-9]]/\1/')],
[Minor version])
AC_DEFINE_UNQUOTED([ATI_VERSION_PATCH],
[$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]\.[[0-9]]\.\([[0-9]]\)/\1/')],
[Patch version])
AC_CONFIG_SRCDIR([Makefile.am])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
# Checks for programs.
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_CC
AH_TOP([#include "xorg-server.h"])
AC_ARG_WITH(xorg-module-dir,
AC_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
[Disable DRI support [[default=auto]]]),
[DRI="$enableval"],
[DRI=auto])
AC_ARG_ENABLE(exa,
AC_HELP_STRING([--disable-exa],
[Disable EXA support [[default enabled]]]),
[EXA="$enableval"],
[EXA=yes])
# Checks for extensions
XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(XF86MISC, xf86miscproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages
PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
if test "$DRI" != no; then
AC_CHECK_FILE([${sdkdir}/dri.h],
[have_dri_h="yes"], [have_dri_h="no"])
AC_CHECK_FILE([${sdkdir}/sarea.h],
[have_sarea_h="yes"], [have_sarea_h="no"])
AC_CHECK_FILE([${sdkdir}/dristruct.h],
[have_dristruct_h="yes"], [have_dristruct_h="no"])
fi
AC_MSG_CHECKING([whether to include DRI support])
if test x$DRI = xauto; then
if test "$have_dri_h" = yes -a \
"$have_sarea_h" = yes -a \
"$have_dristruct_h" = yes; then
DRI="yes"
else
DRI="no"
fi
fi
AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
if test "$DRI" = yes; then
PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
fi
# Note that this is sort of inverted from drivers/ati/Imakefile in
# the monolith. We test for foo, not for !foo (i.e. ATMISC_CPIO, not
# ATIMISC_AVOID_CPIO), but the defines are negative. So beware. Oh yeah,
# TV_OUT is the special case where it's a positive define, not AVOID_TV_OUT.
# AVOID_CPIO: Only x86, amd64, and alpha are cool with CPIO. It needs a
# little-endian, undirected PIO space of at least 64kB.
# AVOID_NON_PCI: Platforms which don't deal with PCI master aborts should
# stick to PCI-only probing, stick their fingers in their ears, and pretend
# that ISA cards simply don't exist.
# AVOID_DGA: ???
# ATI_TV_OUT: This only works on x86.
ATIMISC_CPIO=no
ATIMISC_NON_PCI=yes
ATIMISC_DGA=yes
ATIMISC_TV_OUT=no
case $host_cpu in
i*86)
ATIMISC_TV_OUT=yes
ATIMISC_CPIO=yes
;;
x86_64|amd64|alpha|ia64)
ATIMISC_CPIO=yes
;;
sparc)
ATIMISC_DGA=no
;;
powerpc)
ATIMISC_NON_PCI=no
;;
*)
;;
esac
AC_MSG_CHECKING([whether to include PIO support])
AM_CONDITIONAL(ATIMISC_CPIO, test "x$ATIMISC_CPIO" = xyes)
if test "x$ATIMISC_CPIO" = xyes; then
AC_MSG_RESULT([yes, PIO])
else
AC_DEFINE(AVOID_CPIO, 1, [Avoid PIO and use MMIO for atimisc.])
AC_MSG_RESULT([no, MMIO])
fi
AC_MSG_CHECKING([whether to include support for non-PCI devices])
AM_CONDITIONAL(ATIMISC_NON_PCI, test "x$ATIMISC_NON_PCI" = xyes)
if test "x$ATI_AVOID_NON_PCI" = xyes; then
AC_MSG_RESULT([yes, PCI and ISA])
else
AC_DEFINE(AVOID_NON_PCI, 1, [Only probe PCI cards; do not probe ISA.])
AC_MSG_RESULT([no, PCI only])
fi
AC_MSG_CHECKING([whether to include DGA support])
AC_MSG_RESULT([$ATIMISC_DGA])
AM_CONDITIONAL(ATIMISC_DGA, test "x$ATIMISC_DGA" = xyes)
if ! test "x$ATIMISC_DGA" = xyes; then
AC_DEFINE(AVOID_DGA, 1, [Do not build DGA support.])
fi
AC_MSG_CHECKING([whether to include TV Out support])
AC_MSG_RESULT([$ATIMISC_TV_OUT])
AM_CONDITIONAL(ATIMISC_TV_OUT, test "x$ATIMISC_TV_OUT" = xyes)
if test "x$ATIMISC_TV_OUT" = xyes; then
AC_DEFINE(TV_OUT, 1, [Build TV-Out support for atimisc.])
fi
AC_DEFINE(USE_XAA, 1, [Build support for XAA])
# Properly handle EXA.
AC_MSG_CHECKING([whether to enable EXA support])
if test "x$EXA" = xyes; then
AC_MSG_RESULT(yes)
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
AC_CHECK_HEADER(exa.h,
[have_exa_h="yes"], [have_exa_h="no"])
CPPFLAGS="$SAVE_CPPFLAGS"
else
AC_MSG_RESULT(no)
fi
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
if test "x$have_exa_h" = xyes; then
AC_MSG_CHECKING([whether EXA version is at least 2.0.0])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include "exa.h"
#if EXA_VERSION_MAJOR < 2
#error OLD EXA!
#endif
]])],
[USE_EXA=yes],
[USE_EXA=no])
AC_MSG_RESULT($USE_EXA)
if test "x$USE_EXA" = xyes; then
AC_DEFINE(USE_EXA, 1, [Build support for Exa])
fi
fi
CPPFLAGS="$SAVE_CPPFLAGS"
AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
AC_SUBST([XORG_CFLAGS])
AC_SUBST([DRI_CFLAGS])
AC_SUBST([moduledir])
DRIVER_NAME=ati
AC_SUBST([DRIVER_NAME])
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
XORG_CHECK_LINUXDOC
AC_OUTPUT([
Makefile
src/Makefile
man/Makefile
])

View File

@ -0,0 +1,529 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-02-09.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -0,0 +1,323 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-02-02.21
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# 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 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
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
# $Id$
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
# 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.
#
# The above copyright notice and this permission notice 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 OPEN GROUP 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.
#
# Except as contained in this notice, the name of the copyright holders shall
# not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization
# from the copyright holders.
#
drivermandir = $(DRIVER_MAN_DIR)
driverman_PRE = @DRIVER_NAME@.man r128.man radeon.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man r128.man radeon.man
CLEANFILES = $(driverman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
.man.$(DRIVER_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@

View File

@ -0,0 +1,439 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
# $Id$
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
# 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.
#
# The above copyright notice and this permission notice 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 OPEN GROUP 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.
#
# Except as contained in this notice, the name of the copyright holders shall
# not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization
# from the copyright holders.
#
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
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 = man
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
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 = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(drivermandir)"
drivermanDATA_INSTALL = $(INSTALL_DATA)
DATA = $(driverman_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
ATIMISC_CPIO_FALSE = @ATIMISC_CPIO_FALSE@
ATIMISC_CPIO_TRUE = @ATIMISC_CPIO_TRUE@
ATIMISC_DGA_FALSE = @ATIMISC_DGA_FALSE@
ATIMISC_DGA_TRUE = @ATIMISC_DGA_TRUE@
ATIMISC_NON_PCI_FALSE = @ATIMISC_NON_PCI_FALSE@
ATIMISC_NON_PCI_TRUE = @ATIMISC_NON_PCI_TRUE@
ATIMISC_TV_OUT_FALSE = @ATIMISC_TV_OUT_FALSE@
ATIMISC_TV_OUT_TRUE = @ATIMISC_TV_OUT_TRUE@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@
BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@
BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@
BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_FALSE = @DRI_FALSE@
DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LINUXDOC = @LINUXDOC@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAKE_HTML = @MAKE_HTML@
MAKE_PDF = @MAKE_PDF@
MAKE_PS = @MAKE_PS@
MAKE_TEXT = @MAKE_TEXT@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PS2PDF = @PS2PDF@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_EXA_FALSE = @USE_EXA_FALSE@
USE_EXA_TRUE = @USE_EXA_TRUE@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
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@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
moduledir = @moduledir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
drivermandir = $(DRIVER_MAN_DIR)
driverman_PRE = @DRIVER_NAME@.man r128.man radeon.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man r128.man radeon.man
CLEANFILES = $(driverman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign 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
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-drivermanDATA: $(driverman_DATA)
@$(NORMAL_INSTALL)
test -z "$(drivermandir)" || $(mkdir_p) "$(DESTDIR)$(drivermandir)"
@list='$(driverman_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(drivermanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(drivermandir)/$$f'"; \
$(drivermanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(drivermandir)/$$f"; \
done
uninstall-drivermanDATA:
@$(NORMAL_UNINSTALL)
@list='$(driverman_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(drivermandir)/$$f'"; \
rm -f "$(DESTDIR)$(drivermandir)/$$f"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(drivermandir)"; 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)
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 distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-drivermanDATA
install-exec-am:
install-info: install-info-am
install-man:
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-drivermanDATA uninstall-info-am
.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-drivermanDATA \
install-exec install-exec-am install-info install-info-am \
install-man 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-drivermanDATA \
uninstall-info-am
.man.$(DRIVER_MAN_SUFFIX):
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:

View File

@ -0,0 +1,34 @@
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.man,v 1.2 2001/01/27 18:20:46 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH ATI __drivermansuffix__ __vendorversion__
.SH NAME
ati \- ATI video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qati\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B ati
is an __xservername__ wrapper driver for ATI video cards. It autodetects
whether your hardware has a Radeon, Rage 128, or Mach64 or earlier class of
chipset, and loads the radeon(__drivermansuffix__),
r128(__drivermansuffix__), or atimisc(__drivermansuffix__) driver as
appropriate.
.SH SUPPORTED HARDWARE
The
.B ati
driver supports Radeon, Rage 128, and Mach64 and earlier chipsets by loading
those drivers. See those manpages for specific cards supported.
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details, and the specific card driver for driver configuration details.
driver.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.SH AUTHORS
See the individual driver pages for authors.

View File

@ -0,0 +1,156 @@
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man,v 1.3 2001/06/01 02:10:05 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH R128 __drivermansuffix__ __vendorversion__
.SH NAME
r128 \- ATI Rage 128 video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qr128\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B r128
is an __xservername__ driver for ATI Rage 128 based video cards. It contains
full support for 8, 15, 16 and 24 bit pixel depths, hardware
acceleration of drawing primitives, hardware cursor, video modes up to
1800x1440 @ 70Hz, doublescan modes (e.g., 320x200 and 320x240), gamma
correction at all pixel depths, a fully programming dot clock and robust
text mode restoration for VT switching. Dualhead is supported on M3/M4
mobile chips.
.SH SUPPORTED HARDWARE
The
.B r128
driver supports all ATI Rage 128 based video cards including the Rage
Fury AGP 32MB, the XPERT 128 AGP 16MB and the XPERT 99 AGP 8MB.
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.PP
The driver auto-detects all device information necessary to initialize
the card. However, if you have problems with auto-detection, you can
specify:
.PP
.RS 4
VideoRam - in kilobytes
.br
MemBase - physical address of the linear framebuffer
.br
IOBase - physical address of the MMIO registers
.br
ChipID - PCI DEVICE ID
.RE
.PP
In addition, the following driver
.B Options
are supported:
.TP
.BI "Option \*qSWcursor\*q \*q" boolean \*q
Selects software cursor. The default is
.B off.
.TP
.BI "Option \*qNoAccel\*q \*q" boolean \*q
Enables or disables all hardware acceleration. The default is to
.B enable
hardware acceleration.
.TP
.BI "Option \*qDac6Bit\*q \*q" boolean \*q
Enables or disables the use of 6 bits per color component when in 8 bpp
mode (emulates VGA mode). By default, all 8 bits per color component
are used. The default is
.B off.
.TP
.BI "Option \*qVideoKey\*q \*q" integer \*q
This overrides the default pixel value for the YUV video overlay key.
The default value is
.B undefined.
.TP
.BI "Option \*qDisplay\*q \*q" string \*q
Select display mode for devices which support flat panels. Supported modes are:
.B \*qFP\*q
- use flat panel;
.B \*qCRT\*q
- use cathode ray tube;
.B \*qMirror\*q
- use both FP and CRT;
.B \*qBIOS\*q
- use mode as configured in the BIOS.
The default is
.B FP.
.PP
The following
.B Options
are mostly important for non-x86 architectures:
.TP
.BI "Option \*qProgramFPRegs\*q \*q" boolean \*q
Enable or disable programming of the flat panel registers.
Beware that this may damage your panel, so use this
.B at your own risk.
The default depends on the device.
.TP
.BI "Option \*qPanelWidth\*q \*q" integer \*q
.TP
.BI "Option \*qPanelHeight\*q \*q" integer \*q
Override the flat panel dimensions in pixels. They are used to program the flat panel
registers and normally determined using the video card BIOS. If the wrong dimensions
are used, the system may hang.
.TP
.BI "Option \*qUseFBDev\*q \*q" boolean \*q
Enable or disable use of an OS-specific framebuffer device interface
(which is not supported on all OSs). See fbdevhw(__drivermansuffix__)
for further information.
Default:
.BI on
for PowerPC,
.BI off
for other architectures.
.TP
.BI "Option \*qDMAForXv\*q \*q" boolean \*q
Try or don't try to use DMA for Xv image transfers. This will reduce CPU
usage when playing big videos like DVDs, but may cause instabilities.
Default: off.
.PP
The following additional
.B Options
are supported:
.TP
.BI "Option \*qShowCache\*q \*q" boolean \*q
Enable or disable viewing offscreen cache memory. A
development debug option. Default: off.
.TP
.BI "Option \*qVGAAccess\*q \*q" boolean \*q
Tell the driver if it can do legacy VGA IOs to the card. This is
necessary for properly resuming consoles when in VGA text mode, but
shouldn't be if the console is using radeonfb or some other graphic
mode driver. Some platforms like PowerPC have issues with those, and they aren't
necessary unless you have a real text mode in console. The default is
.B off
on PowerPC and
.B on
on other architectures.
.PP
.B Dualhead Note:
The video BIOS on some laptops interacts strangely with dualhead.
This can result in flickering and problems changing modes on crtc2.
If you experience these problems try toggling your laptop's video
output switch (e.g., fn-f7, etc.) prior to starting X or switch to
another VT and back.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.SH AUTHORS
.nf
Rickard E. (Rik) Faith \fIfaith@precisioninsight.com\fP
Kevin E. Martin \fIkevin@precisioninsight.com\fP

View File

@ -0,0 +1,628 @@
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.man,v 1.0 2003/01/31 23:04:50 $
.ds q \N'34'
.TH RADEON __drivermansuffix__ __vendorversion__
.SH NAME
radeon \- ATI RADEON video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qradeon\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B radeon
is an __xservername__ driver for ATI RADEON based video cards. It contains
full support for 8, 15, 16 and 24 bit pixel depths, dual-head setup,
flat panel, hardware 2D acceleration, hardware 3D acceleration
(experimental on R300 and R400 series cards), hardware cursor, XV extension,
and the Xinerama extension.
.SH SUPPORTED HARDWARE
The
.B radeon
driver supports PCI and AGP video cards based on the following ATI chips
.TP 12
.B R100
Radeon 7200
.TP 12
.B RV100
Radeon 7000(VE), M6
.TP 12
.B RS100
Radeon IGP320(M)
.TP 12
.B RV200
Radeon 7500, M7, FireGL 7800
.TP 12
.B RS200
Radeon IGP330(M)/IGP340(M)
.TP 12
.B RS250
Radeon Mobility 7000 IGP
.TP 12
.B R200
Radeon 8500, 9100, FireGL 8800/8700
.TP 12
.B RV250
Radeon 9000PRO/9000, M9
.TP 12
.B RS300
Radeon 9100 IGP
.TP 12
.B RS350
Radeon 9200 IGP
.TP 12
.B RS400
Radeon XPRESS 200/200M IGP
.TP 12
.B RV280
Radeon 9200PRO/9200/9200SE, M9+
.TP 12
.B R300
Radeon 9700PRO/9700/9500PRO/9500/9600TX, FireGL X1/Z1 (2D only)
.TP 12
.B R350
Radeon 9800PRO/9800SE/9800, FireGL X2 (2D only)
.TP 12
.B R360
Radeon 9800XT (2d only)
.TP 12
.B RV350
Radeon 9600PRO/9600SE/9600, M10/M11, FireGL T2 (2D only)
.TP 12
.B RV360
Radeon 9600XT (2d only)
.TP 12
.B RV370
Radeon X300, M22 (2d only)
.TP 12
.B RV380
Radeon X600, M24 (2d only)
.TP 12
.B RV410
Radeon X700, M26 PCIE (2d only)
.TP 12
.B R420
Radeon X800 AGP (2d only)
.TP 12
.B R423/R430
Radeon X800, M28 PCIE (2d only)
.TP 12
.B R480/R481
Radeon X850 PCIE/AGP (2d only)
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.PP
The driver auto\-detects all device information necessary to initialize
the card. However, if you have problems with auto\-detection, you can
specify:
.PP
.RS 4
VideoRam \- in kilobytes
.br
MemBase \- physical address of the linear framebuffer
.br
IOBase \- physical address of the MMIO registers
.br
ChipID \- PCI DEVICE ID
.RE
.PP
In addition, the following driver
.B Options
are supported:
.TP
.BI "Option \*qSWcursor\*q \*q" boolean \*q
Selects software cursor. The default is
.B off.
.TP
.BI "Option \*qNoAccel\*q \*q" boolean \*q
Enables or disables all hardware acceleration.
.br
The default is to
.B enable
hardware acceleration.
.TP
.BI "Option \*qDac6Bit\*q \*q" boolean \*q
Enables or disables the use of 6 bits per color component when in 8 bpp
mode (emulates VGA mode). By default, all 8 bits per color component
are used.
.br
The default is
.B off.
.TP
.BI "Option \*qVideoKey\*q \*q" integer \*q
This overrides the default pixel value for the YUV video overlay key.
.br
The default value is
.B 0x1E.
.TP
.BI "Option \*qUseFBDev\*q \*q" boolean \*q
Enable or disable use of an OS\-specific framebuffer device interface
(which is not supported on all OSs). MergedFB does not work when this
option is in use. See fbdevhw(__drivermansuffix__) for further information.
.br
The default is
.B off.
.TP
.BI "Option \*qAGPMode\*q \*q" integer \*q
Set AGP data transfer rate.
(used only when DRI is enabled)
.br
1 \-\- x1 (default)
.br
2 \-\- x2
.br
4 \-\- x4
.br
8 \-\- x8
.br
others \-\- invalid
.TP
.BI "Option \*qAGPFastWrite\*q \*q" boolean \*q
Enable AGP fast write. Enabling this option is frequently the cause of
instability. Used only when the DRI is enabled.
.br
The default is
.B off.
.TP
.BI "Option \*qBusType\*q \*q" string \*q
Used to replace previous ForcePCIMode option.
Should only be used when driver's bus detection is incorrect
or you want to force a AGP card to PCI mode. Should NEVER force
a PCI card to AGP bus.
.br
PCI \-\- PCI bus
.br
AGP \-\- AGP bus
.br
PCIE \-\- PCI Express (falls back to PCI at present)
.br
(used only when DRI is enabled)
.br
The default is
.B auto detect.
.TP
.BI "Option \*qDDCMode\*q \*q" boolean \*q
Force to use the modes queried from the connected monitor.
.br
The default is
.B off.
.TP
.BI "Option \*qDisplayPriority\*q \*q" string \*q
.br
Used to prevent flickering or tearing problem caused by display buffer underflow.
.br
AUTO \-\- Driver calculated (default).
.br
BIOS \-\- Remain unchanged from BIOS setting.
Use this if the calculation is not correct
for your card.
.br
HIGH \-\- Force to the highest priority.
Use this if you have problem with above options.
This may affect performance slightly.
.br
The default value is
.B AUTO.
.TP
.BI "Option \*qMonitorLayout\*q \*q" string \*q
.br
This option is used to overwrite the detected monitor types.
This is only required when driver makes a false detection.
The possible monitor types are:
.br
NONE \-\- Not connected
.br
CRT \-\- Analog CRT monitor
.br
TMDS \-\- Desktop flat panel
.br
LVDS \-\- Laptop flat panel
.br
This option can be used in following format:
.br
Option "MonitorLayout" "[type on primary], [type on secondary]"
.br
For example, Option "MonitorLayout" "CRT, TMDS"
Primary/Secondary head for dual\-head cards:
.br
(when only one port is used, it will be treated as the primary regardless)
.br
.B Primary head:
.br
DVI port on DVI+VGA cards
.br
LCD output on laptops
.br
Internal TMDS port on DVI+DVI cards
.br
.B Secondary head:
.br
VGA port on DVI+VGA cards
.br
VGA port on laptops
.br
External TMDS port on DVI+DVI cards
The default value is
.B undefined.
.TP
.BI "Option \*qMergedFB\*q \*q" boolean \*q
This enables merged framebuffer mode. In this mode you have a single
shared framebuffer with two viewports looking into it. It is similar
to Xinerama, but has some advantages. It is faster than Xinerama, the
DRI works on both heads, and it supports clone modes.
.br
Merged framebuffer mode provides two linked viewports looking into a
single large shared framebuffer. The size of the framebuffer is
determined by the
.B Virtual
keyword defined on the
.B Screen
section of your __xconfigfile__ file. It works just like regular virtual
desktop except you have two viewports looking into it instead of one.
.br
For example, if you wanted a desktop composed of two 1024x768 viewports
looking into a single desktop you would create a virtual desktop of
2048x768 (left/right) or 1024x1536 (above/below), e.g.,
.br
.B Virtual 2048 768
or
.B Virtual 1024 1536
.br
The virtual desktop can be larger than larger than the size of the viewports
looking into it. In this case the linked viewports will scroll around in the
virtual desktop. Viewports with different sizes are also supported (e.g., one
that is 1024x768 and one that is 640x480). In this case the smaller viewport
will scroll relative to the larger one such that none of the virtual desktop
is inaccessible. If you do not define a virtual desktop the driver will create
one based on the orientation of the heads and size of the largest defined mode in
the display section that is supported on each head.
.br
The relation of the viewports in specified by the
.B CRT2Position
Option. The options are
.B Clone
,
.B LeftOf
,
.B RightOf
,
.B Above
, and
.B Below.
MergedFB is enabled by default if a monitor is detected on each output. If
no position is given it defaults to clone mode (the old clone options are now
deprecated, also, the option OverlayOnCRTC2 has been replaced by the Xv
attribute XV_SWITCHCRT; the overlay can be switched to CRT1 or CRT2 on the fly
in clone mode).
.br
The maximum framebuffer size that the 2D acceleration engine can handle is
8192x8192. The maximum framebuffer size that the 3D engine can handle is
2048x2048.
.br
.B Note:
Page flipping does not work well in certain configurations with MergedFB. If you
see rendering errors or other strange behavior, disable page flipping. Also MergedFB
is not compatible with the
.B UseFBDev
option.
.br
The default value is
.B undefined.
.TP
.BI "Option \*qCRT2HSync\*q \*q" "string" \*q
Set the horizontal sync range for the secondary monitor.
It is not required if a DDC\-capable monitor is connected.
.br
For example, Option "CRT2HSync" "30.0-86.0"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qCRT2VRefresh\*q \*q" "string" \*q
Set the vertical refresh range for the secondary monitor.
It is not required if a DDC\-capable monitor is connected.
.br
For example, Option "CRT2VRefresh" "50.0-120.0"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qCRT2Position\*q \*q" "string" \*q
Set the relationship of CRT2 relative to CRT1. Valid options are:
.B Clone
,
.B LeftOf
,
.B RightOf
,
.B Above
, and
.B Below
.
.br
For example, Option "CRT2Position" "RightOf"
.br
This option also supports an offset. This is most useful when
.B MergedNonRectangular
is enabled. For example if you want CRT2 to be offset 100 pixels down from
the start of CRT1, you'd type:
.br
Option "CRT2Position" "LeftOf 100"
.br
The offset is vertical for LeftOf and RightOf and horizontal for Above and
Below. Offsets can be positive or negative.
.br
The default value is
.B Clone.
.TP
.BI "Option \*qMetaModes\*q \*q" "string" \*q
MetaModes are mode combinations for CRT1 and CRT2. If you are using merged
frame buffer mode and want to change modes (CTRL-ALT-+/-), these define which
modes will be switched to on CRT1 and CRT2. The MetaModes are defined as
CRT1Mode-CRT2Mode (800x600-1024x768). Modes listed individually (800x600)
define clone modes, that way you can mix clone modes with non-clone modes.
Also some programs require "standard" modes. If you want to add clone modes
of different refreshes or sizes to the mix, they are defined as CRT1Mode+CRT2Mode
(800x600+1024x768).
.br
Note: Any mode you use in the MetaModes must be defined in the
.B Screen
section of your __xconfigfile__ file. Modes not defined there will be ignored when
the MetaModes are parsed since the driver uses them to make sure the monitors can
handle those modes. If you do not define a MetaMode the driver will create
one based on the orientation of the heads and size of the largest defined mode in
the display section that is supported on each head.
.br
.B Modes "1024x768" "800x600" "640x480"
.br
For example, Option "MetaModes" "1024x768-1024x768 800x600-1024x768 640x480-800x600 800x600"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qMergedXinerama\*q \*q" boolean \*q
Since merged framebuffer mode does not use Xinerama, apps are not able to intelligently
place windows. Merged framebuffer mode provides its own pseudo-Xinerama. This allows
Xinerama compliant applications to place windows appropriately. There are some caveats.
Since merged framebuffer mode is able to change relative screen sizes and orientations on
the fly, as well has having overlapping viewports, pseudo-Xinerama, might not always
provide the right hints. Also many Xinerama compliant applications only query Xinerama
once at startup; if the information changes, they may not be aware of the change. If
you are already using Xinerama (e.g., a single head card and a dualhead card providing
three heads), pseudo-Xinerama will be disabled.
.br
This option allows you turn off the driver provided pseudo-Xinerama extension.
.br
The default value is
.B TRUE.
.TP
.BI "Option \*qMergedXineramaCRT2IsScreen0\*q \*q" boolean \*q
By default the pseudo-Xinerama provided by the driver makes the left-most or bottom
head Xinerama screen 0. Certain Xinerama-aware applications do special things with
screen 0. To change that behavior, use this option.
.br
The default value is
.B undefined.
.TP
.BI "Option \*qMergedDPI\*q \*q" "string" \*q
The driver will attempt to figure out an appropriate DPI based on the DDC information
and the orientation of the heads when in merged framebuffer mode. If this value does
not suit you, you can manually set the DPI using this option.
.br
For example, Option "MergedDPI" "100 100"
.br
The default value is
.B undefined.
.TP
.BI "Option \*qMergedNonRectangular\*q \*q" boolean \*q
If you are using MergedFB with two modes of different sizes, turn this option on to
keep the smaller head from scrolling within the larger virtual desktop and to keep
the mouse from moving into that area. Applications that are not Xinerama aware can
potentially end up stranded in this area.
.br
The default value is
.B FALSE.
.TP
.BI "Option \*qColorTiling\*q \*q" "boolean" \*q
Frame buffer can be addressed either in linear or tiled mode. Tiled mode can provide
significant performance benefits with 3D applications, for 2D it shouldn't matter
much. Tiling will be disabled if the virtual x resolution exceeds 2048 (3968 for R300
and above), if option
.B UseFBDev
is used, or (if DRI is enabled) the drm module is too old.
.br
If this option is enabled, a new dri driver is required for direct rendering too.
.br
Color tiling will be automatically disabled in interlaced or doublescan screen modes.
.br
The default value is
.B on.
.TP
.BI "Option \*qIgnoreEDID\*q \*q" boolean \*q
Do not use EDID data for mode validation, but DDC is still used
for monitor detection. This is different from NoDDC option.
.br
The default value is
.B off.
.TP
.BI "Option \*qPanelSize\*q \*q" "string" \*q
Should only be used when driver cannot detect the correct panel size.
Apply to both desktop (TMDS) and laptop (LVDS) digital panels.
When a valid panel size is specified, the timings collected from
DDC and BIOS will not be used. If you have a panel with timings
different from that of a standard VESA mode, you have to provide
this information through the Modeline.
.br
For example, Option "PanelSize" "1400x1050"
.br
The default value is
.B none.
.TP
.BI "Option \*qPanelOff\*q \*q" boolean \*q
Disable panel output.
.br
The default value is
.B off.
.TP
.BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
Enable page flipping for 3D acceleration. This will increase performance
but not work correctly in some rare cases, hence the default is
.B off.
.TP
.BI "Option \*qForceMinDotClock\*q \*q" frequency \*q
Override minimum dot clock. Some Radeon BIOSes report a minimum dot
clock unsuitable (too high) for use with television sets even when they
actually can produce lower dot clocks. If this is the case you can
override the value here.
.B Note that using this option may damage your hardware.
You have been warned. The
.B frequency
parameter may be specified as a float value with standard suffixes like
"k", "kHz", "M", "MHz".
.TP
.BI "Option \*qRenderAccel\*q \*q" boolean \*q
Enables or disables hardware Render acceleration. This driver does not
support component alpha (subpixel) rendering. It is only supported on
Radeon series up to and including 9200 (9500/9700 and newer
unsupported). The default is to
.B enable
Render acceleration.
.TP
.BI "Option \*qAccelMethod\*q \*q" "string" \*q
Chooses between available acceleration architectures. Valid options are
.B XAA
and
.B EXA.
XAA is the traditional acceleration architecture and support for it is very
stable. EXA is a newer acceleration architecture with better performance for
the Render and Composite extensions, but the rendering code for it is newer and
possibly unstable. The default is
.B XAA.
.TP
.BI "Option \*qAccelDFS\*q \*q" boolean \*q
Use or don't use accelerated EXA DownloadFromScreen hook when possible (only
when Direct Rendering is enabled, e.g.).
Default:
.B off
with AGP due to issues with GPU->host transfers with some AGP bridges,
.B on
otherwise.
.TP
.BI "Option \*qFBTexPercent\*q \*q" integer \*q
Amount of video RAM to reserve for OpenGL textures, in percent. With EXA, the
remainder of video RAM is reserved for EXA offscreen management. Specifying 0
results in all offscreen video RAM being reserved for EXA and only GART memory
being available for OpenGL textures. This may improve EXA performance, but
beware that it may cause problems with OpenGL drivers from Mesa versions older
than 6.4. With XAA, specifiying lower percentage than what gets reserved without
this option has no effect, but the driver tries to increase the video RAM
reserved for textures to the amount specified roughly.
Default:
.B 50.
.TP
.BI "Option \*qDepthBits\*q \*q" integer \*q
Precision in bits per pixel of the shared depth buffer used for 3D acceleration.
Valid values are 16 and 24. When this is 24, there will also be a hardware
accelerated stencil buffer, but the combined depth/stencil buffer will take up
twice as much video RAM as when it's 16.
Default:
.B The same as the screen depth.
.TP
.BI "Option \*qDMAForXv\*q \*q" boolean \*q
Try or don't try to use DMA for Xv image transfers. This will reduce CPU
usage when playing big videos like DVDs, but may cause instabilities.
Default:
.B on.
.TP
.BI "Option \*qSubPixelOrder\*q \*q" "string" \*q
Force subpixel order to specified order.
Subpixel order is used for subpixel decimation on flat panels.
.br
NONE \-\- No subpixel (CRT like displays)
.br
RGB \-\- in horizontal RGB order (most flat panels)
.br
BGR \-\- in horizontal BGR order (some flat panels)
.br
This option is intended to be used in following cases:
.br
1. The default subpixel order is incorrect for your panel.
.br
2. Enable subpixel decimation on analog panels.
.br
3. Adjust to one display type in dual-head clone mode setup.
.br
4. Get better performance with Render acceleration on
digital panels (use NONE setting).
.br
The default is
.B NONE
for CRT,
.B RGB
for digital panels
.TP
.BI "Option \*qDynamicClocks\*q \*q" boolean \*q
Enable dynamic clock scaling. The on-chip clocks will scale dynamically
based on usage. This can help reduce heat and increase battery
life by reducing power usage. Some users report reduced 3D performance
with this enabled. The default is
.B off.
.TP
.BI "Option \*qBIOSHotkeys\*q \*q" boolean \*q
Enable BIOS hotkey output switching. This allows the BIOS to toggle outputs
using hotkeys (e.g., fn-f7, etc.). Since the driver does not support ACPI,
there is no way to validate modes on an output switch and the BIOS can
potentially change things behind the driver's back. The default is
.B off.
.TP
.BI "Option \*qVGAAccess\*q \*q" boolean \*q
Tell the driver if it can do legacy VGA IOs to the card. This is
necessary for properly resuming consoles when in VGA text mode, but
shouldn't be if the console is using radeonfb or some other graphic
mode driver. Some platforms like PowerPC have issues with those, and they aren't
necessary unless you have a real text mode in console. The default is
.B off
on PowerPC and
.B on
on other architectures.
.TP
.BI "Option \*qReverseDDC\*q \*q" boolean \*q
When BIOS connector informations aren't available, use this option to
reverse the mapping of the 2 main DDC ports. Use this if the X serve
obviously detects the wrong display for each connector. This is
typically needed on the Radeon 9600 cards bundled with Apple G5s. The
default is
.B off.
.TP
.BI "Option \*qLVDSProbePLL\*q \*q" boolean \*q
When BIOS panel informations aren't available (like on PowerBooks), it
may still be necessary to use the firmware provided PLL values for the
panel or flickering will happen. This option will force probing of
the current value programmed in the chip when X is launched in that
case. This is only useful for LVDS panels (laptop internal panels).
The default is
.B on.
.TP
.SH SEE ALSO
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.SH AUTHORS
.nf
Authors include:
Rickard E. (Rik) Faith \fIfaith@precisioninsight.com\fP
Kevin E. Martin \fIkem@freedesktop.org\fP
Alan Hourihane \fIalanh@fairlite.demon.co.uk\fP
Marc Aurele La France \fItsi@xfree86.org\fP
Benjamin Herrenschmidt \fIbenh@kernel.crashing.org\fP
Michel Dänzer \fImichel@tungstengraphics.com\fP
Alex Deucher \fIalexdeucher@gmail.com\fP
Bogdan D. \fIbogdand@users.sourceforge.net\fP
Eric Anholt \fIeric@anholt.net\fP

View File

@ -0,0 +1,357 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-02-08.22
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -0,0 +1,197 @@
# Copyright 2005 Adam Jackson.
# Copyright 2005 Red Hat, Inc.
#
# 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
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON 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 is obnoxious:
# -module lets us name the module exactly how we want
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
if DRI
ATIMISC_DRI_SRCS = atidri.c
R128_DRI_SRCS = r128_dri.c
RADEON_DRI_SRCS = radeon_dri.c
endif
if ATIMISC_CPIO
ATI_CPIO_SOURCES = ativgaio.c
ATIMISC_CPIO_SOURCES = ativga.c atibank.c atiwonder.c atiwonderio.c
endif
if ATIMISC_DGA
ATIMISC_DGA_SOURCES = atidga.c
endif
if USE_EXA
ATIMISC_EXA_SOURCES = atimach64exa.c
RADEON_EXA_SOURCES = radeon_exa.c
endif
AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@
ati_drv_la_LTLIBRARIES = ati_drv.la
ati_drv_la_LDFLAGS = -module -avoid-version
ati_drv_ladir = @moduledir@/drivers
ati_drv_la_SOURCES = \
ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \
atiprobe.c atividmem.c atimodule.c $(ATI_CPIO_SOURCES) \
radeon_probe.c r128_probe.c
atimisc_drv_la_LTLIBRARIES = atimisc_drv.la
atimisc_drv_la_LDFLAGS = -module -avoid-version
atimisc_drv_ladir = @moduledir@/drivers
atimisc_drv_la_SOURCES = \
atiaccel.c atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \
aticursor.c atidac.c atidecoder.c atidsp.c atifillin.c atii2c.c \
atilock.c atimach64.c atimach64accel.c atimach64cursor.c \
atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \
atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \
atixv.c atiload.c atimisc.c $(ATIMISC_DRI_SRCS) $(ATIMISC_DGA_SOURCES) \
$(ATIMISC_CPIO_SOURCES) $(ATIMISC_EXA_SOURCES)
r128_drv_la_LTLIBRARIES = r128_drv.la
r128_drv_la_LDFLAGS = -module -avoid-version
r128_drv_ladir = @moduledir@/drivers
r128_drv_la_SOURCES = \
r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \
r128_video.c r128_misc.c $(R128_DRI_SRCS)
radeon_drv_la_LTLIBRARIES = radeon_drv.la
radeon_drv_la_LDFLAGS = -module -avoid-version
radeon_drv_ladir = @moduledir@/drivers
radeon_drv_la_SOURCES = \
radeon_accel.c radeon_mergedfb.c radeon_cursor.c radeon_dga.c \
radeon_driver.c radeon_video.c radeon_bios.c radeon_mm_i2c.c \
radeon_vip.c radeon_misc.c $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES)
theatre_detect_drv_la_LTLIBRARIES = theatre_detect_drv.la
theatre_detect_drv_la_LDFLAGS = -module -avoid-version
theatre_detect_drv_ladir = @moduledir@/multimedia
theatre_detect_drv_la_SOURCES = \
theatre_detect.c theatre_detect_module.c
theatre_drv_la_LTLIBRARIES = theatre_drv.la
theatre_drv_la_LDFLAGS = -module -avoid-version
theatre_drv_ladir = @moduledir@/multimedia
theatre_drv_la_SOURCES = \
theatre.c theatre_module.c
theatre200_drv_la_LTLIBRARIES = theatre200_drv.la
theatre200_drv_la_LDFLAGS = -module -avoid-version
theatre200_drv_ladir = @moduledir@/multimedia
theatre200_drv_la_CFLAGS = \
$(AM_CFLAGS) -DMICROC_DIR=\"$(theatre200_drv_ladir)\"
theatre200_drv_la_SOURCES = \
theatre200.c theatre200_module.c
EXTRA_DIST = \
radeon_render.c \
radeon_accelfuncs.c \
\
atiaccel.h \
atiadapter.h \
atiadjust.h \
atiaudio.h \
atibank.h \
atibus.h \
atichip.h \
aticlock.h \
aticonfig.h \
aticonsole.h \
aticrtc.h \
aticursor.h \
atidac.h \
atidecoder.h \
atidga.h \
atidri.h \
atidripriv.h \
atidsp.h \
atifillin.h \
ati.h \
atii2c.h \
atiident.h \
atiio.h \
atiload.h \
atilock.h \
atimach64accel.h \
atimach64cursor.h \
atimach64.h \
atimach64i2c.h \
atimach64io.h \
atimach64render.c \
atimach64xv.h \
atimode.h \
atimodule.h \
atimono.h \
atioption.h \
atipreinit.h \
atiprint.h \
atipriv.h \
atiprobe.h \
atiregs.h \
atirgb514.h \
atiscreen.h \
atistruct.h \
atituner.h \
atiutil.h \
ativalid.h \
ativersion.h \
ativga.h \
ativgaio.h \
atividmem.h \
atiwonder.h \
atiwonderio.h \
atixv.h \
generic_bus.h \
mach64_common.h \
mach64_dri.h \
mach64_sarea.h \
r128_chipset.h \
r128_common.h \
r128_dri.h \
r128_dripriv.h \
r128.h \
r128_probe.h \
r128_reg.h \
r128_sarea.h \
r128_version.h \
radeon_chipset.h \
radeon_common.h \
radeon_commonfuncs.c \
radeon_dri.h \
radeon_dripriv.h \
radeon_exa_render.c \
radeon_exa_funcs.c \
radeon.h \
radeon_macros.h \
radeon_mergedfb.h \
radeon_probe.h \
radeon_reg.h \
radeon_sarea.h \
radeon_version.h \
radeon_video.h \
theatre200.h \
theatre_detect.h \
theatre.h \
theatre_reg.h \
atipciids.h

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.23 2003/04/25 14:37:35 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*/
/*************************************************************************/
/*
* Author: Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* This is the ATI driver for XFree86.
*
* John Donne once said "No man is an island", and I am most certainly not an
* exception. Contributions, intentional or not, to this and previous versions
* of this driver by the following are hereby acknowledged:
*
* Thomas Roell, Per Lindqvist, Doug Evans, Rik Faith, Arthur Tateishi,
* Alain Hebert, Ton van Rosmalen, David Chambers, William Shubert,
* ATI Technologies Incorporated, Robert Wolff, David Dawes, Mark Weaver,
* Hans Nasten, Kevin Martin, Frederic Rienthaler, Marc Bolduc, Reuben Sumner,
* Benjamin T. Yang, James Fast Kane, Randall Hopper, W. Marcus Miller,
* Henrik Harmsen, Christian Lupien, Precision Insight Incorporated,
* Mark Vojkovich, Huw D M Davies, Andrew C Aitchison, Ani Joshi,
* Kostas Gewrgiou, Jakub Jelinek, David S. Miller, A E Lawrence,
* Linus Torvalds, William Blew, Ignacio Garcia Etxebarria, Patrick Chase,
* Vladimir Dergachev, Egbert Eich, Mike A. Harris
*
* ... and, many, many others from around the world.
*
* In addition, this work would not have been possible without the active
* support, both moral and otherwise, of the staff and management of Computing
* and Network Services at the University of Alberta, in Edmonton, Alberta,
* Canada.
*
* The driver is intended to support all ATI adapters since their VGA Wonder
* V3, including OEM counterparts.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atiident.h"
#include "atioption.h"
#include "atiprobe.h"
#include "ativersion.h"
/* The root of all evil... */
_X_EXPORT DriverRec ATI =
{
ATI_VERSION_CURRENT,
"ati",
ATIIdentify,
ATIProbe,
ATIAvailableOptions,
NULL,
0
};

View File

@ -0,0 +1,37 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h,v 1.9 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATI_H___
#define ___ATI_H___ 1
#include <unistd.h>
#include "xf86Pci.h"
#include "atipciids.h"
#include "xf86.h"
#include "xf86_OSproc.h"
extern DriverRec ATI;
#endif /* ___ATI_H___ */

View File

@ -0,0 +1,121 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.13 2003/04/24 21:19:22 tsi Exp $ */
/*
* Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atiaccel.h"
#include "atiadapter.h"
#include "atimach64accel.h"
#include "atistruct.h"
#ifdef USE_XAA
/*
* ATIInitializeAcceleration --
*
* This function is called to initialise both the framebuffer manager and XAA
* on a screen.
*/
Bool
ATIInitializeAcceleration
(
ScreenPtr pScreen,
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
if (pATI->OptionAccel)
{
if (!(pATI->pXAAInfo = XAACreateInfoRec()))
return FALSE;
switch (pATI->Adapter)
{
case ATI_ADAPTER_MACH64:
ATIMach64AccelInit(pATI, pATI->pXAAInfo);
break;
default:
break;
}
}
if (!pATI->OptionAccel || XAAInit(pScreen, pATI->pXAAInfo))
return TRUE;
XAADestroyInfoRec(pATI->pXAAInfo);
pATI->pXAAInfo = NULL;
return FALSE;
}
FBLinearPtr
ATIResizeOffscreenLinear
(
ScreenPtr pScreen,
FBLinearPtr pLinear,
int Size
)
{
if (Size <= 0)
{
xf86FreeOffscreenLinear(pLinear);
return NULL;
}
if (pLinear)
{
if ((pLinear->size >= Size) ||
xf86ResizeOffscreenLinear(pLinear, Size))
{
pLinear->MoveLinearCallback = NULL;
pLinear->RemoveLinearCallback = NULL;
return pLinear;
}
xf86FreeOffscreenLinear(pLinear);
}
pLinear = xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL);
if (!pLinear)
{
int maxSize;
xf86QueryLargestOffscreenLinear(pScreen, &maxSize, 16,
PRIORITY_EXTREME);
if (maxSize < Size)
return NULL;
xf86PurgeUnlockedOffscreenAreas(pScreen);
pLinear =
xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL);
}
return pLinear;
}
#endif /* USE_XAA */

View File

@ -0,0 +1,36 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.5 2003/04/23 21:51:27 tsi Exp $ */
/*
* Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIACCEL_H___
#define ___ATIACCEL_H___ 1
#include "atipriv.h"
#include "xf86str.h"
#include "xf86fbman.h"
extern Bool ATIInitializeAcceleration(ScreenPtr, ScrnInfoPtr, ATIPtr);
extern FBLinearPtr ATIResizeOffscreenLinear(ScreenPtr, FBLinearPtr, int);
#endif /* ___ATIACCEL_H___ */

View File

@ -0,0 +1,58 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c,v 1.17 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atiadapter.h"
/*
* Adapter-related definitions.
*/
const char *ATIAdapterNames[] =
{
"Unknown",
#ifndef AVOID_CPIO
"ATI EGA Wonder800",
"ATI EGA Wonder800+",
"IBM VGA or compatible",
"ATI VGA Basic16",
"ATI VGA Wonder V3",
"ATI VGA Wonder V4",
"ATI VGA Wonder V5",
"ATI VGA Wonder+",
"ATI VGA Wonder XL or XL24",
"ATI VGA Wonder VLB or PCI",
"IBM 8514/A or compatible",
"ATI Mach8",
"ATI Mach32",
#endif /* AVOID_CPIO */
"ATI Mach64",
"ATI Rage128",
"ATI Radeon"
};

View File

@ -0,0 +1,60 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h,v 1.10 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIADAPTER_H___
#define ___ATIADAPTER_H___ 1
/*
* Adapter-related definitions.
*/
typedef enum
{
ATI_ADAPTER_NONE = 0,
#ifndef AVOID_CPIO
ATI_ADAPTER_EGA,
ATI_ADAPTER_EGA_PLUS,
ATI_ADAPTER_VGA,
ATI_ADAPTER_BASIC,
ATI_ADAPTER_V3,
ATI_ADAPTER_V4,
ATI_ADAPTER_V5,
ATI_ADAPTER_PLUS,
ATI_ADAPTER_XL,
ATI_ADAPTER_NONISA,
ATI_ADAPTER_8514A,
ATI_ADAPTER_MACH8,
ATI_ADAPTER_MACH32,
#endif /* AVOID_CPIO */
ATI_ADAPTER_MACH64,
ATI_ADAPTER_RAGE128,
ATI_ADAPTER_RADEON,
ATI_ADAPTER_MAX /* Must be last */
} ATIAdapterType;
extern const char *ATIAdapterNames[];
#endif /* ___ATIADAPTER_H___ */

View File

@ -0,0 +1,234 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.15 2003/04/23 21:51:27 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atiadjust.h"
#include "atichip.h"
#include "aticrtc.h"
#include "atilock.h"
#include "atimach64io.h"
#include "atiwonderio.h"
/*
* The display start address is expressed in units of 32-bit (VGA) or 64-bit
* (accelerator) words where all planar modes are considered as 4bpp modes.
* These functions ensure the start address does not exceed architectural
* limits. Also, to avoid colour changes while panning, these 32-bit or 64-bit
* boundaries may not fall within a pixel.
*/
/*
* ATIAjustPreInit --
*
* This function calculates values needed to speed up the setting of the
* display start address.
*/
void
ATIAdjustPreInit
(
ATIPtr pATI
)
{
unsigned long MaxBase;
#ifndef AVOID_CPIO
if ((pATI->CPIO_VGAWonder) &&
(pATI->Chip <= ATI_CHIP_18800_1) &&
(pATI->VideoRAM == 256) &&
(pATI->depth >= 8))
{
/* Strange, to say the least ... */
pATI->AdjustDepth = (pATI->bitsPerPixel + 3) >> 2;
pATI->AdjustMask = (unsigned long)(-32);
}
else
#endif /* AVOID_CPIO */
{
pATI->AdjustDepth = (pATI->bitsPerPixel + 7) >> 3;
pATI->AdjustMask = 64;
while (pATI->AdjustMask % (unsigned long)(pATI->AdjustDepth))
pATI->AdjustMask += 64;
pATI->AdjustMask =
~(((pATI->AdjustMask / (unsigned long)(pATI->AdjustDepth)) >> 3) -
1);
}
switch (pATI->NewHW.crtc)
{
#ifndef AVOID_CPIO
case ATI_CRTC_VGA:
if (pATI->Chip >= ATI_CHIP_264CT)
{
pATI->AdjustMaxBase = MaxBits(CRTC_OFFSET_VGA) << 2;
if (pATI->depth <= 4)
pATI->AdjustMaxBase <<= 1;
}
else if (!pATI->CPIO_VGAWonder)
{
pATI->AdjustMaxBase = 0xFFFFU << 3;
}
else if (pATI->Chip <= ATI_CHIP_28800_6)
{
pATI->AdjustMaxBase = 0x03FFFFU << 3;
}
else /* Mach32 & Mach64 */
{
pATI->AdjustMaxBase = 0x0FFFFFU << 3;
}
break;
#endif /* AVOID_CPIO */
case ATI_CRTC_MACH64:
pATI->AdjustMaxBase = MaxBits(CRTC_OFFSET) << 3;
break;
default:
pATI->AdjustMaxBase = 0;
break;
}
MaxBase = (pATI->AdjustMaxBase / (unsigned long)pATI->AdjustDepth) |
~pATI->AdjustMask;
pATI->AdjustMaxX = MaxBase % pATI->displayWidth;
pATI->AdjustMaxY = MaxBase / pATI->displayWidth;
}
/*
* ATIAdjustFrame --
*
* This function is used to initialise the SVGA Start Address - the first
* displayed location in video memory. This is used to implement the virtual
* window.
*/
_X_EXPORT void
ATIAdjustFrame
(
int scrnIndex,
int x,
int y,
int flags
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex];
ATIPtr pATI = ATIPTR(pScreenInfo);
int Base, xy;
/*
* Assume the caller has already done its homework in ensuring the physical
* screen is still contained in the virtual resolution.
*/
if (y >= pATI->AdjustMaxY)
{
y = pATI->AdjustMaxY;
if (x > pATI->AdjustMaxX)
y--;
}
Base = ((((y * pATI->displayWidth) + x) & pATI->AdjustMask) *
pATI->AdjustDepth) >> 3;
if (!pATI->currentMode)
{
/*
* Not in DGA. This reverse-calculates pScreenInfo->frame[XY][01] so
* that the cursor does not move on mode switches.
*/
xy = (Base << 3) / pATI->AdjustDepth;
pScreenInfo->frameX0 = xy % pATI->displayWidth;
pScreenInfo->frameY0 = xy / pATI->displayWidth;
pScreenInfo->frameX1 =
pScreenInfo->frameX0 + pScreenInfo->currentMode->HDisplay - 1;
pScreenInfo->frameY1 =
pScreenInfo->frameY0 + pScreenInfo->currentMode->VDisplay - 1;
}
/* Unlock registers */
ATIUnlock(pATI);
#ifndef AVOID_CPIO
if ((pATI->NewHW.crtc == ATI_CRTC_VGA) && (pATI->Chip < ATI_CHIP_264CT))
{
PutReg(CRTX(pATI->CPIO_VGABase), 0x0CU, GetByte(Base, 1));
PutReg(CRTX(pATI->CPIO_VGABase), 0x0DU, GetByte(Base, 0));
if (pATI->CPIO_VGAWonder)
{
if (pATI->Chip <= ATI_CHIP_18800_1)
ATIModifyExtReg(pATI, 0xB0U, -1, 0x3FU, Base >> 10);
else
{
ATIModifyExtReg(pATI, 0xB0U, -1, 0xBFU, Base >> 10);
ATIModifyExtReg(pATI, 0xA3U, -1, 0xEFU, Base >> 13);
/*
* I don't know if this also applies to Mach64's, but give it a
* shot...
*/
if (pATI->Chip >= ATI_CHIP_68800)
ATIModifyExtReg(pATI, 0xADU, -1, 0xF3U, Base >> 16);
}
}
}
else
/*
* On integrated controllers, there is only one set of CRTC control bits,
* many of which are simultaneously accessible through both VGA and
* accelerator I/O ports. Given VGA's architectural limitations, setting
* the CRTC's offset register to more than 256k needs to be done through
* the accelerator port.
*/
if (pATI->depth <= 4)
{
outr(CRTC_OFF_PITCH, SetBits(pATI->displayWidth >> 4, CRTC_PITCH) |
SetBits(Base, CRTC_OFFSET));
}
else
#endif /* AVOID_CPIO */
{
#ifndef AVOID_CPIO
if (pATI->NewHW.crtc == ATI_CRTC_VGA)
Base <<= 1; /* LSBit must be zero */
#endif /* AVOID_CPIO */
outr(CRTC_OFF_PITCH, SetBits(pATI->displayWidth >> 3, CRTC_PITCH) |
SetBits(Base, CRTC_OFFSET));
}
}

View File

@ -0,0 +1,32 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h,v 1.8 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIADJUST_H___
#define ___ATIADJUST_H___ 1
#include "atipriv.h"
extern void ATIAdjustPreInit(ATIPtr);
extern void ATIAdjustFrame(int, int, int, int);
#endif /* ___ATIADJUST_H___ */

View File

@ -0,0 +1,51 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c,v 1.1 2003/07/24 22:08:27 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atiaudio.h"
/*
* Audio chip definitions.
*/
const char *ATIAudioNames[] =
{
"Philips TEA5582",
"Mono with audio mux",
"Philips TDA9850",
"Sony CXA2020S",
"ITT MSP3410D",
"Crystal CS4236B",
"Philips TDA9851",
"ITT MSP3415",
"ITT MSP3430",
"Unknown type (9)",
"Unknown type (10)",
"Unknown type (11)",
"Unknown type (12)",
"Unknown type (13)",
"Unknown type (14)",
"No audio"
};

View File

@ -0,0 +1,52 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h,v 1.1 2003/07/24 22:08:27 tsi Exp $ */
/*
* Copyright 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIAUDIO_H___
#define ___ATIAUDIO_H___ 1
/*
* Audio chip definitions.
*/
typedef enum
{
ATI_AUDIO_TEA5582,
ATI_AUDIO_MONO,
ATI_AUDIO_TDA9850,
ATI_AUDIO_CXA2020S,
ATI_AUDIO_MSP3410D,
ATI_AUDIO_CS4236B,
ATI_AUDIO_TDA9851,
ATI_AUDIO_MSP3415,
ATI_AUDIO_MSP3430,
ATI_AUDIO_9,
ATI_AUDIO_10,
ATI_AUDIO_11,
ATI_AUDIO_12,
ATI_AUDIO_13,
ATI_AUDIO_14,
ATI_AUDIO_NONE
} ATIAudioType;
extern const char *ATIAudioNames[];
#endif /* ___ATIAUDIO_H___ */

View File

@ -0,0 +1,413 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c,v 1.12 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atibank.h"
#include "atimach64io.h"
#include "atiwonderio.h"
#ifndef AVOID_CPIO
/*
* ATI VGA Wonder V3 adapters use an ATI 18800 chip and are single-banked.
* Bank selection is done with bits 0x1E of ATI extended VGA register index
* 0xB2.
*/
/*
* ATIV3SetBank --
*
* Set an ATI 18800's bank number.
*/
void
ATIV3SetBank
(
ATIPtr pATI,
unsigned int iBank
)
{
ATIModifyExtReg(pATI, 0xB2U, -1, (CARD8)(~0x1EU), SetBits(iBank, 0x1EU));
}
/*
* ATIV3SetReadWrite --
*
* Set an ATI 18800's bank number.
*/
int
ATIV3SetReadWrite
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
ATIModifyExtReg(pATI, 0xB2U, -1, (CARD8)(~0x1EU), SetBits(iBank, 0x1EU));
return 0;
}
/*
* ATI VGA Wonder V4 and V5 adapters use an ATI 18800-1 chip. Bank selection
* is done with ATI extended VGA register index 0xB2. The format is:
*
* 0xE0 - Read bank select bits 0x07
* 0x1E - Write bank select bits 0x0F
* 0x01 - Read bank select bit 0x08.
*/
/*
* ATIV4V5SetBank --
*
* Set an ATI 18800-1's read and write bank numbers.
*/
void
ATIV4V5SetBank
(
ATIPtr pATI,
unsigned int iBank
)
{
pATI->B2Reg = SetBits(iBank, 0x1EU) | SetBits(iBank, 0xE0U) |
SetBits(GetBits(iBank, 0x08U), 0x01U);
ATIPutExtReg(0xB2U, pATI->B2Reg);
}
/*
* ATIV4V5SetRead --
*
* Set an ATI 18800-1's read bank number.
*/
int
ATIV4V5SetRead
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
CARD8 B2Reg = (pATI->B2Reg & 0x1EU) | SetBits(iBank, 0xE0U) |
SetBits(GetBits(iBank, 0x08U), 0x01U);
if (B2Reg != pATI->B2Reg)
{
ATIPutExtReg(0xB2U, B2Reg);
pATI->B2Reg = B2Reg;
}
return 0;
}
/*
* ATIV4V5SetWrite --
*
* Set an ATI 18800-1's write bank number.
*/
int
ATIV4V5SetWrite
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
CARD8 B2Reg = (pATI->B2Reg & 0xE1U) | SetBits(iBank, 0x1EU);
if (B2Reg != pATI->B2Reg)
{
ATIPutExtReg(0xB2U, B2Reg);
pATI->B2Reg = B2Reg;
}
return 0;
}
/*
* ATIV4V5SetReadWrite --
*
* Set an ATI 18800-1's read and write bank numbers.
*/
int
ATIV4V5SetReadWrite
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIV4V5SetBank(ATIPTR(XF86SCRNINFO(pScreen)), iBank);
return 0;
}
/*
* In addition to ATI extended register index 0xB2, 28800's, 68800's and
* 88800's define banking bits in bits 0x0F of ATI extended VGA register index
* 0xAE. These are only needed for adapters with more than 1MB of video
* memory, and it is questionable whether or not they are actually implemented
* by 28800's and 88800's. ATI extended VGA register index 0xAE is defined as
* follows:
*
* 0xF0 - reserved
* 0x0C - read bank select bits 0x30
* 0x03 - write bank select bits 0x30
*/
/*
* ATIx8800SetBank --
*
* Set an ATI 28800's, 68800's or 88800's read and write bank numbers.
*/
void
ATIx8800SetBank
(
ATIPtr pATI,
unsigned int iBank
)
{
ATIV4V5SetBank(pATI, iBank);
iBank = GetBits(iBank, 0x30U);
ATIModifyExtReg(pATI, 0xAEU, -1, (CARD8)(~0x0FU),
SetBits(iBank, 0x03U) | SetBits(iBank, 0x0CU));
}
/*
* ATIx8800SetRead --
*
* Set an ATI 28800's, 68800's or 88800's read bank numbers.
*/
int
ATIx8800SetRead
(
ScreenPtr pScreen,
unsigned int iBank
)
{
(void)ATIV4V5SetRead(pScreen, iBank);
ATIModifyExtReg(ATIPTR(XF86SCRNINFO(pScreen)), 0xAEU, -1, (CARD8)(~0x0CU),
SetBits(GetBits(iBank, 0x30U), 0x0CU));
return 0;
}
/*
* ATIx8800SetWrite --
*
* Set an ATI 28800's, 68800's or 88800's write bank numbers.
*/
int
ATIx8800SetWrite
(
ScreenPtr pScreen,
unsigned int iBank
)
{
(void)ATIV4V5SetWrite(pScreen, iBank);
ATIModifyExtReg(ATIPTR(XF86SCRNINFO(pScreen)), 0xAEU, -1, (CARD8)(~0x03U),
SetBits(GetBits(iBank, 0x30U), 0x03U));
return 0;
}
/*
* ATIx8800SetReadWrite --
*
* Set an ATI 28800's, 68800's or 88800's read and write bank numbers.
*/
int
ATIx8800SetReadWrite
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIx8800SetBank(ATIPTR(XF86SCRNINFO(pScreen)), iBank);
return 0;
}
/*
* Functions to simulate a banked VGA aperture using a Mach64's small dual
* paged apertures. There are two sets of these: one for packed modes, the
* other for planar modes.
*/
static CARD32
ATIMach64MassagePackedBankNumber
(
CARD8 iBank
)
{
iBank <<= 1;
return ((iBank + 1) << 16) | iBank;
}
/*
* ATIMach64SetBankPacked --
*
* Set read and write bank numbers for small dual paged apertures.
*/
void
ATIMach64SetBankPacked
(
ATIPtr pATI,
unsigned int iBank
)
{
CARD32 tmp = ATIMach64MassagePackedBankNumber(iBank);
outr(MEM_VGA_RP_SEL, tmp);
outr(MEM_VGA_WP_SEL, tmp);
}
/*
* ATIMach64SetReadPacked --
*
* Set read bank number for small dual paged apertures.
*/
int
ATIMach64SetReadPacked
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
outr(MEM_VGA_RP_SEL, ATIMach64MassagePackedBankNumber(iBank));
return 0;
}
/*
* ATIMach64SetWritePacked --
*
* Set write bank number for small dual paged apertures.
*/
int
ATIMach64SetWritePacked
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
outr(MEM_VGA_WP_SEL, ATIMach64MassagePackedBankNumber(iBank));
return 0;
}
/*
* ATIMach64SetReadWritePacked --
*
* Set read and write bank numbers for small dual paged apertures.
*/
int
ATIMach64SetReadWritePacked
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIMach64SetBankPacked(ATIPTR(XF86SCRNINFO(pScreen)), iBank);
return 0;
}
static CARD32
ATIMach64MassagePlanarBankNumber
(
CARD8 iBank
)
{
iBank <<= 3;
return ((iBank + 4) << 16) | iBank;
}
/*
* ATIMach64SetBankPlanar --
*
* Set read and write bank numbers for small dual paged apertures.
*/
void
ATIMach64SetBankPlanar
(
ATIPtr pATI,
unsigned int iBank
)
{
CARD32 tmp = ATIMach64MassagePlanarBankNumber(iBank);
outr(MEM_VGA_RP_SEL, tmp);
outr(MEM_VGA_WP_SEL, tmp);
}
/*
* ATIMach64SetReadPlanar --
*
* Set read bank number for small dual paged apertures.
*/
int
ATIMach64SetReadPlanar
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
outr(MEM_VGA_RP_SEL, ATIMach64MassagePlanarBankNumber(iBank));
return 0;
}
/*
* ATIMach64SetWritePlanar --
*
* Set write bank number for small dual paged apertures.
*/
int
ATIMach64SetWritePlanar
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIPtr pATI = ATIPTR(XF86SCRNINFO(pScreen));
outr(MEM_VGA_WP_SEL, ATIMach64MassagePlanarBankNumber(iBank));
return 0;
}
/*
* ATIMach64SetReadWritePlanar --
*
* Set read and write bank numbers for small dual paged apertures.
*/
int
ATIMach64SetReadWritePlanar
(
ScreenPtr pScreen,
unsigned int iBank
)
{
ATIMach64SetBankPlanar(ATIPTR(XF86SCRNINFO(pScreen)), iBank);
return 0;
}
#endif /* AVOID_CPIO */

View File

@ -0,0 +1,87 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h,v 1.8 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIBANK_H___
#define ___ATIBANK_H___ 1
#include "atipriv.h"
#include "mibank.h"
#ifndef AVOID_CPIO
/*
* Banking definitions.
*/
/*
* Bank selection function for VGA Wonder V3 adapters (which are
* single-banked).
*/
#define ATIV3SetRead ATIV3SetReadWrite
#define ATIV3SetWrite ATIV3SetReadWrite
extern miBankProc ATIV3SetReadWrite;
/*
* Bank selection functions for VGA Wonder V4 and V5 adapters.
*/
extern miBankProc ATIV4V5SetRead,
ATIV4V5SetWrite,
ATIV4V5SetReadWrite;
/*
* Bank selection functions for 28800-x, 68800-x and 88800 based adapters.
*/
extern miBankProc ATIx8800SetRead,
ATIx8800SetWrite,
ATIx8800SetReadWrite;
/*
* Bank selection functions used to simulate a banked VGA aperture with a
* Mach64's small dual paged apertures. There are two sets of these: one for
* packed modes, and one for planar modes.
*/
extern miBankProc ATIMach64SetReadPacked,
ATIMach64SetWritePacked,
ATIMach64SetReadWritePacked;
extern miBankProc ATIMach64SetReadPlanar,
ATIMach64SetWritePlanar,
ATIMach64SetReadWritePlanar;
/*
* The CRT save/restore code also needs a separate banking interface that can
* used before ATIScreenInit() is called.
*/
typedef void ATIBankProc(ATIPtr, unsigned int);
typedef ATIBankProc *ATIBankProcPtr;
extern ATIBankProc ATIV3SetBank,
ATIV4V5SetBank,
ATIx8800SetBank,
ATIMach64SetBankPacked,
ATIMach64SetBankPlanar;
#endif /* AVOID_CPIO */
#endif /* ___ATIBANK_H___ */

View File

@ -0,0 +1,189 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c,v 1.18 2003/01/22 21:44:10 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "ati.h"
#include "atiadapter.h"
#include "atibus.h"
#include "atichip.h"
#include "atiio.h"
#include "atistruct.h"
#include "ativersion.h"
/*
* Definitions related to an adapter's system bus interface.
*/
const char *ATIBusNames[] =
{
"16-Bit ISA",
"EISA",
"16-Bit MicroChannel",
"32-Bit MicroChannel",
"386SX Local Bus",
"386DX Local Bus",
"VESA Local Bus",
"PCI",
"AGP"
};
/*
* ATIClaimResources --
*
* This function registers most of the bus resources used by an adapter. The
* exceptions are PCI-configured resources and non-PCI non-AGP linear
* apertures, both of which are registered by ATIPreInit(). This function also
* attempts to register unshareable resources for inactive PCI adapters,
* whether or not they are relocatable.
*/
static void
ATIClaimResources
(
ATIPtr pATI,
Bool Active
)
{
resPtr pResources;
#ifndef AVOID_CPIO
resRange Resources[2] = {{0, 0, 0}, _END};
/* Claim VGA and VGAWonder resources */
if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) && (Active || !pATI->SharedVGA))
{
/*
* 18800-x's are the only ATI controllers that decode all ISA aliases
* of VGA and VGA Wonder I/O ports. Other x8800's do not decode >any<
* VGA aliases, but do decode VGA Wonder aliases whose most significant
* nibble is zero.
*/
xf86ClaimFixedResources(
(pATI->Chip <= ATI_CHIP_18800_1) ?
(pATI->SharedVGA ? resVgaSparseShared : resVgaSparseExclusive) :
(pATI->SharedVGA ? resVgaShared : resVgaExclusive),
pATI->iEntity);
if (pATI->CPIO_VGAWonder)
{
if (pATI->SharedVGA)
Resources[0].type = ResShrIoSparse | ResBus;
else
Resources[0].type = ResExcIoSparse | ResBus;
Resources[0].rBase = pATI->CPIO_VGAWonder;
if (pATI->Chip <= ATI_CHIP_18800_1)
Resources[0].rMask = 0x03FEU;
else
Resources[0].rMask = 0xF3FEU;
xf86ClaimFixedResources(Resources, pATI->iEntity);
(void)memcpy(pATI->VGAWonderResources,
Resources, SizeOf(Resources));
}
}
if (!Active && pATI->SharedAccelerator)
return;
/* Claim 8514/A resources */
if (pATI->ChipHasSUBSYS_CNTL)
xf86ClaimFixedResources(
pATI->SharedAccelerator ? res8514Shared : res8514Exclusive,
pATI->iEntity);
/* Claim Mach64 sparse I/O resources */
if ((pATI->Adapter == ATI_ADAPTER_MACH64) &&
(pATI->CPIODecoding == SPARSE_IO))
{
if (pATI->SharedAccelerator)
Resources[0].type = ResShrIoSparse | ResBus;
else
Resources[0].type = ResExcIoSparse | ResBus;
Resources[0].rBase = pATI->CPIOBase;
Resources[0].rMask = 0x03FCU;
xf86ClaimFixedResources(Resources, pATI->iEntity);
}
if (Active)
return;
#else /* AVOID_CPIO */
if (pATI->SharedAccelerator)
return;
#endif /* AVOID_CPIO */
/* Register unshared relocatable resources for inactive adapters */
do
{
pResources = xf86RegisterResources(pATI->iEntity, NULL, ResExclusive);
if (!pResources)
return;
pResources = xf86ReallocatePciResources(pATI->iEntity, pResources);
} while (!pResources);
xf86Msg(X_WARNING,
ATI_NAME ": Unable to register the following resources for inactive"
" adapter:\n");
xf86PrintResList(1, pResources);
xf86FreeResList(pResources);
}
/*
* ATIClaimBusSlot --
*
* Claim an adapter and register its resources.
*/
int
ATIClaimBusSlot
(
DriverPtr pDriver,
int Chipset,
GDevPtr pGDev,
Bool Active,
ATIPtr pATI
)
{
pciVideoPtr pVideo = pATI->PCIInfo;
if (pVideo)
pATI->iEntity =
xf86ClaimPciSlot(pVideo->bus, pVideo->device, pVideo->func,
pDriver, Chipset, pGDev, Active);
else
pATI->iEntity = xf86ClaimIsaSlot(pDriver, Chipset, pGDev, Active);
if (pATI->iEntity >= 0)
ATIClaimResources(pATI, Active);
return pATI->iEntity;
}

View File

@ -0,0 +1,57 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h,v 1.11 2003/01/01 19:16:30 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIBUS_H___
#if !defined(___ATI_H___) && defined(XFree86Module)
# error missing #include "ati.h" before #include "atibus.h"
# undef XFree86Module
#endif
#define ___ATIBUS_H___ 1
#include "atipriv.h"
#include "xf86str.h"
/*
* Definitions related to an adapter's system bus interface.
*/
typedef enum
{
ATI_BUS_ISA = 0,
ATI_BUS_EISA,
ATI_BUS_MCA16,
ATI_BUS_MCA32,
ATI_BUS_SXLB,
ATI_BUS_DXLB,
ATI_BUS_VLB,
ATI_BUS_PCI,
ATI_BUS_AGP
} ATIBusType;
extern const char *ATIBusNames[];
extern int ATIClaimBusSlot(DriverPtr, int, GDevPtr, Bool, ATIPtr);
#endif /* ___ATIBUS_H___ */

View File

@ -0,0 +1,856 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.38tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atibus.h"
#include "atichip.h"
#include "atimach64io.h"
#include "ativersion.h"
/*
* Chip-related definitions.
*/
const char *ATIChipNames[] =
{
"Unknown",
#ifndef AVOID_CPIO
"IBM VGA or compatible",
"ATI 18800",
"ATI 18800-1",
"ATI 28800-2",
"ATI 28800-4",
"ATI 28800-5",
"ATI 28800-6",
"IBM 8514/A",
"Chips & Technologies 82C480",
"ATI 38800-1",
"ATI 68800",
"ATI 68800-3",
"ATI 68800-6",
"ATI 68800LX",
"ATI 68800AX",
#endif /* AVOID_CPIO */
"ATI 88800GX-C",
"ATI 88800GX-D",
"ATI 88800GX-E",
"ATI 88800GX-F",
"ATI 88800GX",
"ATI 88800CX",
"ATI 264CT",
"ATI 264ET",
"ATI 264VT",
"ATI 3D Rage",
"ATI 264VT-B",
"ATI 3D Rage II",
"ATI 264VT3",
"ATI 3D Rage II+DVD",
"ATI 3D Rage LT",
"ATI 264VT4",
"ATI 3D Rage IIc",
"ATI 3D Rage Pro",
"ATI 3D Rage LT Pro",
"ATI 3D Rage XL or XC",
"ATI 3D Rage Mobility",
"ATI unknown Mach64",
"ATI Rage 128 GL",
"ATI Rage 128 VR",
"ATI Rage 128 Pro GL",
"ATI Rage 128 Pro VR",
"ATI Rage 128 Pro ULTRA",
"ATI Rage 128 Mobility M3",
"ATI Rage 128 Mobility M4",
"ATI unknown Rage 128"
"ATI Radeon 7200",
"ATI Radeon 7000 (VE)",
"ATI Radeon Mobility M6",
"ATI Radeon IGP320",
"ATI Radeon IGP330/340/350",
"ATI Radeon 7000 IGP",
"ATI Radeon 7500",
"ATI Radeon Mobility M7",
"ATI Radeon 8500/9100",
"ATI Radeon 9000",
"ATI Radeon Mobility M9",
"ATI Radeon 9100 IGP",
"ATI Radeon 9200 IGP",
"ATI Radeon 9200",
"ATI Radeon Mobility M9+",
"ATI Radeon 9700/9500",
"ATI Radeon 9600/9550",
"ATI Radeon 9800",
"ATI Radeon 9800XT",
"ATI Radeon X300/X550/M22",
"ATI Radeon X600/X550/M24",
"ATI Radeon X800/M18 AGP",
"ATI Radeon X800/M28 PCIE",
"ATI Radeon X800XL PCIE",
"ATI Radeon X850 PCIE",
"ATI Radeon X850 AGP",
"ATI Radeon X700",
"ATI Xpress 200"
"ATI unknown Radeon",
"ATI Rage HDTV"
};
const char *ATIFoundryNames[] =
{ "SGS", "NEC", "KCS", "UMC", "TSMC", "5", "6", "UMC" };
#ifndef AVOID_CPIO
/*
* ATIMach32ChipID --
*
* Set variables whose value is dependent upon an 68800's CHIP_ID register.
*/
void
ATIMach32ChipID
(
ATIPtr pATI
)
{
CARD16 IOValue = inw(CHIP_ID);
pATI->ChipType = GetBits(IOValue, CHIP_CODE_0 | CHIP_CODE_1);
pATI->ChipClass = GetBits(IOValue, CHIP_CLASS);
pATI->ChipRevision = GetBits(IOValue, CHIP_REV);
pATI->ChipRev = pATI->ChipRevision;
if (IOValue == 0xFFFFU)
IOValue = 0;
switch (GetBits(IOValue, CHIP_CODE_0 | CHIP_CODE_1))
{
case OldChipID('A', 'A'):
pATI->Chip = ATI_CHIP_68800_3;
break;
case OldChipID('X', 'X'):
pATI->Chip = ATI_CHIP_68800_6;
break;
case OldChipID('L', 'X'):
pATI->Chip = ATI_CHIP_68800LX;
break;
case OldChipID('A', 'X'):
pATI->Chip = ATI_CHIP_68800AX;
break;
default:
pATI->Chip = ATI_CHIP_68800;
break;
}
}
#endif /* AVOID_CPIO */
/*
* ATIMach64ChipID --
*
* Set variables whose value is dependent upon a Mach64's CONFIG_CHIP_ID
* register.
*/
void
ATIMach64ChipID
(
ATIPtr pATI,
const CARD16 ExpectedChipType
)
{
pATI->config_chip_id = inr(CONFIG_CHIP_ID);
pATI->ChipType = GetBits(pATI->config_chip_id, 0xFFFFU);
pATI->ChipClass = GetBits(pATI->config_chip_id, CFG_CHIP_CLASS);
pATI->ChipRevision = GetBits(pATI->config_chip_id, CFG_CHIP_REV);
pATI->ChipVersion = GetBits(pATI->config_chip_id, CFG_CHIP_VERSION);
pATI->ChipFoundry = GetBits(pATI->config_chip_id, CFG_CHIP_FOUNDRY);
pATI->ChipRev = pATI->ChipRevision;
switch (pATI->ChipType)
{
case OldChipID('G', 'X'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'X'):
switch (pATI->ChipRevision)
{
case 0x00U:
pATI->Chip = ATI_CHIP_88800GXC;
break;
case 0x01U:
pATI->Chip = ATI_CHIP_88800GXD;
break;
case 0x02U:
pATI->Chip = ATI_CHIP_88800GXE;
break;
case 0x03U:
pATI->Chip = ATI_CHIP_88800GXF;
break;
default:
pATI->Chip = ATI_CHIP_88800GX;
break;
}
break;
case OldChipID('C', 'X'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('C', 'X'):
pATI->Chip = ATI_CHIP_88800CX;
break;
case OldChipID('C', 'T'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('C', 'T'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264CT;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('E', 'T'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('E', 'T'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264ET;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('V', 'T'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('V', 'T'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264VT;
pATI->BusType = ATI_BUS_PCI;
/* Some early GT's are detected as VT's */
if (ExpectedChipType && (pATI->ChipType != ExpectedChipType))
{
if (ExpectedChipType == NewChipID('G', 'T'))
pATI->Chip = ATI_CHIP_264GT;
else
xf86Msg(X_WARNING,
ATI_NAME ": Mach64 chip type probe discrepancy"
" detected: PCI=0x%04X; CHIP_ID=0x%04X.\n",
ExpectedChipType, pATI->ChipType);
}
else if (pATI->ChipVersion)
pATI->Chip = ATI_CHIP_264VTB;
break;
case OldChipID('G', 'T'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'T'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->BusType = ATI_BUS_PCI;
if (!pATI->ChipVersion)
pATI->Chip = ATI_CHIP_264GT;
else
pATI->Chip = ATI_CHIP_264GTB;
break;
case OldChipID('V', 'U'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('V', 'U'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264VT3;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('G', 'U'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'U'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264GTDVD;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('L', 'G'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('L', 'G'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264LT;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('V', 'V'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('V', 'V'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264VT4;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('G', 'V'):
case OldChipID('G', 'Y'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'V'):
case NewChipID('G', 'Y'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264GT2C;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('G', 'W'):
case OldChipID('G', 'Z'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'W'):
case NewChipID('G', 'Z'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264GT2C;
pATI->BusType = ATI_BUS_AGP;
break;
case OldChipID('G', 'I'):
case OldChipID('G', 'P'):
case OldChipID('G', 'Q'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'I'):
case NewChipID('G', 'P'):
case NewChipID('G', 'Q'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264GTPRO;
pATI->BusType = ATI_BUS_PCI;
break;
case OldChipID('G', 'B'):
case OldChipID('G', 'D'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'B'):
case NewChipID('G', 'D'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264GTPRO;
pATI->BusType = ATI_BUS_AGP;
break;
case OldChipID('L', 'I'):
case OldChipID('L', 'P'):
case OldChipID('L', 'Q'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('L', 'I'):
case NewChipID('L', 'P'):
case NewChipID('L', 'Q'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264LTPRO;
pATI->BusType = ATI_BUS_PCI;
pATI->LCDVBlendFIFOSize = 800;
break;
case OldChipID('L', 'B'):
case OldChipID('L', 'D'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('L', 'B'):
case NewChipID('L', 'D'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264LTPRO;
pATI->BusType = ATI_BUS_AGP;
pATI->LCDVBlendFIFOSize = 800;
break;
case OldChipID('G', 'L'):
case OldChipID('G', 'O'):
case OldChipID('G', 'R'):
case OldChipID('G', 'S'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'L'):
case NewChipID('G', 'O'):
case NewChipID('G', 'R'):
case NewChipID('G', 'S'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264XL;
pATI->BusType = ATI_BUS_PCI;
pATI->LCDVBlendFIFOSize = 1024;
break;
case OldChipID('G', 'M'):
case OldChipID('G', 'N'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('G', 'M'):
case NewChipID('G', 'N'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_264XL;
pATI->BusType = ATI_BUS_AGP;
pATI->LCDVBlendFIFOSize = 1024;
break;
case OldChipID('L', 'R'):
case OldChipID('L', 'S'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('L', 'R'):
case NewChipID('L', 'S'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_MOBILITY;
pATI->BusType = ATI_BUS_PCI;
pATI->LCDVBlendFIFOSize = 1024;
break;
case OldChipID('L', 'M'):
case OldChipID('L', 'N'):
pATI->ChipType = OldToNewChipID(pATI->ChipType);
case NewChipID('L', 'M'):
case NewChipID('L', 'N'):
pATI->ChipRevision =
GetBits(pATI->config_chip_id, CFG_CHIP_REVISION);
pATI->Chip = ATI_CHIP_MOBILITY;
pATI->BusType = ATI_BUS_AGP;
pATI->LCDVBlendFIFOSize = 1024;
break;
default:
pATI->Chip = ATI_CHIP_Mach64;
break;
}
}
/*
* ATIChipID --
*
* This returns the ATI_CHIP_* value (generally) associated with a particular
* ChipID/ChipRev combination.
*/
ATIChipType
ATIChipID
(
const CARD16 ChipID,
const CARD8 ChipRev
)
{
switch (ChipID)
{
#ifndef AVOID_CPIO
case OldChipID('A', 'A'): case NewChipID('A', 'A'):
return ATI_CHIP_68800_3;
case OldChipID('X', 'X'): case NewChipID('X', 'X'):
return ATI_CHIP_68800_6;
case OldChipID('L', 'X'):
return ATI_CHIP_68800LX;
case OldChipID('A', 'X'): case NewChipID('A', 'X'):
return ATI_CHIP_68800AX;
#endif /* AVOID_CPIO */
case OldChipID('G', 'X'): case NewChipID('G', 'X'):
switch (ChipRev)
{
case 0x00U:
return ATI_CHIP_88800GXC;
case 0x01U:
return ATI_CHIP_88800GXD;
case 0x02U:
return ATI_CHIP_88800GXE;
case 0x03U:
return ATI_CHIP_88800GXF;
default:
return ATI_CHIP_88800GX;
}
case OldChipID('C', 'X'): case NewChipID('C', 'X'):
return ATI_CHIP_88800CX;
case OldChipID('C', 'T'): case NewChipID('C', 'T'):
return ATI_CHIP_264CT;
case OldChipID('E', 'T'): case NewChipID('E', 'T'):
return ATI_CHIP_264ET;
case OldChipID('V', 'T'): case NewChipID('V', 'T'):
/* For simplicity, ignore ChipID discrepancy that can occur here */
if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV)))
return ATI_CHIP_264VT;
return ATI_CHIP_264VTB;
case OldChipID('G', 'T'): case NewChipID('G', 'T'):
if (!(ChipRev & GetBits(CFG_CHIP_VERSION, CFG_CHIP_REV)))
return ATI_CHIP_264GT;
return ATI_CHIP_264GTB;
case OldChipID('V', 'U'): case NewChipID('V', 'U'):
return ATI_CHIP_264VT3;
case OldChipID('G', 'U'): case NewChipID('G', 'U'):
return ATI_CHIP_264GTDVD;
case OldChipID('L', 'G'): case NewChipID('L', 'G'):
return ATI_CHIP_264LT;
case OldChipID('V', 'V'): case NewChipID('V', 'V'):
return ATI_CHIP_264VT4;
case OldChipID('G', 'V'): case NewChipID('G', 'V'):
case OldChipID('G', 'W'): case NewChipID('G', 'W'):
case OldChipID('G', 'Y'): case NewChipID('G', 'Y'):
case OldChipID('G', 'Z'): case NewChipID('G', 'Z'):
return ATI_CHIP_264GT2C;
case OldChipID('G', 'B'): case NewChipID('G', 'B'):
case OldChipID('G', 'D'): case NewChipID('G', 'D'):
case OldChipID('G', 'I'): case NewChipID('G', 'I'):
case OldChipID('G', 'P'): case NewChipID('G', 'P'):
case OldChipID('G', 'Q'): case NewChipID('G', 'Q'):
return ATI_CHIP_264GTPRO;
case OldChipID('L', 'B'): case NewChipID('L', 'B'):
case OldChipID('L', 'D'): case NewChipID('L', 'D'):
case OldChipID('L', 'I'): case NewChipID('L', 'I'):
case OldChipID('L', 'P'): case NewChipID('L', 'P'):
case OldChipID('L', 'Q'): case NewChipID('L', 'Q'):
return ATI_CHIP_264LTPRO;
case OldChipID('G', 'L'): case NewChipID('G', 'L'):
case OldChipID('G', 'M'): case NewChipID('G', 'M'):
case OldChipID('G', 'N'): case NewChipID('G', 'N'):
case OldChipID('G', 'O'): case NewChipID('G', 'O'):
case OldChipID('G', 'R'): case NewChipID('G', 'R'):
case OldChipID('G', 'S'): case NewChipID('G', 'S'):
return ATI_CHIP_264XL;
case OldChipID('L', 'M'): case NewChipID('L', 'M'):
case OldChipID('L', 'N'): case NewChipID('L', 'N'):
case OldChipID('L', 'R'): case NewChipID('L', 'R'):
case OldChipID('L', 'S'): case NewChipID('L', 'S'):
return ATI_CHIP_MOBILITY;
case NewChipID('R', 'E'):
case NewChipID('R', 'F'):
case NewChipID('R', 'G'):
case NewChipID('S', 'K'):
case NewChipID('S', 'L'):
case NewChipID('S', 'M'):
/* "SN" is listed as ATI_CHIP_RAGE128_4X in ATI docs */
case NewChipID('S', 'N'):
return ATI_CHIP_RAGE128GL;
case NewChipID('R', 'K'):
case NewChipID('R', 'L'):
/*
* ATI documentation lists SE/SF/SG under both ATI_CHIP_RAGE128VR
* and ATI_CHIP_RAGE128_4X, and lists SH/SK/SL under Rage 128 4X only.
* I'm stuffing them here for now until this can be clarified as ATI
* documentation doesn't mention their details. <mharris@redhat.com>
*/
case NewChipID('S', 'E'):
case NewChipID('S', 'F'):
case NewChipID('S', 'G'):
case NewChipID('S', 'H'):
return ATI_CHIP_RAGE128VR;
/* case NewChipID('S', 'H'): */
/* case NewChipID('S', 'K'): */
/* case NewChipID('S', 'L'): */
/* case NewChipID('S', 'N'): */
/* return ATI_CHIP_RAGE128_4X; */
case NewChipID('P', 'A'):
case NewChipID('P', 'B'):
case NewChipID('P', 'C'):
case NewChipID('P', 'D'):
case NewChipID('P', 'E'):
case NewChipID('P', 'F'):
return ATI_CHIP_RAGE128PROGL;
case NewChipID('P', 'G'):
case NewChipID('P', 'H'):
case NewChipID('P', 'I'):
case NewChipID('P', 'J'):
case NewChipID('P', 'K'):
case NewChipID('P', 'L'):
case NewChipID('P', 'M'):
case NewChipID('P', 'N'):
case NewChipID('P', 'O'):
case NewChipID('P', 'P'):
case NewChipID('P', 'Q'):
case NewChipID('P', 'R'):
case NewChipID('P', 'S'):
case NewChipID('P', 'T'):
case NewChipID('P', 'U'):
case NewChipID('P', 'V'):
case NewChipID('P', 'W'):
case NewChipID('P', 'X'):
return ATI_CHIP_RAGE128PROVR;
case NewChipID('T', 'F'):
case NewChipID('T', 'L'):
case NewChipID('T', 'R'):
case NewChipID('T', 'S'):
case NewChipID('T', 'T'):
case NewChipID('T', 'U'):
return ATI_CHIP_RAGE128PROULTRA;
case NewChipID('L', 'E'):
case NewChipID('L', 'F'):
/*
* "LK" and "LL" are not in any ATI documentation I can find
* - mharris
*/
case NewChipID('L', 'K'):
case NewChipID('L', 'L'):
return ATI_CHIP_RAGE128MOBILITY3;
case NewChipID('M', 'F'):
case NewChipID('M', 'L'):
return ATI_CHIP_RAGE128MOBILITY4;
case NewChipID('Q', 'D'):
case NewChipID('Q', 'E'):
case NewChipID('Q', 'F'):
case NewChipID('Q', 'G'):
return ATI_CHIP_RADEON;
case NewChipID('Q', 'Y'):
case NewChipID('Q', 'Z'):
case NewChipID('Q', '^'):
return ATI_CHIP_RADEONVE;
case NewChipID('L', 'Y'):
case NewChipID('L', 'Z'):
return ATI_CHIP_RADEONMOBILITY6;
case NewChipID('A', '6'):
case NewChipID('C', '6'):
return ATI_CHIP_RS100;
case NewChipID('A', '7'):
case NewChipID('C', '7'):
return ATI_CHIP_RS200;
case NewChipID('D', '7'):
case NewChipID('B', '7'):
return ATI_CHIP_RS250;
case NewChipID('L', 'W'):
case NewChipID('L', 'X'):
return ATI_CHIP_RADEONMOBILITY7;
case NewChipID('Q', 'H'):
case NewChipID('Q', 'I'):
case NewChipID('Q', 'J'):
case NewChipID('Q', 'K'):
case NewChipID('Q', 'L'):
case NewChipID('Q', 'M'):
case NewChipID('Q', 'N'):
case NewChipID('Q', 'O'):
case NewChipID('Q', 'h'):
case NewChipID('Q', 'i'):
case NewChipID('Q', 'j'):
case NewChipID('Q', 'k'):
case NewChipID('Q', 'l'):
case NewChipID('B', 'B'):
return ATI_CHIP_R200;
case NewChipID('Q', 'W'):
case NewChipID('Q', 'X'):
return ATI_CHIP_RV200;
case NewChipID('I', 'f'):
case NewChipID('I', 'g'):
return ATI_CHIP_RV250;
case NewChipID('L', 'd'):
case NewChipID('L', 'f'):
case NewChipID('L', 'g'):
return ATI_CHIP_RADEONMOBILITY9;
case NewChipID('X', '4'):
case NewChipID('X', '5'):
return ATI_CHIP_RS300;
case NewChipID('x', '4'):
case NewChipID('x', '5'):
return ATI_CHIP_RS350;
case NewChipID('Y', '\''):
case NewChipID('Y', 'a'):
case NewChipID('Y', 'b'):
case NewChipID('Y', 'd'):
case NewChipID('Y', 'e'):
return ATI_CHIP_RV280;
case NewChipID('\\', 'a'):
case NewChipID('\\', 'c'):
return ATI_CHIP_RADEONMOBILITY9PLUS;
case NewChipID('A', 'D'):
case NewChipID('A', 'E'):
case NewChipID('A', 'F'):
case NewChipID('A', 'G'):
case NewChipID('N', 'D'):
case NewChipID('N', 'E'):
case NewChipID('N', 'F'):
case NewChipID('N', 'G'):
return ATI_CHIP_R300;
case NewChipID('A', 'H'):
case NewChipID('A', 'I'):
case NewChipID('A', 'J'):
case NewChipID('A', 'K'):
case NewChipID('N', 'H'):
case NewChipID('N', 'I'):
case NewChipID('N', 'K'):
return ATI_CHIP_R350;
case NewChipID('A', 'P'):
case NewChipID('A', 'Q'):
case NewChipID('A', 'R'):
case NewChipID('A', 'S'):
case NewChipID('A', 'T'):
case NewChipID('A', 'U'):
case NewChipID('A', 'V'):
case NewChipID('N', 'P'):
case NewChipID('N', 'Q'):
case NewChipID('N', 'R'):
case NewChipID('N', 'S'):
case NewChipID('N', 'T'):
case NewChipID('N', 'V'):
return ATI_CHIP_RV350;
case NewChipID('N', 'J'):
return ATI_CHIP_R360;
case NewChipID('[', '\''):
case NewChipID('[', 'b'):
case NewChipID('[', 'c'):
case NewChipID('[', 'd'):
case NewChipID('[', 'e'):
case NewChipID('T', '\''):
case NewChipID('T', 'b'):
case NewChipID('T', 'd'):
return ATI_CHIP_RV370;
case NewChipID('>', 'P'):
case NewChipID('>', 'T'):
case NewChipID('1', 'P'):
case NewChipID('1', 'R'):
case NewChipID('1', 'T'):
return ATI_CHIP_RV380;
case NewChipID('J', 'H'):
case NewChipID('J', 'I'):
case NewChipID('J', 'J'):
case NewChipID('J', 'K'):
case NewChipID('J', 'L'):
case NewChipID('J', 'M'):
case NewChipID('J', 'N'):
case NewChipID('J', 'O'):
case NewChipID('J', 'P'):
case NewChipID('J', 'T'):
return ATI_CHIP_R420;
case NewChipID('U', 'H'):
case NewChipID('U', 'I'):
case NewChipID('U', 'J'):
case NewChipID('U', 'K'):
case NewChipID('U', 'P'):
case NewChipID('U', 'Q'):
case NewChipID('U', 'R'):
case NewChipID('U', 'T'):
case NewChipID(']', 'W'):
/* those are m28, not 100% certain they are r423 could
be r480 but not r430 as their pci id names indicate... */
case NewChipID(']', 'H'):
case NewChipID(']', 'I'):
case NewChipID(']', 'J'):
return ATI_CHIP_R423;
case NewChipID('U', 'L'):
case NewChipID('U', 'M'):
case NewChipID('U', 'N'):
case NewChipID('U', 'O'):
return ATI_CHIP_R430;
case NewChipID(']', 'L'):
case NewChipID(']', 'M'):
case NewChipID(']', 'N'):
case NewChipID(']', 'O'):
case NewChipID(']', 'P'):
case NewChipID(']', 'R'):
return ATI_CHIP_R480;
case NewChipID('K', 'I'):
case NewChipID('K', 'J'):
case NewChipID('K', 'K'):
case NewChipID('K', 'L'):
return ATI_CHIP_R481;
case NewChipID('^', 'H'):
case NewChipID('^', 'J'):
case NewChipID('^', 'K'):
case NewChipID('^', 'L'):
case NewChipID('^', 'M'):
case NewChipID('^', 'O'):
case NewChipID('V', 'J'):
case NewChipID('V', 'K'):
case NewChipID('V', 'O'):
case NewChipID('V', 'R'):
case NewChipID('V', 'S'):
return ATI_CHIP_RV410;
case NewChipID('Z', 'A'):
case NewChipID('Z', 'B'):
case NewChipID('Z', 'a'):
case NewChipID('Z', 'b'):
case NewChipID('Y', 'T'):
case NewChipID('Y', 'U'):
case NewChipID('Y', 't'):
case NewChipID('Y', 'u'):
return ATI_CHIP_RS400;
case NewChipID('H', 'D'):
return ATI_CHIP_HDTV;
default:
/*
* Treat anything else as an unknown Radeon. Please keep the above
* up-to-date however, as it serves as a central chip list.
*/
return ATI_CHIP_Radeon;
}
}

View File

@ -0,0 +1,163 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.26tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATICHIP_H___
#define ___ATICHIP_H___ 1
#include "atipriv.h"
#include "atiregs.h"
#include <X11/Xmd.h>
/*
* Chip-related definitions.
*/
typedef enum
{
ATI_CHIP_NONE = 0,
#ifndef AVOID_CPIO
ATI_CHIP_VGA, /* Generic VGA */
ATI_CHIP_18800,
ATI_CHIP_18800_1,
ATI_CHIP_28800_2,
ATI_CHIP_28800_4,
ATI_CHIP_28800_5,
ATI_CHIP_28800_6,
ATI_CHIP_8514A, /* 8514/A */
ATI_CHIP_CT480, /* 8514/A clone */
ATI_CHIP_38800_1, /* Mach8 */
ATI_CHIP_68800, /* Mach32 */
ATI_CHIP_68800_3, /* Mach32 */
ATI_CHIP_68800_6, /* Mach32 */
ATI_CHIP_68800LX, /* Mach32 */
ATI_CHIP_68800AX, /* Mach32 */
#endif /* AVOID_CPIO */
ATI_CHIP_88800GXC, /* Mach64 */
ATI_CHIP_88800GXD, /* Mach64 */
ATI_CHIP_88800GXE, /* Mach64 */
ATI_CHIP_88800GXF, /* Mach64 */
ATI_CHIP_88800GX, /* Mach64 */
ATI_CHIP_88800CX, /* Mach64 */
ATI_CHIP_264CT, /* Mach64 */
ATI_CHIP_264ET, /* Mach64 */
ATI_CHIP_264VT, /* Mach64 */
ATI_CHIP_264GT, /* Mach64 */
ATI_CHIP_264VTB, /* Mach64 */
ATI_CHIP_264GTB, /* Mach64 */
ATI_CHIP_264VT3, /* Mach64 */
ATI_CHIP_264GTDVD, /* Mach64 */
ATI_CHIP_264LT, /* Mach64 */
ATI_CHIP_264VT4, /* Mach64 */
ATI_CHIP_264GT2C, /* Mach64 */
ATI_CHIP_264GTPRO, /* Mach64 */
ATI_CHIP_264LTPRO, /* Mach64 */
ATI_CHIP_264XL, /* Mach64 */
ATI_CHIP_MOBILITY, /* Mach64 */
ATI_CHIP_Mach64, /* Last among Mach64's */
ATI_CHIP_RAGE128GL, /* Rage128 */
ATI_CHIP_RAGE128VR, /* Rage128 */
ATI_CHIP_RAGE128PROGL, /* Rage128 */
ATI_CHIP_RAGE128PROVR, /* Rage128 */
ATI_CHIP_RAGE128PROULTRA, /* Rage128 */
ATI_CHIP_RAGE128MOBILITY3, /* Rage128 */
ATI_CHIP_RAGE128MOBILITY4, /* Rage128 */
ATI_CHIP_Rage128, /* Last among Rage128's */
ATI_CHIP_RADEON, /* Radeon */
ATI_CHIP_RADEONVE, /* Radeon VE */
ATI_CHIP_RADEONMOBILITY6, /* Radeon M6 */
ATI_CHIP_RS100, /* IGP320 */
ATI_CHIP_RS200, /* IGP340 */
ATI_CHIP_RS250, /* Radoen 7000 IGP */
ATI_CHIP_RV200, /* RV200 */
ATI_CHIP_RADEONMOBILITY7, /* Radeon M7 */
ATI_CHIP_R200, /* R200 */
ATI_CHIP_RV250, /* RV250 */
ATI_CHIP_RADEONMOBILITY9, /* Radeon M9 */
ATI_CHIP_RS300, /* Radoen 9100 IGP */
ATI_CHIP_RS350, /* Radoen 9200 IGP */
ATI_CHIP_RV280, /* RV250 */
ATI_CHIP_RADEONMOBILITY9PLUS, /* Radeon M9+ */
ATI_CHIP_R300, /* R300 */
ATI_CHIP_RV350, /* RV350/M10/M11 */
ATI_CHIP_R350, /* R350 */
ATI_CHIP_R360, /* R360 */
ATI_CHIP_RV370, /* RV370/M22 */
ATI_CHIP_RV380, /* RV380/M24 */
ATI_CHIP_R420, /* R420/M18 */
ATI_CHIP_R423, /* R423/M28? */
ATI_CHIP_R430, /* R430 */
ATI_CHIP_R480, /* R480/M28? */
ATI_CHIP_R481, /* R481 */
ATI_CHIP_RV410, /* RV410, M26 */
ATI_CHIP_RS400, /* RS400, RS410, RS480, RS482, ... */
ATI_CHIP_Radeon, /* Last among Radeon's */
ATI_CHIP_HDTV /* HDTV */
} ATIChipType;
extern const char *ATIChipNames[];
/*
* Foundry codes for 264xT's.
*/
typedef enum
{
ATI_FOUNDRY_SGS, /* SGS-Thompson */
ATI_FOUNDRY_NEC, /* NEC */
ATI_FOUNDRY_KSC, /* KSC (?) */
ATI_FOUNDRY_UMC, /* United Microelectronics Corporation */
ATI_FOUNDRY_TSMC, /* Taiwan Semiconductor Manufacturing Company */
ATI_FOUNDRY_5,
ATI_FOUNDRY_6,
ATI_FOUNDRY_UMCA /* UMC alternate */
} ATIFoundryType;
extern const char *ATIFoundryNames[];
#ifndef AVOID_CPIO
extern void ATIMach32ChipID(ATIPtr);
#endif /* AVOID_CPIO */
extern void ATIMach64ChipID(ATIPtr, const CARD16);
extern ATIChipType ATIChipID(const CARD16, const CARD8);
#define OldChipID(_1, _0) \
(SetBits(_0 - 'A', CHIP_CODE_0) | SetBits(_1 - 'A', CHIP_CODE_1))
#define NewChipID(_1, _0) \
(SetBits(_0, CFG_CHIP_TYPE0) | SetBits(_1, CFG_CHIP_TYPE1))
#define OldToNewChipID(_ChipID) \
(SetBits(GetBits(_ChipID, CHIP_CODE_0) + 'A', CFG_CHIP_TYPE0) | \
SetBits(GetBits(_ChipID, CHIP_CODE_1) + 'A', CFG_CHIP_TYPE1))
#define NewToOldChipID(_ChipID) \
(SetBits(GetBits(_ChipID, CFG_CHIP_TYPE0) - 'A', CHIP_CODE_0) | \
(SetBits(GetBits(_ChipID, CFG_CHIP_TYPE1) - 'A', CHIP_CODE_1))
#endif /* ___ATICHIP_H___ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h,v 1.8 2003/01/01 19:16:31 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATICLOCK_H___
#define ___ATICLOCK_H___ 1
#include "atipriv.h"
#include "xf86str.h"
/*
* Definitions related to non-programmable clock generators.
*/
typedef enum
{
ATI_CLOCK_NONE = 0,
ATI_CLOCK_VGA = 1,
ATI_CLOCK_CRYSTALS = 2,
ATI_CLOCK_18810,
ATI_CLOCK_18811_0,
ATI_CLOCK_18811_1,
ATI_CLOCK_2494AM,
ATI_CLOCK_MACH64A,
ATI_CLOCK_MACH64B,
ATI_CLOCK_MACH64C
} ATIClockType;
extern const char *ATIClockNames[];
/*
* Definitions related to programmable clock generators.
*/
typedef enum
{
ATI_CLOCK_UNKNOWN = -1,
ATI_CLOCK_FIXED = 0, /* Further described by ATIClockType */
ATI_CLOCK_ICS2595,
ATI_CLOCK_STG1703,
ATI_CLOCK_CH8398,
ATI_CLOCK_INTERNAL,
ATI_CLOCK_ATT20C408,
ATI_CLOCK_IBMRGB514,
ATI_CLOCK_MAX /* Must be last */
} ATIProgrammableClockType;
typedef struct
{
CARD16 MinN, MaxN; /* Feedback divider and ... */
CARD16 NAdjust; /* ... its adjustment and ... */
CARD16 N1, N2; /* ... its restrictions */
CARD16 MinM, MaxM; /* Reference divider and ... */
CARD16 MAdjust; /* ... its adjustment */
CARD16 NumD, *PostDividers; /* Post-dividers */
const char *ClockName;
} ClockRec, *ClockPtr;
extern ClockRec ATIClockDescriptors[];
extern void ATIClockPreInit(ScrnInfoPtr, ATIPtr, GDevPtr, ClockRangePtr);
extern void ATIClockSave(ScrnInfoPtr, ATIPtr, ATIHWPtr);
extern Bool ATIClockCalculate(int, ATIPtr, ATIHWPtr, DisplayModePtr);
extern void ATIClockSet(ATIPtr, ATIHWPtr);
#endif /* ___ATICLOCK_H___ */

View File

@ -0,0 +1,373 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c,v 1.15tsi Exp $*/
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "ati.h"
#include "atiadapter.h"
#include "atichip.h"
#include "aticonfig.h"
#include "aticursor.h"
#include "atioption.h"
#include "atistruct.h"
#include "mach64_common.h"
/*
* Non-publicised XF86Config options.
*/
typedef enum
{
ATI_OPTION_BIOS_DISPLAY, /* Allow BIOS interference */
ATI_OPTION_CRT_SCREEN, /* Legacy negation of "PanelDisplay" */
ATI_OPTION_DEVEL, /* Intentionally undocumented */
ATI_OPTION_BLEND, /* Force horizontal blending of small modes */
ATI_OPTION_LCDSYNC /* Use XF86Config panel mode porches */
} ATIPrivateOptionType;
/*
* ATIProcessOptions --
*
* This function extracts options from what was parsed out of the XF86Config
* file.
*/
void
ATIProcessOptions
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
OptionInfoPtr PublicOption = xnfalloc(ATIPublicOptionSize);
OptionInfoRec PrivateOption[] =
{
{ /* ON: Let BIOS change display(s) */
ATI_OPTION_BIOS_DISPLAY, /* OFF: Don't */
"biosdisplay",
OPTV_BOOLEAN,
{0, },
FALSE
},
{ /* Negation of "PanelDisplay" public option */
ATI_OPTION_CRT_SCREEN,
"crtscreen",
OPTV_BOOLEAN,
{0, },
FALSE
},
{ /* ON: Ease exploration of loose ends */
ATI_OPTION_DEVEL, /* OFF: Fit for public consumption */
"tsi",
OPTV_BOOLEAN,
{0, },
FALSE
},
{ /* ON: Horizontally blend most modes */
ATI_OPTION_BLEND, /* OFF: Use pixel replication more often */
"lcdblend",
OPTV_BOOLEAN,
{0, },
FALSE
},
{ /* ON: Use XF86Config porch timings */
ATI_OPTION_LCDSYNC, /* OFF: Use porches from mode on entry */
"lcdsync",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
-1,
NULL,
OPTV_NONE,
{0, },
FALSE
}
};
(void)memcpy(PublicOption, ATIPublicOptions, ATIPublicOptionSize);
# define Accel PublicOption[ATI_OPTION_ACCEL].value.bool
# define BIOSDisplay PrivateOption[ATI_OPTION_BIOS_DISPLAY].value.bool
# define Blend PrivateOption[ATI_OPTION_BLEND].value.bool
# define CRTDisplay PublicOption[ATI_OPTION_CRT_DISPLAY].value.bool
# define CRTScreen PrivateOption[ATI_OPTION_CRT_SCREEN].value.bool
# define CSync PublicOption[ATI_OPTION_CSYNC].value.bool
# define Devel PrivateOption[ATI_OPTION_DEVEL].value.bool
# define HWCursor PublicOption[ATI_OPTION_HWCURSOR].value.bool
#ifndef AVOID_CPIO
# define Linear PublicOption[ATI_OPTION_LINEAR].value.bool
#endif /* AVOID_CPIO */
#ifdef XF86DRI_DEVEL
# define IsPCI PublicOption[ATI_OPTION_IS_PCI].value.bool
# define DMAMode PublicOption[ATI_OPTION_DMA_MODE].value.str
# define AGPMode PublicOption[ATI_OPTION_AGP_MODE].value.num
# define AGPSize PublicOption[ATI_OPTION_AGP_SIZE].value.num
# define LocalTex PublicOption[ATI_OPTION_LOCAL_TEXTURES].value.bool
# define BufferSize PublicOption[ATI_OPTION_BUFFER_SIZE].value.num
#endif /* XF86DRI_DEVEL */
#ifdef TV_OUT
# define TvOut PublicOption[ATI_OPTION_TV_OUT].value.bool
# define TvStd PublicOption[ATI_OPTION_TV_STD].value.str
#endif /* TV_OUT */
# define CacheMMIO PublicOption[ATI_OPTION_MMIO_CACHE].value.bool
# define TestCacheMMIO PublicOption[ATI_OPTION_TEST_MMIO_CACHE].value.bool
# define PanelDisplay PublicOption[ATI_OPTION_PANEL_DISPLAY].value.bool
# define ProbeClocks PublicOption[ATI_OPTION_PROBE_CLOCKS].value.bool
# define ShadowFB PublicOption[ATI_OPTION_SHADOW_FB].value.bool
# define SWCursor PublicOption[ATI_OPTION_SWCURSOR].value.bool
# define AccelMethod PublicOption[ATI_OPTION_ACCELMETHOD].value.str
# define RenderAccel PublicOption[ATI_OPTION_RENDER_ACCEL].value.bool
# define LCDSync PrivateOption[ATI_OPTION_LCDSYNC].value.bool
# define ReferenceClock \
PublicOption[ATI_OPTION_REFERENCE_CLOCK].value.freq.freq
/* Pick up XF86Config options */
xf86CollectOptions(pScreenInfo, NULL);
/* Set non-zero defaults */
#ifndef AVOID_CPIO
if (pATI->Adapter >= ATI_ADAPTER_MACH64)
#endif /* AVOID_CPIO */
{
Accel = CacheMMIO = HWCursor = TRUE;
#ifndef AVOID_CPIO
Linear = TRUE;
#endif /* AVOID_CPIO */
#ifdef TV_OUT
TvStd = "None"; /* No tv standard change requested */
#endif
}
ReferenceClock = ((double)157500000.0) / ((double)11.0);
#ifndef AVOID_CPIO
if (pATI->PCIInfo)
#endif /* AVOID_CPIO */
{
ShadowFB = TRUE;
}
Blend = PanelDisplay = TRUE;
#ifdef XF86DRI_DEVEL
DMAMode = "mmio";
#endif
xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
PublicOption);
xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
PrivateOption);
#ifndef AVOID_CPIO
/* Disable linear apertures if the OS doesn't support them */
if (!xf86LinearVidMem() && Linear)
{
if (PublicOption[ATI_OPTION_LINEAR].found)
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"OS does not support linear apertures.\n");
Linear = FALSE;
}
#endif /* AVOID_CPIO */
/* Move option values into driver private structure */
pATI->OptionAccel = Accel;
pATI->OptionBIOSDisplay = BIOSDisplay;
pATI->OptionBlend = Blend;
pATI->OptionCRTDisplay = CRTDisplay;
pATI->OptionCSync = CSync;
pATI->OptionDevel = Devel;
#ifndef AVOID_CPIO
pATI->OptionLinear = Linear;
#endif /* AVOID_CPIO */
#ifdef TV_OUT
if (TvOut && pATI->Chip < ATI_CHIP_264GT) {
/* Only allow this for 3D Rage (I) or greater chip ID
* AFAIK, no chips before this supported TV-Out
* mach64VT has support for TV tuner, but no TV-Out
*/
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"TV Out not supported for this chip.\n");
} else {
ATITVStandard std;
pATI->OptionTvOut = TvOut;
pATI->OptionTvStd = ATI_TV_STD_INVALID;
for (std = 0; std < ATI_TV_STDS_MAX_VALID; std++) {
if (std != ATI_TV_STD_RESERVED1 && std != ATI_TV_STD_RESERVED2) {
if (strncasecmp(TvStd, ATITVStandardNames[std], ATI_TV_STDS_NAME_MAXLEN)==0) {
pATI->OptionTvStd = std;
break;
}
}
}
}
#endif /* TV_OUT */
pATI->OptionMMIOCache = CacheMMIO;
pATI->OptionTestMMIOCache = TestCacheMMIO;
pATI->OptionProbeClocks = ProbeClocks;
pATI->OptionShadowFB = ShadowFB;
pATI->OptionLCDSync = LCDSync;
/* "CRTScreen" is now "NoPanelDisplay" */
if ((PanelDisplay != CRTScreen) ||
PublicOption[ATI_OPTION_PANEL_DISPLAY].found)
pATI->OptionPanelDisplay = PanelDisplay;
else
pATI->OptionPanelDisplay = !CRTScreen;
#ifdef XF86DRI_DEVEL
pATI->OptionIsPCI = IsPCI;
pATI->OptionAGPMode = AGPMode;
pATI->OptionAGPSize = AGPSize;
pATI->OptionLocalTextures = LocalTex;
pATI->OptionBufferSize = BufferSize;
if (strcasecmp(DMAMode, "async")==0)
pATI->OptionDMAMode = MACH64_MODE_DMA_ASYNC;
else if (strcasecmp(DMAMode, "sync")==0)
pATI->OptionDMAMode = MACH64_MODE_DMA_SYNC;
else if (strcasecmp(DMAMode, "mmio")==0 )
pATI->OptionDMAMode = MACH64_MODE_MMIO;
else {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Unkown dma_mode: '%s'\n", DMAMode);
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Valid dma_mode options are: 'async','sync','mmio'\n");
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Defaulting to async DMA mode\n");
pATI->OptionDMAMode = MACH64_MODE_DMA_ASYNC;
}
#endif /* XF86DRI_DEVEL */
/* Validate and set cursor options */
pATI->Cursor = ATI_CURSOR_SOFTWARE;
if (SWCursor || !HWCursor)
{
if (HWCursor && PublicOption[ATI_OPTION_HWCURSOR].found)
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Option \"sw_cursor\" overrides Option \"hw_cursor\".\n");
}
else if (pATI->Chip < ATI_CHIP_264CT)
{
if (HWCursor && PublicOption[ATI_OPTION_HWCURSOR].found)
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Option \"hw_cursor\" not supported in this configuration.\n");
}
else
{
pATI->Cursor = ATI_CURSOR_HARDWARE;
}
/* Only set the reference clock if it hasn't already been determined */
if (!pATI->ReferenceNumerator || !pATI->ReferenceDenominator)
{
switch ((int)(ReferenceClock / ((double)100000.0)))
{
case 143:
pATI->ReferenceNumerator = 157500;
pATI->ReferenceDenominator = 11;
break;
case 286:
pATI->ReferenceNumerator = 315000;
pATI->ReferenceDenominator = 11;
break;
default:
pATI->ReferenceNumerator =
(int)(ReferenceClock / ((double)1000.0));
pATI->ReferenceDenominator = 1;
break;
}
}
pATI->useEXA = FALSE;
if (pATI->OptionAccel)
{
MessageType from = X_DEFAULT;
#if defined(USE_EXA)
#if defined(USE_XAA)
if (AccelMethod != NULL)
{
from = X_CONFIG;
if (xf86NameCmp(AccelMethod, "EXA") == 0)
pATI->useEXA = TRUE;
}
#else /* USE_XAA */
pATI->useEXA = TRUE;
#endif /* !USE_XAA */
#endif /* USE_EXA */
xf86DrvMsg(pScreenInfo->scrnIndex, from,
"Using %s acceleration architecture\n",
pATI->useEXA ? "EXA" : "XAA");
pATI->RenderAccelEnabled = FALSE;
#if defined(USE_EXA)
if (pATI->useEXA && RenderAccel)
pATI->RenderAccelEnabled = TRUE;
#endif
}
xfree(PublicOption);
}

View File

@ -0,0 +1,33 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h,v 1.5 2003/01/01 19:16:31 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATICONFIG_H___
#define ___ATICONFIG_H___ 1
#include "atipriv.h"
#include "xf86str.h"
extern void ATIProcessOptions(ScrnInfoPtr, ATIPtr);
#endif /* ___ATICONFIG_H___ */

View File

@ -0,0 +1,870 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.22 2003/11/13 18:42:47 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Manuel Teira
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atiadapter.h"
#include "aticonsole.h"
#include "aticrtc.h"
#include "atii2c.h"
#include "atilock.h"
#include "atimach64.h"
#include "atimach64io.h"
#include "atimode.h"
#include "atistruct.h"
#include "ativga.h"
#include "atividmem.h"
#ifdef XF86DRI_DEVEL
#include "mach64_common.h"
#include "atidri.h"
#endif
#include "mach64_common.h"
#include "xf86.h"
#ifdef TV_OUT
#include "atichip.h"
#include "atiprint.h"
#include "atioption.h"
#include "vbe.h"
static const char *vbeSymbols[] = {
"VBEGetVBEMode",
NULL
};
#endif /* TV_OUT */
/*
* ATISaveScreen --
*
* This function is a screen saver hook for DIX.
*/
Bool
ATISaveScreen
(
ScreenPtr pScreen,
int Mode
)
{
ScrnInfoPtr pScreenInfo;
ATIPtr pATI;
if ((Mode != SCREEN_SAVER_ON) && (Mode != SCREEN_SAVER_CYCLE))
SetTimeSinceLastInputEvent();
if (!pScreen)
return TRUE;
pScreenInfo = xf86Screens[pScreen->myNum];
if (!pScreenInfo->vtSema)
return TRUE;
pATI = ATIPTR(pScreenInfo);
switch (pATI->NewHW.crtc)
{
#ifndef AVOID_CPIO
case ATI_CRTC_VGA:
ATIVGASaveScreen(pATI, Mode);
break;
#endif /* AVOID_CPIO */
case ATI_CRTC_MACH64:
ATIMach64SaveScreen(pATI, Mode);
break;
default:
break;
}
return TRUE;
}
/*
* ATISetDPMSMode --
*
* This function sets the adapter's VESA Display Power Management Signaling
* mode.
*/
void
ATISetDPMSMode
(
ScrnInfoPtr pScreenInfo,
int DPMSMode,
int flags
)
{
ATIPtr pATI;
if (!pScreenInfo || !pScreenInfo->vtSema)
return;
pATI = ATIPTR(pScreenInfo);
switch (pATI->Adapter)
{
case ATI_ADAPTER_MACH64:
ATIMach64SetDPMSMode(pScreenInfo, pATI, DPMSMode);
break;
default:
#ifndef AVOID_CPIO
/* Assume EGA/VGA */
ATIVGASetDPMSMode(pATI, DPMSMode);
break;
case ATI_ADAPTER_NONE:
case ATI_ADAPTER_8514A:
case ATI_ADAPTER_MACH8:
#endif /* AVOID_CPIO */
break;
}
}
#ifdef TV_OUT
static void
ATIProbeAndSetActiveDisplays
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
vbeInfoPtr pVbe;
Bool tv_attached, crt_attached, lcd_attached;
int disp_request;
ATITVStandard tv_std, tv_std_request;
xf86LoaderRefSymLists(vbeSymbols, NULL);
if (xf86GetVerbosity() > 3) {
xf86ErrorFVerb(4, "\n Before TV-Out queries\n\n");
ATIPrintRegisters(pATI);
}
pATI->tvActive = FALSE;
pVbe = pATI->pVBE;
if (pVbe) {
/* LT Pro, XL, Mobility specific BIOS functions */
if (pATI->Chip == ATI_CHIP_264LTPRO ||
pATI->Chip == ATI_CHIP_264XL ||
pATI->Chip == ATI_CHIP_MOBILITY) {
/* Get attached display(s) - LTPro, XL, Mobility */
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa083;
pVbe->pInt10->cx = 0x0700; /* ch=0x07 - probe all, 0x01 CRT, 0x02 TV, 0x04 LCD */
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"Attached displays: ax=0x%04x, cx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->cx);
tv_attached = crt_attached = lcd_attached = FALSE;
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to detect attached displays\n");
} else {
if (pVbe->pInt10->cx & 0x3)
{
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" CRT attached\n");
crt_attached = TRUE;
}
else
crt_attached = FALSE;
if ((pVbe->pInt10->cx >> 2) & 0x3)
{
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" DFP/LCD attached\n");
lcd_attached = TRUE;
}
else
lcd_attached = FALSE;
switch ((pVbe->pInt10->cx >> 4) & 0x3) {
case 0:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" No TV attached\n");
break;
case 1:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" TV attached (composite connector)\n");
tv_attached = TRUE;
break;
case 2:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" TV attached (S-video connector)\n");
tv_attached = TRUE;
break;
case 3:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" TV attached (S-video/composite connectors)\n");
tv_attached = TRUE;
break;
default:
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Unrecognized return code: 0x%04x\n",
pVbe->pInt10->cx);
}
}
/* Get active display - LTPro, XL, Mobility */
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa084;
pVbe->pInt10->bx = 0x0000; /* bh=0x00 get active, bh=0x01 set active */
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"Active displays: ax=0x%04x, bx=0x%04x, cx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->bx, pVbe->pInt10->cx);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to detect active display\n");
} else {
if (pVbe->pInt10->bx & 0x1)
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" DFP/LCD is active\n");
if (pVbe->pInt10->bx & 0x2)
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" CRT is active\n");
if (pVbe->pInt10->bx & 0x4) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
" TV is active\n");
if (!tv_attached) {
/* tv not connected - disable tv */
disp_request = 0x00;
if (crt_attached)
disp_request |= 0x02; /* enable CRT */
if (lcd_attached && pATI->OptionPanelDisplay)
disp_request |= 0x01; /* enable DFP/LCD */
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa084;
pVbe->pInt10->bx = 0x0100; /* bh=0x01 set active */
pVbe->pInt10->cx = disp_request;
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV not present, disabling: ax=0x%04x, bx=0x%04x, cx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->bx, pVbe->pInt10->cx);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Disabling TV failed\n");
}
} else {
pATI->tvActive = TRUE;
}
} else if (tv_attached && (pVbe->pInt10->bx & 0x0400)) {
/* tv connected and available - enable TV */
disp_request = 0x04; /* enable TV */
#if 0
/* This works, but CRT image is vertically compressed */
if (crt_attached)
disp_request |= 0x02; /* enable CRT */
/* NOTE: For me, LCD+TV does NOT work */
/*if (lcd_attached && pATI->OptionPanelDisplay)
disp_request |= 0x01; * enable DFP/LCD */
#endif
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa084;
pVbe->pInt10->bx = 0x0100; /* bh=0x01 set active */
pVbe->pInt10->cx = disp_request; /* try to activate TV */
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"Setting TV active: ax=0x%04x, bx=0x%04x, cx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->bx, pVbe->pInt10->cx);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Setting TV active failed\n");
} else {
pATI->tvActive = TRUE;
}
}
}
} else { /* pATI->Chip < ATI_CHIP_264LTPRO */
/* TVOut Hooks - Check for TVOut BIOS/hardware */
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa019;
pVbe->pInt10->cx = 0x0000; /* TVOut BIOS query */
xf86ExecX86int10(pVbe->pInt10);
tv_attached = FALSE;
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to detect TV-Out BIOS\n");
} else {
switch (pVbe->pInt10->ax & 0x0003) {
case 3:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out BIOS detected and active\n");
/* TV attached query */
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa070;
pVbe->pInt10->bx = 0x0002; /* Sub-function: return tv attached info */
xf86ExecX86int10(pVbe->pInt10);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to detect if TV is attached\n");
} else {
switch (pVbe->pInt10->cx & 0x0003) {
case 3:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV attached to composite and S-video connectors\n");
tv_attached = TRUE;
break;
case 2:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV attached to S-video connector\n");
tv_attached = TRUE;
break;
case 1:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV attached to composite connector\n");
tv_attached = TRUE;
break;
default:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV is not attached\n");
}
}
break;
case 1:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out BIOS service is not available due to"
"a system BIOS error or TV-Out hardware not being installed\n");
break;
default:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"No TV-Out BIOS or hardware detected\n");
}
}
}
/* Return TV-Out configuration
* see Programmer's Guide under "TV Out Specific Functions"
* It's not clear exactly which adapters support these
*/
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa070;
pVbe->pInt10->bx = 0x00;
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out query: ax=0x%04x, bx=0x%04x, cx=0x%04x, dx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->bx, pVbe->pInt10->cx, pVbe->pInt10->dx);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to detect TV-Out configuration.\n");
} else if (pVbe->pInt10->bx == 0) {
if (pVbe->pInt10->dx == 0) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out is not detected.\n");
} else {
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out is detected but not supported.\n");
}
} else if ((pVbe->pInt10->cx & 0xff) == 0) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out is currently disabled.\n");
if (tv_attached && pATI->Chip < ATI_CHIP_264LTPRO) {
/* Try to enable TV-Out */
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa070;
pVbe->pInt10->bx = 0x0001; /* Sub-function: Select TV Out */
/* cl=0x001 enable, cl=0x000 disable,
* cl=0x080 disable with feature connector bit preserved
*/
pVbe->pInt10->cx = 0x0001;
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"Setting TV active: ax=0x%04x, bx=0x%04x, cx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->bx, pVbe->pInt10->cx);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Setting TV active failed\n");
} else {
pATI->tvActive = TRUE;
}
}
} else {
pATI->tvActive = TRUE;
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV-Out is currently enabled (TV-Out revision code: %d).\n",
(pVbe->pInt10->dx >> 8) & 0xff);
switch ((pVbe->pInt10->cx >> 8) & 0xff) {
case 0:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Reference frequency 29.49892\n");
break;
case 1:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Reference frequency 28.63636\n");
break;
case 2:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Reference frequency 14.31818\n");
break;
case 3:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Reference frequency 27.00000\n");
break;
default:
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Unknown reference frequency cx=0x%04x\n", pVbe->pInt10->cx);
}
/* Return TV standard
* see Programmer's Guide under "TV Out Specific Functions"
* It's not clear exactly which adapters support these
*/
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa071;
pVbe->pInt10->bx = 0x00;
xf86ExecX86int10(pVbe->pInt10);
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"TV standard query result: ax=0x%04x, bx=0x%04x, cx=0x%04x\n",
pVbe->pInt10->ax, pVbe->pInt10->bx, pVbe->pInt10->cx);
if (pVbe->pInt10->ax & 0xff00) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to return TV standard.\n");
} else {
tv_std = pVbe->pInt10->cx & 0x00ff;
switch (tv_std) {
case ATI_TV_STD_NTSC:
case ATI_TV_STD_PAL:
case ATI_TV_STD_PALM:
case ATI_TV_STD_PAL60:
case ATI_TV_STD_NTSCJ:
case ATI_TV_STD_PALCN:
case ATI_TV_STD_PALN:
case ATI_TV_STD_SCARTPAL:
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"Current TV standard: %s\n", ATITVStandardNames[tv_std]);
break;
default:
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Unrecognized TV standard return code cx=0x%04x\n",
pVbe->pInt10->cx);
}
tv_std_request = pATI->OptionTvStd;
if (tv_std_request < 0 ||
tv_std_request > ATI_TV_STD_NONE ||
tv_std_request == ATI_TV_STD_RESERVED1 ||
tv_std_request == ATI_TV_STD_RESERVED2) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Invalid TV standard requested, please check configuration file\n");
} else if (tv_std_request != ATI_TV_STD_NONE) {
/* Set TV standard if requested (LT Pro not supported) */
if (pATI->Chip != ATI_CHIP_264LTPRO &&
tv_std_request != tv_std) {
pVbe->pInt10->num = 0x10;
pVbe->pInt10->ax = 0xa070;
pVbe->pInt10->bx = 0x0003; /* sub-function: set TV standard */
pVbe->pInt10->cx = tv_std_request;
xf86ExecX86int10(pVbe->pInt10);
if (pVbe->pInt10->ax & 0xff00)
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to set TV standard\n");
else
xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
"Set TV standard to %s\n", ATITVStandardNames[tv_std_request]);
} else {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Setting TV standard not supported on ATI Rage LT Pro\n");
}
}
}
}
} else {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "VBE module not loaded\n");
}
}
#endif /* TV_OUT */
/*
* ATIEnterGraphics --
*
* This function sets the hardware to a graphics video state.
*/
Bool
ATIEnterGraphics
(
ScreenPtr pScreen,
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
/* Map apertures */
if (!ATIMapApertures(pScreenInfo->scrnIndex, pATI))
return FALSE;
/* Unlock device */
ATIUnlock(pATI);
/* Calculate hardware data */
if (pScreen &&
!ATIModeCalculate(pScreenInfo->scrnIndex, pATI, &pATI->NewHW,
pScreenInfo->currentMode))
return FALSE;
pScreenInfo->vtSema = TRUE;
#ifdef TV_OUT
if (pATI->OptionTvOut) {
xf86LoaderRefSymLists(vbeSymbols, NULL);
if (pATI->pVBE) {
if (VBEGetVBEMode(pATI->pVBE, &pATI->vbemode)) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Saving VESA mode: 0x%x\n",
pATI->vbemode);
}
}
}
#endif /* TV_OUT */
/* Save current state */
ATIModeSave(pScreenInfo, pATI, &pATI->OldHW);
#ifdef TV_OUT
if (pATI->OptionTvOut)
ATIProbeAndSetActiveDisplays(pScreenInfo, pATI);
#endif /* TV_OUT */
/* Set graphics state */
ATIModeSet(pScreenInfo, pATI, &pATI->NewHW);
/* Possibly blank the screen */
if (pScreen)
(void)ATISaveScreen(pScreen, SCREEN_SAVER_ON);
/* Position the screen */
(*pScreenInfo->AdjustFrame)(pScreenInfo->scrnIndex,
pScreenInfo->frameX0, pScreenInfo->frameY0, 0);
SetTimeSinceLastInputEvent();
return TRUE;
}
/*
* ATILeaveGraphics --
*
* This function restores the hardware to its previous state.
*/
void
ATILeaveGraphics
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
if (pScreenInfo->vtSema)
{
/* If not exiting, save graphics video state */
if (!xf86ServerIsExiting())
ATIModeSave(pScreenInfo, pATI, &pATI->NewHW);
#ifdef TV_OUT
if (pATI->OptionTvOut)
ATIProbeAndSetActiveDisplays(pScreenInfo, pATI);
#endif /* TV_OUT */
/* Restore mode in effect on server entry */
ATIModeSet(pScreenInfo, pATI, &pATI->OldHW);
pScreenInfo->vtSema = FALSE;
}
/* Lock device */
ATILock(pATI);
/* Unmap apertures */
#ifdef AVOID_DGA
if (!pATI->Closeable)
#else /* AVOID_DGA */
if (!pATI->Closeable || !pATI->nDGAMode)
#endif /* AVOID_DGA */
ATIUnmapApertures(pScreenInfo->scrnIndex, pATI);
SetTimeSinceLastInputEvent();
}
/*
* ATISwitchMode --
*
* This function switches to another graphics video state.
*/
_X_EXPORT Bool
ATISwitchMode
(
int iScreen,
DisplayModePtr pMode,
int flags
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
ATIPtr pATI = ATIPTR(pScreenInfo);
/* Calculate new hardware data */
if (!ATIModeCalculate(iScreen, pATI, &pATI->NewHW, pMode))
return FALSE;
/* Set new hardware state */
if (pScreenInfo->vtSema)
{
pScreenInfo->currentMode = pMode;
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
DRILock(pScreenInfo->pScreen,0);
ATIDRIWaitForIdle(pATI);
}
#endif /* XF86DRI_DEVEL */
ATIModeSet(pScreenInfo, pATI, &pATI->NewHW);
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
DRIUnlock(pScreenInfo->pScreen);
}
#endif /* XF86DRI_DEVEL */
}
SetTimeSinceLastInputEvent();
return TRUE;
}
/*
* ATIEnterVT --
*
* This function sets the server's virtual console to a graphics video state.
*/
_X_EXPORT Bool
ATIEnterVT
(
int iScreen,
int flags
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
ScreenPtr pScreen = pScreenInfo->pScreen;
ATIPtr pATI = ATIPTR(pScreenInfo);
PixmapPtr pScreenPixmap;
DevUnion PixmapPrivate;
Bool Entered;
if (!ATIEnterGraphics(NULL, pScreenInfo, pATI))
return FALSE;
/* The rest of this isn't needed for shadowfb */
if (pATI->OptionShadowFB)
{
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
/* get the Mach64 back into shape after resume */
ATIDRIResume(pScreen);
DRIUnlock(pScreen);
}
#endif /* XF86DRI_DEVEL */
return TRUE;
}
#ifndef AVOID_CPIO
/* If used, modify banking interface */
if (!miModifyBanking(pScreen, &pATI->BankInfo))
return FALSE;
#endif /* AVOID_CPIO */
pScreenPixmap = (*pScreen->GetScreenPixmap)(pScreen);
PixmapPrivate = pScreenPixmap->devPrivate;
if (!PixmapPrivate.ptr)
pScreenPixmap->devPrivate = pScreenInfo->pixmapPrivate;
/* Tell framebuffer about remapped aperture */
Entered = (*pScreen->ModifyPixmapHeader)(pScreenPixmap,
-1, -1, -1, -1, -1, pATI->pMemory);
if (!PixmapPrivate.ptr)
{
pScreenInfo->pixmapPrivate = pScreenPixmap->devPrivate;
pScreenPixmap->devPrivate.ptr = NULL;
}
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
/* get the Mach64 back into shape after resume */
ATIDRIResume(pScreen);
DRIUnlock(pScreen);
}
#endif /* XF86DRI_DEVEL */
return Entered;
}
/*
* ATILeaveVT --
*
* This function restores the server's virtual console to its state on server
* entry.
*/
_X_EXPORT void
ATILeaveVT
(
int iScreen,
int flags
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
ScreenPtr pScreen = pScreenInfo->pScreen;
ATIPtr pATI = ATIPTR(pScreenInfo);
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
DRILock(pScreen,0);
ATIDRIWaitForIdle(pATI);
}
#endif /* XF86DRI_DEVEL */
ATILeaveGraphics(pScreenInfo, ATIPTR(pScreenInfo));
}
/*
* ATIFreeScreen --
*
* This function frees all driver data related to a screen.
*/
_X_EXPORT void
ATIFreeScreen
(
int iScreen,
int flags
)
{
ScreenPtr pScreen = screenInfo.screens[iScreen];
ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
ATIPtr pATI = ATIPTR(pScreenInfo);
if (pATI->Closeable || (serverGeneration > 1))
ATII2CFreeScreen(iScreen);
if (pATI->Closeable)
(void)(*pScreen->CloseScreen)(iScreen, pScreen);
ATILeaveGraphics(pScreenInfo, pATI);
#ifndef AVOID_CPIO
xfree(pATI->OldHW.frame_buffer);
xfree(pATI->NewHW.frame_buffer);
#endif /* AVOID_CPIO */
xfree(pATI->pShadow);
#ifndef AVOID_DGA
xfree(pATI->pDGAMode);
#endif /* AVOID_DGA */
xfree(pATI);
pScreenInfo->driverPrivate = NULL;
}

View File

@ -0,0 +1,44 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h,v 1.9 2003/01/01 19:16:31 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATICONSOLE_H___
#define ___ATICONSOLE_H___ 1
#include "atipriv.h"
#include "xf86str.h"
extern Bool ATISaveScreen(ScreenPtr, int);
extern void ATISetDPMSMode(ScrnInfoPtr, int, int);
extern Bool ATIEnterGraphics(ScreenPtr, ScrnInfoPtr, ATIPtr);
extern void ATILeaveGraphics(ScrnInfoPtr, ATIPtr);
extern Bool ATISwitchMode(int, DisplayModePtr, int);
extern Bool ATIEnterVT(int, int);
extern void ATILeaveVT(int, int);
extern void ATIFreeScreen(int, int);
#endif /* ___ATICONSOLE_H___ */

View File

@ -0,0 +1,43 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h,v 1.8 2003/01/01 19:16:31 tsi Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATICRTC_H___
#define ___ATICRTC_H___ 1
/*
* CRTC related definitions.
*/
typedef enum
{
#ifndef AVOID_CPIO
ATI_CRTC_VGA, /* Use VGA CRTC */
ATI_CRTC_8514, /* Use 8514/Mach8/Mach32 accelerator CRTC */
#endif /* AVOID_CPIO */
ATI_CRTC_MACH64 /* Use Mach64 accelerator CRTC */
} ATICRTCType;
#endif /* ___ATICRTC_H___ */

View File

@ -0,0 +1,79 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c,v 1.4 2003/04/23 21:51:27 tsi Exp $ */
/*
* Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atiadapter.h"
#include "aticursor.h"
#include "atimach64cursor.h"
#include "atistruct.h"
#include "xf86.h"
/*
* ATIInitializeCursor --
*
* This function initialises the screen cursor.
*/
Bool
ATIInitializeCursor
(
ScreenPtr pScreen,
ATIPtr pATI
)
{
/* Initialise software cursor */
if (!miDCInitialize(pScreen, xf86GetPointerScreenFuncs()))
return FALSE;
if (pATI->Cursor == ATI_CURSOR_SOFTWARE)
return TRUE;
if (!(pATI->pCursorInfo = xf86CreateCursorInfoRec()))
return FALSE;
switch (pATI->Adapter)
{
case ATI_ADAPTER_MACH64:
if (ATIMach64CursorInit(pATI->pCursorInfo))
break;
/* Fall through */
default:
xf86DestroyCursorInfoRec(pATI->pCursorInfo);
pATI->pCursorInfo = NULL;
return FALSE;
}
if (xf86InitCursor(pScreen, pATI->pCursorInfo))
{
xf86SetSilkenMouse(pScreen);
return TRUE;
}
xf86DestroyCursorInfoRec(pATI->pCursorInfo);
pATI->pCursorInfo = NULL;
return FALSE;
}

View File

@ -0,0 +1,43 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h,v 1.3 2003/01/01 19:16:31 tsi Exp $ */
/*
* Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATICURSOR_H___
#define ___ATICURSOR_H___ 1
#include "atipriv.h"
#include "screenint.h"
/*
* Cursor related definitions.
*/
typedef enum
{
ATI_CURSOR_SOFTWARE, /* Software cursor */
ATI_CURSOR_HARDWARE, /* Hardware cursor provided by CRTC */
ATI_CURSOR_DAC /* Hardware cursor provided by RAMDAC */
} ATICursorType;
extern Bool ATIInitializeCursor(ScreenPtr, ATIPtr);
#endif /* ___ATICURSOR_H___ */

View File

@ -0,0 +1,528 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.18 2003/02/25 17:58:13 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "ati.h"
#include "atidac.h"
#include "atimach64io.h"
#include "atimono.h"
/*
* RAMDAC-related definitions.
*/
const SymTabRec ATIDACDescriptors[] =
{ /* Keep this table in ascending DACType order */
{ATI_DAC_ATI68830, "ATI 68830 or similar"},
{ATI_DAC_SC11483, "Sierra 11483 or similar"},
{ATI_DAC_ATI68875, "ATI 68875 or similar"},
{ATI_DAC_TVP3026_A, "TI ViewPoint3026 or similar"},
{ATI_DAC_GENERIC, "Brooktree 476 or similar"},
{ATI_DAC_BT481, "Brooktree 481 or similar"},
{ATI_DAC_ATT20C491, "AT&T 20C491 or similar"},
{ATI_DAC_SC15026, "Sierra 15026 or similar"},
{ATI_DAC_MU9C1880, "Music 9C1880 or similar"},
{ATI_DAC_IMSG174, "Inmos G174 or similar"},
{ATI_DAC_ATI68860_B, "ATI 68860 (Revision B) or similar"},
{ATI_DAC_ATI68860_C, "ATI 68860 (Revision C) or similar"},
{ATI_DAC_TVP3026_B, "TI ViewPoint3026 or similar"},
{ATI_DAC_STG1700, "SGS-Thompson 1700 or similar"},
{ATI_DAC_ATT20C498, "AT&T 20C498 or similar"},
{ATI_DAC_STG1702, "SGS-Thompson 1702 or similar"},
{ATI_DAC_SC15021, "Sierra 15021 or similar"},
{ATI_DAC_ATT21C498, "AT&T 21C498 or similar"},
{ATI_DAC_STG1703, "SGS-Thompson 1703 or similar"},
{ATI_DAC_CH8398, "Chrontel 8398 or similar"},
{ATI_DAC_ATT20C408, "AT&T 20C408 or similar"},
{ATI_DAC_INTERNAL, "Internal"},
{ATI_DAC_IBMRGB514, "IBM RGB 514 or similar"},
{ATI_DAC_UNKNOWN, "Unknown"} /* Must be last */
};
#ifndef AVOID_CPIO
/*
* ATISetDACIOPorts --
*
* This function sets up DAC access I/O port numbers.
*/
void
ATISetDACIOPorts
(
ATIPtr pATI,
ATICRTCType crtc
)
{
switch (crtc)
{
case ATI_CRTC_VGA:
pATI->CPIO_DAC_DATA = VGA_DAC_DATA;
pATI->CPIO_DAC_MASK = VGA_DAC_MASK;
pATI->CPIO_DAC_READ = VGA_DAC_READ;
pATI->CPIO_DAC_WRITE = VGA_DAC_WRITE;
pATI->CPIO_DAC_WAIT = GENS1(pATI->CPIO_VGABase);
break;
case ATI_CRTC_8514:
pATI->CPIO_DAC_DATA = IBM_DAC_DATA;
pATI->CPIO_DAC_MASK = IBM_DAC_MASK;
pATI->CPIO_DAC_READ = IBM_DAC_READ;
pATI->CPIO_DAC_WRITE = IBM_DAC_WRITE;
pATI->CPIO_DAC_WAIT = pATI->CPIO_DAC_MASK;
break;
case ATI_CRTC_MACH64:
pATI->CPIO_DAC_DATA = ATIIOPort(DAC_REGS) + 1;
pATI->CPIO_DAC_MASK = ATIIOPort(DAC_REGS) + 2;
pATI->CPIO_DAC_READ = ATIIOPort(DAC_REGS) + 3;
pATI->CPIO_DAC_WRITE = ATIIOPort(DAC_REGS) + 0;
pATI->CPIO_DAC_WAIT = pATI->CPIOBase;
break;
default:
break;
}
}
#endif /* AVOID_CPIO */
/*
* ATIGetDACCmdReg --
*
* Setup to access a RAMDAC's command register.
*/
CARD8
ATIGetDACCmdReg
(
ATIPtr pATI
)
{
#ifdef AVOID_CPIO
(void)in8(M64_DAC_WRITE); /* Reset to PEL mode */
(void)in8(M64_DAC_MASK);
(void)in8(M64_DAC_MASK);
(void)in8(M64_DAC_MASK);
return in8(M64_DAC_MASK);
#else /* AVOID_CPIO */
(void)inb(pATI->CPIO_DAC_WRITE); /* Reset to PEL mode */
(void)inb(pATI->CPIO_DAC_MASK);
(void)inb(pATI->CPIO_DAC_MASK);
(void)inb(pATI->CPIO_DAC_MASK);
return inb(pATI->CPIO_DAC_MASK);
#endif /* AVOID_CPIO */
}
/*
* ATIDACPreInit --
*
* This function initialises the fields in an ATIHWRec that relate to DACs.
*/
void
ATIDACPreInit
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI,
ATIHWPtr pATIHW
)
{
int Index, Index2;
CARD8 maxColour = (1 << pATI->rgbBits) - 1;
pATIHW->dac_read = pATIHW->dac_write = 0x00U;
pATIHW->dac_mask = 0xFFU;
/*
* Set colour lookup table. The first entry has already been zeroed out.
*/
if (pATI->depth > 8)
for (Index = 1; Index < (NumberOf(pATIHW->lut) / 3); Index++)
{
Index2 = Index * 3;
pATIHW->lut[Index2 + 0] =
pATIHW->lut[Index2 + 1] =
pATIHW->lut[Index2 + 2] = Index;
}
else
{
/*
* Initialise hardware colour map so that use of uninitialised
* software colour map entries can easily be seen. For 256-colour
* modes, this doesn't remain effective for very long...
*/
pATIHW->lut[3] = pATIHW->lut[4] = pATIHW->lut[5] = 0xFFU;
for (Index = 2; Index < (NumberOf(pATIHW->lut) / 3); Index++)
{
Index2 = Index * 3;
pATIHW->lut[Index2 + 0] = maxColour;
pATIHW->lut[Index2 + 1] = 0x00U;
pATIHW->lut[Index2 + 2] = maxColour;
}
#ifndef AVOID_CPIO
if (pATI->depth == 1)
{
rgb blackColour = pScreenInfo->display->blackColour,
whiteColour = pScreenInfo->display->whiteColour;
if (blackColour.red > maxColour)
blackColour.red = maxColour;
if (blackColour.green > maxColour)
blackColour.green = maxColour;
if (blackColour.blue > maxColour)
blackColour.blue = maxColour;
if (whiteColour.red > maxColour)
whiteColour.red = maxColour;
if (whiteColour.green > maxColour)
whiteColour.green = maxColour;
if (whiteColour.blue > maxColour)
whiteColour.blue = maxColour;
if ((blackColour.red == whiteColour.red) &&
(blackColour.green == whiteColour.green) &&
(blackColour.blue == whiteColour.blue))
{
blackColour.red ^= maxColour;
blackColour.green ^= maxColour;
blackColour.blue ^= maxColour;
}
pATIHW->lut[(MONO_BLACK * 3) + 0] = blackColour.red;
pATIHW->lut[(MONO_BLACK * 3) + 1] = blackColour.green;
pATIHW->lut[(MONO_BLACK * 3) + 2] = blackColour.blue;
pATIHW->lut[(MONO_WHITE * 3) + 0] = whiteColour.red;
pATIHW->lut[(MONO_WHITE * 3) + 1] = whiteColour.green;
pATIHW->lut[(MONO_WHITE * 3) + 2] = whiteColour.blue;
}
if (pATIHW->crtc == ATI_CRTC_VGA)
{
/* Initialise overscan to black */
Index = pATIHW->attr[17] * 3;
pATIHW->lut[Index + 0] =
pATIHW->lut[Index + 1] =
pATIHW->lut[Index + 2] = 0x00U;
}
#endif /* AVOID_CPIO */
}
}
/*
* ATIDACSave --
*
* This function is called to save the current RAMDAC state into an ATIHWRec
* structure occurrence.
*/
void
ATIDACSave
(
ATIPtr pATI,
ATIHWPtr pATIHW
)
{
int Index;
#ifdef AVOID_CPIO
pATIHW->dac_read = in8(M64_DAC_READ);
DACDelay;
pATIHW->dac_write = in8(M64_DAC_WRITE);
DACDelay;
pATIHW->dac_mask = in8(M64_DAC_MASK);
DACDelay;
/* Save DAC's colour lookup table */
out8(M64_DAC_MASK, 0xFFU);
DACDelay;
out8(M64_DAC_READ, 0x00U);
DACDelay;
for (Index = 0; Index < NumberOf(pATIHW->lut); Index++)
{
pATIHW->lut[Index] = in8(M64_DAC_DATA);
DACDelay;
}
out8(M64_DAC_MASK, pATIHW->dac_mask);
DACDelay;
out8(M64_DAC_READ, pATIHW->dac_read);
DACDelay;
#else /* AVOID_CPIO */
ATISetDACIOPorts(pATI, pATIHW->crtc);
pATIHW->dac_read = inb(pATI->CPIO_DAC_READ);
DACDelay;
pATIHW->dac_write = inb(pATI->CPIO_DAC_WRITE);
DACDelay;
pATIHW->dac_mask = inb(pATI->CPIO_DAC_MASK);
DACDelay;
/* Save DAC's colour lookup table */
outb(pATI->CPIO_DAC_MASK, 0xFFU);
DACDelay;
outb(pATI->CPIO_DAC_READ, 0x00U);
DACDelay;
for (Index = 0; Index < NumberOf(pATIHW->lut); Index++)
{
pATIHW->lut[Index] = inb(pATI->CPIO_DAC_DATA);
DACDelay;
}
outb(pATI->CPIO_DAC_MASK, pATIHW->dac_mask);
DACDelay;
outb(pATI->CPIO_DAC_READ, pATIHW->dac_read);
DACDelay;
#endif /* AVOID_CPIO */
}
/*
* ATIDACSet --
*
* This function loads RAMDAC data from an ATIHWRec structure occurrence.
*/
void
ATIDACSet
(
ATIPtr pATI,
ATIHWPtr pATIHW
)
{
int Index;
#ifdef AVOID_CPIO
/* Load DAC's colour lookup table */
out8(M64_DAC_MASK, 0xFFU);
DACDelay;
out8(M64_DAC_WRITE, 0x00U);
DACDelay;
for (Index = 0; Index < NumberOf(pATIHW->lut); Index++)
{
out8(M64_DAC_DATA, pATIHW->lut[Index]);
DACDelay;
}
out8(M64_DAC_MASK, pATIHW->dac_mask);
DACDelay;
out8(M64_DAC_READ, pATIHW->dac_read);
DACDelay;
out8(M64_DAC_WRITE, pATIHW->dac_write);
DACDelay;
#else /* AVOID_CPIO */
ATISetDACIOPorts(pATI, pATIHW->crtc);
/* Load DAC's colour lookup table */
outb(pATI->CPIO_DAC_MASK, 0xFFU);
DACDelay;
outb(pATI->CPIO_DAC_WRITE, 0x00U);
DACDelay;
for (Index = 0; Index < NumberOf(pATIHW->lut); Index++)
{
outb(pATI->CPIO_DAC_DATA, pATIHW->lut[Index]);
DACDelay;
}
outb(pATI->CPIO_DAC_MASK, pATIHW->dac_mask);
DACDelay;
outb(pATI->CPIO_DAC_READ, pATIHW->dac_read);
DACDelay;
outb(pATI->CPIO_DAC_WRITE, pATIHW->dac_write);
DACDelay;
#endif /* AVOID_CPIO */
}
/*
* ATILoadPalette --
*
* This function updates the RAMDAC's LUT and the in-memory copy of it in
* NewHW.
*/
void
ATILoadPalette
(
ScrnInfoPtr pScreenInfo,
int nColours,
int *Indices,
LOCO *Colours,
VisualPtr pVisual
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
CARD8 *LUTEntry;
int i, j, Index;
if (((pVisual->class | DynamicClass) == DirectColor) &&
((1 << pVisual->nplanes) > (SizeOf(pATI->NewHW.lut) / 3)))
{
int reds = pVisual->redMask >> pVisual->offsetRed;
int greens = pVisual->greenMask >> pVisual->offsetGreen;
int blues = pVisual->blueMask >> pVisual->offsetBlue;
int redShift = 8 - pATI->weight.red;
int greenShift = 8 - pATI->weight.green;
int blueShift = 8 - pATI->weight.blue;
int redMult = 3 << redShift;
int greenMult = 3 << greenShift;
int blueMult = 3 << blueShift;
int minShift;
CARD8 fChanged[SizeOf(pATI->NewHW.lut) / 3];
(void)memset(fChanged, 0, SizeOf(fChanged));
minShift = redShift;
if (minShift > greenShift)
minShift = greenShift;
if (minShift > blueShift)
minShift = blueShift;
for (i = 0; i < nColours; i++)
{
if((Index = Indices[i]) < 0)
continue;
if (Index <= reds)
{
j = Index * redMult;
pATI->NewHW.lut[j + 0] = Colours[Index].red;
fChanged[j / 3] = TRUE;
}
if (Index <= greens)
{
j = Index * greenMult;
pATI->NewHW.lut[j + 1] = Colours[Index].green;
fChanged[j / 3] = TRUE;
}
if (Index <= blues)
{
j = Index * blueMult;
pATI->NewHW.lut[j + 2] = Colours[Index].blue;
fChanged[j / 3] = TRUE;
}
}
if (pScreenInfo->vtSema || pATI->currentMode)
{
/* Rewrite LUT entries that could have been changed */
i = 1 << minShift;
LUTEntry = pATI->NewHW.lut;
for (Index = 0;
Index < (SizeOf(pATI->NewHW.lut) / 3);
Index += i, LUTEntry += i * 3)
{
if (!fChanged[Index])
continue;
#ifdef AVOID_CPIO
out8(M64_DAC_WRITE, Index);
DACDelay;
out8(M64_DAC_DATA, LUTEntry[0]);
DACDelay;
out8(M64_DAC_DATA, LUTEntry[1]);
DACDelay;
out8(M64_DAC_DATA, LUTEntry[2]);
DACDelay;
#else /* AVOID_CPIO */
outb(pATI->CPIO_DAC_WRITE, Index);
DACDelay;
outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
DACDelay;
outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
DACDelay;
outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
DACDelay;
#endif /* AVOID_CPIO */
}
}
}
else
{
for (i = 0; i < nColours; i++)
{
Index = Indices[i];
if ((Index < 0) || (Index >= (SizeOf(pATI->NewHW.lut) / 3)))
continue;
LUTEntry = &pATI->NewHW.lut[Index * 3];
LUTEntry[0] = Colours[Index].red;
LUTEntry[1] = Colours[Index].green;
LUTEntry[2] = Colours[Index].blue;
if (pScreenInfo->vtSema || pATI->currentMode)
{
#ifdef AVOID_CPIO
out8(M64_DAC_WRITE, Index);
DACDelay;
out8(M64_DAC_DATA, LUTEntry[0]);
DACDelay;
out8(M64_DAC_DATA, LUTEntry[1]);
DACDelay;
out8(M64_DAC_DATA, LUTEntry[2]);
DACDelay;
#else /* AVOID_CPIO */
outb(pATI->CPIO_DAC_WRITE, Index);
DACDelay;
outb(pATI->CPIO_DAC_DATA, LUTEntry[0]);
DACDelay;
outb(pATI->CPIO_DAC_DATA, LUTEntry[1]);
DACDelay;
outb(pATI->CPIO_DAC_DATA, LUTEntry[2]);
DACDelay;
#endif /* AVOID_CPIO */
}
}
}
}

View File

@ -0,0 +1,100 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h,v 1.15 2003/01/01 19:16:31 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIDAC_H___
#if !defined(___ATI_H___) && defined(XFree86Module)
# error missing #include "ati.h" before #include "atidac.h"
# undef XFree86Module
#endif
#define ___ATIDAC_H___ 1
#include "aticrtc.h"
#include "atipriv.h"
#include "xf86str.h"
#include "colormapst.h"
/*
* RAMDAC-related definitions.
*/
#define ATI_DAC_MAX_TYPE MaxBits(DACTYPE)
#define ATI_DAC_MAX_SUBTYPE MaxBits(BIOS_INIT_DAC_SUBTYPE)
#define ATI_DAC(_Type, _Subtype) (((_Type) << 4) | (_Subtype))
#define ATI_DAC_ATI68830 ATI_DAC(0x0U, 0x0U)
#define ATI_DAC_SC11483 ATI_DAC(0x1U, 0x0U)
#define ATI_DAC_ATI68875 ATI_DAC(0x2U, 0x0U)
#define ATI_DAC_TVP3026_A ATI_DAC(0x2U, 0x7U)
#define ATI_DAC_GENERIC ATI_DAC(0x3U, 0x0U)
#define ATI_DAC_BT481 ATI_DAC(0x4U, 0x0U)
#define ATI_DAC_ATT20C491 ATI_DAC(0x4U, 0x1U)
#define ATI_DAC_SC15026 ATI_DAC(0x4U, 0x2U)
#define ATI_DAC_MU9C1880 ATI_DAC(0x4U, 0x3U)
#define ATI_DAC_IMSG174 ATI_DAC(0x4U, 0x4U)
#define ATI_DAC_ATI68860_B ATI_DAC(0x5U, 0x0U)
#define ATI_DAC_ATI68860_C ATI_DAC(0x5U, 0x1U)
#define ATI_DAC_TVP3026_B ATI_DAC(0x5U, 0x7U)
#define ATI_DAC_STG1700 ATI_DAC(0x6U, 0x0U)
#define ATI_DAC_ATT20C498 ATI_DAC(0x6U, 0x1U)
#define ATI_DAC_STG1702 ATI_DAC(0x7U, 0x0U)
#define ATI_DAC_SC15021 ATI_DAC(0x7U, 0x1U)
#define ATI_DAC_ATT21C498 ATI_DAC(0x7U, 0x2U)
#define ATI_DAC_STG1703 ATI_DAC(0x7U, 0x3U)
#define ATI_DAC_CH8398 ATI_DAC(0x7U, 0x4U)
#define ATI_DAC_ATT20C408 ATI_DAC(0x7U, 0x5U)
#define ATI_DAC_INTERNAL ATI_DAC(0x8U, 0x0U)
#define ATI_DAC_IBMRGB514 ATI_DAC(0x9U, 0x0U)
#define ATI_DAC_UNKNOWN ATI_DAC((ATI_DAC_MAX_TYPE << 2) + 3, \
ATI_DAC_MAX_SUBTYPE)
extern const SymTabRec ATIDACDescriptors[];
#ifdef AVOID_CPIO
# define DACDelay /* Nothing */
#else /* AVOID_CPIO */
# define DACDelay \
do \
{ \
(void)inb(pATI->CPIO_DAC_WAIT); \
(void)inb(pATI->CPIO_DAC_WAIT); \
} while (0)
extern void ATISetDACIOPorts(ATIPtr, ATICRTCType);
#endif /* AVOID_CPIO */
extern CARD8 ATIGetDACCmdReg(ATIPtr);
extern void ATIDACPreInit(ScrnInfoPtr, ATIPtr, ATIHWPtr);
extern void ATIDACSave(ATIPtr, ATIHWPtr);
extern void ATIDACSet(ATIPtr, ATIHWPtr);
extern void ATILoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
#endif /* ___ATIDAC_H___ */

View File

@ -0,0 +1,51 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c,v 1.1 2003/07/24 22:08:28 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atidecoder.h"
/*
* Video decoder definitions.
*/
const char *ATIDecoderNames[] =
{
"No decoder",
"BrookTree BT819",
"Brooktree BT829",
"Brooktree BT829A",
"Philips SA7111",
"Philips SA7112",
"ATI Rage Theater",
"Unknown type (7)",
"Unknown type (8)",
"Unknown type (9)",
"Unknown type (10)",
"Unknown type (11)",
"Unknown type (12)",
"Unknown type (13)",
"Unknown type (14)",
"Unknown type (15)"
};

View File

@ -0,0 +1,52 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h,v 1.1 2003/07/24 22:08:28 tsi Exp $ */
/*
* Copyright 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIDECODER_H___
#define ___ATIDECODER_H___ 1
/*
* Video decoder definitions.
*/
typedef enum
{
ATI_DECODER_NONE,
ATI_DECODER_BT819,
ATI_DECODER_BT829,
ATI_DECODER_BT829A,
ATI_DECODER_SA7111,
ATI_DECODER_SA7112,
ATI_DECODER_THEATER,
ATI_DECODER_7,
ATI_DECODER_8,
ATI_DECODER_9,
ATI_DECODER_10,
ATI_DECODER_11,
ATI_DECODER_12,
ATI_DECODER_13,
ATI_DECODER_14,
ATI_DECODER_15
} ATIDecoderType;
extern const char *ATIDecoderNames[];
#endif /* ___ATIDECODER_H___ */

View File

@ -0,0 +1,499 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c,v 1.10 2003/04/23 21:51:27 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef AVOID_DGA
#include <string.h>
#include "ati.h"
#include "atiadjust.h"
#include "atichip.h"
#include "atidac.h"
#include "atidga.h"
#include "atiident.h"
#include "atimode.h"
#include "atistruct.h"
#include "dgaproc.h"
/*
* ATIDGAOpenFramebuffer --
*
* This function returns various framebuffer attributes to a DGA client.
*/
static Bool
ATIDGAOpenFramebuffer
(
ScrnInfoPtr pScreenInfo,
char **DeviceName,
unsigned char **ApertureBase,
int *ApertureSize,
int *ApertureOffset,
int *flags
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
*DeviceName = NULL; /* No special device */
*ApertureBase = (unsigned char *)(pATI->LinearBase);
*ApertureSize = pScreenInfo->videoRam * 1024;
*ApertureOffset = 0; /* Always */
*flags = 0; /* Root premissions OS-dependent */
return TRUE;
}
static int
BitsSet
(
unsigned long data
)
{
unsigned long mask = 1;
int set = 0;
for (; mask; mask <<= 1)
if (data & mask)
set++;
return set;
}
/*
* ATIDGASetMode --
*
* This function sets a graphics mode for a DGA client.
*/
static Bool
ATIDGASetMode
(
ScrnInfoPtr pScreenInfo,
DGAModePtr pDGAMode
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
DisplayModePtr pMode;
int iScreen = pScreenInfo->scrnIndex;
int frameX0, frameY0;
if (pDGAMode)
{
pMode = pDGAMode->mode;
pATI->depth = pDGAMode->depth;
pATI->bitsPerPixel = pDGAMode->bitsPerPixel;
pATI->displayWidth =
pDGAMode->bytesPerScanline * 8 / pATI->bitsPerPixel;
pATI->weight.red = BitsSet(pDGAMode->red_mask);
pATI->weight.green = BitsSet(pDGAMode->green_mask);
pATI->weight.blue = BitsSet(pDGAMode->blue_mask);
frameX0 = frameY0 = 0;
if (!pATI->currentMode)
pATI->currentMode = pScreenInfo->currentMode;
}
else
{
if (!(pMode = pATI->currentMode))
return TRUE;
pATI->depth = pScreenInfo->depth;
pATI->bitsPerPixel = pScreenInfo->bitsPerPixel;
pATI->displayWidth = pScreenInfo->displayWidth;
pATI->weight = pScreenInfo->weight;
frameX0 = pScreenInfo->frameX0;
frameY0 = pScreenInfo->frameY0;
}
pATI->XModifier = pATI->bitsPerPixel / UnitOf(pATI->bitsPerPixel);
ATIAdjustPreInit(pATI);
ATIModePreInit(pScreenInfo, pATI, &pATI->NewHW);
if (!(*pScreenInfo->SwitchMode)(iScreen, pMode, 0))
return FALSE;
if (!pDGAMode)
pATI->currentMode = NULL;
(*pScreenInfo->AdjustFrame)(iScreen, frameX0, frameY0, 0);
return TRUE;
}
/*
* ATIDGASetViewport --
*
* This function sets the display start address for a DGA client.
*/
static void
ATIDGASetViewport
(
ScrnInfoPtr pScreenInfo,
int x,
int y,
int flags
)
{
(*pScreenInfo->AdjustFrame)(pScreenInfo->pScreen->myNum, x, y, flags);
}
/*
* ATIDGAGetViewport --
*
* This function returns the current status of prior DGA requests to set the
* adapter's display start address.
*/
static int
ATIDGAGetViewport
(
ScrnInfoPtr pScreenInfo
)
{
return 0; /* There are never any pending requests */
}
/*
* ATIDGAFillRect --
*
* This function calls XAA solid fill primitives to fill a rectangle.
*/
static void
ATIDGAFillRect
(
ScrnInfoPtr pScreenInfo,
int x,
int y,
int w,
int h,
unsigned long colour
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
/*FIXME : use EXA if available */
#ifdef USE_XAA
XAAInfoRecPtr pXAAInfo = pATI->pXAAInfo;
(*pXAAInfo->SetupForSolidFill)(pScreenInfo, (int)colour, GXcopy,
(CARD32)(~0));
(*pXAAInfo->SubsequentSolidFillRect)(pScreenInfo, x, y, w, h);
if (pScreenInfo->bitsPerPixel == pATI->bitsPerPixel)
SET_SYNC_FLAG(pXAAInfo);
#endif
}
/*
* ATIDGABlitRect --
*
* This function calls XAA screen-to-screen copy primitives to copy a
* rectangle.
*/
static void
ATIDGABlitRect
(
ScrnInfoPtr pScreenInfo,
int xSrc,
int ySrc,
int w,
int h,
int xDst,
int yDst
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
/*FIXME : use EXA if available */
#ifdef USE_XAA
XAAInfoRecPtr pXAAInfo = pATI->pXAAInfo;
int xdir = ((xSrc < xDst) && (ySrc == yDst)) ? -1 : 1;
int ydir = (ySrc < yDst) ? -1 : 1;
(*pXAAInfo->SetupForScreenToScreenCopy)(pScreenInfo,
xdir, ydir, GXcopy, (CARD32)(~0), -1);
(*pXAAInfo->SubsequentScreenToScreenCopy)(pScreenInfo,
xSrc, ySrc, xDst, yDst, w, h);
if (pScreenInfo->bitsPerPixel == pATI->bitsPerPixel)
SET_SYNC_FLAG(pXAAInfo);
#endif
}
/*
* ATIDGABlitTransRect --
*
* This function calls XAA screen-to-screen copy primitives to transparently
* copy a rectangle.
*/
static void
ATIDGABlitTransRect
(
ScrnInfoPtr pScreenInfo,
int xSrc,
int ySrc,
int w,
int h,
int xDst,
int yDst,
unsigned long colour
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
/*FIXME : use EXA if available */
#ifdef USE_XAA
XAAInfoRecPtr pXAAInfo = pATI->pXAAInfo;
int xdir = ((xSrc < xDst) && (ySrc == yDst)) ? -1 : 1;
int ydir = (ySrc < yDst) ? -1 : 1;
pATI->XAAForceTransBlit = TRUE;
(*pXAAInfo->SetupForScreenToScreenCopy)(pScreenInfo,
xdir, ydir, GXcopy, (CARD32)(~0), (int)colour);
pATI->XAAForceTransBlit = FALSE;
(*pXAAInfo->SubsequentScreenToScreenCopy)(pScreenInfo,
xSrc, ySrc, xDst, yDst, w, h);
if (pScreenInfo->bitsPerPixel == pATI->bitsPerPixel)
SET_SYNC_FLAG(pXAAInfo);
#endif
}
/*
* ATIDGAAddModes --
*
* This function translates DisplayModeRec's into DGAModeRec's.
*/
static void
ATIDGAAddModes
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI,
int flags,
int depth,
int bitsPerPixel,
int redMask,
int greenMask,
int blueMask,
int visualClass
)
{
DisplayModePtr pMode = pScreenInfo->modes;
DGAModePtr pDGAMode;
int displayWidth = pScreenInfo->displayWidth;
int videoBits = pScreenInfo->videoRam * 1024 * 8;
int xViewportStep = 64 / UnitOf(bitsPerPixel);
int modePitch, bitsPerScanline, maxViewportY;
if (bitsPerPixel != pScreenInfo->bitsPerPixel)
displayWidth = 0;
while (1)
{
/* Weed out multiscanned modes */
if ((pMode->VScan <= 1) ||
((pMode->VScan == 2) && !(pMode->Flags & V_DBLSCAN)))
{
/*
* For code simplicity, ensure DGA mode pitch is a multiple of 64
* bytes.
*/
if (!(modePitch = displayWidth))
{
modePitch = ((64 * 8) / UnitOf(bitsPerPixel)) - 1;
modePitch = (pMode->HDisplay + modePitch) & ~modePitch;
}
/* Ensure the mode fits in video memory */
if ((modePitch * bitsPerPixel * pMode->VDisplay) <= videoBits)
{
/* Stop generating modes on out-of-memory conditions */
pDGAMode = xrealloc(pATI->pDGAMode,
(pATI->nDGAMode + 1) * SizeOf(DGAModeRec));
if (!pDGAMode)
break;
pATI->pDGAMode = pDGAMode;
pDGAMode += pATI->nDGAMode;
pATI->nDGAMode++;
(void)memset(pDGAMode, 0, SizeOf(DGAModeRec));
/* Fill in the mode structure */
pDGAMode->mode = pMode;
pDGAMode->flags = flags;
if (bitsPerPixel == pScreenInfo->bitsPerPixel)
{
pDGAMode->flags |= DGA_PIXMAP_AVAILABLE;
pDGAMode->address = pATI->pMemory;
#ifdef USE_XAA
if (pATI->pXAAInfo)
pDGAMode->flags &= ~DGA_CONCURRENT_ACCESS;
#endif
}
if ((pMode->Flags & V_DBLSCAN) || (pMode->VScan > 1))
pDGAMode->flags |= DGA_DOUBLESCAN;
if (pMode->Flags & V_INTERLACE)
pDGAMode->flags |= DGA_INTERLACED;
pDGAMode->byteOrder = pScreenInfo->imageByteOrder;
pDGAMode->depth = depth;
pDGAMode->bitsPerPixel = bitsPerPixel;
pDGAMode->red_mask = redMask;
pDGAMode->green_mask = greenMask;
pDGAMode->blue_mask = blueMask;
pDGAMode->visualClass = visualClass;
pDGAMode->viewportWidth = pMode->HDisplay;
pDGAMode->viewportHeight = pMode->VDisplay;
pDGAMode->xViewportStep = xViewportStep;
pDGAMode->yViewportStep = 1;
bitsPerScanline = modePitch * bitsPerPixel;
pDGAMode->bytesPerScanline = bitsPerScanline / 8;
pDGAMode->imageWidth = pDGAMode->pixmapWidth = modePitch;
pDGAMode->imageHeight = pDGAMode->pixmapHeight =
videoBits / bitsPerScanline;
pDGAMode->maxViewportX =
pDGAMode->imageWidth - pDGAMode->viewportWidth;
pDGAMode->maxViewportY =
pDGAMode->imageHeight - pDGAMode->viewportHeight;
maxViewportY =
((((pATI->AdjustMaxBase * 8) / bitsPerPixel) +
xViewportStep) / modePitch) - 1;
if (maxViewportY < pDGAMode->maxViewportY)
pDGAMode->maxViewportY = maxViewportY;
}
}
if ((pMode = pMode->next) == pScreenInfo->modes)
{
if (!displayWidth)
break;
displayWidth = 0;
}
}
}
/*
* ATIDGAInit --
*
* This function initialises the driver's support for the DGA extension.
*/
Bool
ATIDGAInit
(
ScreenPtr pScreen,
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
#ifdef USE_XAA
XAAInfoRecPtr pXAAInfo;
#endif
int flags;
if (!pATI->nDGAMode)
{
#ifndef AVOID_CPIO
/*
* Contrary to previous extension versions, DGA 2 does not support
* banked framebuffers. Also, disable DGA when non-DGA server modes
* are planar.
*/
if (pATI->BankInfo.BankSize || (pScreenInfo->depth <= 4))
return FALSE;
#endif /* AVOID_CPIO */
/* Set up DGA callbacks */
pATI->ATIDGAFunctions.OpenFramebuffer = ATIDGAOpenFramebuffer;
pATI->ATIDGAFunctions.SetMode = ATIDGASetMode;
pATI->ATIDGAFunctions.SetViewport = ATIDGASetViewport;
pATI->ATIDGAFunctions.GetViewport = ATIDGAGetViewport;
flags = 0;
#ifdef USE_XAA
if ((pXAAInfo = pATI->pXAAInfo))
{
pATI->ATIDGAFunctions.Sync = pXAAInfo->Sync;
if (pXAAInfo->SetupForSolidFill &&
pXAAInfo->SubsequentSolidFillRect)
{
flags |= DGA_FILL_RECT;
pATI->ATIDGAFunctions.FillRect = ATIDGAFillRect;
}
if (pXAAInfo->SetupForScreenToScreenCopy &&
pXAAInfo->SubsequentScreenToScreenCopy)
{
flags |= DGA_BLIT_RECT | DGA_BLIT_RECT_TRANS;
pATI->ATIDGAFunctions.BlitRect = ATIDGABlitRect;
pATI->ATIDGAFunctions.BlitTransRect = ATIDGABlitTransRect;
}
}
#endif
if (!flags)
flags = DGA_CONCURRENT_ACCESS;
ATIDGAAddModes(pScreenInfo, pATI, flags,
8, 8, 0, 0, 0, PseudoColor);
if ((pATI->Chip >= ATI_CHIP_264CT) &&
(pATI->Chipset == ATI_CHIPSET_ATI))
{
ATIDGAAddModes(pScreenInfo, pATI, flags,
15, 16, 0x7C00U, 0x03E0U, 0x001FU, TrueColor);
ATIDGAAddModes(pScreenInfo, pATI, flags,
16, 16, 0xF800U, 0x07E0U, 0x001FU, TrueColor);
ATIDGAAddModes(pScreenInfo, pATI, flags,
24, 24, 0x00FF0000U, 0x0000FF00U, 0x000000FFU, TrueColor);
ATIDGAAddModes(pScreenInfo, pATI, flags,
24, 32, 0x00FF0000U, 0x0000FF00U, 0x000000FFU, TrueColor);
if (pATI->DAC != ATI_DAC_INTERNAL) /* Not first revision */
{
ATIDGAAddModes(pScreenInfo, pATI, flags,
15, 16, 0x7C00U, 0x03E0U, 0x001FU, DirectColor);
ATIDGAAddModes(pScreenInfo, pATI, flags,
16, 16, 0xF800U, 0x07E0U, 0x001FU, DirectColor);
ATIDGAAddModes(pScreenInfo, pATI, flags,
24, 24, 0x00FF0000U, 0x0000FF00U, 0x000000FFU, DirectColor);
ATIDGAAddModes(pScreenInfo, pATI, flags,
24, 32, 0x00FF0000U, 0x0000FF00U, 0x000000FFU, DirectColor);
}
}
}
return DGAInit(pScreen, &pATI->ATIDGAFunctions, pATI->pDGAMode,
pATI->nDGAMode);
}
#endif /* AVOID_DGA */

View File

@ -0,0 +1,37 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h,v 1.7 2003/04/23 21:51:28 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIDGA_H___
#define ___ATIDGA_H___ 1
#ifndef AVOID_DGA
#include "atipriv.h"
#include "xf86str.h"
extern Bool ATIDGAInit(ScreenPtr, ScrnInfoPtr, ATIPtr);
#endif /* AVOID_DGA */
#endif /* ___ATIDGA_H___ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
/*
* Copyright 2000 Gareth Hughes
* 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
* GARETH HUGHES 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.
*/
/*
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifndef __ATIDRI_H__
#define __ATIDRI_H__ 1
/* DRI driver defaults */
#define ATI_DEFAULT_AGP_SIZE 8 /* MB (must be a power of 2 and > 4MB) */
#define ATI_DEFAULT_AGP_MODE 1
#define ATI_DEFAULT_BUFFER_SIZE 2 /* MB (must be page aligned) */
#define ATI_AGP_MAX_MODE 2
/* Imported from the radeon suspend code writen by cpbotha@ieee.org
* to enable suspend/resume support for the mach64 card.
*/
extern void ATIDRIResume(ScreenPtr pScreen);
extern Bool ATIDRIScreenInit(ScreenPtr);
extern Bool ATIDRIFinishScreenInit(ScreenPtr);
extern void ATIDRICloseScreen(ScreenPtr);
#endif /* __ATIDRI_H__ */

View File

@ -0,0 +1,57 @@
/* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
* VA Linux Systems Inc., Fremont, California.
*
* 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 on 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
* NON-INFRINGEMENT. IN NO EVENT SHALL ATI, PRECISION INSIGHT, VA LINUX
* SYSTEMS AND/OR THEIR SUPPLIERS 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.
*/
/*
* Authors:
* Gareth Hughes <gareth@valinux.com>
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifndef __ATIDRIPRIV_H__
#define __ATIDRIPRIV_H__ 1
#include "GL/glxint.h"
#include "GL/glxtokens.h"
#define ATI_MAX_DRAWABLES 256
typedef struct {
/* Nothing here yet */
int dummy;
} ATIConfigPrivRec, *ATIConfigPrivPtr;
typedef struct {
/* Nothing here yet */
int dummy;
} ATIDRIContextRec, *ATIDRIContextPtr;
extern void GlxSetVisualConfigs(int, __GLXvisualConfig *, void **);
#endif /* __ATIDRIPRIV_H__ */

View File

@ -0,0 +1,332 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c,v 1.21 2003/09/24 02:43:18 dawes Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atichip.h"
#include "aticrtc.h"
#include "atidsp.h"
#include "atimach64io.h"
#include "atividmem.h"
/*
* ATIDSPPreInit --
*
* This function initialises global variables used to set DSP registers on a
* VT-B or later.
*/
Bool
ATIDSPPreInit
(
int iScreen,
ATIPtr pATI
)
{
CARD32 IOValue, dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off;
int trp;
/*
* VT-B's and later have additional post-dividers that are not powers of
* two.
*/
pATI->ClockDescriptor.NumD = 8;
/* Retrieve XCLK settings */
IOValue = ATIMach64GetPLLReg(PLL_XCLK_CNTL);
pATI->XCLKPostDivider = GetBits(IOValue, PLL_XCLK_SRC_SEL);
pATI->XCLKReferenceDivider = 1;
switch (pATI->XCLKPostDivider)
{
case 0: case 1: case 2: case 3:
break;
case 4:
pATI->XCLKReferenceDivider = 3;
pATI->XCLKPostDivider = 0;
break;
default:
xf86DrvMsg(iScreen, X_ERROR,
"Unsupported XCLK source: %d.\n", pATI->XCLKPostDivider);
return FALSE;
}
pATI->XCLKPostDivider -= GetBits(IOValue, PLL_MFB_TIMES_4_2B);
pATI->XCLKFeedbackDivider = ATIMach64GetPLLReg(PLL_MCLK_FB_DIV);
xf86DrvMsgVerb(iScreen, X_INFO, 2,
"Engine XCLK %.3f MHz; Refresh rate code %ld.\n",
ATIDivide(pATI->XCLKFeedbackDivider * pATI->ReferenceNumerator,
pATI->XCLKReferenceDivider * pATI->ClockDescriptor.MaxM *
pATI->ReferenceDenominator, 1 - pATI->XCLKPostDivider, 0) /
(double)1000.0,
GetBits(pATI->LockData.mem_cntl, CTL_MEM_REFRESH_RATE_B));
/* Compute maximum RAS delay and friends */
trp = GetBits(pATI->LockData.mem_cntl, CTL_MEM_TRP);
pATI->XCLKPageFaultDelay = GetBits(pATI->LockData.mem_cntl, CTL_MEM_TRCD) +
GetBits(pATI->LockData.mem_cntl, CTL_MEM_TCRD) + trp + 2;
pATI->XCLKMaxRASDelay = GetBits(pATI->LockData.mem_cntl, CTL_MEM_TRAS) +
trp + 2;
pATI->DisplayFIFODepth = 32;
if (pATI->Chip < ATI_CHIP_264VT4)
{
pATI->XCLKPageFaultDelay += 2;
pATI->XCLKMaxRASDelay += 3;
pATI->DisplayFIFODepth = 24;
}
switch (pATI->MemoryType)
{
case MEM_264_DRAM:
if (pATI->VideoRAM <= 1024)
{
pATI->DisplayLoopLatency = 10;
}
else
{
pATI->DisplayLoopLatency = 8;
pATI->XCLKPageFaultDelay += 2;
}
break;
case MEM_264_EDO:
case MEM_264_PSEUDO_EDO:
if (pATI->VideoRAM <= 1024)
{
pATI->DisplayLoopLatency = 9;
}
else
{
pATI->DisplayLoopLatency = 8;
pATI->XCLKPageFaultDelay++;
}
break;
case MEM_264_SDRAM:
if (pATI->VideoRAM <= 1024)
{
pATI->DisplayLoopLatency = 11;
}
else
{
pATI->DisplayLoopLatency = 10;
pATI->XCLKPageFaultDelay++;
}
break;
case MEM_264_SGRAM:
pATI->DisplayLoopLatency = 8;
pATI->XCLKPageFaultDelay += 3;
break;
default: /* Set maximums */
pATI->DisplayLoopLatency = 11;
pATI->XCLKPageFaultDelay += 3;
break;
}
if (pATI->XCLKMaxRASDelay <= pATI->XCLKPageFaultDelay)
pATI->XCLKMaxRASDelay = pATI->XCLKPageFaultDelay + 1;
/* Allow BIOS to override */
dsp_config = inr(DSP_CONFIG);
dsp_on_off = inr(DSP_ON_OFF);
vga_dsp_config = inr(VGA_DSP_CONFIG);
vga_dsp_on_off = inr(VGA_DSP_ON_OFF);
if (dsp_config)
pATI->DisplayLoopLatency = GetBits(dsp_config, DSP_LOOP_LATENCY);
if ((!dsp_on_off && (pATI->Chip < ATI_CHIP_264GTPRO)) ||
((dsp_on_off == vga_dsp_on_off) &&
(!dsp_config || !((dsp_config ^ vga_dsp_config) & DSP_XCLKS_PER_QW))))
{
if (ATIDivide(GetBits(vga_dsp_on_off, VGA_DSP_OFF),
GetBits(vga_dsp_config, VGA_DSP_XCLKS_PER_QW), 5, 1) > 24)
pATI->DisplayFIFODepth = 32;
else
pATI->DisplayFIFODepth = 24;
}
return TRUE;
}
/*
* ATIDSPSave --
*
* This function is called to remember DSP register values on VT-B and later
* controllers.
*/
void
ATIDSPSave
(
ATIPtr pATI,
ATIHWPtr pATIHW
)
{
pATIHW->dsp_on_off = inr(DSP_ON_OFF);
pATIHW->dsp_config = inr(DSP_CONFIG);
}
/*
* ATIDSPCalculate --
*
* This function sets up DSP register values for a VTB or later. Note that
* this would be slightly different if VCLK 0 or 1 were used for the mode
* instead. In that case, this function would set VGA_DSP_CONFIG and
* VGA_DSP_ON_OFF, would have to zero out DSP_CONFIG and DSP_ON_OFF, and would
* have to consider that VGA_DSP_CONFIG is partitioned slightly differently
* than DSP_CONFIG.
*/
void
ATIDSPCalculate
(
ATIPtr pATI,
ATIHWPtr pATIHW,
DisplayModePtr pMode
)
{
int Multiplier, Divider;
int RASMultiplier = pATI->XCLKMaxRASDelay, RASDivider = 1;
int dsp_precision, dsp_on, dsp_off, dsp_xclks;
int tmp, vshift, xshift;
# define Maximum_DSP_PRECISION ((int)MaxBits(DSP_PRECISION))
/* Compute a memory-to-screen bandwidth ratio */
Multiplier = pATI->XCLKFeedbackDivider *
pATI->ClockDescriptor.PostDividers[pATIHW->PostDivider];
Divider = pATIHW->FeedbackDivider * pATI->XCLKReferenceDivider;
#ifndef AVOID_CPIO
if (pATI->depth >= 8)
#endif /* AVOID_CPIO */
{
Divider *= pATI->bitsPerPixel / 4;
}
/* Start by assuming a display FIFO width of 64 bits */
vshift = (6 - 2) - pATI->XCLKPostDivider;
#ifndef AVOID_CPIO
if (pATIHW->crtc == ATI_CRTC_VGA)
vshift--; /* Nope, it's 32 bits wide */
#endif /* AVOID_CPIO */
if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0))
{
/* Compensate for horizontal stretching */
Multiplier *= pATI->LCDHorizontal;
Divider *= pMode->HDisplay & ~7;
RASMultiplier *= pATI->LCDHorizontal;
RASDivider *= pMode->HDisplay & ~7;
}
/* Determine dsp_precision first */
tmp = ATIDivide(Multiplier * pATI->DisplayFIFODepth, Divider, vshift, -1);
for (dsp_precision = -5; tmp; dsp_precision++)
tmp >>= 1;
if (dsp_precision < 0)
dsp_precision = 0;
else if (dsp_precision > Maximum_DSP_PRECISION)
dsp_precision = Maximum_DSP_PRECISION;
xshift = 6 - dsp_precision;
vshift += xshift;
/* Move on to dsp_off */
dsp_off = ATIDivide(Multiplier * (pATI->DisplayFIFODepth - 1), Divider,
vshift, -1) - ATIDivide(1, 1, vshift - xshift, 1);
/* Next is dsp_on */
#ifndef AVOID_CPIO
if ((pATIHW->crtc == ATI_CRTC_VGA) /* && (dsp_precision < 3) */)
{
/*
* TODO: I don't yet know why something like this appears necessary.
* But I don't have time to explore this right now.
*/
dsp_on = ATIDivide(Multiplier * 5, Divider, vshift + 2, 1);
}
else
#endif /* AVOID_CPIO */
{
dsp_on = ATIDivide(Multiplier, Divider, vshift, 1);
tmp = ATIDivide(RASMultiplier, RASDivider, xshift, 1);
if (dsp_on < tmp)
dsp_on = tmp;
dsp_on += (tmp * 2) +
ATIDivide(pATI->XCLKPageFaultDelay, 1, xshift, 1);
}
/* Calculate rounding factor and apply it to dsp_on */
tmp = ((1 << (Maximum_DSP_PRECISION - dsp_precision)) - 1) >> 1;
dsp_on = ((dsp_on + tmp) / (tmp + 1)) * (tmp + 1);
if (dsp_on >= ((dsp_off / (tmp + 1)) * (tmp + 1)))
{
dsp_on = dsp_off - ATIDivide(Multiplier, Divider, vshift, -1);
dsp_on = (dsp_on / (tmp + 1)) * (tmp + 1);
}
/* Last but not least: dsp_xclks */
dsp_xclks = ATIDivide(Multiplier, Divider, vshift + 5, 1);
/* Build DSP register contents */
pATIHW->dsp_on_off = SetBits(dsp_on, DSP_ON) |
SetBits(dsp_off, DSP_OFF);
pATIHW->dsp_config = SetBits(dsp_precision, DSP_PRECISION) |
SetBits(dsp_xclks, DSP_XCLKS_PER_QW) |
SetBits(pATI->DisplayLoopLatency, DSP_LOOP_LATENCY);
}
/*
* ATIDSPSet --
*
* This function is called to set DSP registers on VT-B and later controllers.
*/
void
ATIDSPSet
(
ATIPtr pATI,
ATIHWPtr pATIHW
)
{
outr(DSP_ON_OFF, pATIHW->dsp_on_off);
outr(DSP_CONFIG, pATIHW->dsp_config);
}

View File

@ -0,0 +1,36 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h,v 1.10 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIDSP_H___
#define ___ATIDSP_H___ 1
#include "atipriv.h"
#include "xf86str.h"
extern Bool ATIDSPPreInit(int, ATIPtr);
extern void ATIDSPSave(ATIPtr, ATIHWPtr);
extern void ATIDSPCalculate(ATIPtr, ATIHWPtr, DisplayModePtr);
extern void ATIDSPSet(ATIPtr, ATIHWPtr);
#endif /* ___ATIDSP_H___ */

View File

@ -0,0 +1,48 @@
/*
* Copyright 2004 Adam Jackson.
*
* 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
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS 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.
*/
/*
* atifillin.c: fill in a ScrnInfoPtr with the relevant information for
* atimisc.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atifillin.h"
_X_EXPORT void ATIFillInScreenInfo(ScrnInfoPtr pScreenInfo)
{
pScreenInfo->driverVersion = ATI_VERSION_CURRENT;
pScreenInfo->driverName = ATI_DRIVER_NAME;
pScreenInfo->name = ATI_NAME;
pScreenInfo->Probe = ATIProbe;
pScreenInfo->PreInit = ATIPreInit;
pScreenInfo->ScreenInit = ATIScreenInit;
pScreenInfo->SwitchMode = ATISwitchMode;
pScreenInfo->AdjustFrame = ATIAdjustFrame;
pScreenInfo->EnterVT = ATIEnterVT;
pScreenInfo->LeaveVT = ATILeaveVT;
pScreenInfo->FreeScreen = ATIFreeScreen;
pScreenInfo->ValidMode = ATIValidMode;
}

View File

@ -0,0 +1,42 @@
/*
* Copyright 2004 Adam Jackson.
*
* 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
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS 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.
*/
/*
* atifillin.h: header for atifillin.c.
*/
#ifndef ATI_FILLIN_H
#define ATI_FILLIN_H
/* include headers corresponding to fields touched by ATIFillInScreenInfo() */
#include "ativersion.h"
#include "atiprobe.h"
#include "atipreinit.h"
#include "atiscreen.h"
#include "aticonsole.h"
#include "atiadjust.h"
#include "ativalid.h"
extern void ATIFillInScreenInfo(ScrnInfoPtr);
#endif

View File

@ -0,0 +1,410 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c,v 1.3 2003/11/10 18:41:20 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atiadapter.h"
#include "atii2c.h"
#include "atiload.h"
#include "atimach64i2c.h"
#include "atistruct.h"
#include "xf86.h"
/* This is derived from GATOS code, with a liberal sprinkling of bug fixes */
/*
* Some local macros for use by the mid-level I2C functions.
*/
#define ATII2CDelay \
(*pI2CBus->I2CUDelay)(pI2CBus, pI2CBus->HoldTime)
#define ATII2CSCLDirOff \
if (pATII2C->SCLDir != 0) \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur & ~pATII2C->SCLDir)
#define ATII2CSCLDirOn \
if (pATII2C->SCLDir != 0) \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur | pATII2C->SCLDir)
#define ATII2CSDADirOff \
if (pATII2C->SDADir != 0) \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur & ~pATII2C->SDADir)
#define ATII2CSDADirOn \
if (pATII2C->SDADir != 0) \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur | pATII2C->SDADir)
#define ATII2CSCLBitGet \
((*pATII2C->I2CGetBits)(pATI) & pATII2C->SCLGet)
#define ATII2CSCLBitOff \
do \
{ \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur & ~pATII2C->SCLSet); \
ATII2CDelay; \
} while (0)
#define ATII2CSCLBitOn \
do \
{ \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur | pATII2C->SCLSet); \
do /* Wait until all devices have released SCL */ \
{ \
ATII2CDelay; \
} while (ATII2CSCLBitGet == 0); \
} while (0)
#define ATII2CSDABitGet \
((*pATII2C->I2CGetBits)(pATI) & pATII2C->SDAGet)
#define ATII2CSDABitOff \
do \
{ \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur & ~pATII2C->SDASet); \
ATII2CDelay; \
} while (0)
#define ATII2CSDABitOn \
do \
{ \
(*pATII2C->I2CSetBits)(pATII2C, pATI, \
pATII2C->I2CCur | pATII2C->SDASet); \
ATII2CDelay; \
} while (0)
#define ATII2CSDABitSet(_flag) \
do \
{ \
if (_flag) \
ATII2CSDABitOn; \
else \
ATII2CSDABitOff; \
} while (0)
/*
* ATII2CStart --
*
* This function puts a start signal on the I2C bus.
*/
static Bool
ATII2CStart
(
I2CBusPtr pI2CBus,
int timeout
)
{
ATII2CPtr pATII2C = pI2CBus->DriverPrivate.ptr;
ATIPtr pATI = pATII2C->pATI;
(void)timeout;
/*
* Set I2C line directions to out-bound. SCL will remain out-bound until
* next I2C Stop.
*/
ATII2CSCLDirOn;
ATII2CSDADirOn;
/*
* Send Start bit. This is a pull-down of the data line while the clock
* line is pulled up.
*/
ATII2CSDABitOn;
ATII2CSCLBitOn;
ATII2CSDABitOff;
ATII2CSCLBitOff;
return TRUE;
}
/*
* ATII2CAddress --
*
* This function puts an 8-bit address on the I2C bus.
*/
static Bool
ATII2CAddress
(
I2CDevPtr pI2CDev,
I2CSlaveAddr Address
)
{
I2CBusPtr pI2CBus = pI2CDev->pI2CBus;
/* Send low byte of device address */
if ((*pI2CBus->I2CPutByte)(pI2CDev, (I2CByte)Address))
{
/* Send top byte of address, if appropriate */
if (((Address & 0x00F8U) != 0x00F0U) &&
((Address & 0x00FEU) != 0x0000U))
return TRUE;
if ((*pI2CBus->I2CPutByte)(pI2CDev, (I2CByte)(Address >> 8)))
return TRUE;
}
/* Kill I2C transaction on failure */
(*pI2CBus->I2CStop)(pI2CDev);
return FALSE;
}
/*
* ATII2CStop --
*
* This function puts a stop signal on the I2C bus.
*/
static void
ATII2CStop
(
I2CDevPtr pI2CDev
)
{
I2CBusPtr pI2CBus = pI2CDev->pI2CBus;
ATII2CPtr pATII2C = pI2CBus->DriverPrivate.ptr;
ATIPtr pATI = pATII2C->pATI;
ATII2CSDADirOn; /* Set data line direction to out-bound */
/*
* Send Stop bit. This is a pull-up of the data line while the clock line
* is pulled up.
*/
ATII2CSDABitOff;
ATII2CSCLBitOn;
ATII2CSDABitOn;
ATII2CSCLBitOff;
/* Reset I2C line directions to in-bound */
ATII2CSCLDirOff;
ATII2CSDADirOff;
}
/*
* ATII2CPutByte --
*
* This function puts an 8-bit value on the I2C bus, starting with its MSB.
*/
static Bool
ATII2CPutByte
(
I2CDevPtr pI2CDev,
I2CByte Data
)
{
I2CBusPtr pI2CBus = pI2CDev->pI2CBus;
ATII2CPtr pATII2C = pI2CBus->DriverPrivate.ptr;
ATIPtr pATI = pATII2C->pATI;
int i;
Bool Result;
ATII2CSDADirOn; /* Set data line direction to out-bound */
/* Send data byte */
for (i = 0; i < 8; i++)
{
ATII2CSDABitSet(Data & 0x80U);
ATII2CSCLBitOn;
ATII2CSCLBitOff;
Data <<= 1;
}
ATII2CSDABitOn; /* Release data line */
ATII2CSDADirOff; /* Set data line direction to in-bound */
ATII2CSCLBitOn; /* Start bit-read clock pulse */
/* Get [N]ACK bit */
if (ATII2CSDABitGet)
Result = FALSE;
else
Result = TRUE;
ATII2CSCLBitOff; /* End clock pulse */
return Result;
}
/*
* ATII2CGetByte --
*
* This function retrieves an 8-bit value from the I2C bus.
*/
static Bool
ATII2CGetByte
(
I2CDevPtr pI2CDev,
I2CByte *pData,
Bool Last
)
{
I2CBusPtr pI2CBus = pI2CDev->pI2CBus;
ATII2CPtr pATII2C = pI2CBus->DriverPrivate.ptr;
ATIPtr pATI = pATII2C->pATI;
unsigned long Value = 1;
do
{
ATII2CSCLBitOn; /* Start bit-read clock pulse */
/* Accumulate bit into byte value */
Value <<= 1;
if (ATII2CSDABitGet)
Value++;
ATII2CSCLBitOff; /* End clock pulse */
} while (Value <= (unsigned long)((I2CByte)(-1)));
*pData = (I2CByte)Value;
ATII2CSDADirOn; /* Set data line direction to out-bound */
/* Send [N]ACK bit */
ATII2CSDABitSet(Last);
ATII2CSCLBitOn;
ATII2CSCLBitOff;
if (!Last)
ATII2CSDABitOn; /* Release data line */
ATII2CSDADirOff; /* Set data line direction to in-bound */
return TRUE;
}
/*
* ATICreateI2CBusRec --
*
* This function is called to initialise an I2CBusRec.
*/
I2CBusPtr
ATICreateI2CBusRec
(
int iScreen,
ATIPtr pATI,
char *BusName
)
{
I2CBusPtr pI2CBus;
ATII2CPtr pATII2C = xnfcalloc(1, SizeOf(ATII2CRec));
if (!(pI2CBus = xf86CreateI2CBusRec()))
{
xf86DrvMsg(iScreen, X_WARNING, "Unable to allocate I2C Bus record.\n");
xfree(pATII2C);
return NULL;
}
/* Fill in generic structure fields */
pI2CBus->BusName = BusName;
pI2CBus->scrnIndex = iScreen;
pI2CBus->I2CAddress = ATII2CAddress;
pI2CBus->I2CStart = ATII2CStart;
pI2CBus->I2CStop = ATII2CStop;
pI2CBus->I2CPutByte = ATII2CPutByte;
pI2CBus->I2CGetByte = ATII2CGetByte;
pI2CBus->DriverPrivate.ptr = pATII2C;
pATII2C->pATI = pATI;
if (xf86I2CBusInit(pI2CBus))
return pI2CBus;
xf86DrvMsg(iScreen, X_WARNING,
"I2C bus %s initialisation failure.\n", BusName);
xf86DestroyI2CBusRec(pI2CBus, TRUE, TRUE);
xfree(pATII2C);
return NULL;
}
/*
* ATII2CPreInit --
*
* This is called by ATIPreInit() to create I2C bus record(s) for the adapter.
*/
void
ATII2CPreInit
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
switch (pATI->Adapter)
{
case ATI_ADAPTER_MACH64:
if (!ATILoadModule(pScreenInfo, "i2c", ATIi2cSymbols))
return;
ATIMach64I2CPreInit(pScreenInfo, pATI);
break;
default:
break;
}
}
/*
* ATII2CFreeScreen --
*
* This is called by ATIFreeScreen() to remove the driver's I2C interface.
*/
void
ATII2CFreeScreen
(
int iScreen
)
{
I2CBusPtr pI2CBus, *ppI2CBus;
ATII2CPtr pATII2C;
int nI2CBus;
nI2CBus = xf86I2CGetScreenBuses(iScreen, &ppI2CBus);
while (--nI2CBus >= 0)
{
pI2CBus = ppI2CBus[nI2CBus];
pATII2C = pI2CBus->DriverPrivate.ptr;
xf86DestroyI2CBusRec(pI2CBus, TRUE, TRUE);
xfree(pATII2C);
}
xfree(ppI2CBus);
}

View File

@ -0,0 +1,49 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h,v 1.1 2003/07/24 22:08:28 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATII2C_H___
#define ___ATII2C_H___ 1
#include "atipriv.h"
#include "xf86str.h"
#include "xf86i2c.h"
typedef struct _ATII2CRec ATII2CRec, *ATII2CPtr;
struct _ATII2CRec
{
ATIPtr pATI;
void (*I2CSetBits) (ATII2CPtr, ATIPtr, CARD32);
CARD32 (*I2CGetBits) (ATIPtr);
CARD32 SCLDir, SCLGet, SCLSet;
CARD32 SDADir, SDAGet, SDASet;
CARD32 I2CCur;
};
extern void ATII2CPreInit(ScrnInfoPtr, ATIPtr);
extern I2CBusPtr ATICreateI2CBusRec(int, ATIPtr, char *);
extern void ATII2CFreeScreen(int);
#endif /* ___ATII2C_H___ */

View File

@ -0,0 +1,138 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c,v 1.11 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atiident.h"
#include "atiutil.h"
#include "ativersion.h"
#include "r128_probe.h"
#include "radeon_probe.h"
const char *ATIChipsetNames[] =
{
"ati",
#ifndef AVOID_CPIO
"ativga",
"ibmvga",
"ibm8514",
"vgawonder",
"mach8",
"mach32",
#endif /* AVOID_CPIO */
"mach64",
"rage128",
"radeon"
};
static SymTabRec ATIPublicChipsetNames[] =
{
{ATI_CHIPSET_ATI, "ati"},
#ifndef AVOID_CPIO
{ATI_CHIPSET_ATIVGA, "ativga"},
#ifdef __MAYBE_NOT__
{ATI_CHIPSET_IBMVGA, "ibmvga"},
#endif
#ifdef __NOT_YET__
{ATI_CHIPSET_IBM8514, "ibm8514"},
#endif
#endif /* AVOID_CPIO */
{-1, NULL}
};
/*
* ATIIdentify --
*
* Print the driver's list of chipset names.
*/
void
ATIIdentify
(
int flags
)
{
xf86PrintChipsets(ATI_NAME,
(NumberOf(ATIPublicChipsetNames) <= 2) ?
"ATI driver (version " ATI_VERSION_NAME ") for chipset" :
"ATI driver (version " ATI_VERSION_NAME ") for chipsets",
ATIPublicChipsetNames);
R128Identify(flags);
RADEONIdentify(flags);
}
/*
* ATIIdentProbe --
*
* This function determines if the user specified a chipset name acceptable to
* the driver. It returns an ATIChipsetType or -1.
*/
int
ATIIdentProbe
(
const char *ChipsetName
)
{
int Chipset;
static SymTabRec SpecificNames[] =
{
#ifndef AVOID_CPIO
{ATI_CHIPSET_VGAWONDER, "vgawonder"},
#ifdef __NOT_YET__
{ATI_CHIPSET_MACH8, "mach8"},
#endif
{ATI_CHIPSET_MACH32, "mach32"},
#endif /* AVOID_CPIO */
{ATI_CHIPSET_MACH64, "mach64"},
{ATI_CHIPSET_RAGE128, "rage128"},
{ATI_CHIPSET_RADEON, "radeon"},
{-1, NULL}
};
/* If no Chipset specification, default to "ati" */
if (!ChipsetName || !*ChipsetName)
return ATI_CHIPSET_ATI;
Chipset = xf86StringToToken(ATIPublicChipsetNames, ChipsetName);
if (Chipset != -1)
return Chipset;
/* Check for some other chipset names */
return xf86StringToToken(SpecificNames, ChipsetName);
}

View File

@ -0,0 +1,53 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h,v 1.10 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIIDENT_H___
#define ___ATIIDENT_H___ 1
typedef enum
{
ATI_CHIPSET_ATI,
#ifndef AVOID_CPIO
ATI_CHIPSET_ATIVGA,
ATI_CHIPSET_IBMVGA,
ATI_CHIPSET_IBM8514,
ATI_CHIPSET_VGAWONDER,
ATI_CHIPSET_MACH8,
ATI_CHIPSET_MACH32,
#endif /* AVOID_CPIO */
ATI_CHIPSET_MACH64,
ATI_CHIPSET_RAGE128,
ATI_CHIPSET_RADEON,
ATI_CHIPSET_MAX /* Must be last */
} ATIChipsetType;
extern const char *ATIChipsetNames[];
extern void ATIIdentify(int);
extern int ATIIdentProbe(const char *);
#endif /* ___ATIIDENT_H___ */

View File

@ -0,0 +1,83 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h,v 1.14 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIIO_H___
#if !defined(___ATI_H___) && defined(XFree86Module)
# error missing #include "ati.h" before #include "atiio.h"
# undef XFree86Module
#endif
#define ___ATIIO_H___ 1
#include "atiregs.h"
#include "compiler.h"
/* I/O decoding definitions */
typedef enum
{
SPARSE_IO,
BLOCK_IO
} ATIIODecodingType;
#ifndef AVOID_CPIO
/* Wait until "n" queue entries are free */
#define ibm8514WaitQueue(_n) \
{ \
while (inw(GP_STAT) & (0x0100U >> (_n))); \
}
#define ATIWaitQueue(_n) \
{ \
while (inw(EXT_FIFO_STATUS) & (0x010000U >> (_n))); \
}
/* Wait until GP is idle and queue is empty */
#define WaitIdleEmpty() \
{ \
while (inw(GP_STAT) & (GPBUSY | 1)); \
}
#define ProbeWaitIdleEmpty() \
{ \
int _i; \
CARD16 _value; \
for (_i = 0; _i < 100000; _i++) \
{ \
_value = inw(GP_STAT); \
if (_value == (CARD16)(-1)) \
break; \
if (!(_value & (GPBUSY | 1))) \
break; \
} \
}
/* Wait until GP has data available */
#define WaitDataReady() \
{ \
while (!(inw(GP_STAT) & DATARDY)); \
}
#endif /* AVOID_CPIO */
#endif /* ___ATIIO_H___ */

View File

@ -0,0 +1,293 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c,v 1.15 2003/08/29 21:07:57 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef XFree86LOADER
#include "ati.h"
#include "aticursor.h"
#include "atiload.h"
#include "atistruct.h"
/*
* All symbol lists belong here. They are externalised so that they can be
* referenced elsewhere. Note the naming convention for these things...
*/
const char *ATIint10Symbols[] =
{
"xf86FreeInt10",
"xf86InitInt10",
"xf86int10Addr",
NULL
};
const char *ATIddcSymbols[] =
{
"xf86PrintEDID",
"xf86SetDDCproperties",
NULL
};
const char *ATIvbeSymbols[] =
{
"VBEInit",
"vbeDoEDID",
"vbeFree",
NULL
};
#ifndef AVOID_CPIO
const char *ATIxf1bppSymbols[] =
{
"xf1bppScreenInit",
NULL
};
const char *ATIxf4bppSymbols[] =
{
"xf4bppScreenInit",
NULL
};
#endif /* AVOID_CPIO */
#ifdef XF86DRI_DEVEL
const char *ATIdrmSymbols[] = {
"drmAddBufs",
"drmAddMap",
"drmAgpAcquire",
"drmAgpAlloc",
"drmAgpBase",
"drmAgpBind",
"drmAgpDeviceId",
"drmAgpEnable",
"drmAgpFree",
"drmAgpGetMode",
"drmAgpRelease",
"drmAgpUnbind",
"drmAgpVendorId",
"drmAvailable",
"drmCommandNone",
"drmCommandRead",
"drmCommandWrite",
"drmCommandWriteRead",
"drmCtlInstHandler",
"drmCtlUninstHandler",
"drmFreeVersion",
"drmGetInterruptFromBusID",
"drmGetLibVersion",
"drmGetVersion",
"drmMap",
"drmMapBufs",
"drmDMA",
"drmUnmap",
"drmUnmapBufs",
NULL
};
const char *ATIdriSymbols[] = {
"DRICloseScreen",
"DRICreateInfoRec",
"DRIDestroyInfoRec",
"DRIFinishScreenInit",
"DRIGetSAREAPrivate",
"DRILock",
"DRIQueryVersion",
"DRIScreenInit",
"DRIUnlock",
"GlxSetVisualConfigs",
"DRICreatePCIBusID",
NULL
};
#endif /* XF86DRI_DEVEL */
const char *ATIfbSymbols[] =
{
"fbPictureInit",
"fbScreenInit",
NULL
};
const char *ATIshadowfbSymbols[] =
{
"ShadowFBInit",
NULL
};
#ifdef USE_EXA
const char *ATIexaSymbols[] =
{
"exaDriverAlloc",
"exaDriverInit",
"exaDriverFini",
"exaOffscreenAlloc",
"exaOffscreenFree",
NULL
};
#endif
#ifdef USE_XAA
const char *ATIxaaSymbols[] =
{
"XAACreateInfoRec",
"XAADestroyInfoRec",
"XAAInit",
NULL
};
#endif
const char *ATIramdacSymbols[] =
{
"xf86CreateCursorInfoRec",
"xf86DestroyCursorInfoRec",
"xf86InitCursor",
NULL
};
const char *ATIi2cSymbols[] =
{
"xf86CreateI2CBusRec",
"xf86DestroyI2CBusRec",
"xf86I2CBusInit",
"xf86I2CDevInit",
"xf86I2CFindDev",
"xf86I2CGetScreenBuses",
NULL
};
/*
* ATILoadModule --
*
* Load a specific module and register with the loader those of its entry
* points that are referenced by this driver.
*/
pointer
ATILoadModule
(
ScrnInfoPtr pScreenInfo,
const char *Module,
const char **SymbolList
)
{
pointer pModule = xf86LoadSubModule(pScreenInfo, Module);
if (pModule)
xf86LoaderReqSymLists(SymbolList, NULL);
return pModule;
}
/*
* ATILoadModules --
*
* This function loads other modules required for a screen.
*/
pointer
ATILoadModules
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
pointer fbPtr = NULL;
/* Load shadow frame buffer code if needed */
if (pATI->OptionShadowFB &&
!ATILoadModule(pScreenInfo, "shadowfb", ATIshadowfbSymbols))
return NULL;
/* Load depth-specific entry points */
switch (pATI->bitsPerPixel)
{
#ifndef AVOID_CPIO
case 1:
fbPtr = ATILoadModule(pScreenInfo, "xf1bpp", ATIxf1bppSymbols);
break;
case 4:
fbPtr = ATILoadModule(pScreenInfo, "xf4bpp", ATIxf4bppSymbols);
break;
#endif /* AVOID_CPIO */
case 8:
case 16:
case 24:
case 32:
fbPtr = ATILoadModule(pScreenInfo, "fb", ATIfbSymbols);
break;
default:
return NULL;
}
if (!fbPtr)
return NULL;
/* Load ramdac module if needed */
if ((pATI->Cursor > ATI_CURSOR_SOFTWARE) &&
!ATILoadModule(pScreenInfo, "ramdac", ATIramdacSymbols))
return NULL;
#ifdef USE_EXA
/* Load EXA if needed */
if (pATI->useEXA && pATI->OptionAccel)
{
/* Cannot use ATILoadModule(), because of version checking */
XF86ModReqInfo req;
int errmaj, errmin;
memset(&req, 0, sizeof(XF86ModReqInfo));
req.majorversion = 2;
req.minorversion = 0;
if (!LoadSubModule(pScreenInfo->module, "exa", NULL, NULL, NULL, &req,
&errmaj, &errmin))
{
LoaderErrorMsg(NULL, "exa", errmaj, errmin);
return NULL;
}
xf86LoaderReqSymLists(ATIexaSymbols, NULL);
}
#endif
#ifdef USE_XAA
/* Load XAA if needed */
if (!pATI->useEXA && pATI->OptionAccel &&
!ATILoadModule(pScreenInfo, "xaa", ATIxaaSymbols))
return NULL;
#endif
return fbPtr;
}
#endif /* XFree86LOADER */

View File

@ -0,0 +1,76 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h,v 1.6 2003/07/24 22:08:28 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifndef ___ATILOAD_H___
#define ___ATILOAD_H___ 1
#ifdef XFree86LOADER
#include "atipriv.h"
#include "xf86str.h"
extern const char *ATIint10Symbols[], *ATIddcSymbols[], *ATIvbeSymbols[],
#ifndef AVOID_CPIO
*ATIxf1bppSymbols[], *ATIxf4bppSymbols[],
#endif /* AVOID_CPIO */
#ifdef XF86DRI_DEVEL
*ATIdrmSymbols[], *ATIdriSymbols[],
#endif /* XF86DRI_DEVEL */
*ATIfbSymbols[], *ATIshadowfbSymbols[],
#ifdef USE_EXA
*ATIexaSymbols[],
#endif /* USE_EXA */
#ifdef USE_XAA
*ATIxaaSymbols[],
#endif /* USE_XAA */
*ATIramdacSymbols[], *ATIi2cSymbols[];
extern pointer ATILoadModule(ScrnInfoPtr, const char *, const char **);
extern pointer ATILoadModules(ScrnInfoPtr, ATIPtr);
#else /* XFree86LOADER */
#define ATILoadModule(pScreenInfo, Module, SymboList) ((pointer)1)
#define ATILoadModules(pScreenInfo, pATI) ((pointer)1)
#endif /* XFree86LOADER */
#endif /* ___ATILOAD_H___ */

View File

@ -0,0 +1,610 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.20tsi Exp $ */
/*
* Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atiadapter.h"
#include "atichip.h"
#include "atilock.h"
#include "atimach64io.h"
#include "atiwonderio.h"
/*
* ATIUnlock --
*
* This function is entered to unlock registers and disable unwanted
* emulations. It saves the current state for later restoration by ATILock().
*/
void
ATIUnlock
(
ATIPtr pATI
)
{
CARD32 tmp;
#ifndef AVOID_CPIO
CARD32 saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0;
#endif /* AVOID_CPIO */
if (pATI->Unlocked)
return;
pATI->Unlocked = TRUE;
#ifndef AVOID_CPIO
if (pATI->ChipHasSUBSYS_CNTL)
{
/* Save register values to be modified */
pATI->LockData.clock_sel = inw(CLOCK_SEL);
if (pATI->Chip >= ATI_CHIP_68800)
{
pATI->LockData.misc_options = inw(MISC_OPTIONS);
pATI->LockData.mem_bndry = inw(MEM_BNDRY);
pATI->LockData.mem_cfg = inw(MEM_CFG);
}
tmp = inw(SUBSYS_STAT) & _8PLANE;
/* Reset the 8514/A and disable all interrupts */
outw(SUBSYS_CNTL, tmp | (GPCTRL_RESET | CHPTEST_NORMAL));
outw(SUBSYS_CNTL, tmp | (GPCTRL_ENAB | CHPTEST_NORMAL | RVBLNKFLG |
RPICKFLAG | RINVALIDIO | RGPIDLE));
/* Ensure VGA is enabled */
outw(CLOCK_SEL, pATI->LockData.clock_sel &~DISABPASSTHRU);
if (pATI->Chip >= ATI_CHIP_68800)
{
outw(MISC_OPTIONS, pATI->LockData.misc_options &
~(DISABLE_VGA | DISABLE_DAC));
/* Disable any video memory boundary */
outw(MEM_BNDRY, pATI->LockData.mem_bndry &
~(MEM_PAGE_BNDRY | MEM_BNDRY_ENA));
/* Disable direct video memory aperture */
outw(MEM_CFG, pATI->LockData.mem_cfg &
~(MEM_APERT_SEL | MEM_APERT_PAGE | MEM_APERT_LOC));
}
/* Wait for all activity to die down */
ProbeWaitIdleEmpty();
}
else if (pATI->Chip >= ATI_CHIP_88800GXC)
#endif /* AVOID_CPIO */
{
/* Reset everything */
pATI->LockData.bus_cntl = inr(BUS_CNTL);
if (pATI->Chip < ATI_CHIP_264VT4)
{
pATI->LockData.bus_cntl =
(pATI->LockData.bus_cntl & ~BUS_HOST_ERR_INT_EN) |
BUS_HOST_ERR_INT;
if (pATI->Chip < ATI_CHIP_264VTB)
pATI->LockData.bus_cntl =
(pATI->LockData.bus_cntl & ~BUS_FIFO_ERR_INT_EN) |
BUS_FIFO_ERR_INT;
}
tmp = pATI->LockData.bus_cntl & ~BUS_ROM_DIS;
if (pATI->Chip < ATI_CHIP_264VTB)
tmp |= SetBits(15, BUS_FIFO_WS);
else
tmp &= ~BUS_MASTER_DIS;
if (pATI->Chip >= ATI_CHIP_264VT)
tmp |= BUS_EXT_REG_EN; /* Enable Block 1 */
outr(BUS_CNTL, tmp);
pATI->LockData.crtc_int_cntl = inr(CRTC_INT_CNTL);
outr(CRTC_INT_CNTL, (pATI->LockData.crtc_int_cntl & ~CRTC_INT_ENS) |
CRTC_INT_ACKS);
#ifdef XF86DRI_DEVEL
if (pATI->irq > 0)
outr(CRTC_INT_CNTL, (inr(CRTC_INT_CNTL) & ~CRTC_INT_ACKS) |
CRTC_VBLANK_INT_EN); /* Enable VBLANK interrupt - handled by DRM */
#endif /* XF86DRI_DEVEL */
pATI->LockData.gen_test_cntl = inr(GEN_TEST_CNTL) &
(GEN_OVR_OUTPUT_EN | GEN_OVR_POLARITY | GEN_CUR_EN |
GEN_BLOCK_WR_EN);
tmp = pATI->LockData.gen_test_cntl & ~GEN_CUR_EN;
outr(GEN_TEST_CNTL, tmp | GEN_GUI_EN);
outr(GEN_TEST_CNTL, tmp);
outr(GEN_TEST_CNTL, tmp | GEN_GUI_EN);
tmp = pATI->LockData.crtc_gen_cntl = inr(CRTC_GEN_CNTL) &
~(CRTC_EN | CRTC_LOCK_REGS);
if (pATI->Chip >= ATI_CHIP_264XL)
tmp = (tmp & ~CRTC_INT_ENS_X) | CRTC_INT_ACKS_X;
outr(CRTC_GEN_CNTL, tmp | CRTC_EN);
outr(CRTC_GEN_CNTL, tmp);
outr(CRTC_GEN_CNTL, tmp | CRTC_EN);
if ((pATI->LCDPanelID >= 0) && (pATI->Chip != ATI_CHIP_264LT))
{
pATI->LockData.lcd_index = inr(LCD_INDEX);
if (pATI->Chip >= ATI_CHIP_264XL)
outr(LCD_INDEX, pATI->LockData.lcd_index &
~(LCD_MONDET_INT_EN | LCD_MONDET_INT));
/*
* Prevent BIOS initiated display switches on dual-CRT controllers.
*/
if (!pATI->OptionBIOSDisplay && (pATI->Chip != ATI_CHIP_264XL))
{
#ifdef TV_OUT
pATI->LockData.scratch_reg3 = inr(SCRATCH_REG3) & ~DISPLAY_SWITCH_DISABLE;
outr(SCRATCH_REG3, pATI->LockData.scratch_reg3);
#else
pATI->LockData.scratch_reg3 = inr(SCRATCH_REG3);
outr(SCRATCH_REG3,
pATI->LockData.scratch_reg3 | DISPLAY_SWITCH_DISABLE);
#endif /* TV_OUT */
}
}
pATI->LockData.mem_cntl = inr(MEM_CNTL);
if (pATI->Chip < ATI_CHIP_264CT)
outr(MEM_CNTL, pATI->LockData.mem_cntl &
~(CTL_MEM_BNDRY | CTL_MEM_BNDRY_EN));
/* Disable feature connector on integrated controllers */
tmp = pATI->LockData.dac_cntl = inr(DAC_CNTL);
if (pATI->Chip >= ATI_CHIP_264CT)
tmp &= ~DAC_FEA_CON_EN;
#ifndef AVOID_CPIO
/* Ensure VGA aperture is enabled */
pATI->LockData.config_cntl = inr(CONFIG_CNTL);
tmp |= DAC_VGA_ADR_EN;
outr(CONFIG_CNTL, pATI->LockData.config_cntl & ~CFG_VGA_DIS);
#endif /* AVOID_CPIO */
outr(DAC_CNTL, tmp);
if (pATI->Chip >= ATI_CHIP_264VTB)
{
pATI->LockData.mpp_config = inr(MPP_CONFIG);
pATI->LockData.mpp_strobe_seq = inr(MPP_STROBE_SEQ);
pATI->LockData.tvo_cntl = inr(TVO_CNTL);
if (pATI->Chip >= ATI_CHIP_264GT2C)
{
pATI->LockData.hw_debug = inr(HW_DEBUG);
if (pATI->Chip >= ATI_CHIP_264GTPRO)
{
if (!(pATI->LockData.hw_debug & CMDFIFO_SIZE_EN))
outr(HW_DEBUG,
pATI->LockData.hw_debug | CMDFIFO_SIZE_EN);
pATI->LockData.i2c_cntl_0 =
inr(I2C_CNTL_0) | (I2C_CNTL_STAT | I2C_CNTL_HPTR_RST);
outr(I2C_CNTL_0,
pATI->LockData.i2c_cntl_0 & ~I2C_CNTL_INT_EN);
pATI->LockData.i2c_cntl_1 = inr(I2C_CNTL_1);
}
else
{
if (pATI->LockData.hw_debug & CMDFIFO_SIZE_DIS)
outr(HW_DEBUG,
pATI->LockData.hw_debug & ~CMDFIFO_SIZE_DIS);
}
}
}
#ifndef AVOID_CPIO
}
if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
{
if (pATI->CPIO_VGAWonder)
{
/*
* Ensure all registers are read/write and disable all non-VGA
* emulations.
*/
pATI->LockData.b1 = ATIGetExtReg(0xB1U);
ATIModifyExtReg(pATI, 0xB1U, pATI->LockData.b1, 0xFCU, 0x00U);
pATI->LockData.b4 = ATIGetExtReg(0xB4U);
ATIModifyExtReg(pATI, 0xB4U, pATI->LockData.b4, 0x00U, 0x00U);
pATI->LockData.b5 = ATIGetExtReg(0xB5U);
ATIModifyExtReg(pATI, 0xB5U, pATI->LockData.b5, 0xBFU, 0x00U);
pATI->LockData.b6 = ATIGetExtReg(0xB6U);
ATIModifyExtReg(pATI, 0xB6U, pATI->LockData.b6, 0xDDU, 0x00U);
pATI->LockData.b8 = ATIGetExtReg(0xB8U);
ATIModifyExtReg(pATI, 0xB8U, pATI->LockData.b8, 0xC0U, 0x00U);
pATI->LockData.b9 = ATIGetExtReg(0xB9U);
ATIModifyExtReg(pATI, 0xB9U, pATI->LockData.b9, 0x7FU, 0x00U);
if (pATI->Chip > ATI_CHIP_18800)
{
pATI->LockData.be = ATIGetExtReg(0xBEU);
ATIModifyExtReg(pATI, 0xBEU, pATI->LockData.be, 0xFAU, 0x01U);
if (pATI->Chip >= ATI_CHIP_28800_2)
{
pATI->LockData.a6 = ATIGetExtReg(0xA6U);
ATIModifyExtReg(pATI, 0xA6U, pATI->LockData.a6,
0x7FU, 0x00U);
pATI->LockData.ab = ATIGetExtReg(0xABU);
ATIModifyExtReg(pATI, 0xABU, pATI->LockData.ab,
0xE7U, 0x00U);
}
}
}
if (pATI->LCDPanelID >= 0)
{
if (pATI->Chip == ATI_CHIP_264LT)
{
saved_lcd_gen_ctrl = inr(LCD_GEN_CTRL);
/* Setup to unlock non-shadow registers */
lcd_gen_ctrl = saved_lcd_gen_ctrl & ~SHADOW_RW_EN;
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
}
else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY)) */
{
saved_lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
/* Setup to unlock non-shadow registers */
lcd_gen_ctrl = saved_lcd_gen_ctrl &
~(CRTC_RW_SELECT | SHADOW_RW_EN);
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
}
}
ATISetVGAIOBase(pATI, inb(R_GENMO));
/*
* There's a bizarre interaction here. If bit 0x80 of CRTC[17] is on,
* then CRTC[3] is read-only. If bit 0x80 of CRTC[3] is off, then
* CRTC[17] is write-only (or a read attempt actually returns bits from
* C/EGA's light pen position). This means that if both conditions are
* met, CRTC[17]'s value on server entry cannot be retrieved.
*/
pATI->LockData.crt03 = tmp = GetReg(CRTX(pATI->CPIO_VGABase), 0x03U);
if ((tmp & 0x80U) ||
((outb(CRTD(pATI->CPIO_VGABase), tmp | 0x80U),
tmp = inb(CRTD(pATI->CPIO_VGABase))) & 0x80U))
{
/* CRTC[16-17] should be readable */
pATI->LockData.crt11 = tmp =
GetReg(CRTX(pATI->CPIO_VGABase), 0x11U);
if (tmp & 0x80U) /* Unprotect CRTC[0-7] */
outb(CRTD(pATI->CPIO_VGABase), tmp & 0x7FU);
}
else
{
/*
* Could not make CRTC[17] readable, so unprotect CRTC[0-7]
* replacing VSyncEnd with zero. This zero will be replaced after
* acquiring the needed access.
*/
unsigned int VSyncEnd, VBlankStart, VBlankEnd;
CARD8 crt07, crt09;
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, 0x20U);
/* Make CRTC[16-17] readable */
PutReg(CRTX(pATI->CPIO_VGABase), 0x03U, tmp | 0x80U);
/* Make vertical synch pulse as wide as possible */
crt07 = GetReg(CRTX(pATI->CPIO_VGABase), 0x07U);
crt09 = GetReg(CRTX(pATI->CPIO_VGABase), 0x09U);
VBlankStart = (((crt09 & 0x20U) << 4) | ((crt07 & 0x08U) << 5) |
GetReg(CRTX(pATI->CPIO_VGABase), 0x15U)) + 1;
VBlankEnd = (VBlankStart & 0x0300U) |
GetReg(CRTX(pATI->CPIO_VGABase), 0x16U);
if (VBlankEnd <= VBlankStart)
VBlankEnd += 0x0100U;
VSyncEnd = (((crt07 & 0x80U) << 2) | ((crt07 & 0x04U) << 6) |
GetReg(CRTX(pATI->CPIO_VGABase), 0x10U)) + 0x0FU;
if (VSyncEnd >= VBlankEnd)
VSyncEnd = VBlankEnd - 1;
pATI->LockData.crt11 = (VSyncEnd & 0x0FU) | 0x20U;
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, pATI->LockData.crt11);
pATI->LockData.crt11 |= 0x80U;
}
if (pATI->LCDPanelID >= 0)
{
/* Setup to unlock shadow registers */
lcd_gen_ctrl |= SHADOW_RW_EN;
if (pATI->Chip == ATI_CHIP_264LT)
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY)) */
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
/* Unlock shadow registers */
ATISetVGAIOBase(pATI, inb(R_GENMO));
pATI->LockData.shadow_crt03 = tmp =
GetReg(CRTX(pATI->CPIO_VGABase), 0x03U);
if ((tmp & 0x80U) ||
((outb(CRTD(pATI->CPIO_VGABase), tmp | 0x80U),
tmp = inb(CRTD(pATI->CPIO_VGABase))) & 0x80U))
{
/* CRTC[16-17] should be readable */
pATI->LockData.shadow_crt11 = tmp =
GetReg(CRTX(pATI->CPIO_VGABase), 0x11U);
if (tmp & 0x80U) /* Unprotect CRTC[0-7] */
{
outb(CRTD(pATI->CPIO_VGABase), tmp & 0x7FU);
}
else if (!tmp && pATI->LockData.crt11)
{
pATI->LockData.shadow_crt11 = tmp = pATI->LockData.crt11;
outb(CRTD(pATI->CPIO_VGABase), tmp & 0x7FU);
}
}
else
{
/*
* Could not make CRTC[17] readable, so unprotect CRTC[0-7]
* replacing VSyncEnd with zero. This zero will be replaced
* after acquiring the needed access.
*/
unsigned int VSyncEnd, VBlankStart, VBlankEnd;
CARD8 crt07, crt09;
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, 0x20U);
/* Make CRTC[16-17] readable */
PutReg(CRTX(pATI->CPIO_VGABase), 0x03U, tmp | 0x80U);
/* Make vertical synch pulse as wide as possible */
crt07 = GetReg(CRTX(pATI->CPIO_VGABase), 0x07U);
crt09 = GetReg(CRTX(pATI->CPIO_VGABase), 0x09U);
VBlankStart = (((crt09 & 0x20U) << 4) |
((crt07 & 0x08U) << 5) |
GetReg(CRTX(pATI->CPIO_VGABase), 0x15U)) + 1;
VBlankEnd = (VBlankStart & 0x0300U) |
GetReg(CRTX(pATI->CPIO_VGABase), 0x16U);
if (VBlankEnd <= VBlankStart)
VBlankEnd += 0x0100U;
VSyncEnd = (((crt07 & 0x80U) << 2) | ((crt07 & 0x04U) << 6) |
GetReg(CRTX(pATI->CPIO_VGABase), 0x10U)) + 0x0FU;
if (VSyncEnd >= VBlankEnd)
VSyncEnd = VBlankEnd - 1;
pATI->LockData.shadow_crt11 = (VSyncEnd & 0x0FU) | 0x20U;
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U,
pATI->LockData.shadow_crt11);
pATI->LockData.shadow_crt11 |= 0x80U;
}
/* Restore selection */
if (pATI->Chip == ATI_CHIP_264LT)
{
outr(LCD_GEN_CTRL, saved_lcd_gen_ctrl);
}
else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY)) */
{
ATIMach64PutLCDReg(LCD_GEN_CNTL, saved_lcd_gen_ctrl);
/* Restore LCD index */
out8(LCD_INDEX, GetByte(pATI->LockData.lcd_index, 0));
}
}
#endif /* AVOID_CPIO */
}
}
/*
* ATILock --
*
* This function restores the state saved by ATIUnlock() above.
*/
void
ATILock
(
ATIPtr pATI
)
{
#ifndef AVOID_CPIO
CARD32 tmp, saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0;
#endif /* AVOID_CPIO */
if (!pATI->Unlocked)
return;
pATI->Unlocked = FALSE;
#ifndef AVOID_CPIO
if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
{
if (pATI->LCDPanelID >= 0)
{
if (pATI->Chip == ATI_CHIP_264LT)
{
saved_lcd_gen_ctrl = inr(LCD_GEN_CTRL);
/* Setup to lock non-shadow registers */
lcd_gen_ctrl = saved_lcd_gen_ctrl & ~SHADOW_RW_EN;
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
}
else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY)) */
{
saved_lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
/* Setup to lock non-shadow registers */
lcd_gen_ctrl = saved_lcd_gen_ctrl &
~(CRTC_RW_SELECT | SHADOW_RW_EN);
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
}
}
ATISetVGAIOBase(pATI, inb(R_GENMO));
/* Restore VGA locks */
PutReg(CRTX(pATI->CPIO_VGABase), 0x03U, pATI->LockData.crt03);
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, pATI->LockData.crt11);
if (pATI->LCDPanelID >= 0)
{
/* Setup to lock shadow registers */
lcd_gen_ctrl |= SHADOW_RW_EN;
if (pATI->Chip == ATI_CHIP_264LT)
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY)) */
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
/* Lock shadow registers */
ATISetVGAIOBase(pATI, inb(R_GENMO));
PutReg(CRTX(pATI->CPIO_VGABase), 0x03U,
pATI->LockData.shadow_crt03);
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U,
pATI->LockData.shadow_crt11);
/* Restore selection */
if (pATI->Chip == ATI_CHIP_264LT)
outr(LCD_GEN_CTRL, saved_lcd_gen_ctrl);
else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY)) */
ATIMach64PutLCDReg(LCD_GEN_CNTL, saved_lcd_gen_ctrl);
}
if (pATI->CPIO_VGAWonder)
{
/*
* Restore emulation and protection bits in ATI extended VGA
* registers.
*/
ATIModifyExtReg(pATI, 0xB1U, -1, 0xFCU, pATI->LockData.b1);
ATIModifyExtReg(pATI, 0xB4U, -1, 0x00U, pATI->LockData.b4);
ATIModifyExtReg(pATI, 0xB5U, -1, 0xBFU, pATI->LockData.b5);
ATIModifyExtReg(pATI, 0xB6U, -1, 0xDDU, pATI->LockData.b6);
ATIModifyExtReg(pATI, 0xB8U, -1, 0xC0U, pATI->LockData.b8 & 0x03U);
ATIModifyExtReg(pATI, 0xB9U, -1, 0x7FU, pATI->LockData.b9);
if (pATI->Chip > ATI_CHIP_18800)
{
ATIModifyExtReg(pATI, 0xBEU, -1, 0xFAU, pATI->LockData.be);
if (pATI->Chip >= ATI_CHIP_28800_2)
{
ATIModifyExtReg(pATI, 0xA6U, -1, 0x7FU, pATI->LockData.a6);
ATIModifyExtReg(pATI, 0xABU, -1, 0xE7U, pATI->LockData.ab);
}
}
ATIModifyExtReg(pATI, 0xB8U, -1, 0xC0U, pATI->LockData.b8);
}
}
if (pATI->ChipHasSUBSYS_CNTL)
{
tmp = inw(SUBSYS_STAT) & _8PLANE;
/* Reset the 8514/A and disable all interrupts */
outw(SUBSYS_CNTL, tmp | (GPCTRL_RESET | CHPTEST_NORMAL));
outw(SUBSYS_CNTL, tmp | (GPCTRL_ENAB | CHPTEST_NORMAL | RVBLNKFLG |
RPICKFLAG | RINVALIDIO | RGPIDLE));
/* Restore modified accelerator registers */
outw(CLOCK_SEL, pATI->LockData.clock_sel);
if (pATI->Chip >= ATI_CHIP_68800)
{
outw(MISC_OPTIONS, pATI->LockData.misc_options);
outw(MEM_BNDRY, pATI->LockData.mem_bndry);
outw(MEM_CFG, pATI->LockData.mem_cfg);
}
/* Wait for all activity to die down */
ProbeWaitIdleEmpty();
}
else if (pATI->Chip >= ATI_CHIP_88800GXC)
#endif /* AVOID_CPIO */
{
/* Reset everything */
outr(BUS_CNTL, pATI->LockData.bus_cntl);
outr(CRTC_INT_CNTL, pATI->LockData.crtc_int_cntl);
outr(GEN_TEST_CNTL, pATI->LockData.gen_test_cntl | GEN_GUI_EN);
outr(GEN_TEST_CNTL, pATI->LockData.gen_test_cntl);
outr(GEN_TEST_CNTL, pATI->LockData.gen_test_cntl | GEN_GUI_EN);
outr(CRTC_GEN_CNTL, pATI->LockData.crtc_gen_cntl | CRTC_EN);
outr(CRTC_GEN_CNTL, pATI->LockData.crtc_gen_cntl);
outr(CRTC_GEN_CNTL, pATI->LockData.crtc_gen_cntl | CRTC_EN);
#ifndef AVOID_CPIO
outr(CONFIG_CNTL, pATI->LockData.config_cntl);
#endif /* AVOID_CPIO */
outr(DAC_CNTL, pATI->LockData.dac_cntl);
if (pATI->Chip < ATI_CHIP_264CT)
outr(MEM_CNTL, pATI->LockData.mem_cntl);
if ((pATI->LCDPanelID >= 0) && (pATI->Chip != ATI_CHIP_264LT))
{
outr(LCD_INDEX, pATI->LockData.lcd_index);
#ifndef TV_OUT
if (!pATI->OptionBIOSDisplay && (pATI->Chip != ATI_CHIP_264XL))
outr(SCRATCH_REG3, pATI->LockData.scratch_reg3);
#endif /* TV_OUT */
}
if (pATI->Chip >= ATI_CHIP_264VTB)
{
outr(MPP_CONFIG, pATI->LockData.mpp_config);
outr(MPP_STROBE_SEQ, pATI->LockData.mpp_strobe_seq);
#ifndef TV_OUT
outr(TVO_CNTL, pATI->LockData.tvo_cntl);
#endif /* TV_OUT */
if (pATI->Chip >= ATI_CHIP_264GT2C)
{
outr(HW_DEBUG, pATI->LockData.hw_debug);
if (pATI->Chip >= ATI_CHIP_264GTPRO)
{
outr(I2C_CNTL_0, pATI->LockData.i2c_cntl_0);
outr(I2C_CNTL_1, pATI->LockData.i2c_cntl_1);
}
}
}
}
}

View File

@ -0,0 +1,32 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h,v 1.5 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATILOCK_H___
#define ___ATILOCK_H___ 1
#include "atipriv.h"
extern void ATIUnlock(ATIPtr);
extern void ATILock(ATIPtr);
#endif /* ___ATILOCK_H___ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h,v 1.17 2003/04/23 21:51:28 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMACH64_H___
#define ___ATIMACH64_H___ 1
#include "atipriv.h"
extern void ATIMach64PreInit(ScrnInfoPtr, ATIPtr, ATIHWPtr);
extern void ATIMach64Save(ATIPtr, ATIHWPtr);
extern void ATIMach64Calculate(ATIPtr, ATIHWPtr, DisplayModePtr);
extern void ATIMach64Set(ATIPtr, ATIHWPtr);
extern void ATIMach64SaveScreen(ATIPtr, int);
extern void ATIMach64SetDPMSMode(ScrnInfoPtr, ATIPtr, int);
#endif /* ___ATIMACH64_H___ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h,v 1.1 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMACH64ACCEL_H___
#define ___ATIMACH64ACCEL_H___ 1
#include "atipriv.h"
#include "xaa.h"
#include "exa.h"
#define ATIMach64MaxX 4095
#define ATIMach64MaxY 16383
#ifdef USE_EXA
extern Bool ATIMach64ExaInit(ScreenPtr);
#endif
#ifdef USE_XAA
extern int ATIMach64AccelInit(ATIPtr, XAAInfoRecPtr);
#endif
extern void ATIMach64Sync(ScrnInfoPtr);
#endif /* ___ATIMACH64ACCEL_H___ */

View File

@ -0,0 +1,417 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c,v 1.1 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "aticrtc.h"
#include "atimach64accel.h"
#include "atimach64cursor.h"
#include "atimach64io.h"
/*
* ATIMach64SetCursorColours --
*
* Set hardware cursor foreground and background colours.
*/
static void
ATIMach64SetCursorColours
(
ScrnInfoPtr pScreenInfo,
int fg,
int bg
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
outr(CUR_CLR0, SetBits(fg, CUR_CLR));
outr(CUR_CLR1, SetBits(bg, CUR_CLR));
}
/*
* ATIMach64SetCursorPosition --
*
* Set position of hardware cursor.
*/
static void
ATIMach64SetCursorPosition
(
ScrnInfoPtr pScreenInfo,
int x,
int y
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
CARD16 CursorXOffset, CursorYOffset;
/* Adjust x & y when the cursor is partially obscured */
if (x < 0)
{
if ((CursorXOffset = -x) > 63)
CursorXOffset = 63;
x = 0;
}
else
{
CursorXOffset = pScreenInfo->frameX1 - pScreenInfo->frameX0;
if (x > CursorXOffset)
x = CursorXOffset;
CursorXOffset = 0;
}
if (y < 0)
{
if ((CursorYOffset = -y) > 63)
CursorYOffset = 63;
y = 0;
}
else
{
CursorYOffset = pScreenInfo->frameY1 - pScreenInfo->frameY0;
if (y > CursorYOffset)
y = CursorYOffset;
CursorYOffset = 0;
}
/* Adjust for multiscanned modes */
if (pScreenInfo->currentMode->Flags & V_DBLSCAN)
y *= 2;
if (pScreenInfo->currentMode->VScan > 1)
y *= pScreenInfo->currentMode->VScan;
do
{
if (CursorYOffset != pATI->CursorYOffset)
{
pATI->CursorYOffset = CursorYOffset;
outr(CUR_OFFSET, ((CursorYOffset << 4) + pATI->CursorOffset) >> 3);
}
else if (CursorXOffset == pATI->CursorXOffset)
break;
pATI->CursorXOffset = CursorXOffset;
outr(CUR_HORZ_VERT_OFF, SetBits(CursorXOffset, CUR_HORZ_OFF) |
SetBits(CursorYOffset, CUR_VERT_OFF));
} while (0);
outr(CUR_HORZ_VERT_POSN,
SetBits(x, CUR_HORZ_POSN) | SetBits(y, CUR_VERT_POSN));
}
/*
* ATIMach64LoadCursorImage --
*
* Copy hardware cursor image into offscreen video memory.
*/
static void
ATIMach64LoadCursorImage
(
ScrnInfoPtr pScreenInfo,
CARD8 *pImage
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
CARD32 *pSrc = (pointer)pImage;
volatile CARD32 *pDst = pATI->pCursorImage;
#ifdef XF86DRI_DEVEL
/* XAA Sync requires the DRM lock if DRI enabled */
ATIDRILock(pScreenInfo);
#endif /* XF86DRI_DEVEL */
/* Synchronise video memory accesses */
ATIMach64Sync(pScreenInfo);
# if defined(ATIMove32)
{
ATIMove32(pDst, pSrc, 256);
}
# else
{
/* This is lengthy, but it does maximise burst modes */
pDst[ 0] = pSrc[ 0]; pDst[ 1] = pSrc[ 1];
pDst[ 2] = pSrc[ 2]; pDst[ 3] = pSrc[ 3];
pDst[ 4] = pSrc[ 4]; pDst[ 5] = pSrc[ 5];
pDst[ 6] = pSrc[ 6]; pDst[ 7] = pSrc[ 7];
pDst[ 8] = pSrc[ 8]; pDst[ 9] = pSrc[ 9];
pDst[ 10] = pSrc[ 10]; pDst[ 11] = pSrc[ 11];
pDst[ 12] = pSrc[ 12]; pDst[ 13] = pSrc[ 13];
pDst[ 14] = pSrc[ 14]; pDst[ 15] = pSrc[ 15];
pDst[ 16] = pSrc[ 16]; pDst[ 17] = pSrc[ 17];
pDst[ 18] = pSrc[ 18]; pDst[ 19] = pSrc[ 19];
pDst[ 20] = pSrc[ 20]; pDst[ 21] = pSrc[ 21];
pDst[ 22] = pSrc[ 22]; pDst[ 23] = pSrc[ 23];
pDst[ 24] = pSrc[ 24]; pDst[ 25] = pSrc[ 25];
pDst[ 26] = pSrc[ 26]; pDst[ 27] = pSrc[ 27];
pDst[ 28] = pSrc[ 28]; pDst[ 29] = pSrc[ 29];
pDst[ 30] = pSrc[ 30]; pDst[ 31] = pSrc[ 31];
pDst[ 32] = pSrc[ 32]; pDst[ 33] = pSrc[ 33];
pDst[ 34] = pSrc[ 34]; pDst[ 35] = pSrc[ 35];
pDst[ 36] = pSrc[ 36]; pDst[ 37] = pSrc[ 37];
pDst[ 38] = pSrc[ 38]; pDst[ 39] = pSrc[ 39];
pDst[ 40] = pSrc[ 40]; pDst[ 41] = pSrc[ 41];
pDst[ 42] = pSrc[ 42]; pDst[ 43] = pSrc[ 43];
pDst[ 44] = pSrc[ 44]; pDst[ 45] = pSrc[ 45];
pDst[ 46] = pSrc[ 46]; pDst[ 47] = pSrc[ 47];
pDst[ 48] = pSrc[ 48]; pDst[ 49] = pSrc[ 49];
pDst[ 50] = pSrc[ 50]; pDst[ 51] = pSrc[ 51];
pDst[ 52] = pSrc[ 52]; pDst[ 53] = pSrc[ 53];
pDst[ 54] = pSrc[ 54]; pDst[ 55] = pSrc[ 55];
pDst[ 56] = pSrc[ 56]; pDst[ 57] = pSrc[ 57];
pDst[ 58] = pSrc[ 58]; pDst[ 59] = pSrc[ 59];
pDst[ 60] = pSrc[ 60]; pDst[ 61] = pSrc[ 61];
pDst[ 62] = pSrc[ 62]; pDst[ 63] = pSrc[ 63];
pDst[ 64] = pSrc[ 64]; pDst[ 65] = pSrc[ 65];
pDst[ 66] = pSrc[ 66]; pDst[ 67] = pSrc[ 67];
pDst[ 68] = pSrc[ 68]; pDst[ 69] = pSrc[ 69];
pDst[ 70] = pSrc[ 70]; pDst[ 71] = pSrc[ 71];
pDst[ 72] = pSrc[ 72]; pDst[ 73] = pSrc[ 73];
pDst[ 74] = pSrc[ 74]; pDst[ 75] = pSrc[ 75];
pDst[ 76] = pSrc[ 76]; pDst[ 77] = pSrc[ 77];
pDst[ 78] = pSrc[ 78]; pDst[ 79] = pSrc[ 79];
pDst[ 80] = pSrc[ 80]; pDst[ 81] = pSrc[ 81];
pDst[ 82] = pSrc[ 82]; pDst[ 83] = pSrc[ 83];
pDst[ 84] = pSrc[ 84]; pDst[ 85] = pSrc[ 85];
pDst[ 86] = pSrc[ 86]; pDst[ 87] = pSrc[ 87];
pDst[ 88] = pSrc[ 88]; pDst[ 89] = pSrc[ 89];
pDst[ 90] = pSrc[ 90]; pDst[ 91] = pSrc[ 91];
pDst[ 92] = pSrc[ 92]; pDst[ 93] = pSrc[ 93];
pDst[ 94] = pSrc[ 94]; pDst[ 95] = pSrc[ 95];
pDst[ 96] = pSrc[ 96]; pDst[ 97] = pSrc[ 97];
pDst[ 98] = pSrc[ 98]; pDst[ 99] = pSrc[ 99];
pDst[100] = pSrc[100]; pDst[101] = pSrc[101];
pDst[102] = pSrc[102]; pDst[103] = pSrc[103];
pDst[104] = pSrc[104]; pDst[105] = pSrc[105];
pDst[106] = pSrc[106]; pDst[107] = pSrc[107];
pDst[108] = pSrc[108]; pDst[109] = pSrc[109];
pDst[110] = pSrc[110]; pDst[111] = pSrc[111];
pDst[112] = pSrc[112]; pDst[113] = pSrc[113];
pDst[114] = pSrc[114]; pDst[115] = pSrc[115];
pDst[116] = pSrc[116]; pDst[117] = pSrc[117];
pDst[118] = pSrc[118]; pDst[119] = pSrc[119];
pDst[120] = pSrc[120]; pDst[121] = pSrc[121];
pDst[122] = pSrc[122]; pDst[123] = pSrc[123];
pDst[124] = pSrc[124]; pDst[125] = pSrc[125];
pDst[126] = pSrc[126]; pDst[127] = pSrc[127];
pDst[128] = pSrc[128]; pDst[129] = pSrc[129];
pDst[130] = pSrc[130]; pDst[131] = pSrc[131];
pDst[132] = pSrc[132]; pDst[133] = pSrc[133];
pDst[134] = pSrc[134]; pDst[135] = pSrc[135];
pDst[136] = pSrc[136]; pDst[137] = pSrc[137];
pDst[138] = pSrc[138]; pDst[139] = pSrc[139];
pDst[140] = pSrc[140]; pDst[141] = pSrc[141];
pDst[142] = pSrc[142]; pDst[143] = pSrc[143];
pDst[144] = pSrc[144]; pDst[145] = pSrc[145];
pDst[146] = pSrc[146]; pDst[147] = pSrc[147];
pDst[148] = pSrc[148]; pDst[149] = pSrc[149];
pDst[150] = pSrc[150]; pDst[151] = pSrc[151];
pDst[152] = pSrc[152]; pDst[153] = pSrc[153];
pDst[154] = pSrc[154]; pDst[155] = pSrc[155];
pDst[156] = pSrc[156]; pDst[157] = pSrc[157];
pDst[158] = pSrc[158]; pDst[159] = pSrc[159];
pDst[160] = pSrc[160]; pDst[161] = pSrc[161];
pDst[162] = pSrc[162]; pDst[163] = pSrc[163];
pDst[164] = pSrc[164]; pDst[165] = pSrc[165];
pDst[166] = pSrc[166]; pDst[167] = pSrc[167];
pDst[168] = pSrc[168]; pDst[169] = pSrc[169];
pDst[170] = pSrc[170]; pDst[171] = pSrc[171];
pDst[172] = pSrc[172]; pDst[173] = pSrc[173];
pDst[174] = pSrc[174]; pDst[175] = pSrc[175];
pDst[176] = pSrc[176]; pDst[177] = pSrc[177];
pDst[178] = pSrc[178]; pDst[179] = pSrc[179];
pDst[180] = pSrc[180]; pDst[181] = pSrc[181];
pDst[182] = pSrc[182]; pDst[183] = pSrc[183];
pDst[184] = pSrc[184]; pDst[185] = pSrc[185];
pDst[186] = pSrc[186]; pDst[187] = pSrc[187];
pDst[188] = pSrc[188]; pDst[189] = pSrc[189];
pDst[190] = pSrc[190]; pDst[191] = pSrc[191];
pDst[192] = pSrc[192]; pDst[193] = pSrc[193];
pDst[194] = pSrc[194]; pDst[195] = pSrc[195];
pDst[196] = pSrc[196]; pDst[197] = pSrc[197];
pDst[198] = pSrc[198]; pDst[199] = pSrc[199];
pDst[200] = pSrc[200]; pDst[201] = pSrc[201];
pDst[202] = pSrc[202]; pDst[203] = pSrc[203];
pDst[204] = pSrc[204]; pDst[205] = pSrc[205];
pDst[206] = pSrc[206]; pDst[207] = pSrc[207];
pDst[208] = pSrc[208]; pDst[209] = pSrc[209];
pDst[210] = pSrc[210]; pDst[211] = pSrc[211];
pDst[212] = pSrc[212]; pDst[213] = pSrc[213];
pDst[214] = pSrc[214]; pDst[215] = pSrc[215];
pDst[216] = pSrc[216]; pDst[217] = pSrc[217];
pDst[218] = pSrc[218]; pDst[219] = pSrc[219];
pDst[220] = pSrc[220]; pDst[221] = pSrc[221];
pDst[222] = pSrc[222]; pDst[223] = pSrc[223];
pDst[224] = pSrc[224]; pDst[225] = pSrc[225];
pDst[226] = pSrc[226]; pDst[227] = pSrc[227];
pDst[228] = pSrc[228]; pDst[229] = pSrc[229];
pDst[230] = pSrc[230]; pDst[231] = pSrc[231];
pDst[232] = pSrc[232]; pDst[233] = pSrc[233];
pDst[234] = pSrc[234]; pDst[235] = pSrc[235];
pDst[236] = pSrc[236]; pDst[237] = pSrc[237];
pDst[238] = pSrc[238]; pDst[239] = pSrc[239];
pDst[240] = pSrc[240]; pDst[241] = pSrc[241];
pDst[242] = pSrc[242]; pDst[243] = pSrc[243];
pDst[244] = pSrc[244]; pDst[245] = pSrc[245];
pDst[246] = pSrc[246]; pDst[247] = pSrc[247];
pDst[248] = pSrc[248]; pDst[249] = pSrc[249];
pDst[250] = pSrc[250]; pDst[251] = pSrc[251];
pDst[252] = pSrc[252]; pDst[253] = pSrc[253];
pDst[254] = pSrc[254]; pDst[255] = pSrc[255];
}
#endif
#ifdef XF86DRI_DEVEL
ATIDRIUnlock(pScreenInfo);
#endif /* XF86DRI_DEVEL */
}
/*
* ATIMach64HideCursor --
*
* Turn off hardware cursor.
*/
static void
ATIMach64HideCursor
(
ScrnInfoPtr pScreenInfo
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
if (!(pATI->NewHW.gen_test_cntl & GEN_CUR_EN))
return;
pATI->NewHW.gen_test_cntl &= ~GEN_CUR_EN;
out8(GEN_TEST_CNTL, GetByte(pATI->NewHW.gen_test_cntl, 0));
}
/*
* ATIMach64ShowCursor --
*
* Turn on hardware cursor.
*/
static void
ATIMach64ShowCursor
(
ScrnInfoPtr pScreenInfo
)
{
ATIPtr pATI = ATIPTR(pScreenInfo);
if (pATI->NewHW.gen_test_cntl & GEN_CUR_EN)
return;
pATI->NewHW.gen_test_cntl |= GEN_CUR_EN;
out8(GEN_TEST_CNTL, GetByte(pATI->NewHW.gen_test_cntl, 0));
}
/*
* ATIMach64UseHWCursor --
*
* Notify cursor layer whether a hardware cursor is configured.
*/
static Bool
ATIMach64UseHWCursor
(
ScreenPtr pScreen,
CursorPtr pCursor
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
if (!pATI->CursorBase)
return FALSE;
#ifndef AVOID_CPIO
/*
* For some reason, the hardware cursor isn't vertically scaled when a VGA
* doublescanned or multiscanned mode is in effect.
*/
if (pATI->NewHW.crtc == ATI_CRTC_MACH64)
return TRUE;
if ((pScreenInfo->currentMode->Flags & V_DBLSCAN) ||
(pScreenInfo->currentMode->VScan > 1))
return FALSE;
#endif /* AVOID_CPIO */
return TRUE;
}
/*
* ATIMach64CursorInit --
*
* Initialise xf86CursorInfoRec fields with information specific to Mach64
* variants.
*/
Bool
ATIMach64CursorInit
(
xf86CursorInfoPtr pCursorInfo
)
{
/*
* For Mach64 variants, toggling hardware cursors off and on causes display
* artifacts. Ask the cursor support layers to always paint the cursor
* (whether or not it is entirely transparent) and to not hide the cursor
* when reloading its image. The two remaining reasons for turning off the
* hardware cursor are when it moves to a different screen or on a switch
* to a different virtual console.
*/
pCursorInfo->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
HARDWARE_CURSOR_INVERT_MASK |
HARDWARE_CURSOR_SHOW_TRANSPARENT |
HARDWARE_CURSOR_UPDATE_UNHIDDEN |
HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
#if X_BYTE_ORDER != X_LITTLE_ENDIAN
HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
#endif /* X_BYTE_ORDER */
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
pCursorInfo->MaxWidth = pCursorInfo->MaxHeight = 64;
pCursorInfo->SetCursorColors = ATIMach64SetCursorColours;
pCursorInfo->SetCursorPosition = ATIMach64SetCursorPosition;
pCursorInfo->LoadCursorImage = ATIMach64LoadCursorImage;
pCursorInfo->HideCursor = ATIMach64HideCursor;
pCursorInfo->ShowCursor = ATIMach64ShowCursor;
pCursorInfo->UseHWCursor = ATIMach64UseHWCursor;
return TRUE;
}

View File

@ -0,0 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h,v 1.1 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMACH64CURSOR_H___
#define ___ATIMACH64CURSOR_H___ 1
#include "xf86Cursor.h"
extern Bool ATIMach64CursorInit(xf86CursorInfoPtr);
#endif /* ___ATIMACH64CURSOR_H___ */

View File

@ -0,0 +1,706 @@
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*/
/*
* Copyright 1999-2000 Precision Insight, Inc., Cedar Park, Texas.
* 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
*/
/*
* DRI support by:
* Manuel Teira
* Leif Delgass <ldelgass@retinalburn.net>
*
* EXA support by:
* Jakub Stachowski <qbast@go2.pl>
* George Sapountzis <gsap7@yahoo.gr>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "ati.h"
#include "atichip.h"
#include "atidri.h"
#include "atimach64accel.h"
#include "atimach64io.h"
#include "atipriv.h"
#include "atiregs.h"
#ifdef XF86DRI_DEVEL
#include "mach64_dri.h"
#include "mach64_sarea.h"
#endif
#ifdef USE_EXA
extern CARD8 ATIMach64ALU[];
extern void
ATIMach64ValidateClip
(
ATIPtr pATI,
int sc_left,
int sc_right,
int sc_top,
int sc_bottom
);
#if 0
#define MACH64_TRACE(x) \
do { \
ErrorF("Mach64(%s): ", __FUNCTION__); \
ErrorF x; \
} while(0)
#else
#define MACH64_TRACE(x) do { } while(0)
#endif
#if 0
#define MACH64_FALLBACK(x) \
do { \
ErrorF("Fallback(%s): ", __FUNCTION__); \
ErrorF x; \
return FALSE; \
} while (0)
#else
#define MACH64_FALLBACK(x) return FALSE
#endif
static void
Mach64WaitMarker(ScreenPtr pScreenInfo, int Marker)
{
ATIMach64Sync(xf86Screens[pScreenInfo->myNum]);
}
static Bool
Mach64GetDatatypeBpp(PixmapPtr pPix, CARD32 *pix_width)
{
int bpp = pPix->drawable.bitsPerPixel;
switch (bpp) {
case 8:
*pix_width =
SetBits(PIX_WIDTH_8BPP, DP_DST_PIX_WIDTH) |
SetBits(PIX_WIDTH_8BPP, DP_SRC_PIX_WIDTH) |
SetBits(PIX_WIDTH_1BPP, DP_HOST_PIX_WIDTH);
break;
case 16:
*pix_width =
SetBits(PIX_WIDTH_16BPP, DP_DST_PIX_WIDTH) |
SetBits(PIX_WIDTH_16BPP, DP_SRC_PIX_WIDTH) |
SetBits(PIX_WIDTH_1BPP, DP_HOST_PIX_WIDTH);
break;
case 24:
*pix_width =
SetBits(PIX_WIDTH_8BPP, DP_DST_PIX_WIDTH) |
SetBits(PIX_WIDTH_8BPP, DP_SRC_PIX_WIDTH) |
SetBits(PIX_WIDTH_1BPP, DP_HOST_PIX_WIDTH);
break;
case 32:
*pix_width =
SetBits(PIX_WIDTH_32BPP, DP_DST_PIX_WIDTH) |
SetBits(PIX_WIDTH_32BPP, DP_SRC_PIX_WIDTH) |
SetBits(PIX_WIDTH_1BPP, DP_HOST_PIX_WIDTH);
break;
default:
MACH64_FALLBACK(("Unsupported bpp: %d\n", bpp));
}
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
*pix_width |= DP_BYTE_PIX_ORDER;
#endif /* X_BYTE_ORDER */
return TRUE;
}
static Bool
Mach64GetOffsetPitch(PixmapPtr pPix, int bpp, CARD32 *pitch_offset,
unsigned int offset, unsigned int pitch)
{
#if 0
ScrnInfoPtr pScreenInfo = xf86Screens[pPix->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
if (pitch % pATI->pExa->pixmapPitchAlign != 0)
MACH64_FALLBACK(("Bad pitch 0x%08x\n", pitch));
if (offset % pATI->pExa->pixmapOffsetAlign != 0)
MACH64_FALLBACK(("Bad offset 0x%08x\n", offset));
#endif
/* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
pitch = pitch / bpp;
/* bytes / 8 */
offset = offset >> 3;
*pitch_offset = ((pitch << 22) | (offset << 0));
return TRUE;
}
static Bool
Mach64GetPixmapOffsetPitch(PixmapPtr pPix, CARD32 *pitch_offset)
{
CARD32 pitch, offset;
int bpp;
bpp = pPix->drawable.bitsPerPixel;
if (bpp == 24)
bpp = 8;
pitch = exaGetPixmapPitch(pPix);
offset = exaGetPixmapOffset(pPix);
return Mach64GetOffsetPitch(pPix, bpp, pitch_offset, offset, pitch);
}
static Bool
Mach64PrepareCopy
(
PixmapPtr pSrcPixmap,
PixmapPtr pDstPixmap,
int xdir,
int ydir,
int alu,
Pixel planemask
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
CARD32 src_pitch_offset, dst_pitch_offset, dp_pix_width;
ATIDRISync(pScreenInfo);
if (!Mach64GetDatatypeBpp(pDstPixmap, &dp_pix_width))
return FALSE;
if (!Mach64GetPixmapOffsetPitch(pSrcPixmap, &src_pitch_offset))
return FALSE;
if (!Mach64GetPixmapOffsetPitch(pDstPixmap, &dst_pitch_offset))
return FALSE;
ATIMach64WaitForFIFO(pATI, 7);
outf(DP_WRITE_MASK, planemask);
outf(DP_PIX_WIDTH, dp_pix_width);
outf(SRC_OFF_PITCH, src_pitch_offset);
outf(DST_OFF_PITCH, dst_pitch_offset);
outf(DP_SRC, DP_MONO_SRC_ALLONES |
SetBits(SRC_BLIT, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC));
outf(DP_MIX, SetBits(ATIMach64ALU[alu], DP_FRGD_MIX));
outf(CLR_CMP_CNTL, CLR_CMP_FN_FALSE);
pATI->dst_cntl = 0;
if (ydir > 0)
pATI->dst_cntl |= DST_Y_DIR;
if (xdir > 0)
pATI->dst_cntl |= DST_X_DIR;
if (pATI->XModifier == 1)
outf(DST_CNTL, pATI->dst_cntl);
else
pATI->dst_cntl |= DST_24_ROT_EN;
return TRUE;
}
static void
Mach64Copy
(
PixmapPtr pDstPixmap,
int srcX,
int srcY,
int dstX,
int dstY,
int w,
int h
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
srcX *= pATI->XModifier;
dstY *= pATI->XModifier;
w *= pATI->XModifier;
ATIDRISync(pScreenInfo);
/* Disable clipping if it gets in the way */
ATIMach64ValidateClip(pATI, dstX, dstX + w - 1, dstY, dstY + h - 1);
if (!(pATI->dst_cntl & DST_X_DIR))
{
srcX += w - 1;
dstX += w - 1;
}
if (!(pATI->dst_cntl & DST_Y_DIR))
{
srcY += h - 1;
dstY += h - 1;
}
if (pATI->XModifier != 1)
outf(DST_CNTL, pATI->dst_cntl | SetBits((dstX / 4) % 6, DST_24_ROT));
ATIMach64WaitForFIFO(pATI, 4);
outf(SRC_Y_X, SetWord(srcX, 1) | SetWord(srcY, 0));
outf(SRC_WIDTH1, w);
outf(DST_Y_X, SetWord(dstX, 1) | SetWord(dstY, 0));
outf(DST_HEIGHT_WIDTH, SetWord(w, 1) | SetWord(h, 0));
/*
* On VTB's and later, the engine will randomly not wait for a copy
* operation to commit its results to video memory before starting the next
* one. The probability of such occurrences increases with GUI_WB_FLUSH
* (or GUI_WB_FLUSH_P) setting, bitsPerPixel and/or CRTC clock. This
* would point to some kind of video memory bandwidth problem were it noti
* for the fact that the problem occurs less often (but still occurs) when
* copying larger rectangles.
*/
if ((pATI->Chip >= ATI_CHIP_264VTB) && !pATI->OptionDevel)
{
exaMarkSync(pScreenInfo->pScreen); /* Force sync. */
exaWaitSync(pScreenInfo->pScreen); /* Sync and notify EXA. */
}
}
static void Mach64DoneCopy(PixmapPtr pDstPixmap) { }
static Bool
Mach64PrepareSolid
(
PixmapPtr pPixmap,
int alu,
Pixel planemask,
Pixel fg
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pPixmap->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
CARD32 dst_pitch_offset, dp_pix_width;
ATIDRISync(pScreenInfo);
if (!Mach64GetDatatypeBpp(pPixmap, &dp_pix_width))
return FALSE;
if (!Mach64GetPixmapOffsetPitch(pPixmap, &dst_pitch_offset))
return FALSE;
ATIMach64WaitForFIFO(pATI, 7);
outf(DP_WRITE_MASK, planemask);
outf(DP_PIX_WIDTH, dp_pix_width);
outf(DST_OFF_PITCH, dst_pitch_offset);
outf(DP_SRC, DP_MONO_SRC_ALLONES |
SetBits(SRC_FRGD, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC));
outf(DP_FRGD_CLR, fg);
outf(DP_MIX, SetBits(ATIMach64ALU[alu], DP_FRGD_MIX));
outf(CLR_CMP_CNTL, CLR_CMP_FN_FALSE);
if (pATI->XModifier == 1)
outf(DST_CNTL, DST_X_DIR | DST_Y_DIR);
return TRUE;
}
static void
Mach64Solid
(
PixmapPtr pPixmap,
int x1,
int y1,
int x2,
int y2
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pPixmap->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
int x = x1;
int y = y1;
int w = x2-x1;
int h = y2-y1;
ATIDRISync(pScreenInfo);
if (pATI->XModifier != 1)
{
x *= pATI->XModifier;
w *= pATI->XModifier;
outf(DST_CNTL, SetBits((x / 4) % 6, DST_24_ROT) |
(DST_X_DIR | DST_Y_DIR | DST_24_ROT_EN));
}
/* Disable clipping if it gets in the way */
ATIMach64ValidateClip(pATI, x, x + w - 1, y, y + h - 1);
ATIMach64WaitForFIFO(pATI, 2);
outf(DST_Y_X, SetWord(x, 1) | SetWord(y, 0));
outf(DST_HEIGHT_WIDTH, SetWord(w, 1) | SetWord(h, 0));
}
static void Mach64DoneSolid(PixmapPtr pPixmap) { }
/*
* Memcpy-based UTS.
*/
static Bool
Mach64UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
char *src, int src_pitch)
{
char *dst = pDst->devPrivate.ptr;
int dst_pitch = exaGetPixmapPitch(pDst);
int bpp = pDst->drawable.bitsPerPixel;
int cpp = (bpp + 7) / 8;
int wBytes = w * cpp;
exaWaitSync(pDst->drawable.pScreen);
dst += (x * cpp) + (y * dst_pitch);
while (h--) {
memcpy(dst, src, wBytes);
src += src_pitch;
dst += dst_pitch;
}
return TRUE;
}
/*
* Memcpy-based DFS.
*/
static Bool
Mach64DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
char *dst, int dst_pitch)
{
char *src = pSrc->devPrivate.ptr;
int src_pitch = exaGetPixmapPitch(pSrc);
int bpp = pSrc->drawable.bitsPerPixel;
int cpp = (bpp + 7) / 8;
int wBytes = w * cpp;
exaWaitSync(pSrc->drawable.pScreen);
src += (x * cpp) + (y * src_pitch);
while (h--) {
memcpy(dst, src, wBytes);
src += src_pitch;
dst += dst_pitch;
}
return TRUE;
}
#include "atimach64render.c"
/* Compute log base 2 of val. */
static __inline__ int Mach64Log2(int val)
{
int bits;
for (bits = 0; val != 0; val >>= 1, ++bits)
;
return bits - 1;
}
/*
* Memory layour for EXA with DRI (no local_textures):
* | front | back | depth | textures | pixmaps, xv | c |
*
* 1024x768@16bpp with 8 MB:
* | 1.5 MB | 1.5 MB | 1.5 MB | 0 | ~3.5 MB | c |
*
* 1024x768@32bpp with 8 MB:
* | 3.0 MB | 3.0 MB | 1.5 MB | 0 | ~0.5 MB | c |
*
* "c" is the hw cursor which occupies 1KB
*/
static void
Mach64SetupMemEXA(ScreenPtr pScreen)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
int cpp = (pScreenInfo->bitsPerPixel + 7) / 8;
/* front and back buffer */
int bufferSize = pScreenInfo->virtualY * pScreenInfo->displayWidth * cpp;
/* always 16-bit z-buffer */
int depthSize = pScreenInfo->virtualY * pScreenInfo->displayWidth * 2;
ExaDriverPtr pExa = pATI->pExa;
pExa->memoryBase = pATI->pMemory;
pExa->memorySize = pScreenInfo->videoRam * 1024;
pExa->offScreenBase = bufferSize;
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
ATIDRIServerInfoPtr pATIDRIServer = pATI->pDRIServerInfo;
Bool is_pci = pATIDRIServer->IsPCI;
int textureSize = 0;
int pixmapCache = 0;
int next = 0;
/* front buffer */
pATIDRIServer->frontOffset = 0;
pATIDRIServer->frontPitch = pScreenInfo->displayWidth;
next += bufferSize;
/* back buffer */
pATIDRIServer->backOffset = next;
pATIDRIServer->backPitch = pScreenInfo->displayWidth;
next += bufferSize;
/* depth buffer */
pATIDRIServer->depthOffset = next;
pATIDRIServer->depthPitch = pScreenInfo->displayWidth;
next += depthSize;
/* ATIScreenInit does check for the this condition. */
if (next > pExa->memorySize)
{
xf86DrvMsg(pScreen->myNum, X_WARNING,
"DRI static buffer allocation failed, disabling DRI --"
"need at least %d kB video memory\n", next / 1024 );
ATIDRICloseScreen(pScreen);
pATI->directRenderingEnabled = FALSE;
}
/* local textures */
/* Reserve approx. half of offscreen memory for local textures */
textureSize = (pExa->memorySize - next) / 2;
/* In case DRI requires more offscreen memory than available,
* should not happen as ATIScreenInit would have not enabled DRI */
if (textureSize < 0)
textureSize = 0;
/* Try for enough pixmap cache for a full viewport */
pixmapCache = (pExa->memorySize - next) - textureSize;
if (pixmapCache < bufferSize)
textureSize = 0;
/* Don't allocate a local texture heap for AGP unless requested */
if ( !is_pci && !pATI->OptionLocalTextures )
textureSize = 0;
if (textureSize > 0)
{
int l = Mach64Log2(textureSize / MACH64_NR_TEX_REGIONS);
if (l < MACH64_LOG_TEX_GRANULARITY)
l = MACH64_LOG_TEX_GRANULARITY;
pATIDRIServer->logTextureGranularity = l;
/* Round the texture size down to the nearest whole number of
* texture regions.
*/
textureSize = (textureSize >> l) << l;
}
/* Set a minimum usable local texture heap size. This will fit
* two 256x256 textures. We check this after any rounding of
* the texture area.
*/
if (textureSize < 256*256 * cpp * 2)
textureSize = 0;
/* Disable DRI for PCI if cannot allocate a local texture heap */
if ( is_pci && textureSize == 0 )
{
xf86DrvMsg(pScreen->myNum, X_WARNING,
"Not enough memory for local textures, disabling DRI\n");
ATIDRICloseScreen(pScreen);
pATI->directRenderingEnabled = FALSE;
}
pATIDRIServer->textureOffset = next;
pATIDRIServer->textureSize = textureSize;
next += textureSize;
if (pATI->directRenderingEnabled)
pExa->offScreenBase = next;
}
#endif /* XF86DRI_DEVEL */
xf86DrvMsg(pScreen->myNum, X_INFO,
"EXA memory management initialized\n"
"\t base : %10p\n"
"\t offscreen: +%10lx\n"
"\t size : +%10lx\n"
"\t cursor : %10p\n",
pExa->memoryBase,
pExa->offScreenBase,
pExa->memorySize,
pATI->pCursorImage);
if (TRUE || xf86GetVerbosity() > 1)
{
int offscreen = pExa->memorySize - pExa->offScreenBase;
int viewport = bufferSize;
int dvdframe = 720*480*cpp; /* enough for single-buffered DVD */
xf86DrvMsg(pScreen->myNum, X_INFO,
"Will use %d kB of offscreen memory for EXA\n"
"\t\t or %5.2f viewports (composite)\n"
"\t\t or %5.2f dvdframes (xvideo)\n",
offscreen / 1024,
1.0 * offscreen / viewport,
1.0 * offscreen / dvdframe);
}
#ifdef XF86DRI_DEVEL
if (pATI->directRenderingEnabled)
{
ATIDRIServerInfoPtr pATIDRIServer = pATI->pDRIServerInfo;
xf86DrvMsg(pScreen->myNum, X_INFO,
"Will use back buffer at offset 0x%x\n",
pATIDRIServer->backOffset);
xf86DrvMsg(pScreen->myNum, X_INFO,
"Will use depth buffer at offset 0x%x\n",
pATIDRIServer->depthOffset);
if (pATIDRIServer->textureSize > 0)
{
xf86DrvMsg(pScreen->myNum, X_INFO,
"Will use %d kB for local textures at offset 0x%x\n",
pATIDRIServer->textureSize/1024,
pATIDRIServer->textureOffset);
}
}
#endif /* XF86DRI_DEVEL */
pExa->pixmapOffsetAlign = 64;
pExa->pixmapPitchAlign = 64;
pExa->flags = EXA_OFFSCREEN_PIXMAPS;
pExa->maxX = ATIMach64MaxX;
pExa->maxY = ATIMach64MaxY;
}
Bool ATIMach64ExaInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
ExaDriverPtr pExa;
/* FIXME: which chips support EXA ? */
if (pATI->Chip < ATI_CHIP_264CT)
{
xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
"EXA is not supported for ATI chips earlier than "
"the ATI Mach64.\n");
return FALSE;
}
pExa = exaDriverAlloc();
if (!pExa)
return FALSE;
pATI->pExa = pExa;
pExa->exa_major = 2;
pExa->exa_minor = 0;
Mach64SetupMemEXA(pScreen);
pExa->WaitMarker = Mach64WaitMarker;
pExa->PrepareSolid = Mach64PrepareSolid;
pExa->Solid = Mach64Solid;
pExa->DoneSolid = Mach64DoneSolid;
pExa->PrepareCopy = Mach64PrepareCopy;
pExa->Copy = Mach64Copy;
pExa->DoneCopy = Mach64DoneCopy;
/* EXA hits more optimized paths when it does not have to fallback because
* of missing UTS/DFS, hook memcpy-based UTS/DFS.
*/
pExa->UploadToScreen = Mach64UploadToScreen;
pExa->DownloadFromScreen = Mach64DownloadFromScreen;
if (pATI->RenderAccelEnabled) {
if (pATI->Chip >= ATI_CHIP_264GTPRO) {
/* 3D Rage Pro does not support NPOT textures. */
pExa->flags |= EXA_OFFSCREEN_ALIGN_POT;
pExa->CheckComposite = Mach64CheckComposite;
pExa->PrepareComposite = Mach64PrepareComposite;
pExa->Composite = Mach64Composite;
pExa->DoneComposite = Mach64DoneComposite;
} else {
xf86DrvMsg(pScreen->myNum, X_INFO,
"Render acceleration is not supported for ATI chips "
"earlier than the ATI 3D Rage Pro.\n");
pATI->RenderAccelEnabled = FALSE;
}
}
xf86DrvMsg(pScreen->myNum, X_INFO, "Render acceleration %s\n",
pATI->RenderAccelEnabled ? "enabled" : "disabled");
if (!exaDriverInit(pScreen, pATI->pExa)) {
xfree(pATI->pExa);
pATI->pExa = NULL;
return FALSE;
}
return TRUE;
}
#endif

View File

@ -0,0 +1,470 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c,v 1.1 2003/07/24 22:08:28 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atichip.h"
#include "atii2c.h"
#include "atimach64i2c.h"
#include "atimach64io.h"
#include "atituner.h"
/* MPP_CONFIG register values */
#define MPP_INIT pATI->NewHW.mpp_config
#define MPP_WRITE (MPP_INIT )
#define MPP_WRITEINC (MPP_INIT | (MPP_AUTO_INC_EN ))
#define MPP_READ (MPP_INIT | ( MPP_BUFFER_MODE_PREFETCH))
#define MPP_READINC (MPP_INIT | (MPP_AUTO_INC_EN | MPP_BUFFER_MODE_PREFETCH))
/*
* ATIMach64MPPWaitForIdle --
*
* Support function to wait for the Multimedia Peripheral Port to become idle.
* Currently, this function's return value indicates whether or not the port
* became idle within 512 polling iterations. For now, this value is ignored
* by the rest of the code, but might be used in the future.
*/
static Bool
ATIMach64MPPWaitForIdle
(
ATIPtr pATI
)
{
CARD32 Count = 0x0200;
while (in8(MPP_CONFIG + 3) & GetByte(MPP_BUSY, 3))
{
if (!--Count)
return FALSE;
usleep(1); /* XXX Excessive? */
}
return TRUE;
}
/*
* ATIMach64MPPSetAddress --
*
* Sets a 16-bit ImpacTV address on the Multimedia Peripheral Port.
*/
static void
ATIMach64MPPSetAddress
(
ATIPtr pATI,
CARD16 Address
)
{
ATIMach64MPPWaitForIdle(pATI);
outr(MPP_CONFIG, MPP_WRITEINC);
outr(MPP_ADDR, 0x00000008U);
out8(MPP_DATA, (CARD8)Address);
ATIMach64MPPWaitForIdle(pATI);
out8(MPP_DATA, (CARD8)(Address >> 8));
ATIMach64MPPWaitForIdle(pATI);
outr(MPP_CONFIG, MPP_WRITE);
outr(MPP_ADDR, 0x00000018U);
ATIMach64MPPWaitForIdle(pATI);
}
/*
* ATIMach64ImpacTVProbe --
*
* This probes for an ImpacTV chip and returns its chip ID, or 0.
*/
static int
ATIMach64ImpacTVProbe
(
int iScreen,
ATIPtr pATI
)
{
CARD8 ChipID = 0;
/* Assume ATIModePreInit() has already been called */
outr(MPP_STROBE_SEQ, pATI->NewHW.mpp_strobe_seq);
outr(TVO_CNTL, pATI->NewHW.tvo_cntl);
outr(MPP_CONFIG, MPP_READ);
ATIMach64MPPWaitForIdle(pATI);
outr(MPP_ADDR, 0x0000000AU);
if (!(ChipID = in8(MPP_DATA)))
{
ATIMach64MPPWaitForIdle(pATI);
outr(MPP_ADDR, 0x00000023U);
if ((ChipID = in8(MPP_DATA)) != 0x54U)
{
ATIMach64MPPWaitForIdle(pATI);
outr(MPP_ADDR, 0x0000000BU);
ChipID = in8(MPP_DATA);
}
}
ATIMach64MPPWaitForIdle(pATI);
outr(MPP_CONFIG, MPP_WRITE);
if (ChipID)
xf86DrvMsg(iScreen, X_PROBED, "ImpacTV chip ID 0x%02X detected.\n",
ChipID);
return (int)(CARD16)ChipID;
}
/*
* ATIMach64ImpacTVSetBits --
*
* Controls I2C SDA and SCL lines through ImpacTV.
*/
static void
ATIMach64ImpacTVSetBits
(
ATII2CPtr pATII2C,
ATIPtr pATI,
CARD32 Bits
)
{
pATII2C->I2CCur = Bits;
ATIMach64MPPSetAddress(pATI, IT_I2C_CNTL);
outr(MPP_CONFIG, MPP_WRITE);
out8(MPP_DATA, (CARD8)Bits);
ATIMach64MPPWaitForIdle(pATI);
}
/*
* ATIMach64ImpacTVGetBits --
*
* Returns the status of an ImpacTV's I2C control lines.
*/
static CARD32
ATIMach64ImpacTVGetBits
(
ATIPtr pATI
)
{
ATIMach64MPPSetAddress(pATI, IT_I2C_CNTL);
outr(MPP_CONFIG, MPP_READ);
ATIMach64MPPWaitForIdle(pATI);
return in8(MPP_DATA);
}
/*
* ATIMach64I2C_CNTLSetBits --
*
* Controls SDA and SCL lines through a 3D Rage Pro's hardware assisted I2C.
*/
static void
ATIMach64I2C_CNTLSetBits
(
ATII2CPtr pATII2C,
ATIPtr pATI,
CARD32 Bits
)
{
pATII2C->I2CCur = Bits;
out8(I2C_CNTL_0 + 1, (CARD8)Bits);
}
/*
* ATIMach64I2C_CNTLGetBits --
*
* Returns the status of a 3D Rage Pro's hardware assisted I2C control lines.
*/
static CARD32
ATIMach64I2C_CNTLGetBits
(
ATIPtr pATI
)
{
return in8(I2C_CNTL_0 + 1);
}
/*
* ATIMach64GP_IOSetBits --
*
* Controls SDA and SCL control lines through a Mach64's GP_IO register.
*/
static void
ATIMach64GP_IOSetBits
(
ATII2CPtr pATII2C,
ATIPtr pATI,
CARD32 Bits
)
{
pATII2C->I2CCur = Bits;
outr(GP_IO, Bits);
}
/*
* ATIMach64GP_IOGetBits --
*
* Returns the status of I2C control lines through a Mach64's GP_IO register.
*/
static CARD32
ATIMach64GP_IOGetBits
(
ATIPtr pATI
)
{
return inr(GP_IO);
}
#define GPIO1_MASK \
(DAC_GIO_STATE_1 | DAC_GIO_DIR_1)
#define GPIO2_MASK \
(GEN_GIO2_DATA_OUT | GEN_GIO2_DATA_IN | GEN_GIO2_WRITE)
/*
* ATIMach64DAC_GENSetBits --
*
* Controls SDA and SCL control lines through a Mach64's GEN_TEST_CNTL and
* DAC_CNTL registers.
*/
static void
ATIMach64DAC_GENSetBits
(
ATII2CPtr pATII2C,
ATIPtr pATI,
CARD32 Bits
)
{
CARD32 tmp;
pATII2C->I2CCur = Bits;
tmp = inr(DAC_CNTL) & ~GPIO1_MASK;
outr(DAC_CNTL, tmp | (Bits & GPIO1_MASK));
tmp = inr(GEN_TEST_CNTL) & ~GPIO2_MASK;
outr(GEN_TEST_CNTL, tmp | (Bits & GPIO2_MASK));
}
/*
* ATIMach64DAC_GENGetBits --
*
* Returns the status of I2C control lines through a Mach64's GEN_TEST_CNTL and
* DAC_CNTL registers.
*/
static CARD32
ATIMach64DAC_GENGetBits
(
ATIPtr pATI
)
{
return (inr(DAC_CNTL) & GPIO1_MASK) | (inr(GEN_TEST_CNTL) & GPIO2_MASK);
}
/*
* ATITVAddOnProbe --
*
* Probe for an ATI-TV add-on card at specific addresses on an I2C bus.
*/
static Bool
ATITVAddOnProbe
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI,
I2CBusPtr pI2CBus
)
{
I2CDevPtr pI2CDev = xnfcalloc(1, SizeOf(I2CDevRec));
int Index;
I2CByte tmp;
static const CARD8 ATITVAddOnAddresses[] = {0x70, 0x40, 0x78, 0x72, 0x42};
pI2CDev->DevName = "ATI-TV Add-on";
pI2CDev->pI2CBus = pI2CBus;
pI2CDev->StartTimeout = pI2CBus->StartTimeout;
pI2CDev->BitTimeout = pI2CBus->BitTimeout;
pI2CDev->AcknTimeout = pI2CBus->AcknTimeout;
pI2CDev->ByteTimeout = pI2CBus->ByteTimeout;
for (Index = 0; Index < NumberOf(ATITVAddOnAddresses); Index++)
{
pI2CDev->SlaveAddr = ATITVAddOnAddresses[Index];
if (xf86I2CFindDev(pI2CBus, pI2CDev->SlaveAddr))
continue;
tmp = 0xFFU;
if (!(*pI2CBus->I2CWriteRead)(pI2CDev, &tmp, 1, NULL, 0) ||
!(*pI2CBus->I2CWriteRead)(pI2CDev, NULL, 0, &tmp, 1) ||
(tmp == 0xFFU) || ((tmp = tmp & 0x1FU) == /*ATI_TUNER_NONE*/0))
continue;
if (!xf86I2CDevInit(pI2CDev))
{
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Failed to register I2C device for ATI-TV add-on.\n");
break;
}
if (pATI->Tuner != tmp)
{
if (pATI->Tuner != ATI_TUNER_NONE)
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Tuner type mismatch: BIOS 0x%x, ATI-TV 0x%x.\n",
pATI->Tuner, tmp);
pATI->Tuner = tmp;
}
xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED,
"%s tuner detected on ATI-TV add-on adapter at I2C bus address"
" 0x%2x.\n", ATITuners[pATI->Tuner].name, pI2CDev->SlaveAddr);
return TRUE;
}
xfree(pI2CDev);
return FALSE;
}
/*
* ATIMach64I2CPreInit --
*
* This function potentially allocates an I2CBusRec and initialises it with
* ATI-specific and Mach64-specific information.
*/
void
ATIMach64I2CPreInit
(
ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
I2CBusPtr pI2CBus;
ATII2CPtr pATII2C;
if ((pATI->Chip < ATI_CHIP_264CT) || (pATI->Chip >= ATI_CHIP_Mach64))
return;
/* Create an I2CBusRec and generically prime it */
if (!(pI2CBus = ATICreateI2CBusRec(pScreenInfo->scrnIndex, pATI, "Mach64")))
return;
pATII2C = pI2CBus->DriverPrivate.ptr;
switch (pATI->Chip)
{
case ATI_CHIP_264GTPRO:
case ATI_CHIP_264LTPRO:
case ATI_CHIP_264XL:
case ATI_CHIP_MOBILITY:
/*
* These have I2C-specific registers. Assume older I2C access
* mechanisms are inoperative.
*/
pATII2C->I2CSetBits = ATIMach64I2C_CNTLSetBits;
pATII2C->I2CGetBits = ATIMach64I2C_CNTLGetBits;
pATII2C->SCLDir = pATII2C->SDADir = 0;
pATII2C->SCLGet = pATII2C->SCLSet = GetByte(I2C_CNTL_SCL, 1);
pATII2C->SDAGet = pATII2C->SDASet = GetByte(I2C_CNTL_SDA, 1);
out8(I2C_CNTL_1 + 2, GetByte(I2C_SEL, 2));
out8(I2C_CNTL_0 + 0,
GetByte(I2C_CNTL_STAT | I2C_CNTL_HPTR_RST, 0));
break;
case ATI_CHIP_264VTB:
case ATI_CHIP_264GTB:
case ATI_CHIP_264VT3:
case ATI_CHIP_264GTDVD:
case ATI_CHIP_264LT:
case ATI_CHIP_264VT4:
case ATI_CHIP_264GT2C:
/* If an ImpacTV chip is found, use it to provide I2C access */
if (ATIMach64ImpacTVProbe(pScreenInfo->scrnIndex, pATI))
{
pATII2C->I2CSetBits = ATIMach64ImpacTVSetBits;
pATII2C->I2CGetBits = ATIMach64ImpacTVGetBits;
pATII2C->SCLDir = IT_SCL_DIR;
pATII2C->SCLGet = IT_SCL_GET;
pATII2C->SCLSet = IT_SCL_SET;
pATII2C->SDADir = IT_SDA_DIR;
pATII2C->SDAGet = IT_SDA_GET;
pATII2C->SDASet = IT_SDA_SET;
ATIMach64MPPSetAddress(pATI, IT_I2C_CNTL);
outr(MPP_CONFIG, MPP_WRITEINC);
out8(MPP_DATA, 0x00U);
out8(MPP_DATA, 0x55U);
out8(MPP_DATA, 0x00U);
out8(MPP_DATA, 0x00U);
ATIMach64MPPWaitForIdle(pATI);
break;
}
/* Otherwise, fall through to the older case */
case ATI_CHIP_264VT:
case ATI_CHIP_264GT:
/* First try GIO pins 11 (clock) and 4 (data) */
pATII2C->I2CSetBits = ATIMach64GP_IOSetBits;
pATII2C->I2CGetBits = ATIMach64GP_IOGetBits;
pATII2C->SCLDir = GP_IO_DIR_B;
pATII2C->SCLGet = pATII2C->SCLSet = GP_IO_B;
pATII2C->SDADir = GP_IO_DIR_4;
pATII2C->SDAGet = pATII2C->SDASet = GP_IO_4;
if (ATITVAddOnProbe(pScreenInfo, pATI, pI2CBus))
break;
/* Next, try pins 10 (clock) and 12 (data) */
pATII2C->SCLDir = GP_IO_DIR_A;
pATII2C->SCLGet = pATII2C->SCLSet = GP_IO_A;
pATII2C->SDADir = GP_IO_DIR_C;
pATII2C->SDAGet = pATII2C->SDASet = GP_IO_C;
if (ATITVAddOnProbe(pScreenInfo, pATI, pI2CBus))
break;
/* Otherwise, fall back to ATI's first I2C implementation */
default:
/*
* First generation integrated controllers access GIO pin 1 (clock)
* though DAC_CNTL, and pin 2 (data) through GEN_TEST_CNTL.
*/
pATII2C->I2CSetBits = ATIMach64DAC_GENSetBits;
pATII2C->I2CGetBits = ATIMach64DAC_GENGetBits;
pATII2C->SCLDir = DAC_GIO_DIR_1;
pATII2C->SCLGet = pATII2C->SCLSet = DAC_GIO_STATE_1;
pATII2C->SDADir = GEN_GIO2_WRITE;
pATII2C->SDAGet = GEN_GIO2_DATA_IN;
pATII2C->SDASet = GEN_GIO2_DATA_OUT;
(void)ATITVAddOnProbe(pScreenInfo, pATI, pI2CBus);
break;
}
}

View File

@ -0,0 +1,33 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h,v 1.1 2003/07/24 22:08:28 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMACH64I2C_H___
#define ___ATIMACH64I2C_H___ 1
#include "atipriv.h"
#include "xf86str.h"
extern void ATIMach64I2CPreInit(ScrnInfoPtr, ATIPtr);
#endif /* ___ATIMACH64I2C_H___ */

View File

@ -0,0 +1,104 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c,v 1.6 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ati.h"
#include "atichip.h"
#include "atimach64io.h"
/*
* ATIMach64AccessPLLReg --
*
* This function sets up the addressing required to access, for read or write,
* a 264xT's PLL registers.
*/
void
ATIMach64AccessPLLReg
(
ATIPtr pATI,
const CARD8 Index,
const Bool Write
)
{
CARD8 clock_cntl1 = in8(CLOCK_CNTL + 1) &
~GetByte(PLL_WR_EN | PLL_ADDR, 1);
/* Set PLL register to be read or written */
out8(CLOCK_CNTL + 1, clock_cntl1 |
GetByte(SetBits(Index, PLL_ADDR) | SetBits(Write, PLL_WR_EN), 1));
}
/*
* ATIMach64PollEngineStatus --
*
* This function refreshes the driver's view of the draw engine's status. This
* has been moved into a separate compilation unit to prevent inlining.
*/
void
ATIMach64PollEngineStatus
(
ATIPtr pATI
)
{
CARD32 IOValue;
int Count;
if (pATI->Chip < ATI_CHIP_264VTB)
{
/*
* TODO: Deal with locked engines.
*/
IOValue = inm(FIFO_STAT);
pATI->EngineIsLocked = GetBits(IOValue, FIFO_ERR);
/*
* The following counts the number of bits in FIFO_STAT_BITS, and is
* derived from miSetVisualTypes().
*/
IOValue = GetBits(IOValue, FIFO_STAT_BITS);
Count = (IOValue >> 1) & 0x36DBU;
Count = IOValue - Count - ((Count >> 1) & 0x36DBU);
Count = ((Count + (Count >> 3)) & 0x71C7U) % 0x3FU;
Count = pATI->nFIFOEntries - Count;
if (Count > pATI->nAvailableFIFOEntries)
pATI->nAvailableFIFOEntries = Count;
/*
* If the command FIFO is non-empty, then the engine isn't idle.
*/
if (pATI->nAvailableFIFOEntries < pATI->nFIFOEntries)
{
pATI->EngineIsBusy = TRUE;
return;
}
}
IOValue = inm(GUI_STAT);
pATI->EngineIsBusy = GetBits(IOValue, GUI_ACTIVE);
Count = GetBits(IOValue, GUI_FIFO);
if (Count > pATI->nAvailableFIFOEntries)
pATI->nAvailableFIFOEntries = Count;
}

View File

@ -0,0 +1,419 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.15 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Manuel Teira
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifndef ___ATIMACH64IO_H___
#if !defined(___ATI_H___) && defined(XFree86Module)
# error Missing #include "ati.h" before #include "atimach64io.h"
# undef XFree86Module
#endif
#define ___ATIMACH64IO_H___ 1
#include "atiio.h"
#include "atistruct.h"
/*
* A few important notes on some of the I/O statements provided:
*
* inl/outl 32-bit R/W through PIO space. The register is specified as the
* actual PIO address. These are actually defined in compiler.h.
*
* inw/outw 16-bit counterparts to inl/outl. Not used for Mach64 support.
*
* inb/outb 8-bit counterparts to inl/outl.
*
* inm/outm 32-bit R/W through MMIO space. The register is specified as
* the actual MMIO offset (with Block 1 following Block 0), which,
* in this case, is equivalent to the register's IOPortTag from
* atiregs.h. Can be used for those few non-FIFO'ed registers
* outside of Block 0's first 256 bytes. inm() can also be used
* for FIFO'ed registers if, and only if, it can be guaranteed to
* not have been previously FIFO'ed (e.g. when the engine is
* idle). pATI->pBlock array elements must have been previously
* set up by ATIMapApertures().
*
* outf 32-bit write through MMIO cache. Identical to outm() but
* intended for FIFO'ed registers. There is no inf() provided.
*
* inr/outr 32-bit R/W through PIO or MMIO. Which one depends on the
* machine architecture. The register is specified as a IOPortTag
* from atiregs.h. Can only be used for registers in the first
* 256 bytes of MMIO space (in Block 0). Note that all of these
* registers are non-FIFO'ed.
*
* in8/out8 8-bit counterparts to inr/outr.
*
* For portability reasons, inr/outr/in8/out8 should be used in preference to
* inl/outl/inb/outb to/from any register space starting with CRTC_H_TOTAL_DISP
* but before DST_OFF_PITCH (in the order defined by atiregs.h). None of
* inm/outm/outf should ever be used for these registers.
*
* outf()'s should be grouped together as much as possible, while respecting
* any ordering constraints the engine might impose. Groups larger than 16
* outf()'s should be split up into two or more groups as needed (but not
* necessarily wanted). The outf() groups that result should be immediately
* preceeded by an ATIMach64WaitForFIFO(n) call, where "n" is the number of
* outf()'s in the group with the exception that groups containing a single
* outf() should not be thus preceeded. This means "n" should not be less than
* 2, nor larger than 16.
*/
/*
* Cave canem (or it WILL bite you): All Mach64 non-VGA registers are
* ================================ little-endian, no matter how they are
* accessed (nor by what).
*/
#define inm(_Register) \
MMIO_IN32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \
(_Register) & MM_IO_SELECT)
#define outm(_Register, _Value) \
MMIO_OUT32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \
(_Register) & MM_IO_SELECT, _Value)
#ifdef AVOID_CPIO
# define inr(_Register) \
MMIO_IN32(pATI->pBlock[0], (_Register) & MM_IO_SELECT)
# define outr(_Register, _Value) \
MMIO_OUT32(pATI->pBlock[0], (_Register) & MM_IO_SELECT, _Value)
# define in8(_Register) \
MMIO_IN8(pATI->pBlock[0], \
(_Register) & (MM_IO_SELECT | IO_BYTE_SELECT))
# define out8(_Register, _Value) \
MMIO_OUT8(pATI->pBlock[0], \
(_Register) & (MM_IO_SELECT | IO_BYTE_SELECT), _Value)
/* Cause a cpp syntax error if any of these are used */
#undef inb
#undef inw
#undef inl
#undef outb
#undef outw
#undef outl
#define inb() /* Nothing */
#define inw() /* Nothing */
#define inl() /* Nothing */
#define outb() /* Nothing */
#define outw() /* Nothing */
#define outl() /* Nothing */
#else /* AVOID_CPIO */
# define ATIIOPort(_PortTag) \
(((pATI->CPIODecoding == SPARSE_IO) ? \
((_PortTag) & (SPARSE_IO_SELECT | IO_BYTE_SELECT)) : \
((_PortTag) & (BLOCK_IO_SELECT | IO_BYTE_SELECT))) | \
pATI->CPIOBase)
# define inr(_Register) \
inl(ATIIOPort(_Register))
# define outr(_Register, _Value) \
outl(ATIIOPort(_Register), _Value)
# define in8(_Register) \
inb(ATIIOPort(_Register))
# define out8(_Register, _Value) \
outb(ATIIOPort(_Register), _Value)
#endif /* AVOID_CPIO */
extern void ATIMach64PollEngineStatus(ATIPtr);
/*
* MMIO cache definitions.
*
* Many FIFO'ed registers can be cached by the driver. Registers that qualify
* for caching must not contain values that can change without driver
* intervention. Thus registers that contain hardware counters, strobe lines,
* etc., cannot be cached. This caching is intended to minimise FIFO use.
* There is therefore not much point to enable it for non-FIFO'ed registers.
*
* The cache for a particular 32-bit register is enabled by coding a
* CacheRegister() line for that register in the ATIMach64Set() function. The
* integrity of the cache for a particular register should be verified by the
* ATIMach64Sync() function. This code should be kept in register order, as
* defined in atiregs.h.
*/
#define CacheByte(___Register) pATI->MMIOCached[CacheSlotOf(___Register) >> 3]
#define CacheBit(___Register) (0x80U >> (CacheSlotOf(___Register) & 0x07U))
#define RegisterIsCached(__Register) \
(CacheByte(__Register) & CacheBit(__Register))
#define CacheSlot(__Register) pATI->MMIOCache[CacheSlotOf(__Register)]
#define CacheRegister(__Register) \
CacheByte(__Register) |= CacheBit(__Register)
#define UncacheRegister(__Register) \
CacheByte(__Register) &= ~CacheBit(__Register)
/* This would be quite a bit slower as a function */
#define outf(_Register, _Value) \
do \
{ \
CARD32 _IOValue = (_Value); \
\
if (!RegisterIsCached(_Register) || \
(_IOValue != CacheSlot(_Register))) \
{ \
while (!pATI->nAvailableFIFOEntries--) \
ATIMach64PollEngineStatus(pATI); \
MMIO_OUT32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \
(_Register) & MM_IO_SELECT, _IOValue); \
CacheSlot(_Register) = _IOValue; \
pATI->EngineIsBusy = TRUE; \
} \
} while (0)
/*
* This is no longer as critical, especially for _n == 1. However,
* there is still a need to ensure _n <= pATI->nFIFOEntries.
*/
#define ATIMach64WaitForFIFO(_pATI, _n) \
while ((_pATI)->nAvailableFIFOEntries < (_n)) \
ATIMach64PollEngineStatus(_pATI)
#define ATIMach64WaitForIdle(_pATI) \
while ((_pATI)->EngineIsBusy) \
ATIMach64PollEngineStatus(_pATI)
#ifdef XF86DRI_DEVEL
/*
* DRI Sync and Lock definitions.
*/
#define ATIDRIWaitForIdle(_pATI) \
do { \
ATIDRIServerInfoPtr pATIDRIServer = _pATI->pDRIServerInfo; \
int ret; \
\
if (pATIDRIServer && pATI->directRenderingEnabled) { \
/* Wait for DMA to complete */ \
ret = drmCommandNone(_pATI->drmFD, DRM_MACH64_IDLE); \
if (ret) { \
drmCommandNone(_pATI->drmFD, DRM_MACH64_RESET); \
} \
\
/* Force updating of FIFO entry counters */ \
pATI->EngineIsBusy = TRUE; \
ATIMach64PollEngineStatus(_pATI); \
} else { \
ATIMach64WaitForIdle(_pATI); \
} \
} while (0)
/*
* Set upon DRISwapContext and when DRI accesses the GPU engine
* from within the server, see DRIInitBuffers/DRIMoveBuffers.
*
* Forces the EXA/XAA software paths to sync before accessing the FB memory.
*/
static __inline__ void ATIDRIMarkSyncInt(ScrnInfoPtr _pScrInfo)
{
ATIPtr _pATI=ATIPTR(_pScrInfo);
#ifdef USE_EXA
if (_pATI->useEXA)
exaMarkSync(_pScrInfo->pScreen);
#endif
#ifdef USE_XAA
if (!_pATI->useEXA)
SET_SYNC_FLAG(_pATI->pXAAInfo); /* NeedToSync = TRUE */
#endif
}
/*
* Set upon DRISwapContext and when the server acquires the DRI lock.
*
* Forces the EXA/XAA accelerated paths to sync before accessing the GPU engine.
*/
static __inline__ void ATIDRIMarkSyncExt(ScrnInfoPtr _pScrInfo)
{
ATIPtr _pATI=ATIPTR(_pScrInfo);
_pATI->NeedDRISync = TRUE;
}
static __inline__ void ATIDRISync(ScrnInfoPtr _pScrInfo)
{
ATIPtr _pATI=ATIPTR(_pScrInfo);
#ifdef USE_EXA
if (_pATI->directRenderingEnabled && _pATI->pExa)
{
if (_pATI->NeedDRISync) exaWaitSync(_pScrInfo->pScreen);
}
#endif
#ifdef USE_XAA
if (_pATI->directRenderingEnabled && _pATI->pXAAInfo)
{
if (_pATI->NeedDRISync) (*_pATI->pXAAInfo->Sync)(_pScrInfo);
}
#endif
}
#define ATIDRILock(_pScrInfo) \
do \
{ \
ATIPtr _pATI=ATIPTR(_pScrInfo); \
if (_pATI->directRenderingEnabled) \
{ \
DRILock(_pScrInfo->pScreen, 0); \
ATIDRIMarkSyncExt(_pScrInfo); \
} \
} while (0)
#define ATIDRIUnlock(_pScrInfo) \
do \
{ \
ATIPtr _pATI=ATIPTR(_pScrInfo); \
if (_pATI->directRenderingEnabled) \
{ \
DRIUnlock(_pScrInfo->pScreen); \
} \
} while (0)
#else /* XF86DRI_DEVEL */
#define ATIDRIWaitForIdle(_pATI)
#define ATIDRILock(_pScrInfo)
#define ATIDRIUnlock(_pScrInfo)
#define ATIDRISync(_pScrInfo)
#endif /* XF86DRI_DEVEL */
/*
* An outf() variant to write two registers such that the second register is
* is always written whenever either is to be changed.
*/
#define outq(_Register1, _Register2, _Value1, _Value2) \
do \
{ \
CARD32 _IOValue1 = (_Value1), \
_IOValue2 = (_Value2); \
\
if (!RegisterIsCached(_Register1) || \
(_IOValue1 != CacheSlot(_Register1))) \
{ \
ATIMach64WaitForFIFO(pATI, 2); \
pATI->nAvailableFIFOEntries -= 2; \
MMIO_OUT32(pATI->pBlock[GetBits(_Register1, BLOCK_SELECT)], \
(_Register1) & MM_IO_SELECT, _IOValue1); \
MMIO_OUT32(pATI->pBlock[GetBits(_Register2, BLOCK_SELECT)], \
(_Register2) & MM_IO_SELECT, _IOValue2); \
CacheSlot(_Register1) = _IOValue1; \
CacheSlot(_Register2) = _IOValue2; \
pATI->EngineIsBusy = TRUE; \
} \
else if (!RegisterIsCached(_Register2) || \
(_IOValue2 != CacheSlot(_Register2))) \
{ \
while (!pATI->nAvailableFIFOEntries--) \
ATIMach64PollEngineStatus(pATI); \
MMIO_OUT32(pATI->pBlock[GetBits(_Register2, BLOCK_SELECT)], \
(_Register2) & MM_IO_SELECT, _IOValue2); \
CacheSlot(_Register2) = _IOValue2; \
pATI->EngineIsBusy = TRUE; \
} \
} while (0)
extern void ATIMach64AccessPLLReg(ATIPtr, const CARD8, const Bool);
#define ATIMach64GetPLLReg(_Index) \
( \
ATIMach64AccessPLLReg(pATI, _Index, FALSE), \
in8(CLOCK_CNTL + 2) \
)
#define ATIMach64PutPLLReg(_Index, _Value) \
do \
{ \
ATIMach64AccessPLLReg(pATI, _Index, TRUE); \
out8(CLOCK_CNTL + 2, _Value); \
} while (0)
#define ATIMach64GetLCDReg(_Index) \
( \
out8(LCD_INDEX, SetBits(_Index, LCD_REG_INDEX)), \
inr(LCD_DATA) \
)
#define ATIMach64PutLCDReg(_Index, _Value) \
do \
{ \
out8(LCD_INDEX, SetBits(_Index, LCD_REG_INDEX)); \
outr(LCD_DATA, _Value); \
} while (0)
#define ATIMach64GetTVReg(_Index) \
( \
out8(TV_OUT_INDEX, SetBits(_Index, TV_REG_INDEX)), \
inr(TV_OUT_DATA) \
)
#define ATIMach64PutTVReg(_Index, _Value) \
do \
{ \
out8(TV_OUT_INDEX, SetBits(_Index, TV_REG_INDEX)); \
outr(TV_OUT_DATA, _Value); \
} while (0)
/*
* Block transfer definitions.
*/
#if defined(GCCUSESGAS) && \
(defined(i386) || defined(__i386) || defined(__i386__))
#define ATIMove32(_pDst, _pSrc, _nCount) \
do \
{ \
long d0, d1, d2; \
__asm__ __volatile__ \
( \
"cld\n\t" \
"rep ; movsl" \
: "=&c" (d0), \
"=&D" (d1), \
"=&S" (d2) \
: "0" (_nCount), \
"1" (_pDst), \
"2" (_pSrc) \
: "memory" \
); \
} while (0)
#endif
/*
* Return the MMIO address of register, used for HOST_DATA_X only.
*/
#define ATIHostDataAddr(_Register) \
((CARD8 *)pATI->pBlock[GetBits(_Register, BLOCK_SELECT)] + \
((_Register) & MM_IO_SELECT))
#endif /* ___ATIMACH64IO_H___ */

View File

@ -0,0 +1,891 @@
/*
* Copyright 2006 George Sapountzis
* All Rights Reserved.
*
* Based on the mach64 DRI and DRM drivers:
* Copyright 2000 Gareth Hughes
* Copyright 2002-2003 Leif Delgass
* All Rights Reserved.
*
* Based on the ati hw/kdrive driver:
* Copyright 2003 Eric Anholt, Anders Carlsson
*
* Based on the via hw/xfree86 driver:
* Copyright 2006 Thomas Hellstrom. 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.
*
* Authors:
* George Sapountzis <gsap7@yahoo.gr>
*/
/*
* Interesting cases for RENDER acceleration:
*
* cursor : ARGB8888 (24x24) Over
* RGB565
*
* glyph : A8 (9x10) Add
* A8 (420x13)
* glyph set : ARGB8888 (1x1 R) In
* A8 (420x13) Over
* RGB565
*
* shadow : ARGB8888 (1x1 R) In
* A8 (670x362) Over
* RGB565
* translucent : RGB565 (652x344) In
* A8 (1x1 R) Over
* RGB565
*
* In all interesting cases one of src/mask is "1x1 R".
*/
/*
* Assumptions and limitations of mach64 RENDER acceleration:
*
* RENDER acceleration is supported for GTPRO and later chips using the 3D
* triangle setup, i.e. the VERTEX_? registers (see the dri driver). According
* to atiregs.h, SCALE_3D_CNTL and TEX_?_OFF appear in GT, thus chips as old
* as GT should be capable of RENDER acceleration, using the S_?_INC, T_?_INC
* registers for texture mapping (see the directfb driver).
*
* GTPRO added a triangle setup engine and multitexturing. However, it seems
* that none of the 8bpp mach64 formats expands the 8bit value to the alpha
* channel in texture mapping, RGB8 appears to expand to (I,I,I,0). This makes
* GTPRO multitexturing unsuitable for emulating the IN operation. Moreover,
* it seems that GT/GTPRO has a muxltiplexer instead of a blender for computing
* the final alpha channel which forbids destinations with an alpha channel and
* generic two-pass compositing.
*
* A texture unit combines the fragment color (VERTEX_?_ARGB) coming in from
* triangle rasterization with the texel from the texture according to the
* texture environment (TEX_LIGHT_FCN_). "1x1 R" textures may come in as frag-
* ment colors, eliminating the need for multitexturing in all interesting
* cases (via also uses this optimization).
*
* Texture registers are saved/restored and cached (see atimach64.c). TEX_CNTL
* cannot be cached because it flushes the texture cache. TEX_?_OFF are also
* not cached because I am not sure whether writing at some offset register
* affects the value at another offset.
*
* Vertex registers are not saved/restored. This shouldn't be a problem though
* either for DRI or VT switch because vertex registers are set and used within
* a signle acceleration hook. Synchronization between the DDX and DRI is based
* on calling ATIDRISync() at the beginning of each DDX acceleration hook,
* which suggests the assumption that individual acceleration hooks are not
* interrupted.
*/
#include <string.h>
#include <stdio.h>
/*
* Helper functions copied from exa and via.
*/
#if 0
static void
Mach64ExaCompositePictDesc(PicturePtr pict, char *string, int n)
{
char format[20];
char size[20];
if (!pict) {
snprintf(string, n, "None");
return;
}
switch (pict->format) {
case PICT_x8r8g8b8:
snprintf(format, 20, "RGB8888 ");
break;
case PICT_x8b8g8r8:
snprintf(format, 20, "BGR8888 ");
break;
case PICT_a8r8g8b8:
snprintf(format, 20, "ARGB8888");
break;
case PICT_a8b8g8r8:
snprintf(format, 20, "ABGR8888");
break;
case PICT_r5g6b5:
snprintf(format, 20, "RGB565 ");
break;
case PICT_x1r5g5b5:
snprintf(format, 20, "RGB555 ");
break;
case PICT_a8:
snprintf(format, 20, "A8 ");
break;
case PICT_a1:
snprintf(format, 20, "A1 ");
break;
default:
snprintf(format, 20, "0x%x", (int)pict->format);
break;
}
snprintf(size, 20, "%dx%d%s%s",
pict->pDrawable->width,
pict->pDrawable->height,
pict->repeat ? " R" : "",
pict->componentAlpha ? " C" : ""
);
snprintf(string, n, "%-10p: fmt %s (%s)", (void *)pict->pDrawable, format, size);
}
static void
Mach64ExaPrintComposite(CARD8 op,
PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, char *string)
{
char sop[20];
char srcdesc[40], maskdesc[40], dstdesc[40];
switch (op) {
case PictOpSrc:
sprintf(sop, "Src");
break;
case PictOpOver:
sprintf(sop, "Over");
break;
case PictOpInReverse:
sprintf(sop, "InR");
break;
case PictOpOutReverse:
sprintf(sop, "OutR");
break;
case PictOpAdd:
sprintf(sop, "Add");
break;
default:
sprintf(sop, "0x%x", (int)op);
break;
}
Mach64ExaCompositePictDesc(pSrc, srcdesc, 40);
Mach64ExaCompositePictDesc(pMask, maskdesc, 40);
Mach64ExaCompositePictDesc(pDst, dstdesc, 40);
sprintf(string, "op %s, \n"
" src %s\n"
" mask %s\n"
" dst %s\n", sop, srcdesc, maskdesc, dstdesc);
}
#endif
static __inline__ CARD32
viaBitExpandHelper(CARD32 component, CARD32 bits)
{
CARD32 tmp, mask;
mask = (1 << (8 - bits)) - 1;
tmp = component << (8 - bits);
return ((component & 1) ? tmp | mask : tmp);
}
static __inline__ void
Mach64PixelARGB(PixmapPtr pPixmap, CARD32 format, CARD32 *argb)
{
CARD32 pixel;
CARD8 comp;
int bits, shift;
/* Ensure that texture drawing has completed. */
exaWaitSync(pPixmap->drawable.pScreen);
/* exaGetPixmapFirstPixel() */
switch (pPixmap->drawable.bitsPerPixel) {
case 32:
pixel = *(CARD32 *)(pPixmap->devPrivate.ptr);
break;
case 16:
pixel = *(CARD16 *)(pPixmap->devPrivate.ptr);
break;
default:
pixel = *(CARD8 *)(pPixmap->devPrivate.ptr);
break;
}
/* exaGetRGBAFromPixel()/viaPixelARGB8888() */
switch (PICT_FORMAT_TYPE(format)) {
case PICT_TYPE_A:
shift = 0;
bits = PICT_FORMAT_A(format);
comp = (pixel >> shift) & ((1 << bits) - 1);
comp = viaBitExpandHelper(comp, bits);
*argb = comp << 24;
break;
case PICT_TYPE_ARGB:
shift = 0;
bits = PICT_FORMAT_B(format);
comp = (pixel >> shift) & ((1 << bits) - 1);
comp = viaBitExpandHelper(comp, bits);
*argb = comp;
shift += bits;
bits = PICT_FORMAT_G(format);
comp = (pixel >> shift) & ((1 << bits) - 1);
comp = viaBitExpandHelper(comp, bits);
*argb |= comp << 8;
shift += bits;
bits = PICT_FORMAT_R(format);
comp = (pixel >> shift) & ((1 << bits) - 1);
comp = viaBitExpandHelper(comp, bits);
*argb |= comp << 16;
shift += bits;
bits = PICT_FORMAT_A(format);
if (bits) {
comp = (pixel >> shift) & ((1 << bits) - 1);
comp = viaBitExpandHelper(comp, bits);
} else {
comp = 0xff;
}
*argb |= comp << 24;
break;
case PICT_TYPE_ABGR:
break;
default:
break;
}
}
/*
* RENDER acceleration for mach64
*/
typedef struct {
Bool supported;
CARD32 scale_3d_cntl;
} Mach64BlendOp;
static Mach64BlendOp Mach64BlendOps[] = {
/* Clear */
{1, MACH64_ALPHA_BLEND_SRC_ZERO | MACH64_ALPHA_BLEND_DST_ZERO},
/* Src */
{1, MACH64_ALPHA_BLEND_SRC_ONE | MACH64_ALPHA_BLEND_DST_ZERO},
/* Dst */
{1, MACH64_ALPHA_BLEND_SRC_ZERO | MACH64_ALPHA_BLEND_DST_ONE},
/* Over */
{1, MACH64_ALPHA_BLEND_SRC_ONE | MACH64_ALPHA_BLEND_DST_INVSRCALPHA},
/* OverReverse */
{1, MACH64_ALPHA_BLEND_SRC_INVDSTALPHA | MACH64_ALPHA_BLEND_DST_ONE},
/* In */
{1, MACH64_ALPHA_BLEND_SRC_DSTALPHA | MACH64_ALPHA_BLEND_DST_ZERO},
/* InReverse */
{1, MACH64_ALPHA_BLEND_SRC_ZERO | MACH64_ALPHA_BLEND_DST_SRCALPHA},
/* Out */
{1, MACH64_ALPHA_BLEND_SRC_INVDSTALPHA | MACH64_ALPHA_BLEND_DST_ZERO},
/* OutReverse */
{1, MACH64_ALPHA_BLEND_SRC_ZERO | MACH64_ALPHA_BLEND_DST_INVSRCALPHA},
/* Atop */
{0, MACH64_ALPHA_BLEND_SRC_DSTALPHA | MACH64_ALPHA_BLEND_DST_INVSRCALPHA},
/* AtopReverse */
{0, MACH64_ALPHA_BLEND_SRC_INVDSTALPHA | MACH64_ALPHA_BLEND_DST_SRCALPHA},
/* Xor */
{1, MACH64_ALPHA_BLEND_SRC_INVDSTALPHA | MACH64_ALPHA_BLEND_DST_INVSRCALPHA},
/* Add */
{1, MACH64_ALPHA_BLEND_SRC_ONE | MACH64_ALPHA_BLEND_DST_ONE}
};
#define MACH64_NR_BLEND_OPS \
(sizeof(Mach64BlendOps) / sizeof(Mach64BlendOps[0]))
typedef struct {
CARD32 pictFormat;
CARD32 dstFormat;
CARD32 texFormat;
} Mach64TexFormat;
static Mach64TexFormat Mach64TexFormats[] = {
{PICT_a8r8g8b8, -1, MACH64_DATATYPE_ARGB8888},
{PICT_x8r8g8b8, MACH64_DATATYPE_ARGB8888, MACH64_DATATYPE_ARGB8888},
{PICT_a1r5g5b5, -1, MACH64_DATATYPE_ARGB1555},
{PICT_x1r5g5b5, MACH64_DATATYPE_ARGB1555, MACH64_DATATYPE_ARGB1555},
{PICT_r5g6b5, MACH64_DATATYPE_RGB565, MACH64_DATATYPE_RGB565 },
{PICT_a8, MACH64_DATATYPE_RGB8, MACH64_DATATYPE_RGB8 }
};
#define MACH64_NR_TEX_FORMATS \
(sizeof(Mach64TexFormats) / sizeof(Mach64TexFormats[0]))
#define MACH64_PICT_IS_1x1R(_pPict) \
((_pPict) && \
(_pPict)->pDrawable->width == 1 && \
(_pPict)->pDrawable->height == 1 && \
(_pPict)->repeat)
/*
* CheckComposite hook helper functions.
*/
static __inline__ Bool
Mach64GetOrder(int val, int *shift)
{
*shift = 0;
while (val > (1 << *shift))
(*shift)++;
return (val == (1 << *shift));
}
static Bool
Mach64CheckTexture(PicturePtr pPict)
{
int w = pPict->pDrawable->width;
int h = pPict->pDrawable->height;
int l2w, l2h, level, i;
for (i = 0; i < MACH64_NR_TEX_FORMATS; i++) {
if (Mach64TexFormats[i].pictFormat == pPict->format)
break;
}
if (i == MACH64_NR_TEX_FORMATS)
MACH64_FALLBACK(("Unsupported picture format 0x%x\n",
(int)pPict->format));
/* l2w equals l2p (pitch) for all interesting cases (w >= 64) */
Mach64GetOrder(w, &l2w);
Mach64GetOrder(h, &l2h);
level = (l2w > l2h) ? l2w : l2h;
if (level > 10)
MACH64_FALLBACK(("Picture w/h too large (%dx%d)\n", w, h));
return TRUE;
}
/*
* CheckComposite acceleration hook.
*/
Bool
Mach64CheckComposite
(
int op,
PicturePtr pSrcPicture,
PicturePtr pMaskPicture,
PicturePtr pDstPicture
)
{
Bool src_solid, mask_solid, mask_comp, op_comp;
int i;
if (op >= MACH64_NR_BLEND_OPS || !Mach64BlendOps[op].supported)
return FALSE;
if (!Mach64CheckTexture(pSrcPicture))
return FALSE;
if (pMaskPicture && !Mach64CheckTexture(pMaskPicture))
return FALSE;
/* Check destination format */
for (i = 0; i < MACH64_NR_TEX_FORMATS; i++) {
if (Mach64TexFormats[i].pictFormat == pDstPicture->format)
break;
}
if (i == MACH64_NR_TEX_FORMATS || Mach64TexFormats[i].dstFormat == -1)
MACH64_FALLBACK(("Unsupported dst format 0x%x\n",
(int)pDstPicture->format));
/* Check that A8 src/dst appears only as "A8 ADD A8" */
if (pDstPicture->format == PICT_a8) {
if (pMaskPicture || pSrcPicture->format != PICT_a8 || op != PictOpAdd)
MACH64_FALLBACK(("A8 dst with mask or non-A8 src.\n"));
}
if (pDstPicture->format != PICT_a8) {
if (pSrcPicture->format == PICT_a8)
MACH64_FALLBACK(("A8 src with non-A8 dst.\n"));
}
/* Check that one of src/mask can come in as the fragment color. */
src_solid = MACH64_PICT_IS_1x1R(pSrcPicture);
mask_solid = MACH64_PICT_IS_1x1R(pMaskPicture);
mask_comp = pMaskPicture && pMaskPicture->componentAlpha;
op_comp = op == PictOpAdd ||
op == PictOpInReverse ||
op == PictOpOutReverse;
if (mask_solid && src_solid)
MACH64_FALLBACK(("Bad one-pixel IN composite operation.\n"));
if (pMaskPicture) {
if (!mask_solid && !src_solid)
MACH64_FALLBACK(("Multitexturing required.\n"));
if (!mask_solid && !op_comp)
MACH64_FALLBACK(("Non-solid mask.\n"));
if (mask_comp && !src_solid)
MACH64_FALLBACK(("Component-alpha mask.\n"));
if (!mask_comp && pMaskPicture->format != PICT_a8)
MACH64_FALLBACK(("Non-A8 mask.\n"));
if (mask_comp && pMaskPicture->format != PICT_a8r8g8b8)
MACH64_FALLBACK(("Non-ARGB mask.\n"));
}
return TRUE;
}
/*
* This function setups the fragment color from a solid pixmap in the presence
* of a mask.
*/
static __inline__ Bool
Mach64PrepareMask
(
Mach64ContextRegs3D *m3d,
int op,
PicturePtr pSrcPicture,
PicturePtr pMaskPicture,
PixmapPtr pSrc,
PixmapPtr pMask
)
{
Bool mask_solid, src_solid;
CARD32 argb = 0;
mask_solid = MACH64_PICT_IS_1x1R(pMaskPicture);
src_solid = MACH64_PICT_IS_1x1R(pSrcPicture);
if (mask_solid) {
Mach64PixelARGB(pMask, pMaskPicture->format, &argb);
argb >>= 24;
argb &= 0xff;
m3d->frag_mask = TRUE;
m3d->frag_color = (argb << 24) | (argb << 16) | (argb << 8) | argb;
return TRUE;
}
if (src_solid) {
/* We can only handle cases where either the src color (e.g. ADD) or
* the src alpha (e.g. IN_REV, OUT_REV) is used but not both.
*
* (ARGB8888 IN A8) OVER RGB565 is implemented as:
* (ARGB8888 IN A8) ADD ((ARGB8888 IN A8) OUT_REV RGB565).
*/
if (op == PictOpInReverse || op == PictOpOutReverse) {
Mach64PixelARGB(pSrc, pSrcPicture->format, &argb);
argb >>= 24;
argb &= 0xff;
m3d->frag_src = TRUE;
m3d->frag_color = (argb << 24) | (argb << 16) | (argb << 8) | argb;
m3d->color_alpha = TRUE;
return TRUE;
}
if (op == PictOpAdd) {
Mach64PixelARGB(pSrc, pSrcPicture->format, &argb);
m3d->frag_src = TRUE;
m3d->frag_color = argb;
return TRUE;
}
}
return FALSE;
}
/*
* This function setups the texturing and blending environments. It also
* manipulates blend control for non-solid masks.
*/
static void __inline__
Mach64BlendCntl(Mach64ContextRegs3D *m3d, int op)
{
m3d->scale_3d_cntl |= MACH64_SCALE_PIX_EXPAND_DYNAMIC_RANGE |
MACH64_SCALE_DITHER_2D_TABLE |
MACH64_DITHER_INIT_RESET;
m3d->scale_3d_cntl |= Mach64BlendOps[op].scale_3d_cntl;
if (m3d->color_alpha) {
/* A8 uses RGB8 which expands to (I,I,I,0). Thus, we use the color
* channels instead of the alpha channel as the alpha factor. We also
* use the color channels for ARGB8888 masks with component-alpha.
*/
CARD32 Ad = m3d->scale_3d_cntl & MACH64_ALPHA_BLEND_DST_MASK;
/* InReverse */
if (Ad == MACH64_ALPHA_BLEND_DST_SRCALPHA) {
m3d->scale_3d_cntl &= ~MACH64_ALPHA_BLEND_DST_MASK;
m3d->scale_3d_cntl |= MACH64_ALPHA_BLEND_DST_SRCCOLOR;
}
/* OutReverse */
if (Ad == MACH64_ALPHA_BLEND_DST_INVSRCALPHA) {
m3d->scale_3d_cntl &= ~MACH64_ALPHA_BLEND_DST_MASK;
m3d->scale_3d_cntl |= MACH64_ALPHA_BLEND_DST_INVSRCCOLOR;
}
}
/* Can't color mask and blend at the same time */
m3d->dp_write_mask = 0xffffffff;
/* Can't fog and blend at the same time */
m3d->scale_3d_cntl |= MACH64_ALPHA_FOG_EN_ALPHA;
/* Enable texture mapping mode */
m3d->scale_3d_cntl |= MACH64_SCALE_3D_FCN_TEXTURE;
m3d->scale_3d_cntl |= MACH64_MIP_MAP_DISABLE;
/* Setup the texture environment */
m3d->scale_3d_cntl |= MACH64_TEX_LIGHT_FCN_MODULATE;
/* Initialize texture unit */
m3d->tex_cntl |= MACH64_TEX_ST_DIRECT |
MACH64_TEX_SRC_LOCAL |
MACH64_TEX_UNCOMPRESSED |
MACH64_TEX_CACHE_FLUSH |
MACH64_TEX_CACHE_SIZE_4K;
}
/*
* This function setups the texture unit.
*/
static Bool
Mach64PrepareTexture(PicturePtr pPict, PixmapPtr pPix)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pPix->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
Mach64ContextRegs3D *m3d = &pATI->m3d;
CARD32 texFormat;
int w = pPict->pDrawable->width;
int h = pPict->pDrawable->height;
int l2w, l2h, l2p, level, pitch, cpp, i;
/* Prepare picture format */
for (i = 0; i < MACH64_NR_TEX_FORMATS; i++) {
if (Mach64TexFormats[i].pictFormat == pPict->format)
break;
}
texFormat = Mach64TexFormats[i].texFormat;
/* Prepare picture size */
cpp = PICT_FORMAT_BPP(pPict->format) / 8;
pitch = exaGetPixmapPitch(pPix) / cpp;
Mach64GetOrder(w, &l2w);
Mach64GetOrder(h, &l2h);
Mach64GetOrder(pitch, &l2p);
if (pPict->repeat && w == 1 && h == 1)
l2p = 0;
else if (pPict->repeat)
MACH64_FALLBACK(("Repeat not supported for w,h != 1,1\n"));
l2w = l2p;
level = (l2w > l2h) ? l2w : l2h;
m3d->tex_width = (1 << l2w);
m3d->tex_height = (1 << l2h);
/* Update hw state */
m3d->dp_pix_width |= SetBits(texFormat, DP_SCALE_PIX_WIDTH);
m3d->tex_size_pitch = (l2w << 0) |
(level << 4) |
(l2h << 8);
m3d->tex_offset = exaGetPixmapOffset(pPix);
if (PICT_FORMAT_A(pPict->format))
m3d->scale_3d_cntl |= MACH64_TEX_MAP_AEN;
switch (pPict->filter) {
case PictFilterNearest:
m3d->scale_3d_cntl |= MACH64_TEX_BLEND_FCN_NEAREST;
break;
case PictFilterBilinear:
/* FIXME */
#if 0
m3d->scale_3d_cntl |= MACH64_TEX_BLEND_FCN_LINEAR;
m3d->scale_3d_cntl |= MACH64_BILINEAR_TEX_EN;
#endif
MACH64_FALLBACK(("Bilinear filter 0x%x\n", pPict->filter));
break;
default:
MACH64_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
}
m3d->transform = pPict->transform;
return TRUE;
}
/*
* PrepareComposite acceleration hook.
*/
Bool
Mach64PrepareComposite
(
int op,
PicturePtr pSrcPicture,
PicturePtr pMaskPicture,
PicturePtr pDstPicture,
PixmapPtr pSrc,
PixmapPtr pMask,
PixmapPtr pDst
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pDst->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
Mach64ContextRegs3D *m3d = &pATI->m3d;
CARD32 dstFormat;
int offset, i;
ATIDRISync(pScreenInfo);
/* Initialize state */
m3d->dp_mix = SetBits(MIX_SRC, DP_BKGD_MIX) |
SetBits(MIX_SRC, DP_FRGD_MIX);
m3d->dp_src = SetBits(SRC_SCALER_3D, DP_BKGD_SRC) |
SetBits(SRC_SCALER_3D, DP_FRGD_SRC) |
DP_MONO_SRC_ALLONES;
Mach64GetPixmapOffsetPitch(pDst, &m3d->dst_pitch_offset);
m3d->scale_3d_cntl = 0;
m3d->tex_cntl = 0;
m3d->frag_src = FALSE;
m3d->frag_mask = FALSE;
m3d->frag_color = 0xffffffff;
m3d->color_alpha = FALSE;
m3d->transform = NULL;
/* Compute state */
if (pMaskPicture && !Mach64PrepareMask(m3d, op, pSrcPicture, pMaskPicture,
pSrc, pMask))
return FALSE;
Mach64BlendCntl(m3d, op);
for (i = 0; i < MACH64_NR_TEX_FORMATS; i++) {
if (Mach64TexFormats[i].pictFormat == pDstPicture->format)
break;
}
dstFormat = Mach64TexFormats[i].dstFormat;
m3d->dp_pix_width = SetBits(dstFormat, DP_DST_PIX_WIDTH) |
SetBits(dstFormat, DP_SRC_PIX_WIDTH) |
SetBits(dstFormat, DP_HOST_PIX_WIDTH);
if (!m3d->frag_src) {
if (!Mach64PrepareTexture(pSrcPicture, pSrc))
return FALSE;
}
if (pMaskPicture && !m3d->frag_mask) {
if (!Mach64PrepareTexture(pMaskPicture, pMask))
return FALSE;
}
offset = TEX_LEVEL(m3d->tex_size_pitch);
/* Emit state */
ATIMach64WaitForFIFO(pATI, 12);
outf(DP_SRC, m3d->dp_src);
outf(DP_MIX, m3d->dp_mix);
outf(CLR_CMP_CNTL, CLR_CMP_FN_FALSE);
outf(DST_CNTL, DST_X_DIR | DST_Y_DIR);
outf(DST_OFF_PITCH, m3d->dst_pitch_offset);
outf(SCALE_3D_CNTL, m3d->scale_3d_cntl);
outf(DP_WRITE_MASK, m3d->dp_write_mask);
outf(DP_PIX_WIDTH, m3d->dp_pix_width);
outf(SETUP_CNTL, 0);
outf(TEX_SIZE_PITCH, m3d->tex_size_pitch);
outf(TEX_CNTL, m3d->tex_cntl);
outf(TEX_0_OFF + offset, m3d->tex_offset);
return TRUE;
}
/*
* Vertex format, setup and emission.
*/
typedef struct {
float s0; /* normalized texture coords */
float t0;
float x; /* quarter-pixels */
float y;
CARD32 argb; /* fragment color */
} Mach64Vertex;
#define VTX_SET(_v, _col, _dstX, _dstY, _srcX, _dx, _srcY, _dy) \
do { \
_v.s0 = ((float)(_srcX) + _dx) / m3d->tex_width; \
_v.t0 = ((float)(_srcY) + _dy) / m3d->tex_height; \
_v.x = ((float)(_dstX) * 4.0); \
_v.y = ((float)(_dstY) * 4.0); \
_v.argb = _col; \
} while (0)
#define FVAL(_fval) (*(CARD32 *)&(_fval))
#define VTX_OUT(_v, n) \
do { \
float w = 1.0; \
CARD32 z = 0xffff << 15; \
CARD32 x_y = ((CARD16)_v.x << 16) | \
((CARD16)_v.y & 0xffff); \
\
ATIMach64WaitForFIFO(pATI, 6); \
outf(VERTEX_##n##_S, FVAL(_v.s0)); \
outf(VERTEX_##n##_T, FVAL(_v.t0)); \
outf(VERTEX_##n##_W, FVAL(w)); \
\
outf(VERTEX_##n##_Z, z); \
outf(VERTEX_##n##_ARGB, _v.argb); \
outf(VERTEX_##n##_X_Y, x_y); \
} while (0)
/*
* Composite acceleration hook.
*/
void
Mach64Composite
(
PixmapPtr pDst,
int srcX,
int srcY,
int maskX,
int maskY,
int dstX,
int dstY,
int w,
int h
)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pDst->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
Mach64ContextRegs3D *m3d = &pATI->m3d;
Mach64Vertex v0, v1, v2, v3;
float ooa;
CARD32 col;
PictVector v;
int srcXend, srcYend;
float dxy = 0.0, dwh = 0.0;
ATIDRISync(pScreenInfo);
/* Disable clipping if it gets in the way */
ATIMach64ValidateClip(pATI, dstX, dstX + w - 1, dstY, dstY + h - 1);
/* Handle solid textures which come in as fragment color */
col = m3d->frag_color;
if (m3d->frag_src) {
srcX = maskX;
srcY = maskY;
}
/* Handle transform */
srcXend = srcX + w;
srcYend = srcY + h;
if (m3d->transform) {
v.vector[0] = IntToxFixed(srcX);
v.vector[1] = IntToxFixed(srcY);
v.vector[2] = xFixed1;
PictureTransformPoint(m3d->transform, &v);
srcX = xFixedToInt(v.vector[0]);
srcY = xFixedToInt(v.vector[1]);
v.vector[0] = IntToxFixed(srcXend);
v.vector[1] = IntToxFixed(srcYend);
v.vector[2] = xFixed1;
PictureTransformPoint(m3d->transform, &v);
srcXend = xFixedToInt(v.vector[0]);
srcYend = xFixedToInt(v.vector[1]);
#if 0
/* Bilinear needs manipulation of texture coordinates */
if (m3d->scale_3d_cntl & MACH64_BILINEAR_TEX_EN) {
dxy = 0.5;
dwh = -1.0;
}
#endif
}
/* Create vertices in clock-wise order */
VTX_SET(v0, col, dstX, dstY, srcX, dxy, srcY, dxy);
VTX_SET(v1, col, dstX + w, dstY, srcXend, dwh, srcY, dxy);
VTX_SET(v2, col, dstX + w, dstY + h, srcXend, dwh, srcYend, dwh);
VTX_SET(v3, col, dstX, dstY + h, srcX, dxy, srcYend, dwh);
/* Setup upper triangle (v0, v1, v3) */
VTX_OUT(v0, 1);
VTX_OUT(v1, 2);
VTX_OUT(v3, 3);
ooa = 1.0 / (w * h);
outf(ONE_OVER_AREA, FVAL(ooa));
/* Setup lower triangle (v2, v1, v3) */
VTX_OUT(v2, 1);
ooa = -ooa;
outf(ONE_OVER_AREA, FVAL(ooa));
}
/*
* DoneComposite acceleration hook.
*/
void
Mach64DoneComposite(PixmapPtr pDst)
{
ScrnInfoPtr pScreenInfo = xf86Screens[pDst->drawable.pScreen->myNum];
ATIPtr pATI = ATIPTR(pScreenInfo);
ATIDRISync(pScreenInfo);
outf(SCALE_3D_CNTL, 0);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h,v 1.1 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMACH64XV_H___
#define ___ATIMACH64XV_H___ 1
#include "atipriv.h"
#include "xf86str.h"
#include "xf86xv.h"
extern int ATIMach64XVInitialiseAdaptor(ScreenPtr, ScrnInfoPtr, ATIPtr,
XF86VideoAdaptorPtr **);
extern void ATIMach64CloseXVideo(ScreenPtr, ScrnInfoPtr, ATIPtr);
#endif /* ___ATIMACH64XV_H___ */

View File

@ -0,0 +1,161 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c,v 1.8tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef XFree86LOADER
#include "ati.h"
#include "atiload.h"
#include "ativersion.h"
/* Module loader interface for subsidiary driver module */
static XF86ModuleVersionInfo ATIVersionRec =
{
"atimisc",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
MOD_CLASS_VIDEODRV,
{0, 0, 0, 0}
};
/*
* ATISetup --
*
* This function is called every time the module is loaded.
*/
static pointer
ATISetup
(
pointer Module,
pointer Options,
int *ErrorMajor,
int *ErrorMinor
)
{
static Bool Inited = FALSE;
if (!Inited)
{
/* Ensure main driver module is loaded, but not as a submodule */
if (!xf86ServerIsOnlyDetecting())
{
if (!LoaderSymbol(ATI_NAME))
xf86LoadOneModule(ATI_DRIVER_NAME, Options);
/* ati & atimisc module versions must match */
do
{
XF86ModuleData *pModuleData = LoaderSymbol("atiModuleData");
if (pModuleData)
{
XF86ModuleVersionInfo *pModuleInfo = pModuleData->vers;
if ((pModuleInfo->majorversion == ATI_VERSION_MAJOR) &&
(pModuleInfo->minorversion == ATI_VERSION_MINOR) &&
(pModuleInfo->patchlevel == ATI_VERSION_PATCH))
break;
}
xf86Msg(X_ERROR,
"\"ati\" and \"atimisc\" module versions must"
" match.\n");
if (ErrorMajor)
*ErrorMajor = (int)LDR_MISMATCH;
if (ErrorMinor)
*ErrorMinor = (int)LDR_MISMATCH;
return NULL;
} while (0);
}
/*
* Tell loader about symbols from other modules that this module might
* refer to.
*/
xf86LoaderRefSymLists(
ATIint10Symbols,
ATIddcSymbols,
ATIvbeSymbols,
#ifndef AVOID_CPIO
ATIxf1bppSymbols,
ATIxf4bppSymbols,
#endif /* AVOID_CPIO */
#ifdef XF86DRI_DEVEL
ATIdrmSymbols,
ATIdriSymbols,
#endif /* XF86DRI_DEVEL */
ATIfbSymbols,
ATIshadowfbSymbols,
#ifdef USE_EXA
ATIexaSymbols,
#endif /* USE_EXA */
#ifdef USE_XAA
ATIxaaSymbols,
#endif /* USE_XAA */
ATIramdacSymbols,
ATIi2cSymbols,
NULL);
Inited = TRUE;
}
return (pointer)TRUE;
}
/* The following record must be called atimiscModuleData */
_X_EXPORT XF86ModuleData atimiscModuleData =
{
&ATIVersionRec,
ATISetup,
NULL
};
#endif /* XFree86LOADER */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h,v 1.5 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMODE_H___
#define ___ATIMODE_H___ 1
#include "atipriv.h"
#include "xf86str.h"
extern void ATIModePreInit(ScrnInfoPtr, ATIPtr, ATIHWPtr);
extern void ATIModeSave(ScrnInfoPtr, ATIPtr, ATIHWPtr);
extern Bool ATIModeCalculate(int, ATIPtr, ATIHWPtr, DisplayModePtr);
extern void ATIModeSet(ScrnInfoPtr, ATIPtr, ATIHWPtr);
#endif /* ___ATIMODE_H___ */

View File

@ -0,0 +1,134 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c,v 1.16 2003/05/28 14:08:03 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef XFree86LOADER
#include "ati.h"
#include "atimodule.h"
#include "ativersion.h"
/* Module loader interface */
const char *ATISymbols[] =
{
"ATIPreInit",
"ATIScreenInit",
"ATISwitchMode",
"ATIAdjustFrame",
"ATIEnterVT",
"ATILeaveVT",
"ATIFreeScreen",
"ATIValidMode",
"ATIFillInScreenInfo",
NULL
};
const char *R128Symbols[] =
{
"R128PreInit",
"R128ScreenInit",
"R128SwitchMode",
"R128AdjustFrame",
"R128EnterVT",
"R128LeaveVT",
"R128FreeScreen",
"R128ValidMode",
"R128OptionsWeak",
"R128FillInScreenInfo",
NULL
};
const char *RADEONSymbols[] =
{
"RADEONPreInit",
"RADEONScreenInit",
"RADEONSwitchMode",
"RADEONAdjustFrame",
"RADEONEnterVT",
"RADEONLeaveVT",
"RADEONFreeScreen",
"RADEONValidMode",
"RADEONOptionsWeak",
"RADEONHandleMessage",
"RADEONFillInScreenInfo",
NULL
};
static XF86ModuleVersionInfo ATIVersionRec =
{
ATI_DRIVER_NAME,
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
MOD_CLASS_VIDEODRV,
{0, 0, 0, 0}
};
/*
* ATISetup --
*
* This function is called every time the module is loaded.
*/
static pointer
ATISetup
(
pointer Module,
pointer Options,
int *ErrorMajor,
int *ErrorMinor
)
{
static Bool Inited = FALSE;
if (!Inited)
{
Inited = TRUE;
xf86AddDriver(&ATI, Module, 0);
xf86LoaderRefSymLists(
ATISymbols,
R128Symbols,
RADEONSymbols,
NULL);
}
return (pointer)1;
}
/* The following record must be called atiModuleData */
_X_EXPORT XF86ModuleData atiModuleData =
{
&ATIVersionRec,
ATISetup,
NULL
};
#endif /* XFree86LOADER */

View File

@ -0,0 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.9 2003/01/01 19:16:32 tsi Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*/
#if defined(XFree86LOADER) && !defined(___ATIMODULE_H___)
#define ___ATIMODULE_H___ 1
extern const char *ATISymbols[];
extern const char *R128Symbols[];
extern const char *RADEONSymbols[];
#endif /* ___ATIMODULE_H___ */

View File

@ -0,0 +1,43 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h,v 1.7 2003/01/01 19:16:33 tsi Exp $ */
/*
* Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIMONO_H___
#define ___ATIMONO_H___ 1
#ifndef BIT_PLANE
# define BIT_PLANE 3
#endif
#ifndef MONO_BLACK
# define MONO_BLACK 0x00U
#endif
#ifndef MONO_WHITE
# define MONO_WHITE 0x3FU
#endif
#ifndef MONO_OVERSCAN
# define MONO_OVERSCAN 0x01U
#endif
#endif /* ___ATIMONO_H___ */

View File

@ -0,0 +1,267 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.22 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "atioption.h"
#include "atiutil.h"
#include "radeon_probe.h"
#include "r128_probe.h"
#ifdef TV_OUT
/*
* List of supported TV standard names
*/
const char *ATITVStandardNames[ATI_TV_STDS_MAX_VALID+1] = {
"NTSC",
"PAL",
"PAL-M",
"PAL-60",
"NTSC-J",
"PAL-CN",
"PAL-N",
"Reserved1",
"Reserved2",
"SCART-PAL",
"None",
"Invalid"
};
#endif /* TV_OUT */
/*
* Recognised XF86Config options.
*/
const OptionInfoRec ATIPublicOptions[] =
{
{
ATI_OPTION_ACCEL,
"accel",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_CRT_DISPLAY,
"crt_display",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_CSYNC,
"composite_sync",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_HWCURSOR,
"hw_cursor",
OPTV_BOOLEAN,
{0, },
FALSE,
},
#ifndef AVOID_CPIO
{
ATI_OPTION_LINEAR,
"linear",
OPTV_BOOLEAN,
{0, },
FALSE
},
#endif /* AVOID_CPIO */
#ifdef XF86DRI_DEVEL
{
ATI_OPTION_IS_PCI,
"force_pci_mode",
OPTV_BOOLEAN,
{0, },
FALSE,
},
{
ATI_OPTION_DMA_MODE,
"dma_mode",
OPTV_STRING,
{0, },
FALSE,
},
{
ATI_OPTION_AGP_MODE,
"agp_mode",
OPTV_INTEGER,
{0, },
FALSE,
},
{
ATI_OPTION_AGP_SIZE,
"agp_size",
OPTV_INTEGER,
{0, },
FALSE,
},
{
ATI_OPTION_LOCAL_TEXTURES,
"local_textures",
OPTV_BOOLEAN,
{0, },
FALSE,
},
{
ATI_OPTION_BUFFER_SIZE,
"buffer_size",
OPTV_INTEGER,
{0, },
FALSE,
},
#endif /* XF86DRI_DEVEL */
#ifdef TV_OUT
{
ATI_OPTION_TV_OUT,
"tv_out",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_TV_STD,
"tv_standard",
OPTV_STRING,
{0, },
FALSE
},
#endif /* TV_OUT */
{
ATI_OPTION_MMIO_CACHE,
"mmio_cache",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_TEST_MMIO_CACHE,
"test_mmio_cache",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_PANEL_DISPLAY,
"panel_display",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_PROBE_CLOCKS,
"probe_clocks",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_REFERENCE_CLOCK,
"reference_clock",
OPTV_FREQ,
{0, },
FALSE
},
{
ATI_OPTION_SHADOW_FB,
"shadow_fb",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
ATI_OPTION_SWCURSOR,
"sw_cursor",
OPTV_BOOLEAN,
{0, },
FALSE,
},
{
ATI_OPTION_ACCELMETHOD,
"AccelMethod",
OPTV_STRING,
{0, },
FALSE
},
{
ATI_OPTION_RENDER_ACCEL,
"RenderAccel",
OPTV_BOOLEAN,
{0, },
FALSE
},
{
-1,
NULL,
OPTV_NONE,
{0, },
FALSE
}
};
const unsigned long ATIPublicOptionSize = SizeOf(ATIPublicOptions);
/*
* ATIAvailableOptions --
*
* Return recognised options that are intended for public consumption.
*/
const OptionInfoRec *
ATIAvailableOptions
(
int ChipId,
int BusId
)
{
const OptionInfoRec *pOptions;
if ((pOptions = R128AvailableOptions(ChipId, BusId)))
return pOptions;
if ((pOptions = RADEONAvailableOptions(ChipId, BusId)))
return pOptions;
return ATIPublicOptions;
}

View File

@ -0,0 +1,106 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.12 2003/04/23 21:51:29 tsi Exp $ */
/*
* Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE 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.
*
* DRI support by:
* Leif Delgass <ldelgass@retinalburn.net>
*/
#ifndef ___ATIOPTION_H___
#define ___ATIOPTION_H___ 1
#include "xf86str.h"
/*
* Documented XF86Config options.
*/
typedef enum
{
ATI_OPTION_ACCEL,
ATI_OPTION_CRT_DISPLAY,
ATI_OPTION_CSYNC,
ATI_OPTION_HWCURSOR,
#ifndef AVOID_CPIO
ATI_OPTION_LINEAR,
#endif /* AVOID_CPIO */
#ifdef XF86DRI_DEVEL
ATI_OPTION_IS_PCI,
ATI_OPTION_DMA_MODE,
ATI_OPTION_AGP_MODE,
ATI_OPTION_AGP_SIZE,
ATI_OPTION_LOCAL_TEXTURES,
ATI_OPTION_BUFFER_SIZE,
#endif /* XF86DRI_DEVEL */
#ifdef TV_OUT
ATI_OPTION_TV_OUT,
ATI_OPTION_TV_STD,
#endif /* TV_OUT */
ATI_OPTION_MMIO_CACHE,
ATI_OPTION_TEST_MMIO_CACHE,
ATI_OPTION_PANEL_DISPLAY,
ATI_OPTION_PROBE_CLOCKS,
ATI_OPTION_REFERENCE_CLOCK,
ATI_OPTION_SHADOW_FB,
ATI_OPTION_SWCURSOR,
ATI_OPTION_ACCELMETHOD,
ATI_OPTION_RENDER_ACCEL
} ATIPublicOptionType;
#ifdef TV_OUT
#define ATI_TV_STDS_MAX_VALID 11
#define ATI_TV_STDS_NAME_MAXLEN 9
typedef enum {
ATI_TV_STD_NTSC = 0,
ATI_TV_STD_PAL,
ATI_TV_STD_PALM,
ATI_TV_STD_PAL60,
ATI_TV_STD_NTSCJ,
ATI_TV_STD_PALCN,
ATI_TV_STD_PALN,
ATI_TV_STD_RESERVED1, /* NOT usable */
ATI_TV_STD_RESERVED2, /* NOT usable */
ATI_TV_STD_SCARTPAL,
ATI_TV_STD_NONE, /* OK, means no tv standard change requested */
ATI_TV_STD_INVALID /* Invalid tv standard requested */
} ATITVStandard;
extern const char * ATITVStandardNames[];
#endif /* TV_OUT */
extern const OptionInfoRec ATIPublicOptions[];
extern const unsigned long ATIPublicOptionSize;
extern const OptionInfoRec * ATIAvailableOptions(int, int);
#endif /* ___ATIOPTION_H___ */

View File

@ -0,0 +1,294 @@
/* $XdotOrg: driver/xf86-video-ati/src/atipciids.c, Exp $ */
/*
* Copyright (c) 1995-2003 by The XFree86 Project, Inc.
*
* 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
/*
* This file is a replacement for xf86PciInfo.h moving ATI related PCI IDs
* locally to the driver module
*/
#ifndef _ATIPCIIDS_H
#define _ATIPCIIDS_H
/* PCI Vendor */
#define PCI_VENDOR_ATI 0x1002
#define PCI_VENDOR_AMD 0x1022
#define PCI_VENDOR_DELL 0x1028
/* ATI */
#define PCI_CHIP_RV380_3150 0x3150
#define PCI_CHIP_RV380_3151 0x3151
#define PCI_CHIP_RV380_3152 0x3152
#define PCI_CHIP_RV380_3153 0x3153
#define PCI_CHIP_RV380_3154 0x3154
#define PCI_CHIP_RV380_3156 0x3156
#define PCI_CHIP_RV380_3E50 0x3E50
#define PCI_CHIP_RV380_3E51 0x3E51
#define PCI_CHIP_RV380_3E52 0x3E52
#define PCI_CHIP_RV380_3E53 0x3E53
#define PCI_CHIP_RV380_3E54 0x3E54
#define PCI_CHIP_RV380_3E56 0x3E56
#define PCI_CHIP_RS100_4136 0x4136
#define PCI_CHIP_RS200_4137 0x4137
#define PCI_CHIP_R300_AD 0x4144
#define PCI_CHIP_R300_AE 0x4145
#define PCI_CHIP_R300_AF 0x4146
#define PCI_CHIP_R300_AG 0x4147
#define PCI_CHIP_R350_AH 0x4148
#define PCI_CHIP_R350_AI 0x4149
#define PCI_CHIP_R350_AJ 0x414A
#define PCI_CHIP_R350_AK 0x414B
#define PCI_CHIP_RV350_AP 0x4150
#define PCI_CHIP_RV350_AQ 0x4151
#define PCI_CHIP_RV360_AR 0x4152
#define PCI_CHIP_RV350_AS 0x4153
#define PCI_CHIP_RV350_AT 0x4154
#define PCI_CHIP_RV350_4155 0x4155
#define PCI_CHIP_RV350_AV 0x4156
#define PCI_CHIP_MACH32 0x4158
#define PCI_CHIP_RS250_4237 0x4237
#define PCI_CHIP_R200_BB 0x4242
#define PCI_CHIP_R200_BC 0x4243
#define PCI_CHIP_RS100_4336 0x4336
#define PCI_CHIP_RS200_4337 0x4337
#define PCI_CHIP_MACH64CT 0x4354
#define PCI_CHIP_MACH64CX 0x4358
#define PCI_CHIP_RS250_4437 0x4437
#define PCI_CHIP_MACH64ET 0x4554
#define PCI_CHIP_MACH64GB 0x4742
#define PCI_CHIP_MACH64GD 0x4744
#define PCI_CHIP_MACH64GI 0x4749
#define PCI_CHIP_MACH64GL 0x474C
#define PCI_CHIP_MACH64GM 0x474D
#define PCI_CHIP_MACH64GN 0x474E
#define PCI_CHIP_MACH64GO 0x474F
#define PCI_CHIP_MACH64GP 0x4750
#define PCI_CHIP_MACH64GQ 0x4751
#define PCI_CHIP_MACH64GR 0x4752
#define PCI_CHIP_MACH64GS 0x4753
#define PCI_CHIP_MACH64GT 0x4754
#define PCI_CHIP_MACH64GU 0x4755
#define PCI_CHIP_MACH64GV 0x4756
#define PCI_CHIP_MACH64GW 0x4757
#define PCI_CHIP_MACH64GX 0x4758
#define PCI_CHIP_MACH64GY 0x4759
#define PCI_CHIP_MACH64GZ 0x475A
#define PCI_CHIP_RV250_Id 0x4964
#define PCI_CHIP_RV250_Ie 0x4965
#define PCI_CHIP_RV250_If 0x4966
#define PCI_CHIP_RV250_Ig 0x4967
#define PCI_CHIP_R420_JH 0x4A48
#define PCI_CHIP_R420_JI 0x4A49
#define PCI_CHIP_R420_JJ 0x4A4A
#define PCI_CHIP_R420_JK 0x4A4B
#define PCI_CHIP_R420_JL 0x4A4C
#define PCI_CHIP_R420_JM 0x4A4D
#define PCI_CHIP_R420_JN 0x4A4E
#define PCI_CHIP_R420_4A4F 0x4A4F
#define PCI_CHIP_R420_JP 0x4A50
#define PCI_CHIP_R420_4A54 0x4A54
#define PCI_CHIP_R481_4B49 0x4B49
#define PCI_CHIP_R481_4B4A 0x4B4A
#define PCI_CHIP_R481_4B4B 0x4B4B
#define PCI_CHIP_R481_4B4C 0x4B4C
#define PCI_CHIP_MACH64LB 0x4C42
#define PCI_CHIP_MACH64LD 0x4C44
#define PCI_CHIP_RAGE128LE 0x4C45
#define PCI_CHIP_RAGE128LF 0x4C46
#define PCI_CHIP_MACH64LG 0x4C47
#define PCI_CHIP_MACH64LI 0x4C49
#define PCI_CHIP_MACH64LM 0x4C4D
#define PCI_CHIP_MACH64LN 0x4C4E
#define PCI_CHIP_MACH64LP 0x4C50
#define PCI_CHIP_MACH64LQ 0x4C51
#define PCI_CHIP_MACH64LR 0x4C52
#define PCI_CHIP_MACH64LS 0x4C53
#define PCI_CHIP_RADEON_LW 0x4C57
#define PCI_CHIP_RADEON_LX 0x4C58
#define PCI_CHIP_RADEON_LY 0x4C59
#define PCI_CHIP_RADEON_LZ 0x4C5A
#define PCI_CHIP_RV250_Ld 0x4C64
#define PCI_CHIP_RV250_Le 0x4C65
#define PCI_CHIP_RV250_Lf 0x4C66
#define PCI_CHIP_RV250_Lg 0x4C67
#define PCI_CHIP_RV250_Ln 0x4C6E
#define PCI_CHIP_RAGE128MF 0x4D46
#define PCI_CHIP_RAGE128ML 0x4D4C
#define PCI_CHIP_R300_ND 0x4E44
#define PCI_CHIP_R300_NE 0x4E45
#define PCI_CHIP_R300_NF 0x4E46
#define PCI_CHIP_R300_NG 0x4E47
#define PCI_CHIP_R350_NH 0x4E48
#define PCI_CHIP_R350_NI 0x4E49
#define PCI_CHIP_R360_NJ 0x4E4A
#define PCI_CHIP_R350_NK 0x4E4B
#define PCI_CHIP_RV350_NP 0x4E50
#define PCI_CHIP_RV350_NQ 0x4E51
#define PCI_CHIP_RV350_NR 0x4E52
#define PCI_CHIP_RV350_NS 0x4E53
#define PCI_CHIP_RV350_NT 0x4E54
#define PCI_CHIP_RV350_NV 0x4E56
#define PCI_CHIP_RAGE128PA 0x5041
#define PCI_CHIP_RAGE128PB 0x5042
#define PCI_CHIP_RAGE128PC 0x5043
#define PCI_CHIP_RAGE128PD 0x5044
#define PCI_CHIP_RAGE128PE 0x5045
#define PCI_CHIP_RAGE128PF 0x5046
#define PCI_CHIP_RAGE128PG 0x5047
#define PCI_CHIP_RAGE128PH 0x5048
#define PCI_CHIP_RAGE128PI 0x5049
#define PCI_CHIP_RAGE128PJ 0x504A
#define PCI_CHIP_RAGE128PK 0x504B
#define PCI_CHIP_RAGE128PL 0x504C
#define PCI_CHIP_RAGE128PM 0x504D
#define PCI_CHIP_RAGE128PN 0x504E
#define PCI_CHIP_RAGE128PO 0x504F
#define PCI_CHIP_RAGE128PP 0x5050
#define PCI_CHIP_RAGE128PQ 0x5051
#define PCI_CHIP_RAGE128PR 0x5052
#define PCI_CHIP_RAGE128PS 0x5053
#define PCI_CHIP_RAGE128PT 0x5054
#define PCI_CHIP_RAGE128PU 0x5055
#define PCI_CHIP_RAGE128PV 0x5056
#define PCI_CHIP_RAGE128PW 0x5057
#define PCI_CHIP_RAGE128PX 0x5058
#define PCI_CHIP_RADEON_QD 0x5144
#define PCI_CHIP_RADEON_QE 0x5145
#define PCI_CHIP_RADEON_QF 0x5146
#define PCI_CHIP_RADEON_QG 0x5147
#define PCI_CHIP_R200_QH 0x5148
#define PCI_CHIP_R200_QI 0x5149
#define PCI_CHIP_R200_QJ 0x514A
#define PCI_CHIP_R200_QK 0x514B
#define PCI_CHIP_R200_QL 0x514C
#define PCI_CHIP_R200_QM 0x514D
#define PCI_CHIP_R200_QN 0x514E
#define PCI_CHIP_R200_QO 0x514F
#define PCI_CHIP_RV200_QW 0x5157
#define PCI_CHIP_RV200_QX 0x5158
#define PCI_CHIP_RV100_QY 0x5159
#define PCI_CHIP_RV100_QZ 0x515A
#define PCI_CHIP_RN50_515E 0x515E
#define PCI_CHIP_RAGE128RE 0x5245
#define PCI_CHIP_RAGE128RF 0x5246
#define PCI_CHIP_RAGE128RG 0x5247
#define PCI_CHIP_RAGE128RK 0x524B
#define PCI_CHIP_RAGE128RL 0x524C
#define PCI_CHIP_RAGE128SE 0x5345
#define PCI_CHIP_RAGE128SF 0x5346
#define PCI_CHIP_RAGE128SG 0x5347
#define PCI_CHIP_RAGE128SH 0x5348
#define PCI_CHIP_RAGE128SK 0x534B
#define PCI_CHIP_RAGE128SL 0x534C
#define PCI_CHIP_RAGE128SM 0x534D
#define PCI_CHIP_RAGE128SN 0x534E
#define PCI_CHIP_RAGE128TF 0x5446
#define PCI_CHIP_RAGE128TL 0x544C
#define PCI_CHIP_RAGE128TR 0x5452
#define PCI_CHIP_RAGE128TS 0x5453
#define PCI_CHIP_RAGE128TT 0x5454
#define PCI_CHIP_RAGE128TU 0x5455
#define PCI_CHIP_RV370_5460 0x5460
#define PCI_CHIP_RV370_5461 0x5461
#define PCI_CHIP_RV370_5462 0x5462
#define PCI_CHIP_RV370_5463 0x5463
#define PCI_CHIP_RV370_5464 0x5464
#define PCI_CHIP_RV370_5465 0x5465
#define PCI_CHIP_RV370_5466 0x5466
#define PCI_CHIP_RV370_5467 0x5467
#define PCI_CHIP_R423_UH 0x5548
#define PCI_CHIP_R423_UI 0x5549
#define PCI_CHIP_R423_UJ 0x554A
#define PCI_CHIP_R423_UK 0x554B
#define PCI_CHIP_R430_554C 0x554C
#define PCI_CHIP_R430_554D 0x554D
#define PCI_CHIP_R430_554E 0x554E
#define PCI_CHIP_R430_554F 0x554F
#define PCI_CHIP_R423_5550 0x5550
#define PCI_CHIP_R423_UQ 0x5551
#define PCI_CHIP_R423_UR 0x5552
#define PCI_CHIP_R423_UT 0x5554
#define PCI_CHIP_RV410_564A 0x564A
#define PCI_CHIP_RV410_564B 0x564B
#define PCI_CHIP_RV410_564F 0x564F
#define PCI_CHIP_RV410_5652 0x5652
#define PCI_CHIP_RV410_5653 0x5653
#define PCI_CHIP_MACH64VT 0x5654
#define PCI_CHIP_MACH64VU 0x5655
#define PCI_CHIP_MACH64VV 0x5656
#define PCI_CHIP_RS300_5834 0x5834
#define PCI_CHIP_RS300_5835 0x5835
#define PCI_CHIP_RS300_5836 0x5836
#define PCI_CHIP_RS300_5837 0x5837
#define PCI_CHIP_RS480_5954 0x5954
#define PCI_CHIP_RS480_5955 0x5955
#define PCI_CHIP_RV280_5960 0x5960
#define PCI_CHIP_RV280_5961 0x5961
#define PCI_CHIP_RV280_5962 0x5962
#define PCI_CHIP_RV280_5964 0x5964
#define PCI_CHIP_RV280_5965 0x5965
#define PCI_CHIP_RN50_5969 0x5969
#define PCI_CHIP_RS482_5974 0x5974
#define PCI_CHIP_RS482_5975 0x5975
#define PCI_CHIP_RS400_5A41 0x5A41
#define PCI_CHIP_RS400_5A42 0x5A42
#define PCI_CHIP_RC410_5A61 0x5A61
#define PCI_CHIP_RC410_5A62 0x5A62
#define PCI_CHIP_RV370_5B60 0x5B60
#define PCI_CHIP_RV370_5B61 0x5B61
#define PCI_CHIP_RV370_5B62 0x5B62
#define PCI_CHIP_RV370_5B63 0x5B63
#define PCI_CHIP_RV370_5B64 0x5B64
#define PCI_CHIP_RV370_5B65 0x5B65
#define PCI_CHIP_RV370_5B66 0x5B66
#define PCI_CHIP_RV370_5B67 0x5B67
#define PCI_CHIP_RV280_5C61 0x5C61
#define PCI_CHIP_RV280_5C63 0x5C63
#define PCI_CHIP_R430_5D48 0x5D48
#define PCI_CHIP_R430_5D49 0x5D49
#define PCI_CHIP_R430_5D4A 0x5D4A
#define PCI_CHIP_R480_5D4C 0x5D4C
#define PCI_CHIP_R480_5D4D 0x5D4D
#define PCI_CHIP_R480_5D4E 0x5D4E
#define PCI_CHIP_R480_5D4F 0x5D4F
#define PCI_CHIP_R480_5D50 0x5D50
#define PCI_CHIP_R480_5D52 0x5D52
#define PCI_CHIP_R423_5D57 0x5D57
#define PCI_CHIP_RV410_5E48 0x5E48
#define PCI_CHIP_RV410_5E4A 0x5E4A
#define PCI_CHIP_RV410_5E4B 0x5E4B
#define PCI_CHIP_RV410_5E4C 0x5E4C
#define PCI_CHIP_RV410_5E4D 0x5E4D
#define PCI_CHIP_RV410_5E4F 0x5E4F
#define PCI_CHIP_RS350_7834 0x7834
#define PCI_CHIP_RS350_7835 0x7835
/* Misc */
#define PCI_CHIP_AMD761 0x700E
#endif /* _ATIPCIIDS_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h,v 1.6 2003/01/01 19:16:33 tsi Exp $ */
/*
* Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIPREINIT_H___
#define ___ATIPREINIT_H___ 1
#include "xf86str.h"
extern Bool ATIPreInit(ScrnInfoPtr, int);
#endif /* ___ATIPREINIT_H___ */

View File

@ -0,0 +1,838 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c,v 1.28 2003/11/07 13:45:26 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <ctype.h>
#include "ati.h"
#include "atiadapter.h"
#include "atichip.h"
#include "atidac.h"
#include "atimach64io.h"
#include "atiprint.h"
#include "atiwonderio.h"
/*
* ATIPrintBIOS --
*
* Display various parts of the BIOS when the server is invoked with -verbose.
*/
void
ATIPrintBIOS
(
const CARD8 *BIOS,
const unsigned int Length /* A multiple of 512 */
)
{
unsigned char *Char = NULL;
unsigned int Index;
unsigned char Printable[17];
if (xf86GetVerbosity() <= 4)
return;
(void)memset(Printable, 0, SizeOf(Printable));
xf86ErrorFVerb(5, "\n BIOS image:");
for (Index = 0; Index < Length; Index++)
{
if (!(Index & (4U - 1U)))
{
if (!(Index & (16U - 1U)))
{
if (Printable[0])
xf86ErrorFVerb(5, " |%s|", Printable);
Char = Printable;
xf86ErrorFVerb(5, "\n 0x%08X: ", Index);
}
xf86ErrorFVerb(5, " ");
}
xf86ErrorFVerb(5, "%02X", BIOS[Index]);
if (isprint(BIOS[Index]))
*Char++ = BIOS[Index];
else
*Char++ = '.';
}
xf86ErrorFVerb(5, " |%s|\n", Printable);
}
#ifndef AVOID_CPIO
/*
* ATIPrintIndexedRegisters --
*
* Display a set of indexed byte-size registers when the server is invoked with
* -verbose.
*/
static void
ATIPrintIndexedRegisters
(
const IOADDRESS Port,
const CARD8 StartIndex,
const CARD8 EndIndex,
const char *Name,
const IOADDRESS GenS1
)
{
int Index;
xf86ErrorFVerb(4, "\n %s register values:", Name);
for (Index = StartIndex; Index < EndIndex; Index++)
{
if (!(Index & (4U - 1U)))
{
if (!(Index & (16U - 1U)))
xf86ErrorFVerb(4, "\n 0x%02X: ", Index);
xf86ErrorFVerb(4, " ");
}
if (Port == ATTRX)
(void)inb(GenS1); /* Reset flip-flop */
xf86ErrorFVerb(4, "%02X", GetReg(Port, Index));
}
if (Port == ATTRX)
{
(void)inb(GenS1); /* Reset flip-flop */
outb(ATTRX, 0x20U); /* Turn on PAS bit */
}
xf86ErrorFVerb(4, "\n");
}
#endif /* AVOID_CPIO */
/*
* ATIMach64PrintRegisters --
*
* Display a Mach64's main register bank when the server is invoked with
* -verbose.
*/
static void
ATIMach64PrintRegisters
(
ATIPtr pATI,
CARD8 *crtc,
const char *Description
)
{
CARD32 IOValue;
CARD8 dac_read, dac_mask, dac_data, dac_write;
int Index, Limit;
#ifndef AVOID_CPIO
int Step;
#endif /* AVOID_CPIO */
xf86ErrorFVerb(4, "\n Mach64 %s register values:", Description);
#ifdef AVOID_CPIO
if (pATI->pBlock[1])
Limit = DWORD_SELECT;
else
Limit = MM_IO_SELECT;
for (Index = 0; Index <= Limit; Index += UnitOf(MM_IO_SELECT))
{
if (!(Index & SetBits(3, MM_IO_SELECT)))
xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
if (Index == (DAC_REGS & DWORD_SELECT))
{
dac_read = in8(DAC_REGS + 3);
DACDelay;
dac_mask = in8(DAC_REGS + 2);
DACDelay;
dac_data = in8(DAC_REGS + 1);
DACDelay;
dac_write = in8(DAC_REGS + 0);
DACDelay;
xf86ErrorFVerb(4, " %02X%02X%02X%02X",
dac_read, dac_mask, dac_data, dac_write);
out8(DAC_REGS + 2, dac_mask);
DACDelay;
out8(DAC_REGS + 3, dac_read);
DACDelay;
}
else
{
IOValue = inm(Index);
if ((Index == (CRTC_GEN_CNTL & DWORD_SELECT)) &&
(IOValue & CRTC_EXT_DISP_EN))
*crtc = ATI_CRTC_MACH64;
xf86ErrorFVerb(4, " %08lX", (unsigned long)IOValue);
}
}
#else /* AVOID_CPIO */
Limit = ATIIOPort(IOPortTag(0x1FU, 0x3FU));
Step = ATIIOPort(IOPortTag(0x01U, 0x01U)) - pATI->CPIOBase;
for (Index = pATI->CPIOBase; Index <= Limit; Index += Step)
{
if (!(((Index - pATI->CPIOBase) / Step) & 0x03U))
xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
if (Index == (int)ATIIOPort(DAC_REGS))
{
dac_read = in8(DAC_REGS + 3);
DACDelay;
dac_mask = in8(DAC_REGS + 2);
DACDelay;
dac_data = in8(DAC_REGS + 1);
DACDelay;
dac_write = in8(DAC_REGS + 0);
DACDelay;
xf86ErrorFVerb(4, " %02X%02X%02X%02X",
dac_read, dac_mask, dac_data, dac_write);
out8(DAC_REGS + 2, dac_mask);
DACDelay;
out8(DAC_REGS + 3, dac_read);
DACDelay;
}
else
{
IOValue = inl(Index);
if ((Index == (int)ATIIOPort(CRTC_GEN_CNTL)) &&
(IOValue & CRTC_EXT_DISP_EN))
*crtc = ATI_CRTC_MACH64;
xf86ErrorFVerb(4, " %08lX", (unsigned long)IOValue);
}
}
#endif /* AVOID_CPIO */
xf86ErrorFVerb(4, "\n");
}
/*
* ATIMach64PrintPLLRegisters --
*
* Display an integrated Mach64's PLL registers when the server is invoked with
* -verbose.
*/
static void
ATIMach64PrintPLLRegisters
(
ATIPtr pATI
)
{
int Index, Limit;
CARD8 PLLReg[MaxBits(PLL_ADDR) + 1];
for (Limit = 0; Limit < SizeOf(PLLReg); Limit++)
PLLReg[Limit] = ATIMach64GetPLLReg(Limit);
/* Determine how many PLL registers there really are */
while ((Limit = Limit >> 1))
for (Index = 0; Index < Limit; Index++)
if (PLLReg[Index] != PLLReg[Index + Limit])
goto FoundLimit;
FoundLimit:
Limit <<= 1;
xf86ErrorFVerb(4, "\n Mach64 PLL register values:");
for (Index = 0; Index < Limit; Index++)
{
if (!(Index & 3))
{
if (!(Index & 15))
xf86ErrorFVerb(4, "\n 0x%02X: ", Index);
xf86ErrorFVerb(4, " ");
}
xf86ErrorFVerb(4, "%02X", PLLReg[Index]);
}
xf86ErrorFVerb(4, "\n");
}
/*
* ATIRGB514PrintRegisters --
*
* Display IBM RGB 514 registers when the server is invoked with -verbose.
*/
static void
ATIRGB514PrintRegisters
(
ATIPtr pATI
)
{
CARD32 crtc_gen_cntl, dac_cntl;
CARD8 index_lo, index_hi, index_ctl;
int Index;
/* Temporarily switch to Mach64 CRTC */
crtc_gen_cntl = inr(CRTC_GEN_CNTL);
if (!(crtc_gen_cntl & CRTC_EXT_DISP_EN))
outr(CRTC_GEN_CNTL, crtc_gen_cntl | CRTC_EXT_DISP_EN);
/* Temporarily switch to IBM RGB 514 registers */
dac_cntl = inr(DAC_CNTL);
outr(DAC_CNTL, (dac_cntl & ~DAC_EXT_SEL_RS3) | DAC_EXT_SEL_RS2);
index_lo = in8(M64_DAC_WRITE);
index_hi = in8(M64_DAC_DATA);
index_ctl = in8(M64_DAC_READ);
out8(M64_DAC_WRITE, 0x00U);
out8(M64_DAC_DATA, 0x00U);
out8(M64_DAC_READ, 0x01U); /* Auto-increment */
xf86ErrorFVerb(4, "\n IBM RGB 514 registers:");
for (Index = 0; Index < 0x0800; Index++)
{
if (!(Index & 3))
{
if (!(Index & 15))
{
xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
/* Need to rewrite index every so often... */
if ((Index == 0x0100) || (Index == 0x0500))
{
out8(M64_DAC_WRITE, 0x00U);
out8(M64_DAC_DATA, Index >> 8);
}
}
xf86ErrorFVerb(4, " ");
}
xf86ErrorFVerb(4, "%02X", in8(M64_DAC_MASK));
}
/* Restore registers */
out8(M64_DAC_WRITE, index_lo);
out8(M64_DAC_DATA, index_hi);
out8(M64_DAC_READ, index_ctl);
outr(DAC_CNTL, dac_cntl);
if (!(crtc_gen_cntl & CRTC_EXT_DISP_EN))
outr(CRTC_GEN_CNTL, crtc_gen_cntl);
xf86ErrorFVerb(4, "\n");
}
/*
* ATIPrintRegisters --
*
* Display various registers when the server is invoked with -verbose.
*/
void
ATIPrintRegisters
(
ATIPtr pATI
)
{
pciVideoPtr pVideo;
pciConfigPtr pPCI;
int Index;
CARD32 lcd_index, tv_out_index, lcd_gen_ctrl;
CARD8 dac_read, dac_mask, dac_write;
CARD8 crtc;
#ifndef AVOID_CPIO
CARD8 genmo, seq1 = 0;
crtc = ATI_CRTC_VGA;
if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
{
xf86ErrorFVerb(4, "\n Miscellaneous output register value: 0x%02X.\n",
genmo = inb(R_GENMO));
if (genmo & 0x01U)
{
if (pATI->Chip == ATI_CHIP_264LT)
{
lcd_gen_ctrl = inr(LCD_GEN_CTRL);
outr(LCD_GEN_CTRL, lcd_gen_ctrl & ~SHADOW_RW_EN);
ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64,
"Non-shadow colour CRT controller", 0);
outr(LCD_GEN_CTRL, lcd_gen_ctrl | SHADOW_RW_EN);
ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64,
"Shadow colour CRT controller", 0);
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
}
else if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY))
{
lcd_index = inr(LCD_INDEX);
lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
ATIMach64PutLCDReg(LCD_GEN_CNTL,
lcd_gen_ctrl & ~(CRTC_RW_SELECT | SHADOW_RW_EN));
ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64,
"Non-shadow colour CRT controller", 0);
ATIMach64PutLCDReg(LCD_GEN_CNTL,
(lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN);
ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64,
"Shadow colour CRT controller", 0);
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
outr(LCD_INDEX, lcd_index);
}
else
{
ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64,
"Colour CRT controller", 0);
}
ATIPrintIndexedRegisters(ATTRX, 0, 32, "Attribute controller",
GENS1(ColourIOBase));
}
else
{
if (pATI->Chip == ATI_CHIP_264LT)
{
lcd_gen_ctrl = inr(LCD_GEN_CTRL);
outr(LCD_GEN_CTRL, lcd_gen_ctrl & ~SHADOW_RW_EN);
ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64,
"Non-shadow monochrome CRT controller", 0);
outr(LCD_GEN_CTRL, lcd_gen_ctrl | SHADOW_RW_EN);
ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64,
"Shadow monochrome CRT controller", 0);
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
}
else if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY))
{
lcd_index = inr(LCD_INDEX);
lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
ATIMach64PutLCDReg(LCD_GEN_CNTL,
lcd_gen_ctrl & ~(CRTC_RW_SELECT | SHADOW_RW_EN));
ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64,
"Non-shadow monochrome CRT controller", 0);
ATIMach64PutLCDReg(LCD_GEN_CNTL,
(lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN);
ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64,
"Shadow monochrome CRT controller", 0);
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
outr(LCD_INDEX, lcd_index);
}
else
{
ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64,
"Monochrome CRT controller", 0);
}
ATIPrintIndexedRegisters(ATTRX, 0, 32, "Attribute controller",
GENS1(MonochromeIOBase));
}
ATIPrintIndexedRegisters(GRAX, 0, 16, "Graphics controller", 0);
ATIPrintIndexedRegisters(SEQX, 0, 8, "Sequencer", 0);
if (pATI->CPIO_VGAWonder)
ATIPrintIndexedRegisters(pATI->CPIO_VGAWonder,
xf86ServerIsOnlyProbing() ? 0x80U : pATI->VGAOffset, 0xC0U,
"ATI extended VGA", 0);
}
if (pATI->ChipHasSUBSYS_CNTL)
{
xf86ErrorFVerb(4, "\n 8514/A register values:");
for (Index = 0x02E8U; Index <= 0x0FEE8; Index += 0x0400U)
{
if (!((Index - 0x02E8U) & 0x0C00U))
xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
xf86ErrorFVerb(4, " %04X", inw(Index));
}
if (pATI->Adapter >= ATI_ADAPTER_MACH8)
{
xf86ErrorFVerb(4, "\n\n Mach8/Mach32 register values:");
for (Index = 0x02EEU; Index <= 0x0FEEE; Index += 0x0400U)
{
if (!((Index - 0x02EEU) & 0x0C00U))
xf86ErrorFVerb(4, "\n 0x%04X: ", Index);
xf86ErrorFVerb(4, " %04X", inw(Index));
}
}
xf86ErrorFVerb(4, "\n");
}
else
#endif /* AVOID_CPIO */
if (pATI->Chip == ATI_CHIP_264LT)
{
lcd_gen_ctrl = inr(LCD_GEN_CTRL);
outr(LCD_GEN_CTRL, lcd_gen_ctrl & ~SHADOW_RW_EN);
ATIMach64PrintRegisters(pATI, &crtc, "non-shadow");
outr(LCD_GEN_CTRL, lcd_gen_ctrl | SHADOW_RW_EN);
ATIMach64PrintRegisters(pATI, &crtc, "shadow");
outr(LCD_GEN_CTRL, lcd_gen_ctrl);
ATIMach64PrintPLLRegisters(pATI);
}
else if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
(pATI->Chip == ATI_CHIP_264XL) ||
(pATI->Chip == ATI_CHIP_MOBILITY))
{
lcd_index = inr(LCD_INDEX);
lcd_gen_ctrl = ATIMach64GetLCDReg(LCD_GEN_CNTL);
ATIMach64PutLCDReg(LCD_GEN_CNTL,
lcd_gen_ctrl & ~(CRTC_RW_SELECT | SHADOW_RW_EN));
ATIMach64PrintRegisters(pATI, &crtc, "non-shadow");
ATIMach64PutLCDReg(LCD_GEN_CNTL,
(lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN);
ATIMach64PrintRegisters(pATI, &crtc, "shadow");
if (pATI->Chip != ATI_CHIP_264XL)
{
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl | CRTC_RW_SELECT);
ATIMach64PrintRegisters(pATI, &crtc, "secondary");
}
ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
ATIMach64PrintPLLRegisters(pATI);
xf86ErrorFVerb(4, "\n LCD register values:");
for (Index = 0; Index < 64; Index++)
{
if (!(Index & 3))
xf86ErrorFVerb(4, "\n 0x%02X: ", Index);
xf86ErrorFVerb(4, " %08X", ATIMach64GetLCDReg(Index));
}
outr(LCD_INDEX, lcd_index);
tv_out_index = inr(TV_OUT_INDEX);
xf86ErrorFVerb(4, "\n\n TV_OUT register values:");
for (Index = 0; Index < 256; Index++)
{
if (!(Index & 3))
xf86ErrorFVerb(4, "\n 0x%02X: ", Index);
xf86ErrorFVerb(4, " %08X", ATIMach64GetTVReg(Index));
}
outr(TV_OUT_INDEX, tv_out_index);
xf86ErrorFVerb(4, "\n");
}
else
#ifndef AVOID_CPIO
if (pATI->Chip >= ATI_CHIP_88800GXC)
#endif /* AVOID_CPIO */
{
#ifdef AVOID_CPIO
ATIMach64PrintRegisters(pATI, &crtc, "MMIO");
#else /* AVOID_CPIO */
ATIMach64PrintRegisters(pATI, &crtc,
(pATI->CPIODecoding == SPARSE_IO) ? "sparse" : "block");
#endif /* AVOID_CPIO */
if (pATI->Chip >= ATI_CHIP_264CT)
ATIMach64PrintPLLRegisters(pATI);
if (pATI->DAC == ATI_DAC_IBMRGB514)
ATIRGB514PrintRegisters(pATI);
}
#ifdef AVOID_CPIO
dac_read = in8(M64_DAC_READ);
DACDelay;
dac_write = in8(M64_DAC_WRITE);
DACDelay;
dac_mask = in8(M64_DAC_MASK);
DACDelay;
xf86ErrorFVerb(4, "\n"
" DAC read index: 0x%02X\n"
" DAC write index: 0x%02X\n"
" DAC mask: 0x%02X\n\n"
" DAC colour lookup table:",
dac_read, dac_write, dac_mask);
out8(M64_DAC_MASK, 0xFFU);
DACDelay;
out8(M64_DAC_READ, 0x00U);
DACDelay;
for (Index = 0; Index < 256; Index++)
{
if (!(Index & 3))
xf86ErrorFVerb(4, "\n 0x%02X:", Index);
xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA));
DACDelay;
xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA));
DACDelay;
xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA));
DACDelay;
}
out8(M64_DAC_MASK, dac_mask);
DACDelay;
out8(M64_DAC_READ, dac_read);
DACDelay;
#else /* AVOID_CPIO */
ATISetDACIOPorts(pATI, crtc);
/* Temporarily turn off CLKDIV2 while reading DAC's LUT */
if (pATI->Adapter == ATI_ADAPTER_NONISA)
{
seq1 = GetReg(SEQX, 0x01U);
if (seq1 & 0x08U)
PutReg(SEQX, 0x01U, seq1 & ~0x08U);
}
dac_read = inb(pATI->CPIO_DAC_READ);
DACDelay;
dac_write = inb(pATI->CPIO_DAC_WRITE);
DACDelay;
dac_mask = inb(pATI->CPIO_DAC_MASK);
DACDelay;
xf86ErrorFVerb(4, "\n"
" DAC read index: 0x%02X\n"
" DAC write index: 0x%02X\n"
" DAC mask: 0x%02X\n\n"
" DAC colour lookup table:",
dac_read, dac_write, dac_mask);
outb(pATI->CPIO_DAC_MASK, 0xFFU);
DACDelay;
outb(pATI->CPIO_DAC_READ, 0x00U);
DACDelay;
for (Index = 0; Index < 256; Index++)
{
if (!(Index & 3))
xf86ErrorFVerb(4, "\n 0x%02X:", Index);
xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA));
DACDelay;
xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA));
DACDelay;
xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA));
DACDelay;
}
outb(pATI->CPIO_DAC_MASK, dac_mask);
DACDelay;
outb(pATI->CPIO_DAC_READ, dac_read);
DACDelay;
if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (seq1 & 0x08U))
PutReg(SEQX, 0x01U, seq1);
#endif /* AVOID_CPIO */
if ((pVideo = pATI->PCIInfo))
{
pPCI = pVideo->thisCard;
xf86ErrorFVerb(4, "\n\n PCI configuration register values:");
for (Index = 0; Index < 256; Index+= 4)
{
if (!(Index & 15))
xf86ErrorFVerb(4, "\n 0x%02X: ", Index);
xf86ErrorFVerb(4, " 0x%08lX",
(unsigned long)pciReadLong(pPCI->tag, Index));
}
}
xf86ErrorFVerb(4, "\n");
#ifndef AVOID_CPIO
if (pATI->pBank)
xf86ErrorFVerb(4, "\n Banked aperture at 0x%0lX.",
(unsigned long)pATI->pBank);
else
xf86ErrorFVerb(4, "\n No banked aperture.");
if (pATI->pMemory == pATI->pBank)
{
xf86ErrorFVerb(4, "\n No linear aperture.\n");
}
else
#else /* AVOID_CPIO */
if (pATI->pMemory)
#endif /* AVOID_CPIO */
{
xf86ErrorFVerb(4, "\n Linear aperture at %p.\n", pATI->pMemory);
}
if (pATI->pBlock[0])
{
xf86ErrorFVerb(4, " Block 0 aperture at %p.\n", pATI->pBlock[0]);
if (inr(CONFIG_CHIP_ID) == pATI->config_chip_id)
xf86ErrorFVerb(4, " MMIO registers are correctly mapped.\n");
else
xf86ErrorFVerb(4, " MMIO mapping is in error!\n");
if (pATI->pBlock[1])
xf86ErrorFVerb(4, " Block 1 aperture at %p.\n",
pATI->pBlock[1]);
}
else
{
xf86ErrorFVerb(4, " No MMIO aperture.\n");
}
if (pATI->pCursorImage)
xf86ErrorFVerb(4, " Hardware cursor image aperture at %p.\n",
pATI->pCursorImage);
else
xf86ErrorFVerb(4, " No hardware cursor image aperture.\n");
xf86ErrorFVerb(4, "\n");
}
/*
* A table to associate mode attributes with character strings.
*/
static const SymTabRec ModeAttributeNames[] =
{
{V_PHSYNC, "+hsync"},
{V_NHSYNC, "-hsync"},
{V_PVSYNC, "+vsync"},
{V_NVSYNC, "-vsync"},
{V_PCSYNC, "+csync"},
{V_NCSYNC, "-csync"},
{V_INTERLACE, "interlace"},
{V_DBLSCAN, "doublescan"},
{V_CSYNC, "composite"},
{V_DBLCLK, "dblclk"},
{V_CLKDIV2, "clkdiv2"},
{0, NULL}
};
/*
* ATIPrintMode --
*
* This function displays a mode's timing information.
*/
void
ATIPrintMode
(
DisplayModePtr pMode
)
{
const SymTabRec *pSymbol = ModeAttributeNames;
int flags = pMode->Flags;
double mClock, hSync, vRefresh;
mClock = (double)pMode->SynthClock;
if (pMode->HSync > 0.0)
hSync = pMode->HSync;
else
hSync = mClock / pMode->HTotal;
if (pMode->VRefresh > 0.0)
{
vRefresh = pMode->VRefresh;
}
else
{
vRefresh = (hSync * 1000.0) / pMode->VTotal;
if (flags & V_INTERLACE)
vRefresh *= 2.0;
if (flags & V_DBLSCAN)
vRefresh /= 2.0;
if (pMode->VScan > 1)
vRefresh /= pMode->VScan;
}
xf86ErrorFVerb(4, " Dot clock: %7.3f MHz\n", mClock / 1000.0);
xf86ErrorFVerb(4, " Horizontal sync: %7.3f kHz\n", hSync);
xf86ErrorFVerb(4, " Vertical refresh: %7.3f Hz (%s)\n", vRefresh,
(flags & V_INTERLACE) ? "I" : "NI");
if ((pMode->ClockIndex >= 0) && (pMode->ClockIndex < MAXCLOCKS))
xf86ErrorFVerb(4, " Clock index: %d\n", pMode->ClockIndex);
xf86ErrorFVerb(4, " Horizontal timings: %4d %4d %4d %4d\n"
" Vertical timings: %4d %4d %4d %4d\n",
pMode->HDisplay, pMode->HSyncStart, pMode->HSyncEnd, pMode->HTotal,
pMode->VDisplay, pMode->VSyncStart, pMode->VSyncEnd, pMode->VTotal);
if (flags & V_HSKEW)
{
flags &= ~V_HSKEW;
xf86ErrorFVerb(4, " Horizontal skew: %4d\n", pMode->HSkew);
}
if (pMode->VScan >= 1)
xf86ErrorFVerb(4, " Vertical scan: %4d\n", pMode->VScan);
xf86ErrorFVerb(4, " Flags: ");
for (; pSymbol->token; pSymbol++)
{
if (flags & pSymbol->token)
{
xf86ErrorFVerb(4, " %s", pSymbol->name);
flags &= ~pSymbol->token;
if (!flags)
break;
}
}
xf86ErrorFVerb(4, "\n");
}

View File

@ -0,0 +1,35 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h,v 1.10 2003/01/01 19:16:33 tsi Exp $ */
/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* 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 Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ___ATIPRINT_H___
#define ___ATIPRINT_H___ 1
#include "atipriv.h"
#include "xf86str.h"
extern void ATIPrintBIOS(const CARD8 *, const unsigned int);
extern void ATIPrintRegisters(ATIPtr);
extern void ATIPrintMode(DisplayModePtr);
#endif /* ___ATIPRINT_H___ */

Some files were not shown because too many files have changed in this diff Show More