Importing xf86-video-sunffb 1.1.0

This commit is contained in:
matthieu
2006-11-26 20:15:39 +00:00
parent f3145dd3f1
commit 3a259de7f0
37 changed files with 52378 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

View File

@@ -0,0 +1,98 @@
2006-04-07 Adam Jackson <ajax@freedesktop.org>
* configure.ac:
* src/ffb.h:
* src/ffb_dac.c:
* src/ffb_ddc.c:
* src/ffb_dga.c:
* src/ffb_dri.c:
* src/ffb_driver.c:
Unlibcwrap. Bump server version requirement. Bump to 1.1.0.
2006-01-25 Adam Jackson <ajax@freedesktop.org>
* src/ffb_bcopy.c:
* src/ffb_circle.c:
* src/ffb_driver.c:
Remove xf8_32wid damage, it is going away.
* src/Makefile.am:
* src/ffb_accel.c:
* src/ffb_bcopy.c:
* src/ffb_checks.c:
* src/ffb_circle.c:
* src/ffb_clip.c:
* src/ffb_clip.h:
* src/ffb_cplane.c:
* src/ffb_dbe.c:
* src/ffb_dga.c:
* src/ffb_dri.c:
* src/ffb_frect.c:
* src/ffb_fspans.c:
* src/ffb_gc.c:
* src/ffb_gc.h:
* src/ffb_glyph.c:
* src/ffb_gspans.c:
* src/ffb_line.c:
* src/ffb_plygon.c:
* src/ffb_point.c:
* src/ffb_rect.c:
* src/ffb_seg.c:
* src/ffb_sspans.c:
* src/ffb_stip.c:
* src/ffb_stip.h:
* src/ffb_stubs.c:
* src/ffb_wline.c:
* src/ffb_zeroarc.c:
Remove remaining cfb-isms and dead accel code.
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version for X11R7 release.
2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version number for final X11R7 release candidate.
2005-12-14 Adam Jackson <ajax@freedesktop.org>
* configure.ac:
* src/Makefile.am:
Bug #4890: Include the assembly in the build (Ferris McCormick)
2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org>
* man/Makefile.am:
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version number for X11R7 RC3 release.
2005-12-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Remove extraneous AC_MSG_RESULT.
2005-11-20 Adam Jackson <ajax@freedesktop.org>
* configure.ac:
Bump libdrm dep to 2.0.
2005-11-29 Adam Jackson <ajax@freedesktop.org>
* configure.ac:
Only build dlloader modules by default.
2005-11-09 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version number for X11R7 RC2 release.
2005-11-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update pkgcheck dependencies to work with separate build roots.

View File

@@ -0,0 +1,22 @@
# 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

View File

@@ -0,0 +1,657 @@
# 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 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@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
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@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
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@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPARC_FALSE = @SPARC_FALSE@
SPARC_TRUE = @SPARC_TRUE@
STRIP = @STRIP@
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
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:
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
# 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:

7829
driver/xf86-video-sunffb/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

1411
driver/xf86-video-sunffb/config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
/* config.h.in. Generated from configure.ac by autoheader. */
#include "xorg-server.h"
/* 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
/* Version number of package */
#undef VERSION
/* Enable DRI driver support */
#undef XF86DRI
/* Enable developmental DRI driver support */
#undef XF86DRI_DEVEL

1500
driver/xf86-video-sunffb/config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

21962
driver/xf86-video-sunffb/configure vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,119 @@
# 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-sunffb],
1.1.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-sunffb)
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
case $host_cpu in
sparc*)
CCASFLAGS="-x assembler-with-cpp -Wa,-Av9a"
SPARC=yes
esac
AM_PROG_AS
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])
# Checks for extensions
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 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
AM_CONDITIONAL(SPARC, test x$SPARC = xyes)
AC_SUBST([DRI_CFLAGS])
AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])
DRIVER_NAME=sunffb
AC_SUBST([DRIVER_NAME])
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
AC_OUTPUT([
Makefile
src/Makefile
man/Makefile
])

View File

@@ -0,0 +1,530 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, 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 -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [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-05-14.22
# 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: Makefile.am,v 1.1.1.1 2006/11/26 20:15:58 matthieu Exp $
#
# 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
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.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,423 @@
# 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: Makefile.in,v 1.1.1.1 2006/11/26 20:15:58 matthieu Exp $
#
# 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@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
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@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
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@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPARC_FALSE = @SPARC_FALSE@
SPARC_TRUE = @SPARC_TRUE@
STRIP = @STRIP@
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
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.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) --gnu man/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu 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,30 @@
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.man,v 1.1 2001/01/24 00:06:30 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH FFB __drivermansuffix__ __vendorversion__
.SH NAME
ffb \- SUNFFB video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qsunffb\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B ffb
is an __xservername__ driver for Sun Creator, Creator 3D and Elite 3D video cards.
THIS MAN PAGE NEEDS TO BE FILLED IN.
.SH SUPPORTED HARDWARE
The
.B ffb
driver supports...
.SH CONFIGURATION DETAILS
Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.SH AUTHORS
Authors include: Jakub Jelinek <jakub@redhat.com>, David S. Miller <davem@redhat.com>, Michal Rehacek <majkl@iname.com>

View File

@@ -0,0 +1,360 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, 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
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
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,56 @@
# 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.
# 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.
AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@
sunffb_drv_la_LTLIBRARIES = sunffb_drv.la
sunffb_drv_la_LDFLAGS = -module -avoid-version
sunffb_drv_ladir = @moduledir@/drivers
if SPARC
SPARC_ASM_SRC = ffb_asm.s VISmoveImage.s
endif
sunffb_drv_la_SOURCES = \
ffb_accel.c \
ffb_attr.c \
ffb_cursor.c \
ffb_dac.c \
ffb_dac.h \
ffb_ddc.c \
ffb_dga.c \
ffb_driver.c \
ffb_fifo.h \
ffb.h \
ffb_loops.h \
ffb_rcache.h \
ffb_regs.h \
ffb_wid.c \
$(SPARC_ASM_SRC)
if DRI
sunffb_drv_la_SOURCES += \
ffb_dri.c \
ffb_drishare.h
endif

View File

@@ -0,0 +1,542 @@
# 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@
@DRI_TRUE@am__append_1 = \
@DRI_TRUE@ ffb_dri.c \
@DRI_TRUE@ ffb_drishare.h
subdir = src
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 =
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)$(sunffb_drv_ladir)"
sunffb_drv_laLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(sunffb_drv_la_LTLIBRARIES)
sunffb_drv_la_LIBADD =
am__sunffb_drv_la_SOURCES_DIST = ffb_accel.c ffb_attr.c ffb_cursor.c \
ffb_dac.c ffb_dac.h ffb_ddc.c ffb_dga.c ffb_driver.c \
ffb_fifo.h ffb.h ffb_loops.h ffb_rcache.h ffb_regs.h ffb_wid.c \
ffb_asm.s VISmoveImage.s ffb_dri.c ffb_drishare.h
@SPARC_TRUE@am__objects_1 = ffb_asm.lo VISmoveImage.lo
@DRI_TRUE@am__objects_2 = ffb_dri.lo
am_sunffb_drv_la_OBJECTS = ffb_accel.lo ffb_attr.lo ffb_cursor.lo \
ffb_dac.lo ffb_ddc.lo ffb_dga.lo ffb_driver.lo ffb_wid.lo \
$(am__objects_1) $(am__objects_2)
sunffb_drv_la_OBJECTS = $(am_sunffb_drv_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \
$(CCASFLAGS)
SOURCES = $(sunffb_drv_la_SOURCES)
DIST_SOURCES = $(am__sunffb_drv_la_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
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@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
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@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPARC_FALSE = @SPARC_FALSE@
SPARC_TRUE = @SPARC_TRUE@
STRIP = @STRIP@
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@
# 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.
AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@
sunffb_drv_la_LTLIBRARIES = sunffb_drv.la
sunffb_drv_la_LDFLAGS = -module -avoid-version
sunffb_drv_ladir = @moduledir@/drivers
@SPARC_TRUE@SPARC_ASM_SRC = ffb_asm.s VISmoveImage.s
sunffb_drv_la_SOURCES = ffb_accel.c ffb_attr.c ffb_cursor.c ffb_dac.c \
ffb_dac.h ffb_ddc.c ffb_dga.c ffb_driver.c ffb_fifo.h ffb.h \
ffb_loops.h ffb_rcache.h ffb_regs.h ffb_wid.c $(SPARC_ASM_SRC) \
$(am__append_1)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj .s
$(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) --gnu src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/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
install-sunffb_drv_laLTLIBRARIES: $(sunffb_drv_la_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(sunffb_drv_ladir)" || $(mkdir_p) "$(DESTDIR)$(sunffb_drv_ladir)"
@list='$(sunffb_drv_la_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(sunffb_drv_laLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(sunffb_drv_ladir)/$$f'"; \
$(LIBTOOL) --mode=install $(sunffb_drv_laLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(sunffb_drv_ladir)/$$f"; \
else :; fi; \
done
uninstall-sunffb_drv_laLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(sunffb_drv_la_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(sunffb_drv_ladir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(sunffb_drv_ladir)/$$p"; \
done
clean-sunffb_drv_laLTLIBRARIES:
-test -z "$(sunffb_drv_la_LTLIBRARIES)" || rm -f $(sunffb_drv_la_LTLIBRARIES)
@list='$(sunffb_drv_la_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
sunffb_drv.la: $(sunffb_drv_la_OBJECTS) $(sunffb_drv_la_DEPENDENCIES)
$(LINK) -rpath $(sunffb_drv_ladir) $(sunffb_drv_la_LDFLAGS) $(sunffb_drv_la_OBJECTS) $(sunffb_drv_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_accel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_attr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_cursor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_dac.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_ddc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_dga.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_dri.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_driver.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ffb_wid.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
.s.o:
$(CCASCOMPILE) -c $<
.s.obj:
$(CCASCOMPILE) -c `$(CYGPATH_W) '$<'`
.s.lo:
$(LTCCASCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
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: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
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)
@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 $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(sunffb_drv_ladir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-sunffb_drv_laLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-sunffb_drv_laLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-sunffb_drv_laLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-sunffb_drv_laLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip install-sunffb_drv_laLTLIBRARIES installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-sunffb_drv_laLTLIBRARIES
# 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:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,338 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - defines.
*
* Copyright (C) 1998,1999,2000 Jakub Jelinek (jakub@redhat.com)
* Copyright (C) 1998 Michal Rehacek (majkl@iname.com)
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
*
* 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
* JAKUB JELINEK, MICHAL REHACEK, OR DAVID MILLER 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.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.7tsi Exp $ */
#ifndef FFB_H
#define FFB_H
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86RamDac.h"
#include "xaa.h"
#include <X11/Xmd.h>
#include "gcstruct.h"
#include "windowstr.h"
#include "ffb_regs.h"
#include "xf86sbusBus.h"
#include "ffb_dac.h"
#ifdef XF86DRI
#include "xf86drm.h"
#include "ffb_drishare.h"
#endif
#ifndef DPMS_SERVER
#define DPMS_SERVER
#endif /* DPMS_SERVER */
#include <X11/extensions/dpms.h>
/* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
/* Note: do not mmap FFB_DFB8R_VOFF and following mappings using one mmap together
with any previous SFB mapping, otherwise the OS won't be able to use 4M pages
for the DFB mappings. -jj */
#define FFB_SFB8R_VOFF 0x00000000
#define FFB_SFB8G_VOFF 0x00400000
#define FFB_SFB8B_VOFF 0x00800000
#define FFB_SFB8X_VOFF 0x00c00000
#define FFB_SFB32_VOFF 0x01000000
#define FFB_SFB64_VOFF 0x02000000
#define FFB_FBC_REGS_VOFF 0x04000000
#define FFB_BM_FBC_REGS_VOFF 0x04002000
#define FFB_DFB8R_VOFF 0x04004000
#define FFB_DFB8G_VOFF 0x04404000
#define FFB_DFB8B_VOFF 0x04804000
#define FFB_DFB8X_VOFF 0x04c04000
#define FFB_DFB24_VOFF 0x05004000
#define FFB_DFB32_VOFF 0x06004000
#define FFB_DFB422A_VOFF 0x07004000 /* DFB 422 mode write to A */
#define FFB_DFB422AD_VOFF 0x07804000 /* DFB 422 mode with line doubling */
#define FFB_DFB24B_VOFF 0x08004000 /* DFB 24bit mode write to B */
#define FFB_DFB422B_VOFF 0x09004000 /* DFB 422 mode write to B */
#define FFB_DFB422BD_VOFF 0x09804000 /* DFB 422 mode with line doubling */
#define FFB_SFB16Z_VOFF 0x0a004000 /* 16bit mode Z planes */
#define FFB_SFB8Z_VOFF 0x0a404000 /* 8bit mode Z planes */
#define FFB_SFB422_VOFF 0x0ac04000 /* SFB 422 mode write to A/B */
#define FFB_SFB422D_VOFF 0x0b404000 /* SFB 422 mode with line doubling */
#define FFB_FBC_KREGS_VOFF 0x0bc04000
#define FFB_DAC_VOFF 0x0bc06000
#define FFB_PROM_VOFF 0x0bc08000
#define FFB_EXP_VOFF 0x0bc18000
#if defined(__GNUC__) && defined(USE_VIS)
#define FFB_ALIGN64 __attribute__((aligned(8)))
#else
#define FFB_ALIGN64
#endif
typedef struct {
unsigned int fg FFB_ALIGN64, bg; /* FG/BG colors for stipple */
unsigned int patalign; /* X/Y alignment of bits */
unsigned char alu; /* ALU operation */
unsigned char inhw; /* Cached in FFB */
unsigned char pagable; /* Can be used in a pagefill */
unsigned char ph; /* Page buffer height */
unsigned int bits[32]; /* The stipple bits themselves */
} CreatorStippleRec, *CreatorStipplePtr;
typedef struct {
int type;
unsigned int linepat;
CreatorStipplePtr stipple;
void (*PolySegment)(DrawablePtr, GCPtr, int, xSegment *);
void (*Polylines)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
} CreatorPrivGCRec, *CreatorPrivGCPtr;
/* WID and framebuffer controls are a property of the
* window.
*/
typedef struct {
CreatorStipplePtr Stipple;
unsigned int fbc_base;
unsigned int wid;
} CreatorPrivWinRec, *CreatorPrivWinPtr;
enum ffb_resolution {
ffb_res_standard = 0, /* 1280 x 1024 */
ffb_res_high, /* 1920 x 1360 */
ffb_res_stereo, /* 960 x 580 */
ffb_res_portrait /* 1280 x 2048 */
};
enum ffb_chip_type {
ffb1_prototype = 0, /* Early pre-FCS FFB */
ffb1_standard, /* First FCS FFB, 100Mhz UPA, 66MHz gclk */
ffb1_speedsort, /* Second FCS FFB, 100Mhz UPA, 75MHz gclk */
ffb2_prototype, /* Early pre-FCS vertical FFB2 */
ffb2_vertical, /* First FCS FFB2/vertical, 100Mhz UPA, 100MHZ gclk,
75(SingleBuffer)/83(DoubleBuffer) MHz fclk */
ffb2_vertical_plus, /* Second FCS FFB2/vertical, same timings */
ffb2_horizontal, /* First FCS FFB2/horizontal, same timings as FFB2/vert */
ffb2_horizontal_plus, /* Second FCS FFB2/horizontal, same timings */
afb_m3, /* FCS Elite3D, 3 float chips */
afb_m6 /* FCS Elite3D, 6 float chips */
};
#ifdef XF86DRI
typedef struct {
int index;
} FFBConfigPrivRec, *FFBConfigPrivPtr;
#endif
typedef struct {
unsigned short fifo_cache;
unsigned short rp_active;
ffb_fbcPtr regs;
unsigned int ppc_cache;
unsigned int pmask_cache;
unsigned int rop_cache;
unsigned int drawop_cache;
unsigned int fg_cache;
unsigned int bg_cache;
unsigned int fontw_cache;
unsigned int fontinc_cache;
unsigned int fbc_cache;
unsigned int wid_cache;
enum ffb_chip_type ffb_type;
CreatorStipplePtr laststipple;
unsigned *fb;
unsigned *sfb32;
unsigned *sfb8r;
unsigned *sfb8x;
unsigned *dfb24;
unsigned *dfb8r;
unsigned *dfb8x;
/* Slot offset 0x0200000, used to probe board type. */
volatile unsigned int *strapping_bits;
/* Needed for some 3DRAM revisions and ffb1 in hires */
unsigned char disable_pagefill;
/* Needed for FFB2/AFB when in stereo or hires */
unsigned char disable_fastfill_ap;
/* Needed for FFB1 in highres mode */
unsigned char disable_vscroll;
/* Needed on all FFB1 boards. */
unsigned char has_brline_bug;
/* Available on FFB2 and AFB */
unsigned char use_blkread_prefetch;
/* Framebuffer configuration */
unsigned char has_double_res;
unsigned char has_z_buffer;
unsigned char has_double_buffer;
/* XAA related info */
XAAInfoRecPtr pXAAInfo;
unsigned int xaa_fbc;
unsigned int xaa_wid;
unsigned int xaa_planemask;
unsigned int xaa_linepat;
int xaa_xdir, xaa_ydir, xaa_rop;
unsigned char *xaa_scanline_buffers[2];
int xaa_scanline_x, xaa_scanline_y, xaa_scanline_w;
unsigned char *xaa_tex;
int xaa_tex_pitch, xaa_tex_width, xaa_tex_height;
unsigned int xaa_tex_color;
enum ffb_resolution ffb_res;
BoxRec ClippedBoxBuf[64];
xRectangle Pf_Fixups[4];
short Pf_AlignTab[0x800];
ffb_dacPtr dac;
sbusDevicePtr psdp;
Bool HWCursor;
Bool NoAccel;
Bool vtSema;
CloseScreenProcPtr CloseScreen;
xf86CursorInfoPtr CursorInfoRec;
unsigned char CursorShiftX, CursorShiftY;
unsigned char *CursorData;
PixmapPtr pix32, pix8;
void *I2C;
struct ffb_dac_info dac_info;
#ifdef XF86DRI
void *pDRIInfo;
int numVisualConfigs;
void *pVisualConfigs;
FFBConfigPrivPtr pVisualConfigsPriv;
int drmSubFD;
Bool dri_enabled;
ffb_dri_state_t *pFfbSarea;
#endif
OptionInfoPtr Options;
} FFBRec, *FFBPtr;
/* Acceleration */
extern Bool FFBAccelInit(ScreenPtr, FFBPtr);
extern void CreatorVtChange (ScreenPtr pScreen, int enter);
/* HW cursor support */
extern Bool FFBHWCursorInit(ScreenPtr);
/* Exported DAC layer routines. */
extern void FFBDacLoadCursorPos(FFBPtr, int, int);
extern void FFBDacLoadCursorColor(FFBPtr, int, int);
extern void FFBDacCursorEnableDisable(FFBPtr, int);
extern void FFBDacCursorLoadBitmap(FFBPtr, int, int, unsigned int *);
extern void FFBDacLoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
extern Bool FFBDacInit(FFBPtr);
extern void FFBDacFini(FFBPtr);
extern void FFBDacEnterVT(FFBPtr);
extern void FFBDacLeaveVT(FFBPtr);
extern Bool FFBDacSaveScreen(FFBPtr, int);
extern void FFBDacDPMSMode(FFBPtr, int, int);
/* Exported WID layer routines. */
extern void FFBWidPoolInit(FFBPtr);
extern unsigned int FFBWidAlloc(FFBPtr, int, int, Bool);
extern void FFBWidFree(FFBPtr, unsigned int);
extern unsigned int FFBWidUnshare(FFBPtr, unsigned int);
extern unsigned int FFBWidReshare(FFBPtr, unsigned int);
extern void FFBWidChangeBuffer(FFBPtr, unsigned int, int);
extern Bool FFBWidIsShared(FFBPtr pFfb, unsigned int wid);
/* Accelerated double-buffering. */
extern Bool FFBDbePreInit(ScreenPtr);
#ifdef XF86DRI
/* DRI support */
extern Bool FFBDRIScreenInit(ScreenPtr);
extern Bool FFBDRIFinishScreenInit(ScreenPtr);
extern void FFBDRICloseScreen(ScreenPtr);
#endif
/* The fastfill and pagefill buffer sizes change based upon
* the resolution.
*/
struct fastfill_parms {
int fastfill_small_area;
int pagefill_small_area;
int fastfill_height;
int fastfill_width;
int pagefill_height;
int pagefill_width;
};
extern struct fastfill_parms ffb_fastfill_parms[];
#define FFB_FFPARMS(__fpriv) (ffb_fastfill_parms[(__fpriv)->ffb_res])
extern int CreatorScreenPrivateIndex;
extern int CreatorGCPrivateIndex;
extern int CreatorWindowPrivateIndex;
#define GET_FFB_FROM_SCRN(p) ((FFBPtr)((p)->driverPrivate))
#define GET_FFB_FROM_SCREEN(s) \
((FFBPtr)(s)->devPrivates[CreatorScreenPrivateIndex].ptr)
#define CreatorGetGCPrivate(g) \
((CreatorPrivGCPtr) (g)->devPrivates [CreatorGCPrivateIndex].ptr)
#define CreatorGetWindowPrivate(w) \
((CreatorPrivWinPtr) (w)->devPrivates[CreatorWindowPrivateIndex].ptr)
#define CreatorSetWindowPrivate(w,p) \
((w)->devPrivates[CreatorWindowPrivateIndex].ptr = (pointer) p)
#undef DEBUG_FFB
#ifdef DEBUG_FFB
extern FILE *FDEBUG_FD;
static __inline__ void FFB_DEBUG_init(void)
{
FDEBUG_FD = fopen("/tmp/FFB.DEBUG", "a");
}
#define FDEBUG(__x) \
do { fprintf __x; \
fflush(FDEBUG_FD); \
} while(0)
#else
#define FFB_DEBUG_init() do { } while(0)
#define FDEBUG(__x) do { } while(0)
#endif
/* Enable this to get very verbose tracing of the driver onto stderr. */
#undef TRACE_FFB
#ifdef TRACE_FFB
#define FFBLOG(__x) ErrorF __x
#else
#define FFBLOG(__x) do { } while(0)
#endif
#endif /* FFB_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,349 @@
/*
* ffb_asm.s: Fast Creator raster op inner loops.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
* Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com)
*
* 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
* JAKUB JELINEK OR DAVID MILLER 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.
*/
/* $XFree86$ */
/* Hardware register offsets */
#define FFB_BY 0x0060
#define FFB_DY 0x0068
#define FFB_BH 0x0070
#define FFB_PPC 0x0200
#define FFB_DRAWOP 0x0300
#define FFB_UCSR 0x0900
#define FFB_DRAWOP_VSCROLL 0x0b
#define FIFO_CACHE 0x00
#define BOX_X1 0x00
#define BOX_Y1 0x02
#define BOX_X2 0x04
#define BOX_Y2 0x06
#define POINT_X 0x00
#define POINT_Y 0x02
#define RECT_X 0x00
#define RECT_Y 0x02
#define RECT_W 0x04
#define RECT_H 0x06
#define SEG_X1 0x00
#define SEG_Y1 0x02
#define SEG_X2 0x04
#define SEG_Y2 0x06
.text
.align 32
.globl FFB_STIPPLE_LOAD
/* %o0 = &ffbregs->pattern[0]
* %o1 = &stipple->bits[0]
*/
FFB_STIPPLE_LOAD:
cmp %g0, 0
1: ldx [%o1 + 0x00], %g1
ldx [%o1 + 0x08], %g2
ldx [%o1 + 0x10], %g3
ldx [%o1 + 0x18], %g4
add %o0, 0x40, %o0
ldx [%o1 + 0x20], %g5
ldx [%o1 + 0x28], %o2
ldx [%o1 + 0x30], %o3
ldx [%o1 + 0x38], %o4
stx %g1, [%o0 - 0x40]
stx %g2, [%o0 - 0x38]
stx %g3, [%o0 - 0x30]
stx %g4, [%o0 - 0x28]
add %o1, 0x40, %o1
stx %g5, [%o0 - 0x20]
stx %o2, [%o0 - 0x18]
stx %o3, [%o0 - 0x10]
stx %o4, [%o0 - 0x08]
be,pt %icc, 1b
cmp %g0, 1
retl
nop
#define FIFO_WAIT(ffbregs, goal, this_label, done_label) \
this_label: \
lduw [ffbregs + FFB_UCSR], %g1; \
and %g1, 0xfff, %g1; \
subcc %g1, (4 + goal), %g1; \
bge,pt %icc, done_label; \
nop; \
ba,a,pt %xcc, this_label
.align 32
.globl FFB_PPT_BOX_LOOP
/* This is only used (currently) by vscroll, so we put
* the creator hwbug workaround in here (writing
* the drawop each iteration).
*
* %o0 = ffbpriv, %o1 = ffbregs,
* %o2 = pbox, %o3 = pbox_last, %o4 = ppt
*/
FFB_PPT_BOX_LOOP:
lduh [%o0 + FIFO_CACHE], %g1 /* Load Group */
sethi %hi(FFB_DRAWOP), %g2 /* IEU0 */
cmp %o2, %o3 /* IEU1 */
bgu,pn %icc, 2f /* CTI */
or %g2,%lo(FFB_DRAWOP),%g2 /* IEU0 Group */
1: lduh [%o4 + POINT_X], %g3 /* Load Group */
lduh [%o4 + POINT_Y], %g4 /* Load Group */
lduh [%o2 + BOX_Y2], %g5 /* Load Group */
lduh [%o2 + BOX_Y1], %o5 /* Load Group */
sllx %g4, 32, %g4 /* IEU0 */
or %g3, %g4, %g3 /* IEU0 Group */
sub %g5, %o5, %g5 /* IEU1 */
sllx %o5, 32, %g4 /* IEU0 Group */
sllx %g5, 32, %g5 /* IEU0 Group */
lduh [%o2 + BOX_X2], %o5 /* Load */
add %o4, 0x4, %o4 /* IEU1 */
lduh [%o2 + BOX_X1], %g7 /* Load Group */
add %o2, 0x8, %o2 /* IEU0 */
sub %o5, %g7, %o5 /* IEU0 Group */
or %g4, %g7, %g4 /* IEU1 */
or %g5, %o5, %g5 /* IEU0 Group */
subcc %g1, 7, %g1 /* IEU1 */
bl,pn %icc, FFB_PPT_BOX_WAIT /* CTI */
9: cmp %o2, %o3 /* IEU1 Group */
/* This works around BUG ID 1189858 -DaveM */
mov FFB_DRAWOP_VSCROLL, %o5 /* IEU0 */
stw %o5, [%o1 + %g2] /* STORE */
stx %g3, [%o1 + FFB_BY] /* STORE Group */
stx %g4, [%o1 + FFB_DY] /* STORE Group */
bleu,pt %icc, 1b /* CTI */
stx %g5, [%o1 + FFB_BH] /* STORE Group */
2: retl /* CTI Group */
sth %g1, [%o0 + FIFO_CACHE] /* STORE */
FIFO_WAIT(%o1, 7, FFB_PPT_BOX_WAIT, 9b)
.align 32
.globl FFB_BOX_LOOP
/* %o0 = ffbpriv, %o1 = ffbregs,
* %o2 = pbox, %o3 = pbox_last
*/
FFB_BOX_LOOP:
lduh [%o0 + FIFO_CACHE], %g1 /* Load Group */
cmp %o2, %o3 /* IEU0 */
bgu,pn %icc, 2f /* CTI */
nop /* IEU0 Group */
1: lduw [%o2 + BOX_X1], %g4 /* Load Group */
lduw [%o2 + BOX_X2], %g3 /* Load Group */
sllx %g4, 32, %o5 /* IEU0 */
srl %g4, 16, %g7 /* IEU0 Group */
add %o2, 8, %o2 /* IEU1 */
sllx %g3, 32, %g5 /* IEU0 Group */
subcc %g1, 4, %g1 /* IEU1 */
srl %g3, 16, %o4 /* IEU0 Group */
or %o5, %g7, %o5 /* IEU1 */
or %g5, %o4, %g5 /* IEU0 Group */
bl,pn %icc, FFB_BOX_WAIT /* CTI */
sub %g5, %o5, %g5 /* IEU0 Group */
9: cmp %o2, %o3 /* IEU1 */
stx %o5, [%o1 + FFB_BY] /* Store */
bleu,pt %icc, 1b /* CTI Group */
stx %g5, [%o1 + FFB_BH] /* Store */
2: retl /* CTI Group */
sth %g1, [%o0 + FIFO_CACHE] /* Store */
FIFO_WAIT(%o1, 4, FFB_BOX_WAIT, 9b)
.align 32
.globl FFB_RECT_LOOP
/* %o0 = ffbpriv, %o1 = ffbregs,
* %o2 = prect, %o3 = prect_last,
* %o4 = xOrg, %o5 = yOrg
*/
FFB_RECT_LOOP:
lduh [%o0 + FIFO_CACHE], %g1 /* Load Group */
sllx %o5, 32, %o5 /* IEU0 */
cmp %o2, %o3 /* IEU1 */
bgu,pn %icc, 2f /* CTI */
or %o4, %o5, %o4 /* IEU0 Group */
1: lduh [%o2 + RECT_X], %g4 /* Load Group */
lduh [%o2 + RECT_Y], %o5 /* Load Group */
lduh [%o2 + RECT_W], %g3 /* Load Group */
lduh [%o2 + RECT_H], %g2 /* Load Group */
sllx %o5, 32, %g7 /* IEU0 */
add %o2, 8, %o2 /* IEU1 */
orcc %g7, %g4, %g7 /* IEU1 Group */
sllx %g2, 32, %g5 /* IEU0 */
or %g5, %g3, %g5 /* IEU0 Group */
add %g7, %o4, %g7 /* IEU1 */
subcc %g1, 4, %g1 /* IEU1 Group */
bl,pn %icc, FFB_RECT_WAIT /* CTI */
9: cmp %o2, %o3 /* IEU1 Group */
stx %g7, [%o1 + FFB_BY] /* Store */
bleu,pt %icc, 1b /* CTI */
stx %g5, [%o1 + FFB_BH] /* Store Group */
2: retl /* CTI Group */
sth %g1, [%o0 + FIFO_CACHE] /* Store */
FIFO_WAIT(%o1, 4, FFB_RECT_WAIT, 9b)
.align 32
.globl FFB_PPT_WIDTH_LOOP
/* %o0 = ffbpriv, %o1 = ffbregs,
* %o2 = ppt, %o3 = ppt_last,
* %o4 = pwidth
*/
FFB_PPT_WIDTH_LOOP:
lduh [%o0 + FIFO_CACHE], %g1 /* Load Group */
cmp %o2, %o3 /* IEU1 */
bgu,pn %icc, 2f /* CTI */
nop
8: lduw [%o2 + POINT_X], %g4 /* Load Group */
lduw [%o4], %g2 /* Load Group */
sllx %g4, 32, %g7
1: srl %g4, 16, %g5 /* IEU0 Group */
add %o2, 4, %o2 /* IEU1 */
brz,pn %g2, 8b /* CTI+IEU1 Group */
add %o4, 4, %o4 /* IEU0 */
or %g5, %g7, %g7 /* IEU0 Group */
subcc %g1, 5, %g1 /* IEU1 */
bl,pn %icc, FFB_PPT_WIDTH_WAIT/* CTI */
add %g7, %g2, %o5 /* IEU0 Group */
9: stw %g0, [%o1 + FFB_PPC] /* Store Group */
cmp %o2, %o3 /* IEU1 */
stx %g7, [%o1 + FFB_BY] /* Store Group */
bleu,pt %icc, 8b /* CTI */
stx %o5, [%o1 + FFB_BH] /* Store Group */
2: retl /* CTI Group */
sth %g1, [%o0 + FIFO_CACHE] /* Store */
FIFO_WAIT(%o1, 5, FFB_PPT_WIDTH_WAIT, 9b)
.align 32
.globl FFB_LINE_LOOP1
/* %o0 = ffbpriv, %o1 = ffbregs,
* %o2 = ppt, %o3 = ppt_last,
* %o4 = xOrg, %o5 = yOrg
*
* We return ppt_last + 1.
*/
FFB_LINE_LOOP1:
lduh [%o0 + FIFO_CACHE], %g1
sllx %o5, 32, %o5
and %o4, 0x7ff, %o4
cmp %o2, %o3
bgu,pn %icc, 2f
or %o4, %o5, %o4
1: lduw [%o2 + POINT_X], %g4
sllx %g4, 32, %g7
srl %g4, 16, %g3
add %o2, 4, %o2
or %g7, %g3, %g7
subcc %g1, 3, %g1
bl,pn %icc, FFB_LINE1_WAIT
add %g7, %o4, %g7
9: cmp %o2, %o3
stw %g0, [%o1 + FFB_PPC]
bleu,pt %icc, 1b
stx %g7, [%o1 + FFB_BH]
2: nop
sth %g1, [%o0 + FIFO_CACHE]
retl
mov %o2, %o0
FIFO_WAIT(%o1, 3, FFB_LINE1_WAIT, 9b)
.align 32
.globl FFB_LINE_LOOP2
/* %o0 = ffbpriv, %o1 = ffbregs,
* %o2 = ppt, %o3 = ppt_last,
* %o4 = &xOrg, %o5 = &yOrg
*
* We return ppt_last + 1.
* The only difference between the previous routine
* is that here we accumulate the origin values.
*/
FFB_LINE_LOOP2:
lduw [%o5], %g5
lduw [%o4], %g2
lduh [%o0 + FIFO_CACHE], %g1
sllx %g5, 32, %g5
and %g2, 0x7ff, %g2
cmp %o2, %o3
bgu,pn %icc, 2f
or %g5, %g2, %g5
1: lduw [%o2 + POINT_X], %g4
sllx %g4, 32, %g7
srl %g4, 16, %g3
add %o2, 4, %o2
or %g7, %g3, %g7
subcc %g1, 3, %g1
bl,pn %icc, FFB_LINE2_WAIT
add %g7, %g5, %g5
9: cmp %o2, %o3
stw %g0, [%o1 + FFB_PPC]
bleu,pt %icc, 1b
stx %g5, [%o1 + FFB_BH]
2: sth %g1, [%o0 + FIFO_CACHE]
srlx %g5, 32, %g4
stw %g5, [%o4]
stw %g4, [%o5]
retl
mov %o2, %o0
FIFO_WAIT(%o1, 3, FFB_LINE2_WAIT, 9b)

View File

@@ -0,0 +1,260 @@
/*
* Attribute setting for the Creator and Creator3D framebuffer.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
* Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com)
*
* 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
* JAKUB JELINEK OR DAVID MILLER 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.
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_attr.c,v 1.1 2000/05/18 23:21:35 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ffb.h"
#include "ffb_fifo.h"
#include "ffb_rcache.h"
/* If we're going to write any attributes, write them all. */
void __FFB_Attr_Raw(FFBPtr pFfb, unsigned int ppc, unsigned int ppc_mask,
unsigned int pmask, unsigned int rop,
int drawop, int fg, unsigned int fbc, unsigned int wid)
{
ffb_fbcPtr ffb = pFfb->regs;
FFBLOG(("WRATTRS_RAW: PPC[%08x:%08x] PMSK[%08x] ROP[%08x] DOP[%08x] FG[%08x] FBC[%08x] WID[%02x]\n",
ppc, ppc_mask, pmask, rop, drawop, fg, fbc, wid));
pFfb->ppc_cache &= ~ppc_mask;
pFfb->ppc_cache |= ppc;
pFfb->fg_cache = fg;
pFfb->fbc_cache = fbc;
pFfb->wid_cache = wid;
pFfb->rop_cache = rop;
pFfb->pmask_cache = pmask;
pFfb->drawop_cache = drawop;
pFfb->rp_active = 1;
FFBFifo(pFfb, 7);
ffb->ppc = ppc;
ffb->fg = fg;
ffb->fbc = fbc;
ffb->wid = wid;
ffb->rop = rop;
ffb->pmask = pmask;
ffb->drawop = drawop;
}
void __FFB_Attr_SFB_VAR(FFBPtr pFfb, unsigned int ppc, unsigned int ppc_mask, unsigned int fbc,
unsigned int wid, unsigned int rop, unsigned int pmask)
{
ffb_fbcPtr ffb = pFfb->regs;
FFBLOG(("WRATTRS_SFBVAR: PPC[%08x:%08x] PMSK[%08x] ROP[%08x] FBC[%08x] WID[%02x]\n",
ppc, ppc_mask, pmask, rop, fbc, wid));
pFfb->ppc_cache &= ~ppc_mask;
pFfb->ppc_cache |= ppc;
pFfb->fbc_cache = fbc;
pFfb->wid_cache = wid;
pFfb->rop_cache = rop;
pFfb->pmask_cache = pmask;
pFfb->rp_active = 1;
FFBFifo(pFfb, 5);
ffb->ppc = ppc;
ffb->fbc = fbc;
ffb->wid = wid;
ffb->rop = rop;
ffb->pmask = pmask;
}
#define NEED_PPC 0x00000001
#define NEED_PMASK 0x00000002
#define NEED_ROP 0x00000004
#define NEED_DRAWOP 0x00000008
#define NEED_FG 0x00000010
#define NEED_BG 0x00000020
#define NEED_FBC 0x00000040
#define NEED_WID 0x00000080
void __FFB_Attr_GC(FFBPtr pFfb, GCPtr pGC, WindowPtr pWin, unsigned int ppc, int drawop)
{
ffb_fbcPtr ffb = pFfb->regs;
unsigned int rop, need_mask, need_count;
need_mask = need_count = 0;
if ((pFfb->ppc_cache & FFB_PPC_GCMASK) != ppc) {
unsigned int newppc = pFfb->ppc_cache & ~FFB_PPC_GCMASK;
newppc |= (ppc & FFB_PPC_GCMASK);
pFfb->ppc_cache = newppc;
need_mask |= NEED_PPC;
need_count++;
}
if (pFfb->pmask_cache != pGC->planemask) {
pFfb->pmask_cache = pGC->planemask;
need_mask |= NEED_PMASK;
need_count++;
}
rop = (pGC->alu | FFB_ROP_EDIT_BIT)|(FFB_ROP_NEW<<8);
if (pFfb->rop_cache != rop) {
pFfb->rop_cache = rop;
need_mask |= NEED_ROP;
need_count++;
}
if (pFfb->drawop_cache != drawop) {
pFfb->drawop_cache = drawop;
need_mask |= NEED_DRAWOP;
need_count++;
}
if (pFfb->fg_cache != pGC->fgPixel) {
pFfb->fg_cache = pGC->fgPixel;
need_mask |= NEED_FG;
need_count++;
}
{
CreatorPrivWinPtr WinPriv = CreatorGetWindowPrivate(pWin);
unsigned int fbc = WinPriv->fbc_base;
fbc &= ~FFB_FBC_XE_MASK;
fbc |= FFB_FBC_XE_OFF;
if (pFfb->fbc_cache != fbc) {
pFfb->fbc_cache = fbc;
need_mask |= NEED_FBC;
need_count++;
}
}
pFfb->rp_active = 1;
FFBLOG(("WRATTRS_GC: PPC[%08x:%08x] PMSK[%08x] ROP[%08x] "
"DOP[%08x] FG[%08x] FBC[%08x]\n",
pFfb->ppc_cache & FFB_PPC_GCMASK, FFB_PPC_GCMASK,
pFfb->pmask_cache, pFfb->rop_cache,
pFfb->drawop_cache, pFfb->fg_cache, pFfb->fbc_cache));
FFBFifo(pFfb, need_count);
if (need_mask & NEED_PPC)
ffb->ppc = (pFfb->ppc_cache & FFB_PPC_GCMASK);
if (need_mask & NEED_PMASK)
ffb->pmask = pFfb->pmask_cache;
if (need_mask & NEED_ROP)
ffb->rop = pFfb->rop_cache;
if (need_mask & NEED_DRAWOP)
ffb->drawop = pFfb->drawop_cache;
if (need_mask & NEED_FG)
ffb->fg = pFfb->fg_cache;
if (need_mask & NEED_FBC)
ffb->fbc = pFfb->fbc_cache;
}
void __FFB_Attr_FastfillWin(FFBPtr pFfb, WindowPtr pWin,
unsigned int ppc, unsigned int pixel)
{
ffb_fbcPtr ffb = pFfb->regs;
unsigned int rop, need_mask, need_count;
need_mask = need_count = 0;
if ((pFfb->ppc_cache & FFB_PPC_WINMASK) != ppc) {
unsigned int newppc = pFfb->ppc_cache & ~FFB_PPC_WINMASK;
newppc |= (ppc & FFB_PPC_WINMASK);
pFfb->ppc_cache = newppc;
need_mask |= NEED_PPC;
need_count++;
}
if (pFfb->pmask_cache != 0x00ffffff) {
pFfb->pmask_cache = 0x00ffffff;
need_mask |= NEED_PMASK;
need_count++;
}
rop = FFB_ROP_NEW | (FFB_ROP_NEW<<8);
if (pFfb->rop_cache != rop) {
pFfb->rop_cache = rop;
need_mask |= NEED_ROP;
need_count++;
}
if (pFfb->drawop_cache != FFB_DRAWOP_FASTFILL) {
pFfb->drawop_cache = FFB_DRAWOP_FASTFILL;
need_mask |= NEED_DRAWOP;
need_count++;
}
if (pFfb->fg_cache != pixel) {
pFfb->fg_cache = pixel;
need_mask |= NEED_FG;
need_count++;
}
{
CreatorPrivWinPtr pWinPriv = CreatorGetWindowPrivate(pWin);
unsigned int fbc = pWinPriv->fbc_base;
if (pFfb->has_double_buffer) {
fbc &= ~FFB_FBC_WB_MASK;
fbc |= FFB_FBC_WB_AB;
}
fbc &= ~(FFB_FBC_XE_MASK | FFB_FBC_RGBE_MASK);
fbc |= FFB_FBC_XE_ON | FFB_FBC_RGBE_ON;
if (pFfb->ffb_res == ffb_res_high)
fbc |= FFB_FBC_WB_B;
if (pFfb->fbc_cache != fbc) {
pFfb->fbc_cache = fbc;
need_mask |= NEED_FBC;
need_count++;
}
if (pFfb->wid_cache != pWinPriv->wid) {
pFfb->wid_cache = pWinPriv->wid;
need_mask |= NEED_WID;
need_count++;
}
}
pFfb->rp_active = 1;
FFBLOG(("WRATTRS_GC: PPC[%08x:%08x] PMSK[%08x] ROP[%08x] DOP[%08x] FG[%08x] FBC[%08x] WID[%02x]\n",
pFfb->ppc_cache & FFB_PPC_WINMASK, FFB_PPC_WINMASK,
pFfb->pmask_cache, pFfb->rop_cache,
pFfb->drawop_cache, pFfb->fg_cache, pFfb->fbc_cache, pFfb->wid_cache));
FFBFifo(pFfb, need_count);
if (need_mask & NEED_PPC)
ffb->ppc = (pFfb->ppc_cache & FFB_PPC_WINMASK);
if (need_mask & NEED_PMASK)
ffb->pmask = pFfb->pmask_cache;
if (need_mask & NEED_ROP)
ffb->rop = pFfb->rop_cache;
if (need_mask & NEED_DRAWOP)
ffb->drawop = pFfb->drawop_cache;
if (need_mask & NEED_FG)
ffb->fg = pFfb->fg_cache;
if (need_mask & NEED_FBC)
ffb->fbc = pFfb->fbc_cache;
if (need_mask & NEED_WID)
ffb->wid = pFfb->wid_cache;
}

View File

@@ -0,0 +1,143 @@
/*
* Hardware cursor support for Creator, Creator 3D and Elite 3D
*
* Copyright 2000 by Jakub Jelinek <jakub@redhat.com>.
*
* 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 Jakub
* Jelinek not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Jakub Jelinek makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* JAKUB JELINEK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL JAKUB JELINEK 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.
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cursor.c,v 1.1 2000/05/18 23:21:36 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ffb.h"
/* This file just performs cursor software state management. The
* actual programming is done by calls into the DAC layer.
*/
static void FFBLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src);
static void FFBShowCursor(ScrnInfoPtr pScrn);
static void FFBHideCursor(ScrnInfoPtr pScrn);
static void FFBSetCursorPosition(ScrnInfoPtr pScrn, int x, int y);
static void FFBSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
static void
FFBLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
unsigned int *data = (unsigned int *)src;
int x, y;
pFfb->CursorData = src;
x = pFfb->CursorShiftX;
y = pFfb->CursorShiftY;
if (x >= 64 || y >= 64)
y = 64;
FFBDacCursorLoadBitmap(pFfb, x, y, data);
}
static void
FFBShowCursor(ScrnInfoPtr pScrn)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
FFBDacCursorEnableDisable(pFfb, 1);
}
static void
FFBHideCursor(ScrnInfoPtr pScrn)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
FFBDacCursorEnableDisable(pFfb, 0);
pFfb->CursorData = NULL;
}
static void
FFBSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
int CursorShiftX = 0, CursorShiftY = 0;
if (x < 0) {
CursorShiftX = -x;
x = 0;
if (CursorShiftX > 64)
CursorShiftX = 64;
}
if (y < 0) {
CursorShiftY = -y;
y = 0;
if (CursorShiftY > 64)
CursorShiftY = 64;
}
if ((CursorShiftX != pFfb->CursorShiftX ||
CursorShiftY != pFfb->CursorShiftY) &&
pFfb->CursorData != NULL) {
pFfb->CursorShiftX = CursorShiftX;
pFfb->CursorShiftY = CursorShiftY;
FFBLoadCursorImage(pScrn, pFfb->CursorData);
}
FFBDacLoadCursorPos(pFfb, x, y);
}
static void
FFBSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
FFBDacLoadCursorColor(pFfb, fg, bg);
}
Bool
FFBHWCursorInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
FFBPtr pFfb;
xf86CursorInfoPtr infoPtr;
pFfb = GET_FFB_FROM_SCRN(pScrn);
pFfb->CursorShiftX = 0;
pFfb->CursorShiftY = 0;
pFfb->CursorData = NULL;
infoPtr = xf86CreateCursorInfoRec();
if(!infoPtr) return FALSE;
pFfb->CursorInfoRec = infoPtr;
infoPtr->MaxWidth = 64;
infoPtr->MaxHeight = 64;
infoPtr->Flags = HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
infoPtr->SetCursorColors = FFBSetCursorColors;
infoPtr->SetCursorPosition = FFBSetCursorPosition;
infoPtr->LoadCursorImage = FFBLoadCursorImage;
infoPtr->HideCursor = FFBHideCursor;
infoPtr->ShowCursor = FFBShowCursor;
infoPtr->UseHWCursor = NULL;
return xf86InitCursor(pScreen, infoPtr);
}

View File

@@ -0,0 +1,615 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - DAC programming.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*
* 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
* DAVID MILLER 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.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c,v 1.3tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ffb.h"
#include "ffb_rcache.h"
#include "ffb_fifo.h"
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86DDC.h"
/*
* Used for stabilize time after playing with power management on the display
*/
#ifndef DPMS_SPIN_COUNT
#define DPMS_SPIN_COUNT 100
#endif /* DPMS_SPIN_COUNT */
/* Cursor programming */
void
FFBDacLoadCursorPos(FFBPtr pFfb, int x, int y)
{
ffb_dacPtr dac = pFfb->dac;
int posval;
posval = ((y & 0xffff) << 16) | (x & 0xffff);
posval &= (FFBDAC_CUR_POS_Y_SIGN |
FFBDAC_CUR_POS_Y |
FFBDAC_CUR_POS_X_SIGN |
FFBDAC_CUR_POS_X);
DACCUR_WRITE(dac, FFBDAC_CUR_POS, posval);
}
void
FFBDacLoadCursorColor(FFBPtr pFfb, int fg, int bg)
{
ffb_dacPtr dac = pFfb->dac;
dac->cur = FFBDAC_CUR_COLOR1;
dac->curdata = bg;
dac->curdata = fg;
}
void
FFBDacCursorEnableDisable(FFBPtr pFfb, int enable)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
int val;
val = 0;
if (!enable)
val = (FFBDAC_CUR_CTRL_P0 | FFBDAC_CUR_CTRL_P1);
/* PAC1 ramdacs with manufacturing revision less than
* '3' invert these control bits, wheee...
*/
if (p->flags & FFB_DAC_ICURCTL)
val ^= (FFBDAC_CUR_CTRL_P0 | FFBDAC_CUR_CTRL_P1);
DACCUR_WRITE(dac, FFBDAC_CUR_CTRL, val);
}
void
FFBDacCursorLoadBitmap(FFBPtr pFfb, int xshift, int yshift, unsigned int *bitmap)
{
ffb_dacPtr dac = pFfb->dac;
int i, j;
dac->cur = FFBDAC_CUR_BITMAP_P0;
for (j = 0; j < 2; j++) {
bitmap += yshift * 2;
if (!xshift) {
for (i = yshift * 2; i < 128; i++)
dac->curdata = *bitmap++;
} else if (xshift < 32) {
for (i = yshift; i < 64; i++, bitmap += 2) {
dac->curdata = (bitmap[0] << xshift) |
(bitmap[1] >> (32 - xshift));
dac->curdata = bitmap[1] << xshift;
}
} else {
for (i = yshift; i < 64; i++, bitmap += 2) {
dac->curdata = bitmap[1] << (xshift - 32);
dac->curdata = 0;
}
}
for (i = 0; i < yshift * 2; i++)
dac->curdata = 0;
}
}
/* Config space programming */
/* XF86 LoadPalette callback. */
void
FFBDacLoadPalette(ScrnInfoPtr pScrn, int ncolors, int *indices, LOCO *colors, VisualPtr pVisual)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
unsigned int *cluts;
int i, index, palette;
if ((pVisual->nplanes != 8 && pVisual->class != DirectColor) ||
(pVisual->nplanes == 8 && pVisual->class == StaticGray))
return;
palette = 0;
if (p->flags & FFB_DAC_PAC2) {
if (pVisual->class == PseudoColor)
palette = 0;
if (pVisual->class == GrayScale)
palette = 1;
if (pVisual->class == DirectColor)
palette = 2;
}
cluts = &p->x_dac_state.clut[256 * palette];
for (i = 0; i < ncolors; i++) {
unsigned int regval;
index = indices[i];
if (pVisual->class == GrayScale) {
regval = cluts[index] =
((colors[index].red << FFBDAC_COLOR_RED_SHFT) |
(colors[index].red << FFBDAC_COLOR_GREEN_SHFT) |
(colors[index].red << FFBDAC_COLOR_BLUE_SHFT));
} else {
regval = cluts[index] =
((colors[index].red << FFBDAC_COLOR_RED_SHFT) |
(colors[index].green << FFBDAC_COLOR_GREEN_SHFT) |
(colors[index].blue << FFBDAC_COLOR_BLUE_SHFT));
}
FFBLOG(("FFBDacLoadPalette: visclass(%d) index(%d) val[%08x]\n",
pVisual->class, index, regval));
/* Now update the hardware copy. */
dac->cfg = FFBDAC_CFG_CLUP(palette) + index;
dac->cfgdata = regval;
}
}
/* WARNING: Very dangerous function, use with extreme care. */
static void
dac_stop(FFBPtr pFfb)
{
ffb_dacPtr dac = pFfb->dac;
unsigned int tgctrl;
tgctrl = DACCFG_READ(dac, FFBDAC_CFG_TGEN);
if (tgctrl & FFBDAC_CFG_TGEN_TGE) {
long limit = 1000000;
/* We try to shut off the timing generation
* precisely at the beginning of a vertical
* retrace. This is really just to make it
* look nice, it's not a functional necessity.
*
* The limit is so that malfunctioning hardware
* does not end up hanging the server.
*/
while (limit--) {
unsigned int vctr = DACCFG_READ(dac, FFBDAC_CFG_TGVC);
if (vctr == 0)
break;
}
DACCFG_WRITE(dac, FFBDAC_CFG_TGEN, 0);
}
}
/* This is made slightly complex because the ordering matters
* between several operations. We have to stop the DAC while
* restoring the timing registers so that some intermediate
* state does not emit wild retrace signals to the monitor.
*
* Another further complication is that we need to mess with
* some portions of the FFB framebuffer config registers to
* do this all properly.
*/
static void
dac_state_restore(FFBPtr pFfb, ffb_dac_hwstate_t *state)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
ffb_fbcPtr ffb = pFfb->regs;
int i, nluts;
/* Step 1: Shut off all pixel timing generation. */
dac_stop(pFfb);
ffb->fbcfg0 = 0;
/* Step 2: Restore timing settings. */
DACCFG_WRITE(dac, FFBDAC_CFG_VBNP, state->vbnp);
DACCFG_WRITE(dac, FFBDAC_CFG_VBAP, state->vbap);
DACCFG_WRITE(dac, FFBDAC_CFG_VSNP, state->vsnp);
DACCFG_WRITE(dac, FFBDAC_CFG_VSAP, state->vsap);
DACCFG_WRITE(dac, FFBDAC_CFG_HSNP, state->hsnp);
DACCFG_WRITE(dac, FFBDAC_CFG_HBNP, state->hbnp);
DACCFG_WRITE(dac, FFBDAC_CFG_HBAP, state->hbap);
DACCFG_WRITE(dac, FFBDAC_CFG_HSYNCNP, state->hsyncnp);
DACCFG_WRITE(dac, FFBDAC_CFG_HSYNCAP, state->hsyncap);
DACCFG_WRITE(dac, FFBDAC_CFG_HSCENNP, state->hscennp);
DACCFG_WRITE(dac, FFBDAC_CFG_HSCENAP, state->hscenap);
DACCFG_WRITE(dac, FFBDAC_CFG_EPNP, state->epnp);
DACCFG_WRITE(dac, FFBDAC_CFG_EINP, state->einp);
DACCFG_WRITE(dac, FFBDAC_CFG_EIAP, state->eiap);
/* Step 3: Restore rest of DAC hw state. */
DACCFG_WRITE(dac, FFBDAC_CFG_PPLLCTRL, state->ppllctrl);
DACCFG_WRITE(dac, FFBDAC_CFG_GPLLCTRL, state->gpllctrl);
DACCFG_WRITE(dac, FFBDAC_CFG_PFCTRL, state->pfctrl);
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL, state->uctrl);
nluts = (p->flags & FFB_DAC_PAC1) ? 256 : (4 * 256);
dac->cfg = FFBDAC_CFG_CLUP_BASE;
for (i = 0; i < nluts; i++)
dac->cfgdata = state->clut[i];
if (p->flags & FFB_DAC_PAC2) {
dac->cfg = FFBDAC_PAC2_AOVWLUT0;
for (i = 0; i < 4; i++)
dac->cfgdata = state->ovluts[i];
}
DACCFG_WRITE(dac, FFBDAC_CFG_WTCTRL, state->wtctrl);
DACCFG_WRITE(dac, FFBDAC_CFG_TMCTRL, state->tmctrl);
DACCFG_WRITE(dac, FFBDAC_CFG_TCOLORKEY, state->tcolorkey);
if (p->flags & FFB_DAC_PAC2)
DACCFG_WRITE(dac, FFBDAC_CFG_WAMASK, state->wamask);
if (p->flags & FFB_DAC_PAC1) {
dac->cfg = FFBDAC_PAC1_APWLUT_BASE;
for (i = 0; i < 32; i++)
dac->cfgdata = state->pwluts[i];
} else {
dac->cfg = FFBDAC_PAC2_APWLUT_BASE;
for (i = 0; i < 64; i++)
dac->cfgdata = state->pwluts[i];
}
DACCFG_WRITE(dac, FFBDAC_CFG_DACCTRL, state->dacctrl);
/* Step 4: Restore FFB framebuffer config state. */
if (pFfb->ffb_type == ffb2_vertical_plus ||
pFfb->ffb_type == ffb2_horizontal_plus ||
pFfb->ffb_type == afb_m3 ||
pFfb->ffb_type == afb_m6)
ffb->passin = p->ffb_passin_ctrl;
ffb->fbcfg0 = p->ffbcfg0;
ffb->fbcfg2 = p->ffbcfg2;
/* Step 5: Restore the timing generator control reg. */
DACCFG_WRITE(dac, FFBDAC_CFG_TGEN, state->tgen);
/* Step 6: Pause for a bit. */
for (i = 0; i < 100; i++)
(void) DACCFG_READ(dac, FFBDAC_CFG_TGVC);
}
static void
dac_state_save(FFBPtr pFfb, ffb_dac_hwstate_t *state)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
int i, nluts;
state->ppllctrl = DACCFG_READ(dac, FFBDAC_CFG_PPLLCTRL);
state->gpllctrl = DACCFG_READ(dac, FFBDAC_CFG_GPLLCTRL);
state->pfctrl = DACCFG_READ(dac, FFBDAC_CFG_PFCTRL);
state->uctrl = DACCFG_READ(dac, FFBDAC_CFG_UCTRL);
nluts = (p->flags & FFB_DAC_PAC1) ? 256 : (4 * 256);
dac->cfg = FFBDAC_CFG_CLUP_BASE;
for (i = 0; i < nluts; i++)
state->clut[i] = dac->cfgdata;
if (p->flags & FFB_DAC_PAC2) {
dac->cfg = FFBDAC_PAC2_AOVWLUT0;
for (i = 0; i < 4; i++)
state->ovluts[i] = dac->cfgdata;
}
state->wtctrl = DACCFG_READ(dac, FFBDAC_CFG_WTCTRL);
state->tmctrl = DACCFG_READ(dac, FFBDAC_CFG_TMCTRL);
state->tcolorkey = DACCFG_READ(dac, FFBDAC_CFG_TCOLORKEY);
if (p->flags & FFB_DAC_PAC2)
state->wamask = DACCFG_READ(dac, FFBDAC_CFG_WAMASK);
if (p->flags & FFB_DAC_PAC1) {
dac->cfg = FFBDAC_PAC1_APWLUT_BASE;
for (i = 0; i < 32; i++)
state->pwluts[i] = dac->cfgdata;
} else {
dac->cfg = FFBDAC_PAC2_APWLUT_BASE;
for (i = 0; i < 64; i++)
state->pwluts[i] = dac->cfgdata;
}
state->dacctrl = DACCFG_READ(dac, FFBDAC_CFG_DACCTRL);
state->tgen = DACCFG_READ(dac, FFBDAC_CFG_TGEN);
state->vbnp = DACCFG_READ(dac, FFBDAC_CFG_VBNP);
state->vbap = DACCFG_READ(dac, FFBDAC_CFG_VBAP);
state->vsnp = DACCFG_READ(dac, FFBDAC_CFG_VSNP);
state->vsap = DACCFG_READ(dac, FFBDAC_CFG_VSAP);
state->hsnp = DACCFG_READ(dac, FFBDAC_CFG_HSNP);
state->hbnp = DACCFG_READ(dac, FFBDAC_CFG_HBNP);
state->hbap = DACCFG_READ(dac, FFBDAC_CFG_HBAP);
state->hsyncnp = DACCFG_READ(dac, FFBDAC_CFG_HSYNCNP);
state->hsyncap = DACCFG_READ(dac, FFBDAC_CFG_HSYNCAP);
state->hscennp = DACCFG_READ(dac, FFBDAC_CFG_HSCENNP);
state->hscenap = DACCFG_READ(dac, FFBDAC_CFG_HSCENAP);
state->epnp = DACCFG_READ(dac, FFBDAC_CFG_EPNP);
state->einp = DACCFG_READ(dac, FFBDAC_CFG_EINP);
state->eiap = DACCFG_READ(dac, FFBDAC_CFG_EIAP);
}
static void
init_dac_flags(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
unsigned int did, manuf_rev, partnum;
char *device;
/* Fetch kernel WID. */
p->kernel_wid = *((volatile unsigned char *)pFfb->dfb8x);
/* For AFB, assume it is PAC2 which also implies not having
* the inverted cursor control attribute.
*/
if (pFfb->ffb_type == afb_m3 || pFfb->ffb_type == afb_m6) {
p->flags = FFB_DAC_PAC2;
manuf_rev = 4;
} else {
p->flags = 0;
did = DACCFG_READ(dac, FFBDAC_CFG_DID);
manuf_rev = DACCFG_READ(dac, FFBDAC_CFG_UCTRL);
manuf_rev = (manuf_rev & FFBDAC_UCTRL_MANREV) >> 8;
partnum = ((did & FFBDAC_CFG_DID_PNUM) >> 12);
if (partnum == 0x236e)
p->flags |= FFB_DAC_PAC2;
else
p->flags |= FFB_DAC_PAC1;
}
device = pFfb->psdp->device;
if ((p->flags & FFB_DAC_PAC1) != 0) {
if (manuf_rev < 3) {
p->flags |= FFB_DAC_ICURCTL;
xf86Msg(X_INFO, "%s: BT9068 (PAC1) ramdac detected (with "
"inverted cursor control)\n", device);
} else {
xf86Msg(X_INFO, "%s: BT9068 (PAC1) ramdac detected (with "
"normal cursor control)\n", device);
}
} else {
xf86Msg(X_INFO, "%s: BT498 (PAC2) ramdac detected\n", device);
}
}
/* The registers of the chip must be mapped, and the FFB/AFB
* board type must be probed before this is invoked.
*/
Bool
FFBDacInit(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_fbcPtr ffb = pFfb->regs;
init_dac_flags(pFfb);
p->ffbcfg0 = ffb->fbcfg0;
p->ffbcfg2 = ffb->fbcfg2;
if (pFfb->ffb_type == ffb2_vertical_plus ||
pFfb->ffb_type == ffb2_horizontal_plus ||
pFfb->ffb_type == afb_m3 ||
pFfb->ffb_type == afb_m6)
p->ffb_passin_ctrl = ffb->passin;
/* Save the kernel DAC state. We also save to the
* X server state here as well even though we have
* not modified anything yet.
*/
dac_state_save(pFfb, &p->kern_dac_state);
dac_state_save(pFfb, &p->x_dac_state);
/* Fire up the WID layer. */
FFBWidPoolInit(pFfb);
return TRUE;
}
/* We need to reset the A buffer X planes to the value 0xff
* when giving the hardware back to the kernel too, thus...
* Also need to do this for the B buffer X planes when double
* buffering is available.
*/
static void
restore_kernel_xchannel(FFBPtr pFfb)
{
ffb_fbcPtr ffb = pFfb->regs;
unsigned int fbc, ppc, ppc_mask, drawop, wid;
wid = pFfb->dac_info.kernel_wid;
if (pFfb->has_double_buffer)
fbc = FFB_FBC_WB_AB;
else
fbc = FFB_FBC_WB_A;
fbc |= (FFB_FBC_WM_COMBINED | FFB_FBC_RB_A | FFB_FBC_SB_BOTH |
FFB_FBC_ZE_OFF | FFB_FBC_YE_OFF |
FFB_FBC_XE_ON | FFB_FBC_RGBE_MASK);
ppc = (FFB_PPC_APE_DISABLE | FFB_PPC_CS_CONST | FFB_PPC_XS_WID);
ppc_mask = (FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK);
drawop = FFB_DRAWOP_RECTANGLE;
FFB_ATTR_RAW(pFfb, ppc, ppc_mask, ~0,
(FFB_ROP_EDIT_BIT | GXcopy)|(FFB_ROP_NEW<<8),
drawop, 0x0, fbc, wid);
FFBFifo(pFfb, 4);
FFB_WRITE64(&ffb->by, 0, 0);
FFB_WRITE64_2(&ffb->bh, pFfb->psdp->height, pFfb->psdp->width);
pFfb->rp_active = 1;
FFBWait(pFfb, ffb);
}
void
FFBDacFini(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
/* Just restore the kernel ramdac/x-channel state. */
dac_state_restore(pFfb, &p->kern_dac_state);
restore_kernel_xchannel(pFfb);
}
/* Restore X server DAC state. */
void
FFBDacEnterVT(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
/* Save kernel DAC state. */
dac_state_save(pFfb, &p->kern_dac_state);
/* Restore X DAC state. */
dac_state_restore(pFfb, &p->x_dac_state);
}
/* Restore kernel DAC state. */
void
FFBDacLeaveVT(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
/* Save X DAC state. */
dac_state_save(pFfb, &p->x_dac_state);
/* Restore kernel DAC and x-channel state. */
dac_state_restore(pFfb, &p->kern_dac_state);
restore_kernel_xchannel(pFfb);
}
/* DPMS stuff, courtesy of a hint from David S. Miller.
* 05.xii.01, FEM
*/
/*
* I don't know why, if at all, this is needed, but JJ or DSM do it
* on restore. I observe that when just blanking/unblanking, everything
* works fine without it, but that sometimes DPMS -> Standby actually
* results in Off. Maybe related?
*/
static void
SPIN(ffb_dacPtr d, int count) {
while(count-- > 0) {
(void) DACCFG_READ(d, FFBDAC_CFG_TGVC);
}
return;
}
/* Screen save (blank) restore */
Bool
FFBDacSaveScreen(FFBPtr pFfb, int mode) {
int tmp;
ffb_dacPtr dac;
if(!pFfb) return FALSE; /* Is there any way at all this could happen? */
else dac = pFfb -> dac;
tmp = DACCFG_READ(dac, FFBDAC_CFG_TGEN); /* Get the timing information */
switch(mode) {
case SCREEN_SAVER_ON:
case SCREEN_SAVER_CYCLE:
tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */
break;
case SCREEN_SAVER_OFF:
case SCREEN_SAVER_FORCER:
tmp |= FFBDAC_CFG_TGEN_VIDE; /* Turn the video on */
break;
default:
return FALSE; /* Don't know what to do; gently fail. */
}
DACCFG_WRITE(dac, FFBDAC_CFG_TGEN, tmp); /* Restore timing register, video set as asked */
SPIN(dac, DPMS_SPIN_COUNT/10);
return TRUE;
}
/* DPMS Control, also hinted at by David Miller.
The rule seems to be:
StandBy = -HSYNC +VSYNC -VIDEO
Suspend = +HSYNC -VSYNC -VIDEO
Off = -HSYNC -VSYNC -VIDEO
On = +HSYNC +VSINC +VIDEO
If you don't force video off, someone periodically tries to turn the
monitor on for some reason. I don't know who or why, so I kill the video
when trying to go into some sort of energy saving mode. (In real life,
'xset s blank s xx' could well have taken care of this.)
Also, on MY monitor, StandBy as above defined (-H+V-Vid) in fact
gives the same as Off, which I don't want. Hence, I just do (-Vid)
05.xii.01, FEM
08.xii.01, FEM
*/
void
FFBDacDPMSMode(FFBPtr pFfb, int DPMSMode, int flags) {
int tmp;
ffb_dacPtr dac = pFfb -> dac;
tmp = DACCFG_READ(dac, FFBDAC_CFG_TGEN); /* Get timing control */
switch(DPMSMode) {
case DPMSModeOn:
tmp &= ~(FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_HSD); /* Turn off VSYNC, HSYNC
disable bits */
tmp |= FFBDAC_CFG_TGEN_VIDE; /* Turn the video on */
break;
case DPMSModeStandby:
#ifdef DPMS_TRUE_STANDBY
tmp |= FFBDAC_CFG_TGEN_HSD; /* HSYNC = OFF */
#endif /* DPMS_TRUE_STANDBY */
tmp &= ~FFBDAC_CFG_TGEN_VSD; /* VSYNC = ON */
tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */
break;
case DPMSModeSuspend:
tmp |= FFBDAC_CFG_TGEN_VSD; /* VSYNC = OFF */
tmp &= ~FFBDAC_CFG_TGEN_HSD; /* HSYNC = ON */
tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */
break;
case DPMSModeOff:
tmp |= (FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_HSD); /* Kill HSYNC, VSYNC both */
tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */
break;
default:
return; /* If we get here, we really should log an error */
}
DACCFG_WRITE(dac, FFBDAC_CFG_TGEN,tmp); /* Restore timing register, video set as asked */
SPIN(dac, DPMS_SPIN_COUNT); /* Is this necessary? Why? */
}

View File

@@ -0,0 +1,365 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - DAC register layout.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*
* 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
* DAVID MILLER 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.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.h,v 1.1 2000/05/23 04:47:44 dawes Exp $ */
#ifndef _FFB_DAC_H
#define _FFB_DAC_H
/* FFB utilizes two different ramdac chips:
*
* 1) BT9068 "Pacifica1", used in all FFB1 and
* FFB2 boards.
*
* 2) BT498(a) "Pacifica2", used in FFB2+ and
* AFB boards.
*
* They are mostly equivalent, except in a few key areas:
*
* 1) WID register layout
* 2) Number of CLUT tables
* 3) Presence of Window Address Mask register
* 4) Method of GAMMA correction support
*/
/* NOTE: All addresses described in this file are DAC
* indirect addresses.
*/
/* DAC color values are in the following format. */
#define FFBDAC_COLOR_BLUE 0x00ff0000
#define FFBDAC_COLOR_BLUE_SHFT 16
#define FFBDAC_COLOR_GREEN 0x0000ff00
#define FFBDAC_COLOR_GREEN_SHFT 8
#define FFBDAC_COLOR_RED 0x000000ff
#define FFBDAC_COLOR_RED_SHFT 0
/* Cursor DAC register addresses. */
#define FFBDAC_CUR_BITMAP_P0 0x000 /* Plane 0 cursor bitmap */
#define FFBDAC_CUR_BITMAP_P1 0x080 /* Plane 1 cursor bitmap */
#define FFBDAC_CUR_CTRL 0x100 /* Cursor control */
#define FFBDAC_CUR_COLOR0 0x101 /* Cursor Color 0 */
#define FFBDAC_CUR_COLOR1 0x102 /* Cursor Color 1 (bg) */
#define FFBDAC_CUR_COLOR2 0x103 /* Cursor Color 2 (fg) */
#define FFBDAC_CUR_POS 0x104 /* Active cursor position */
/* Cursor control register.
* WARNING: Be careful, reverse logic on these bits.
*/
#define FFBDAC_CUR_CTRL_P0 0x00000001 /* Plane0 display disable */
#define FFBDAC_CUR_CTRL_P1 0x00000002 /* Plane1 display disable */
/* Active cursor position register */
#define FFBDAC_CUR_POS_Y_SIGN 0x80000000 /* Sign of Y position */
#define FFBDAC_CUR_POS_Y 0x0fff0000 /* Y position */
#define FFBDAC_CUR_POS_X_SIGN 0x00008000 /* Sign of X position */
#define FFBDAC_CUR_POS_X 0x00000fff /* X position */
/* Configuration and Palette DAC register addresses. */
#define FFBDAC_CFG_PPLLCTRL 0x0000 /* Pixel PLL Control */
#define FFBDAC_CFG_GPLLCTRL 0x0001 /* General Purpose PLL Control */
#define FFBDAC_CFG_PFCTRL 0x1000 /* Pixel Format Control */
#define FFBDAC_CFG_UCTRL 0x1001 /* User Control */
#define FFBDAC_CFG_CLUP_BASE 0x2000 /* Color Lookup Palette */
#define FFBDAC_CFG_CLUP(entry) (FFBDAC_CFG_CLUP_BASE + ((entry) * 0x100))
#define FFBDAC_PAC2_SOVWLUT0 0x3100 /* Shadow Overlay Window Lookup 0*/
#define FFBDAC_PAC2_SOVWLUT1 0x3101 /* Shadow Overlay Window Lookup 1*/
#define FFBDAC_PAC2_SOVWLUT2 0x3102 /* Shadow Overlay Window Lookup 2*/
#define FFBDAC_PAC2_SOVWLUT3 0x3103 /* Shadow Overlay Window Lookup 3*/
#define FFBDAC_PAC2_AOVWLUT0 0x3210 /* Active Overlay Window Lookup 0*/
#define FFBDAC_PAC2_AOVWLUT1 0x3211 /* Active Overlay Window Lookup 1*/
#define FFBDAC_PAC2_AOVWLUT2 0x3212 /* Active Overlay Window Lookup 2*/
#define FFBDAC_PAC2_AOVWLUT3 0x3213 /* Active Overlay Window Lookup 3*/
#define FFBDAC_CFG_WTCTRL 0x3150 /* Window Transfer Control */
#define FFBDAC_CFG_TMCTRL 0x3151 /* Transparent Mask Control */
#define FFBDAC_CFG_TCOLORKEY 0x3152 /* Transparent Color Key */
#define FFBDAC_CFG_WAMASK 0x3153 /* Window Address Mask (PAC2 only) */
#define FFBDAC_PAC1_SPWLUT_BASE 0x3100 /* Shadow Primary Window Lookups */
#define FFBDAC_PAC1_SPWLUT(entry) (FFBDAC_PAC1_SPWLUT_BASE + (entry))
#define FFBDAC_PAC1_APWLUT_BASE 0x3120 /* Active Primary Window Lookups */
#define FFBDAC_PAC1_APWLUT(entry) (FFBDAC_PAC1_APWLUT_BASE + (entry))
#define FFBDAC_PAC2_SPWLUT_BASE 0x3200 /* Shadow Primary Window Lookups */
#define FFBDAC_PAC2_SPWLUT(entry) (FFBDAC_PAC2_SPWLUT_BASE + (entry))
#define FFBDAC_PAC2_APWLUT_BASE 0x3240 /* Active Primary Window Lookups */
#define FFBDAC_PAC2_APWLUT(entry) (FFBDAC_PAC2_APWLUT_BASE + (entry))
#define FFBDAC_CFG_SANAL 0x5000 /* Signature Analysis Control */
#define FFBDAC_CFG_DACCTRL 0x5001 /* DAC Control */
#define FFBDAC_CFG_TGEN 0x6000 /* Timing Generator Control */
#define FFBDAC_CFG_VBNP 0x6001 /* Vertical Blank Negation Point */
#define FFBDAC_CFG_VBAP 0x6002 /* Vertical Blank Assertion Point*/
#define FFBDAC_CFG_VSNP 0x6003 /* Vertical Sync Negation Point */
#define FFBDAC_CFG_VSAP 0x6004 /* Vertical Sync Assertion Point */
#define FFBDAC_CFG_HSNP 0x6005 /* Horz Serration Negation Point */
#define FFBDAC_CFG_HBNP 0x6006 /* Horz Blank Negation Point */
#define FFBDAC_CFG_HBAP 0x6007 /* Horz Blank Assertion Point */
#define FFBDAC_CFG_HSYNCNP 0x6008 /* Horz Sync Negation Point */
#define FFBDAC_CFG_HSYNCAP 0x6009 /* Horz Sync Assertion Point */
#define FFBDAC_CFG_HSCENNP 0x600A /* Horz SCEN Negation Point */
#define FFBDAC_CFG_HSCENAP 0x600B /* Horz SCEN Assertion Point */
#define FFBDAC_CFG_EPNP 0x600C /* Eql'zing Pulse Negation Point */
#define FFBDAC_CFG_EINP 0x600D /* Eql'zing Intvl Negation Point */
#define FFBDAC_CFG_EIAP 0x600E /* Eql'zing Intvl Assertion Point*/
#define FFBDAC_CFG_TGVC 0x600F /* Timing Generator Vert Counter */
#define FFBDAC_CFG_TGHC 0x6010 /* Timing Generator Horz Counter */
#define FFBDAC_CFG_DID 0x8000 /* Device Identification */
#define FFBDAC_CFG_MPDATA 0x8001 /* Monitor Port Data */
#define FFBDAC_CFG_MPSENSE 0x8002 /* Monitor Port Sense */
/* Pixel PLL Control Register */
#define FFBDAC_CFG_PPLLCTRL_M 0x0000007f /* PLL VCO Multiplicand */
#define FFBDAC_CFG_PPLLCTRL_D 0x00000780 /* PLL VCO Divisor */
#define FFBDAC_CFG_PPLLCTRL_PFD 0x00001800 /* Post VCO Frequency Divider */
#define FFBDAC_CFG_PPLLCTRL_EN 0x00004000 /* Enable PLL as pixel clock src */
/* General Purpose PLL Control Register */
#define FFBDAC_CFG_GPLLCTRL_M 0x0000007f /* PLL VCO Multiplicand */
#define FFBDAC_CFG_GPLLCTRL_D 0x00000780 /* PLL VCO Divisor */
#define FFBDAC_CFG_GPLLCTRL_PFD 0x00001800 /* Post VCO Frequency Divider */
#define FFBDAC_CFG_GPLLCTRL_EN 0x00004000 /* Enable PLL as Gen. Purpose clk*/
/* Pixel Format Control Register */
#define FFBDAC_CFG_PFCTRL_2_1 0x00000000 /* 2:1 pixel interleave format */
#define FFBDAC_CFG_PFCTRL_4_1 0x00000001 /* 4:1 pixel interleave format */
#define FFBDAC_CFG_PFCTRL_42_1 0x00000002 /* 4/2:1 pixel interleave format */
#define FFBDAC_CFG_PFCTRL_82_1 0x00000003 /* 8/2:1 pixel interleave format */
/* User Control Register */
#define FFBDAC_UCTRL_IPDISAB 0x00000001 /* Disable input pullup resistors*/
#define FFBDAC_UCTRL_ABLANK 0x00000002 /* Asynchronous Blank */
#define FFBDAC_UCTRL_DBENAB 0x00000004 /* Double-Buffer Enable */
#define FFBDAC_UCTRL_OVENAB 0x00000008 /* Overlay Enable */
#define FFBDAC_UCTRL_WMODE 0x00000030 /* Window Mode */
#define FFBDAC_UCTRL_WM_COMB 0x00000000 /* Window Mode = Combined */
#define FFBDAC_UCTRL_WM_S4 0x00000010 /* Window Mode = Seperate_4 */
#define FFBDAC_UCTRL_WM_S8 0x00000020 /* Window Mode = Seperate_8 */
#define FFBDAC_UCTRL_WM_RESV 0x00000030 /* Window Mode = reserved */
#define FFBDAC_UCTRL_MANREV 0x00000f00 /* 4-bit Manufacturing Revision */
/* Overlay Window Lookup Registers (PAC2 only) */
#define FFBDAC_CFG_OVWLUT_PSEL 0x0000000f /* Palette Section, Seperate_4 */
#define FFBDAC_CFG_OVWLUT_PTBL 0x00000030 /* Palette Table */
#define FFBDAC_CFG_OVWLUT_LKUP 0x00000100 /* 1 = Use palette, 0 = Bypass */
#define FFBDAC_CFG_OVWLUT_OTYP 0x00000c00 /* Overlay Type */
#define FFBDAC_CFG_OVWLUT_O_N 0x00000000 /* Overlay Type - None */
#define FFBDAC_CFG_OVWLUT_O_T 0x00000400 /* Overlay Type - Transparent */
#define FFBDAC_CFG_OVWLUT_O_O 0x00000800 /* Overlay Type - Opaque */
#define FFBDAC_CFG_OVWLUT_O_R 0x00000c00 /* Overlay Type - Reserved */
#define FFBDAC_CFG_OVWLUT_PCS 0x00003000 /* Psuedocolor Src */
#define FFBDAC_CFG_OVWLUT_P_XO 0x00000000 /* Psuedocolor Src - XO[7:0] */
#define FFBDAC_CFG_OVWLUT_P_R 0x00001000 /* Psuedocolor Src - R[7:0] */
#define FFBDAC_CFG_OVWLUT_P_G 0x00002000 /* Psuedocolor Src - G[7:0] */
#define FFBDAC_CFG_OVWLUT_P_B 0x00003000 /* Psuedocolor Src - B[7:0] */
/* Window Transfer Control Register */
#define FFBDAC_CFG_WTCTRL_DS 0x00000001 /* Device Status, 1 = Busy */
#define FFBDAC_CFG_WTCTRL_TCMD 0x00000002 /* Transfer Command
* 1 = Transfer, 0 = No Action
*/
#define FFBDAC_CFG_WTCTRL_TE 0x00000004 /* Transfer Event
* 1 = Next Frame, 0 = Next Field
*/
#define FFBDAC_CFG_WTCTRL_DRD 0x00000008 /* Drawing Data
* 1 = Local Drawing Active
* 0 = Local Drawing Idle
*/
#define FFBDAC_CFG_WTCTRL_DRS 0x00000010 /* Drawing Status
* 1 = Network Drawing Active
* 0 = Network Drawing Idle
*/
/* Transparent Mask Control Register */
#define FFBDAC_CFG_TMCTRL_OMSK 0x000000ff /* Overlay Mask */
/* Transparent Color Key Register */
#define FFBDAC_CFG_TCOLORKEY_K 0x000000ff /* Overlay Color Key */
/* Window Address Mask Register (PAC2 only) */
#define FFBDAC_CFG_WAMASK_PMSK 0x0000003f /* PWLUT select PMASK */
#define FFBDAC_CFG_WAMASK_OMSK 0x00000300 /* OWLUT control OMASK */
/* (non-Overlay) Window Lookup Table Registers, PAC1 format */
#define FFBDAC_PAC1_WLUT_DB 0x00000020 /* 0 = Buffer A, 1 = Buffer B */
#define FFBDAC_PAC1_WLUT_C 0x0000001c /* C: Color Model Selection */
#define FFBDAC_PAC1_WLUT_C_8P 0x00000000 /* C: 8bpp Pseudocolor */
#define FFBDAC_PAC1_WLUT_C_8LG 0x00000004 /* C: 8bpp Linear Grey */
#define FFBDAC_PAC1_WLUT_C_8NG 0x00000008 /* C: 8bpp Non-Linear Grey */
#define FFBDAC_PAC1_WLUT_C_24D 0x00000010 /* C: 24bpp Directcolor */
#define FFBDAC_PAC1_WLUT_C_24LT 0x00000014 /* C: 24bpp Linear Truecolor */
#define FFBDAC_PAC1_WLUT_C_24NT 0x00000018 /* C: 24bpp Non-Linear Truecolor */
#define FFBDAC_PAC1_WLUT_PCS 0x00000003 /* Pseudocolor Src */
#define FFBDAC_PAC1_WLUT_P_XO 0x00000000 /* Pseudocolor Src - XO[7:0] */
#define FFBDAC_PAC1_WLUT_P_R 0x00000001 /* Pseudocolor Src - R[7:0] */
#define FFBDAC_PAC1_WLUT_P_G 0x00000002 /* Pseudocolor Src - G[7:0] */
#define FFBDAC_PAC1_WLUT_P_B 0x00000003 /* Pseudocolor Src - B[7:0] */
/* (non-Overlay) Window Lookup Table Registers, PAC2 format */
#define FFBDAC_PAC2_WLUT_PTBL 0x00000030 /* Palette Table Entry */
#define FFBDAC_PAC2_WLUT_LKUP 0x00000100 /* 1 = Use palette, 0 = Bypass */
#define FFBDAC_PAC2_WLUT_PCS 0x00003000 /* Pseudocolor Src */
#define FFBDAC_PAC2_WLUT_P_XO 0x00000000 /* Pseudocolor Src - XO[7:0] */
#define FFBDAC_PAC2_WLUT_P_R 0x00001000 /* Pseudocolor Src - R[7:0] */
#define FFBDAC_PAC2_WLUT_P_G 0x00002000 /* Pseudocolor Src - G[7:0] */
#define FFBDAC_PAC2_WLUT_P_B 0x00003000 /* Pseudocolor Src - B[7:0] */
#define FFBDAC_PAC2_WLUT_DEPTH 0x00004000 /* 0 = Pseudocolor, 1 = Truecolor*/
#define FFBDAC_PAC2_WLUT_DB 0x00008000 /* 0 = Buffer A, 1 = Buffer B */
/* Signature Analysis Control Register */
#define FFBDAC_CFG_SANAL_SRR 0x000000ff /* DAC Seed/Result for Red */
#define FFBDAC_CFG_SANAL_SRG 0x0000ff00 /* DAC Seed/Result for Green */
#define FFBDAC_CFG_SANAL_SRB 0x00ff0000 /* DAC Seed/Result for Blue */
#define FFBDAC_CFG_SANAL_RQST 0x01000000 /* Signature Capture Request */
#define FFBDAC_CFG_SANAL_BSY 0x02000000 /* Signature Analysis Busy */
#define FFBDAC_CFG_SANAL_DSM 0x04000000 /* Data Strobe Mode
* 0 = Signature Analysis Mode
* 1 = Data Strobe Mode
*/
/* DAC Control Register */
#define FFBDAC_CFG_DACCTRL_O2 0x00000003 /* Operand 2 Select
* 00 = Normal Operation
* 01 = Select 145mv Reference
* 10 = Select Blue DAC Output
* 11 = Reserved
*/
#define FFBDAC_CFG_DACCTRL_O1 0x0000000c /* Operand 1 Select
* 00 = Normal Operation
* 01 = Select Green DAC Output
* 10 = Select Red DAC Output
* 11 = Reserved
*/
#define FFBDAC_CFG_DACCTRL_CR 0x00000010 /* Comparator Result
* 0 = operand1 < operand2
* 1 = operand1 > operand2
*/
#define FFBDAC_CFG_DACCTRL_SGE 0x00000020 /* Sync-on-Green Enable */
#define FFBDAC_CFG_DACCTRL_PE 0x00000040 /* Pedestal Enable */
#define FFBDAC_CFG_DACCTRL_VPD 0x00000080 /* VSYNC* Pin Disable */
#define FFBDAC_CFG_DACCTRL_SPB 0x00000100 /* Sync Polarity Bit
* 0 = VSYNC* and CSYNC* active low
* 1 = VSYNC* and CSYNC* active high
*/
/* Timing Generator Control Register */
#define FFBDAC_CFG_TGEN_VIDE 0x00000001 /* Video Enable */
#define FFBDAC_CFG_TGEN_TGE 0x00000002 /* Timing Generator Enable */
#define FFBDAC_CFG_TGEN_HSD 0x00000004 /* HSYNC* Disabled */
#define FFBDAC_CFG_TGEN_VSD 0x00000008 /* VSYNC* Disabled */
#define FFBDAC_CFG_TGEN_EQD 0x00000010 /* Equalization Disabled */
#define FFBDAC_CFG_TGEN_MM 0x00000020 /* 0 = Slave, 1 = Master */
#define FFBDAC_CFG_TGEN_IM 0x00000040 /* 1 = Interlaced Mode */
/* Device Identification Register, should be 0xA236E1AD for FFB bt497/bt498 */
#define FFBDAC_CFG_DID_ONE 0x00000001 /* Always set */
#define FFBDAC_CFG_DID_MANUF 0x00000ffe /* Manufacturer ID */
#define FFBDAC_CFG_DID_PNUM 0x0ffff000 /* Device Part Number */
#define FFBDAC_CFG_DID_REV 0xf0000000 /* Device Revision */
/* Monitor Port Data Register */
#define FFBDAC_CFG_MPDATA_SCL 0x00000001 /* SCL Data */
#define FFBDAC_CFG_MPDATA_SDA 0x00000002 /* SDA Data */
/* Monitor Port Sense Register */
#define FFBDAC_CFG_MPSENSE_SCL 0x00000001 /* SCL Sense */
#define FFBDAC_CFG_MPSENSE_SDA 0x00000002 /* SDA Sense */
/* DAC register access shorthands. */
#define DACCUR_READ(DAC, ADDR) ((DAC)->cur = (ADDR), (DAC)->curdata)
#define DACCUR_WRITE(DAC, ADDR, VAL) ((DAC)->cur = (ADDR), (DAC)->curdata = (VAL))
#define DACCFG_READ(DAC, ADDR) ((DAC)->cfg = (ADDR), (DAC)->cfgdata)
#define DACCFG_WRITE(DAC, ADDR, VAL) ((DAC)->cfg = (ADDR), (DAC)->cfgdata = (VAL))
typedef struct ffb_dac_hwstate {
unsigned int ppllctrl;
unsigned int gpllctrl;
unsigned int pfctrl;
unsigned int uctrl;
unsigned int clut[256 * 4]; /* One 256 entry clut on PAC1, 4 on PAC2 */
unsigned int ovluts[4]; /* Overlay WLUTS, PAC2 only */
unsigned int wtctrl;
unsigned int tmctrl;
unsigned int tcolorkey;
unsigned int wamask;
unsigned int pwluts[64];
unsigned int dacctrl;
unsigned int tgen;
unsigned int vbnp;
unsigned int vbap;
unsigned int vsnp;
unsigned int vsap;
unsigned int hsnp;
unsigned int hbnp;
unsigned int hbap;
unsigned int hsyncnp;
unsigned int hsyncap;
unsigned int hscennp;
unsigned int hscenap;
unsigned int epnp;
unsigned int einp;
unsigned int eiap;
} ffb_dac_hwstate_t;
typedef struct {
Bool InUse;
/* The following fields are undefined unless InUse is TRUE. */
int refcount;
Bool canshare;
unsigned int wlut_regval;
int buffer; /* 0 = Buffer A, 1 = Buffer B */
int depth; /* 8 or 32 bpp */
int greyscale; /* 1 = greyscale, 0 = color */
int linear; /* 1 = linear, 0 = non-linear */
int direct; /* 1 = 24bpp directcolor */
int channel; /* 0 = X, 1 = R, 2 = G, 3 = B */
int palette; /* Only PAC2 has multiple CLUTs */
} ffb_wid_info_t;
#define FFB_MAX_PWIDS 64
typedef struct {
int num_wids;
int wid_shift; /* To get X channel value */
ffb_wid_info_t wid_pool[FFB_MAX_PWIDS];
} ffb_wid_pool_t;
typedef struct ffb_dac_info {
unsigned int flags;
#define FFB_DAC_PAC1 0x00000001 /* Pacifica1 DAC, BT9068 */
#define FFB_DAC_PAC2 0x00000002 /* Pacifica2 DAC, BT498 */
#define FFB_DAC_ICURCTL 0x00000004 /* Inverted CUR_CTRL bits */
unsigned int kernel_wid;
/* These registers need to be modified when changing DAC
* timing state, so at init time we capture their values.
*/
unsigned int ffbcfg0;
unsigned int ffbcfg2;
unsigned int ffb_passin_ctrl; /* FFB2+/AFB only */
ffb_dac_hwstate_t kern_dac_state;
ffb_dac_hwstate_t x_dac_state;
ffb_wid_pool_t wid_table;
} ffb_dac_info_t;
#endif /* _FFB_DAC_H */

View File

@@ -0,0 +1,198 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - DDC support.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*
* 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
* DAVID MILLER 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.
*
*/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ffb.h"
#include "ffb_dac.h"
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86DDC.h"
/* XXX This needs a lot more work. Only an attempt at the PAC2 version
* XXX is below, and that is untested. The BT498 manual is unclear about
* XXX several details and I must figure them out by trial and error.
*/
/* Wait for the next VSYNC. */
static void
WaitForVSYNC(ffb_dacPtr dac)
{
unsigned int vsap = DACCFG_READ(dac, FFBDAC_CFG_VSAP);
unsigned int vcnt;
vcnt = DACCFG_READ(dac, FFBDAC_CFG_TGVC);
while (vcnt > vsap)
vcnt = DACCFG_READ(dac, FFBDAC_CFG_TGVC);
while (vcnt <= vsap)
vcnt = DACCFG_READ(dac, FFBDAC_CFG_TGVC);
}
/* The manual seems to imply this is needed, but it's really clumsy
* so we can test if it really is a requirement with this.
*/
#define MDATA_NEEDS_BLANK
/* DDC1/DDC2 support */
static unsigned int
FFBDacDdc1Read(ScrnInfoPtr pScrn)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
ffb_dacPtr dac = pFfb->dac;
unsigned int val;
#ifdef MDATA_NEEDS_BLANK
unsigned int uctrl;
#endif
#ifdef MDATA_NEEDS_BLANK
/* Force a blank of the screen. */
uctrl = DACCFG_READ(dac, FFBDAC_CFG_UCTRL);
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL,
(uctrl | FFBDAC_UCTRL_ABLANK));
#endif
/* Tristate SCL pin. */
DACCFG_WRITE(dac, FFBDAC_CFG_MPDATA,
FFBDAC_CFG_MPDATA_SCL);
/* Pause until VSYNC is hit. */
WaitForVSYNC(dac);
/* Read the sense line to see what the monitor is driving
* it at.
*/
val = DACCFG_READ(dac, FFBDAC_CFG_MPSENSE);
val = (val & FFBDAC_CFG_MPSENSE_SCL) ? 1 : 0;
/* Stop tristating the SCL pin. */
DACCFG_WRITE(dac, FFBDAC_CFG_MPDATA, 0);
#ifdef MDATA_NEEDS_BLANK
/* Restore UCTRL to unblank the screen. */
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL, uctrl);
#endif
/* Return the result and we're done. */
return val;
}
static void
FFBI2CGetBits(I2CBusPtr b, int *clock, int *data)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(xf86Screens[b->scrnIndex]);
ffb_dacPtr dac = pFfb->dac;
unsigned int val;
#ifdef MDATA_NEEDS_BLANK
unsigned int uctrl;
#endif
#ifdef MDATA_NEEDS_BLANK
/* Force a blank of the screen. */
uctrl = DACCFG_READ(dac, FFBDAC_CFG_UCTRL);
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL,
(uctrl | FFBDAC_UCTRL_ABLANK));
#endif
/* Tristate SCL+SDA pins. */
DACCFG_WRITE(dac, FFBDAC_CFG_MPDATA,
(FFBDAC_CFG_MPDATA_SCL | FFBDAC_CFG_MPDATA_SDA));
/* Read the sense line to see what the monitor is driving
* them at.
*/
val = DACCFG_READ(dac, FFBDAC_CFG_MPSENSE);
*clock = (val & FFBDAC_CFG_MPSENSE_SCL) ? 1 : 0;
*data = (val & FFBDAC_CFG_MPSENSE_SDA) ? 1 : 0;
/* Stop tristating the SCL pin. */
DACCFG_WRITE(dac, FFBDAC_CFG_MPDATA, 0);
#ifdef MDATA_NEEDS_BLANK
/* Restore UCTRL to unblank the screen. */
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL, uctrl);
#endif
}
static void
FFBI2CPutBits(I2CBusPtr b, int clock, int data)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(xf86Screens[b->scrnIndex]);
ffb_dacPtr dac = pFfb->dac;
unsigned int val;
#ifdef MDATA_NEEDS_BLANK
unsigned int uctrl;
#endif
val = 0;
if (clock)
val |= FFBDAC_CFG_MPDATA_SCL;
if (data)
val |= FFBDAC_CFG_MPDATA_SDA;
#ifdef MDATA_NEEDS_BLANK
/* Force a blank of the screen. */
uctrl = DACCFG_READ(dac, FFBDAC_CFG_UCTRL);
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL,
(uctrl | FFBDAC_UCTRL_ABLANK));
#endif
/* Tristate requested pins. */
DACCFG_WRITE(dac, FFBDAC_CFG_MPDATA, val);
#ifdef MDATA_NEEDS_BLANK
/* Restore UCTRL to unblank the screen. */
DACCFG_WRITE(dac, FFBDAC_CFG_UCTRL, uctrl);
#endif
}
Bool
FFBi2cInit(ScrnInfoPtr pScrn)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
I2CBusPtr I2CPtr;
I2CPtr = xf86CreateI2CBusRec();
if (!I2CPtr)
return FALSE;
pFfb->I2C = I2CPtr;
I2CPtr->BusName = "DDC";
I2CPtr->scrnIndex = pScrn->scrnIndex;
I2CPtr->I2CPutBits = FFBI2CPutBits;
I2CPtr->I2CGetBits = FFBI2CGetBits;
I2CPtr->AcknTimeout = 5;
if (!xf86I2CBusInit(I2CPtr))
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,210 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - DGA support.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*
* 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
* DAVID MILLER 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.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dga.c,v 1.1 2000/05/23 04:47:44 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
#include "dgaproc.h"
#include "ffb.h"
#include "ffb_regs.h"
#include "ffb_rcache.h"
#include "ffb_fifo.h"
#include "ffb_loops.h"
static Bool FFB_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
int *, int *, int *);
static void FFB_CloseFramebuffer(ScrnInfoPtr);
static Bool FFB_SetMode(ScrnInfoPtr, DGAModePtr);
static void FFB_SetViewport(ScrnInfoPtr, int, int, int);
static int FFB_GetViewport(ScrnInfoPtr);
static void FFB_Flush(ScrnInfoPtr);
static void FFB_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void FFB_BlitRect(ScrnInfoPtr, int, int, int, int,
int, int);
static DGAFunctionRec FFB_DGAFuncs = {
FFB_OpenFramebuffer,
FFB_CloseFramebuffer,
FFB_SetMode,
FFB_SetViewport,
FFB_GetViewport,
FFB_Flush,
FFB_FillRect,
FFB_BlitRect,
NULL
};
void FFB_InitDGA(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
FFBPtr pFfb;
DGAModePtr mode;
Bool result;
pFfb = GET_FFB_FROM_SCRN(pScrn);
mode = xnfcalloc(sizeof(DGAModeRec), 1);
if (!mode) {
xf86Msg(X_WARNING, "%s: DGA init failed, cannot alloc DGAMode.\n",
pFfb->psdp->device);
return;
}
mode->num = 0;
mode->mode = pScrn->modes;
/* Hmmm, what does concurrent access really mean? -DaveM */
mode->flags = (DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE | DGA_FILL_RECT);
mode->flags |= DGA_BLIT_RECT;
mode->imageWidth = 2048;
mode->imageHeight = 2048;
mode->pixmapWidth = 2048;
mode->pixmapHeight = 2048;
/* XXX I would imagine that this value states how many bytes
* XXX you add to advance exactly one full horizontal line in
* XXX the framebuffer addressing, but the way we set the pScrn
* XXX mode values do not match that definition.
* XXX
* XXX Ask Jakub what is going on here. -DaveM
*/
#if 1
mode->bytesPerScanline = pScrn->modes->HDisplay * 4;
#else
mode->bytesPerScanline = (2048 * 4);
#endif
mode->byteOrder = pScrn->imageByteOrder;
mode->depth = 32;
mode->bitsPerPixel = 32;
mode->red_mask = 0xff;
mode->green_mask = 0xff00;
mode->blue_mask = 0xff0000;
mode->visualClass = TrueColor;
mode->viewportWidth = pScrn->modes->HDisplay;
mode->viewportHeight = pScrn->modes->VDisplay;
/* Do these values even matter if we do not support
* viewports? -DaveM
*/
mode->xViewportStep = 0;
mode->yViewportStep = 0;
mode->maxViewportX = 0;
mode->maxViewportY = 0;
mode->viewportFlags = 0;
mode->offset = 0;
result = DGAInit(pScreen, &FFB_DGAFuncs, mode, 1);
if (result == FALSE) {
xf86Msg(X_WARNING,
"%s: DGA init failed, DGAInit returns FALSE.\n",
pFfb->psdp->device);
} else {
xf86Msg(X_INFO, "%s: DGA support initialized.\n",
pFfb->psdp->device);
}
}
static Bool FFB_OpenFramebuffer(ScrnInfoPtr pScrn, char **name, unsigned char **mem,
int *size, int *offset, int *extra)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
*name = pFfb->psdp->device;
/* We give the user the dumb frame buffer. */
*mem = (unsigned char *)FFB_DFB24_VOFF;
*size = 0x1000000;
*offset = 0;
*extra = 0;
return TRUE;
}
static void FFB_CloseFramebuffer(ScrnInfoPtr pScrn)
{
}
static Bool FFB_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
{
/* Nothing to do, we currently only support one mode
* and we are always in it.
*/
return TRUE;
}
static void FFB_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
{
/* We don't support viewports, so... */
}
static int FFB_GetViewport(ScrnInfoPtr pScrn)
{
/* No viewports, none pending... */
return 0;
}
static void FFB_Flush(ScrnInfoPtr pScrn)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
ffb_fbcPtr ffb = pFfb->regs;
FFBWait(pFfb, ffb);
}
extern void FFB_SetupForSolidFill(ScrnInfoPtr, int, int, unsigned int);
extern void FFB_SubsequentSolidFillRect(ScrnInfoPtr, int, int, int, int);
static void FFB_FillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
FFB_SetupForSolidFill(pScrn, color, GXcopy, ~0);
FFB_SubsequentSolidFillRect(pScrn, x, y, w, h);
SET_SYNC_FLAG(pFfb->pXAAInfo);
}
extern void FFB_SetupForScreenToScreenCopy(ScrnInfoPtr, int, int, int,
unsigned int, int);
extern void FFB_SubsequentScreenToScreenCopy(ScrnInfoPtr, int, int,
int, int, int, int);
static void FFB_BlitRect(ScrnInfoPtr pScrn, int srcx, int srcy,
int w, int h, int dstx, int dsty)
{
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
int ydir = (srcy < dsty) ? -1 : 1;
FFB_SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, ~0, -1);
FFB_SubsequentScreenToScreenCopy(pScrn, srcx, srcy, dstx,dsty, w, h);
SET_SYNC_FLAG(pFfb->pXAAInfo);
}

View File

@@ -0,0 +1,521 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.8 2001/04/18 14:52:42 dawes Exp $
* Acceleration for the Creator and Creator3D framebuffer - DRI/DRM support.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*
* 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
* DAVID MILLER 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.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Priv.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "miline.h"
#include "GL/glxtokens.h"
#include "xf86drm.h"
#include "sarea.h"
#define _XF86DRI_SERVER_
#include "dri.h"
#include "GL/glxint.h"
#include "ffb.h"
#include "ffb_regs.h"
#include "ffb_fifo.h"
#include "ffb_rcache.h"
static char FFBKernelDriverName[] = "ffb";
static char FFBClientDriverName[] = "ffb";
/* Forward declarations. */
static Bool FFBDRICreateContext(ScreenPtr, VisualPtr, drm_context_t,
void *, DRIContextType);
static void FFBDRIDestroyContext(ScreenPtr, drm_context_t, DRIContextType);
static void FFBDRIInitBuffers(WindowPtr, RegionPtr, CARD32);
static void FFBDRIMoveBuffers(WindowPtr, DDXPointRec, RegionPtr, CARD32);
static void FFBDRISetDrawableIndex(WindowPtr, CARD32);
/* XXX Why isn't this in a header somewhere? XXX */
extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
void **configprivs);
static Bool
FFBDRIInitVisualConfigs(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
__GLXvisualConfig *pConfigs;
FFBConfigPrivPtr pFfbConfigs;
FFBConfigPrivPtr *pFfbConfigPtrs;
pConfigs = (__GLXvisualConfig *)
xcalloc(sizeof(__GLXvisualConfig), 1);
if (!pConfigs)
return FALSE;
pFfbConfigs = (FFBConfigPrivPtr)
xcalloc(sizeof(FFBConfigPrivRec), 1);
if (!pFfbConfigs) {
xfree(pConfigs);
return FALSE;
}
pFfbConfigPtrs = (FFBConfigPrivPtr *)
xcalloc(sizeof(FFBConfigPrivPtr), 1);
if (!pFfbConfigPtrs) {
xfree(pConfigs);
xfree(pFfbConfigs);
return FALSE;
}
pFfbConfigPtrs[0] = &pFfbConfigs[0];
pConfigs->vid = -1;
pConfigs->class = -1;
pConfigs->rgba = TRUE;
pConfigs->redSize = 8;
pConfigs->greenSize = 8;
pConfigs->blueSize = 8;
pConfigs->alphaSize = 0;
pConfigs->redMask = 0x000000ff;
pConfigs->greenMask = 0x0000ff00;
pConfigs->blueMask = 0x00ff0000;
pConfigs->alphaMask = 0;
pConfigs->accumRedSize = 0;
pConfigs->accumGreenSize = 0;
pConfigs->accumBlueSize = 0;
pConfigs->accumAlphaSize = 0;
pConfigs->doubleBuffer = TRUE;
pConfigs->stereo = FALSE;
pConfigs->bufferSize = 32;
pConfigs->depthSize = 16;
pConfigs->stencilSize = 0;
pConfigs->auxBuffers = 0;
pConfigs->level = 0;
pConfigs->visualRating = GLX_NONE;
pConfigs->transparentPixel = GLX_NONE;
pConfigs->transparentRed = 0;
pConfigs->transparentGreen = 0;
pConfigs->transparentBlue = 0;
pConfigs->transparentAlpha = 0;
pConfigs->transparentIndex = 0;
pFfb->numVisualConfigs = 1;
pFfb->pVisualConfigs = pConfigs;
pFfb->pVisualConfigsPriv = pFfbConfigs;
GlxSetVisualConfigs(1, pConfigs, (void **)pFfbConfigPtrs);
return TRUE;
}
static void
init_ffb_sarea(FFBPtr pFfb, ffb_dri_state_t *pFfbSarea)
{
int i;
pFfbSarea->flags = 0;
switch (pFfb->ffb_type) {
case ffb2_prototype:
case ffb2_vertical:
case ffb2_vertical_plus:
case ffb2_horizontal:
case ffb2_horizontal_plus:
pFfbSarea->flags |= FFB_DRI_FFB2;
break;
default:
break;
};
if (pFfb->ffb_type == ffb2_vertical_plus ||
pFfb->ffb_type == ffb2_horizontal_plus)
pFfbSarea->flags |= FFB_DRI_FFB2PLUS;
if (pFfb->dac_info.flags & FFB_DAC_PAC1)
pFfbSarea->flags |= FFB_DRI_PAC1;
if (pFfb->dac_info.flags & FFB_DAC_PAC2)
pFfbSarea->flags |= FFB_DRI_PAC2;
for (i = 0; i < FFB_DRI_NWIDS; i++)
pFfbSarea->wid_table[i] = 0;
}
#define FFB_DFB24_POFF 0x02000000UL
#define FFB_DFB24_SIZE 0x01000000UL
#define FFB_FBC_REGS_POFF 0x00600000UL
#define FFB_FBC_REGS_SIZE 0x00002000UL
#define FFB_DAC_POFF 0x00400000UL
#define FFB_DAC_SIZE 0x00002000UL
#define FFB_SFB8R_POFF 0x04000000UL
#define FFB_SFB8R_SIZE 0x00400000UL
#define FFB_SFB32_POFF 0x05000000UL
#define FFB_SFB32_SIZE 0x01000000UL
#define FFB_SFB64_POFF 0x06000000UL
#define FFB_SFB64_SIZE 0x02000000UL
Bool
FFBDRIScreenInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
DRIInfoPtr pDRIInfo;
FFBDRIPtr pFfbDRI;
/* Check that the GLX, DRI, and DRM modules have been loaded by testing
* for canonical symbols in each module.
*/
if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs"))
return FALSE;
if (!xf86LoaderCheckSymbol("drmAvailable"))
return FALSE;
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
"FFBDRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
/* Check the DRI version */
{
int major, minor, patch;
DRIQueryVersion(&major, &minor, &patch);
if (major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] FFBDRIScreenInit failed because of a version mismatch.\n"
"[dri] libdri version is %d.%d.%d but version %d.%d.x is needed.\n"
"[dri] Disabling DRI.\n",
major, minor, patch,
DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION);
return FALSE;
}
}
pDRIInfo = DRICreateInfoRec();
if (pDRIInfo == NULL)
return FALSE;
pFfb->pDRIInfo = pDRIInfo;
pDRIInfo->drmDriverName = FFBKernelDriverName;
pDRIInfo->clientDriverName = FFBClientDriverName;
pDRIInfo->ddxDriverMajorVersion = 0;
pDRIInfo->ddxDriverMinorVersion = 1;
pDRIInfo->ddxDriverPatchVersion = 1;
pDRIInfo->busIdString = xalloc(64); /* Freed in DRIDestroyInfoRec */
sprintf(pDRIInfo->busIdString, "SBUS:%s", pFfb->psdp->device);
/* Dumb rendering port for now... */
pDRIInfo->frameBufferPhysicalAddress = FFB_DFB24_POFF;
pDRIInfo->frameBufferSize = FFB_DFB24_SIZE;
pDRIInfo->frameBufferStride = (2048 * 4);
/* XXX */
pDRIInfo->ddxDrawableTableEntry = 15;
pDRIInfo->maxDrawableTableEntry = 15;
pDRIInfo->SAREASize = (SAREA_MAX + (0x2000 - 1)) & ~(0x2000 - 1);
pFfbDRI = (FFBDRIPtr) xcalloc(sizeof(FFBDRIRec), 1);
if (pFfbDRI == NULL) {
DRIDestroyInfoRec(pFfb->pDRIInfo);
return FALSE;
}
pDRIInfo->devPrivate = pFfbDRI;
pDRIInfo->devPrivateSize = sizeof(*pFfbDRI);
pDRIInfo->contextSize = 0; /* kernel does ctx swaps */
pDRIInfo->CreateContext = FFBDRICreateContext;
pDRIInfo->DestroyContext = FFBDRIDestroyContext;
pDRIInfo->InitBuffers = FFBDRIInitBuffers;
pDRIInfo->MoveBuffers = FFBDRIMoveBuffers;
pDRIInfo->SetDrawableIndex = FFBDRISetDrawableIndex;
/* Our InitBuffers depends heavily on this setting. */
pDRIInfo->bufferRequests = DRI_3D_WINDOWS_ONLY;
pDRIInfo->createDummyCtx = TRUE;
pDRIInfo->createDummyCtxPriv = FALSE;
if (!DRIScreenInit(pScreen, pDRIInfo, &(pFfb->drmSubFD))) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] DRIScreenInit failed. Disabling DRI.\n");
DRIDestroyInfoRec(pFfb->pDRIInfo);
xfree(pFfbDRI);
return FALSE;
}
#if 000 /* XXX this should be cleaned up and used */
/* Check the ffb DRM version */
version = drmGetVersion(info->drmFD);
if (version) {
if (version->version_major != 1 ||
version->version_minor < 0) {
/* incompatible drm version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] FFBDRIScreenInit failed because of a version mismatch.\n"
"[dri] ffb.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n"
"[dri] Disabling the DRI.\n",
version->version_major,
version->version_minor,
version->version_patchlevel);
drmFreeVersion(version);
R128DRICloseScreen(pScreen);
return FALSE;
}
drmFreeVersion(version);
}
#endif
pFfb->pFfbSarea = DRIGetSAREAPrivate(pScreen);
init_ffb_sarea(pFfb, pFfb->pFfbSarea);
/* Setup device specific direct rendering memory maps. */
if (drmAddMap(pFfb->drmSubFD,
FFB_FBC_REGS_POFF, FFB_FBC_REGS_SIZE,
DRM_REGISTERS, 0, &pFfbDRI->hFbcRegs) < 0) {
DRICloseScreen(pScreen);
return FALSE;
}
pFfbDRI->sFbcRegs = FFB_FBC_REGS_SIZE;
xf86DrvMsg(pScreen->myNum, X_INFO,
"[drm] FBC Register handle = 0x%08x\n",
pFfbDRI->hFbcRegs);
if (drmAddMap(pFfb->drmSubFD,
FFB_DAC_POFF, FFB_DAC_SIZE,
DRM_REGISTERS, 0, &pFfbDRI->hDacRegs) < 0) {
DRICloseScreen(pScreen);
return FALSE;
}
pFfbDRI->sDacRegs = FFB_DAC_SIZE;
xf86DrvMsg(pScreen->myNum, X_INFO,
"[drm] DAC Register handle = 0x%08x\n",
pFfbDRI->hDacRegs);
/* Now add maps for the "Smart" views of the framebuffer. */
if (drmAddMap(pFfb->drmSubFD,
FFB_SFB8R_POFF, FFB_SFB8R_SIZE,
DRM_REGISTERS, 0, &pFfbDRI->hSfb8r) < 0) {
DRICloseScreen(pScreen);
return FALSE;
}
pFfbDRI->sSfb8r = FFB_SFB8R_SIZE;
xf86DrvMsg(pScreen->myNum, X_INFO,
"[drm] SFB8R handle = 0x%08x\n",
pFfbDRI->hSfb8r);
if (drmAddMap(pFfb->drmSubFD,
FFB_SFB32_POFF, FFB_SFB32_SIZE,
DRM_REGISTERS, 0, &pFfbDRI->hSfb32) < 0) {
DRICloseScreen(pScreen);
return FALSE;
}
pFfbDRI->sSfb32 = FFB_SFB32_SIZE;
xf86DrvMsg(pScreen->myNum, X_INFO,
"[drm] SFB32 handle = 0x%08x\n",
pFfbDRI->hSfb32);
if (drmAddMap(pFfb->drmSubFD,
FFB_SFB64_POFF, FFB_SFB64_SIZE,
DRM_REGISTERS, 0, &pFfbDRI->hSfb64) < 0) {
DRICloseScreen(pScreen);
return FALSE;
}
pFfbDRI->sSfb64 = FFB_SFB64_SIZE;
xf86DrvMsg(pScreen->myNum, X_INFO,
"[drm] SFB64 handle = 0x%08x\n",
pFfbDRI->hSfb64);
/* Setup visual configurations. */
if (!FFBDRIInitVisualConfigs(pScreen)) {
DRICloseScreen(pScreen);
return FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"[drm] Visual configs initialized\n");
return TRUE;
}
void
FFBDRICloseScreen(ScreenPtr pScreen)
{
FFBPtr pFfb = GET_FFB_FROM_SCREEN(pScreen);
DRICloseScreen(pScreen);
if (pFfb->pDRIInfo) {
DRIInfoPtr pDRIInfo = pFfb->pDRIInfo;
if (pDRIInfo->devPrivate)
xfree(pDRIInfo->devPrivate);
DRIDestroyInfoRec(pDRIInfo);
pFfb->pDRIInfo = NULL;
}
if (pFfb->pVisualConfigs) {
xfree(pFfb->pVisualConfigs);
pFfb->pVisualConfigs = NULL;
}
if (pFfb->pVisualConfigsPriv) {
xfree(pFfb->pVisualConfigsPriv);
pFfb->pVisualConfigsPriv = NULL;
}
}
static Bool
FFBDRICreateContext(ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext,
void *pVisualConfigPriv, DRIContextType context)
{
/* Nothing to do... */
return TRUE;
}
static void
FFBDRIDestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType context)
{
/* Nothing to do... */
}
Bool
FFBDRIFinishScreenInit(ScreenPtr pScreen)
{
FFBPtr pFfb = GET_FFB_FROM_SCREEN(pScreen);
DRIInfoPtr pDRIInfo = pFfb->pDRIInfo;
FFBDRIPtr pFfbDRI = (FFBDRIPtr) pDRIInfo->devPrivate;
int i;
/* This belongs in the kernel. I'm sorry, the rest
* of the current DRI switching mechanisms just suck.
*/
pDRIInfo->driverSwapMethod = DRI_KERNEL_SWAP;
/* Copy over the fast/page filling parameters now that
* acceleration has been fully setup.
*/
pFfbDRI->disable_pagefill = pFfb->disable_pagefill;
pFfbDRI->fastfill_small_area = FFB_FFPARMS(pFfb).fastfill_small_area;
pFfbDRI->pagefill_small_area = FFB_FFPARMS(pFfb).pagefill_small_area;
pFfbDRI->fastfill_height = FFB_FFPARMS(pFfb).fastfill_height;
pFfbDRI->fastfill_width = FFB_FFPARMS(pFfb).fastfill_width;
pFfbDRI->pagefill_height = FFB_FFPARMS(pFfb).pagefill_height;
pFfbDRI->pagefill_width = FFB_FFPARMS(pFfb).pagefill_width;
for (i = 0; i < 0x800; i++)
pFfbDRI->Pf_AlignTab[i] = pFfb->Pf_AlignTab[i];
return DRIFinishScreenInit(pScreen);
}
static void
FFBDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
FFBPtr pFfb = GET_FFB_FROM_SCREEN(pScreen);
CreatorPrivWinPtr pFfbPrivWin = CreatorGetWindowPrivate(pWin);
ffb_fbcPtr ffb = pFfb->regs;
unsigned int fbc;
BoxPtr pBox;
int nBox;
fbc = pFfbPrivWin->fbc_base;
fbc = (fbc & ~FFB_FBC_WB_MASK) | FFB_FBC_WB_AB;
fbc = (fbc & ~FFB_FBC_XE_MASK) | FFB_FBC_XE_ON;
fbc = (fbc & ~FFB_FBC_RGBE_MASK) | FFB_FBC_RGBE_OFF;
pBox = REGION_RECTS(prgn);
nBox = (int) REGION_NUM_RECTS(prgn);
FFB_WRITE_ROP(pFfb, ffb, (FFB_ROP_NEW | (FFB_ROP_NEW << 8)));
FFB_WRITE_PPC(pFfb, ffb,
(FFB_PPC_APE_DISABLE | FFB_PPC_CS_CONST | FFB_PPC_XS_WID),
(FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK));
FFB_WRITE_PMASK(pFfb, ffb, ~0);
FFB_WRITE_DRAWOP(pFfb, ffb, FFB_DRAWOP_RECTANGLE);
FFB_WRITE_FBC(pFfb, ffb, fbc);
FFB_WRITE_WID(pFfb, ffb, FFB_WID_WIN(pWin));
while(nBox--) {
register int x, y, w, h;
x = pBox->x1;
y = pBox->y1;
w = (pBox->x2 - x);
h = (pBox->y2 - y);
FFBFifo(pFfb, 4);
FFB_WRITE64(&ffb->by, y, x);
FFB_WRITE64_2(&ffb->bh, h, w);
pBox++;
}
pFfb->rp_active = 1;
FFBSync(pFfb, ffb);
}
static void
FFBDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
{
}
static void
FFBDRISetDrawableIndex(WindowPtr pWin, CARD32 index)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
FFBPtr pFfb = GET_FFB_FROM_SCREEN(pScreen);
CreatorPrivWinPtr pFfbPrivWin = CreatorGetWindowPrivate(pWin);
unsigned int wid;
if (FFBWidIsShared(pFfb, pFfbPrivWin->wid)) {
wid = FFBWidUnshare(pFfb, pFfbPrivWin->wid);
if (wid == (unsigned int) -1)
return;
ErrorF("FFB: Allocated WID %x for DRI window.\n", wid);
pFfbPrivWin->wid = wid;
/* Now update the SAREA. */
pFfb->pFfbSarea->wid_table[index] = wid;
}
}

View File

@@ -0,0 +1,48 @@
/* $XFree86$ */
#ifndef _FFB_DRISHARE_H
#define _FFB_DRISHARE_H
typedef struct ffb_dri_state {
int flags;
#define FFB_DRI_FFB2 0x00000001
#define FFB_DRI_FFB2PLUS 0x00000002
#define FFB_DRI_PAC1 0x00000004
#define FFB_DRI_PAC2 0x00000008
/* Indexed by DRI drawable id. */
#define FFB_DRI_NWIDS 64
unsigned int wid_table[FFB_DRI_NWIDS];
} ffb_dri_state_t;
#define FFB_DRISHARE(SAREA) \
((ffb_dri_state_t *) (((char *)(SAREA)) + sizeof(drm_sarea_t)))
typedef struct {
drm_handle_t hFbcRegs;
drmSize sFbcRegs;
drm_handle_t hDacRegs;
drmSize sDacRegs;
drm_handle_t hSfb8r;
drmSize sSfb8r;
drm_handle_t hSfb32;
drmSize sSfb32;
drm_handle_t hSfb64;
drmSize sSfb64;
/* Fastfill/Pagefill parameters. */
unsigned char disable_pagefill;
int fastfill_small_area;
int pagefill_small_area;
int fastfill_height;
int fastfill_width;
int pagefill_height;
int pagefill_width;
short Pf_AlignTab[0x800];
} FFBDRIRec, *FFBDRIPtr;
#endif /* !(_FFB_DRISHARE_H) */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - fifo macros.
*
* Copyright (C) 1998,1999 Jakub Jelinek (jakub@redhat.com)
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
*
* 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
* JAKUB JELINEK OR DAVID MILLER 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.
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fifo.h,v 1.1 2000/05/18 23:21:36 dawes Exp $ */
#ifndef FFBFIFO_H
#define FFBFIFO_H
#include "ffb.h"
/* This is the smallest FFB fifo size I know of. -DaveM */
#define FFB_FIFO_MIN 124
#define FFBFifo(__fpriv, __n) \
do { int __cur_slots = (__fpriv)->fifo_cache; \
if((__cur_slots - (__n)) < 0) { \
ffb_fbcPtr __ffb = pFfb->regs; \
do { __cur_slots = (((int)__ffb->ucsr & FFB_UCSR_FIFO_MASK) - 4); \
} while((__cur_slots - (__n)) < 0); \
} (__fpriv)->fifo_cache = (__cur_slots - (__n)); \
} while(0)
/* While we are polling for the raster processor to idle, cache the
* fifo count as well.
*/
#define FFBWait(__fpriv, __ffb) \
if ((__fpriv)->rp_active != 0) { \
unsigned int __regval = (__ffb)->ucsr; \
while((__regval & FFB_UCSR_RP_BUSY) != 0) { \
__regval = (__ffb)->ucsr; \
} \
(__fpriv)->fifo_cache = ((int)(__regval & FFB_UCSR_FIFO_MASK)) - 4; \
(__fpriv)->rp_active = 0; \
} while(0)
/* DEBUGGING: You can use this if you suspect corruption is occuring
* because someone is touching the framebuffer while the
* raster processor is active. If you enable this and the
* problem goes away, odds are your suspicions are correct.
*/
#undef FORCE_WAIT_EVERY_ROP
#ifdef FORCE_WAIT_EVERY_ROP
#define FFBSync(__fpriv, __ffb) FFBWait(__fpriv, __ffb)
#else
#define FFBSync(__fpriv, __ffb) do { } while(0)
#endif
#endif /* FFBFIFO_H */

View File

@@ -0,0 +1,212 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - fast inner loops.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
* Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com)
*
* 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
* JAKUB JELINEK OR DAVID MILLER 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.
*
*/
/* $XFree86$ */
#ifndef FFBLOOPS_H
#define FFBLOOPS_H
#ifdef USE_VIS
extern void FFB_STIPPLE_LOAD(volatile unsigned int *d,
unsigned int *s);
extern void FFB_PPT_BOX_LOOP(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
BoxPtr pbox, BoxPtr pbox_last,
DDXPointPtr ppt);
extern void FFB_BOX_LOOP(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
BoxPtr pbox,
BoxPtr pbox_last);
extern void FFB_RECT_LOOP(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
xRectangle *prect,
xRectangle *prect_last,
int xOrg, int yOrg);
extern void FFB_PPT_WIDTH_LOOP(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int *pwidth);
extern DDXPointPtr FFB_PPT_LOOP1(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int xOrg, int yOrg);
extern DDXPointPtr FFB_PPT_LOOP2(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int x, int y);
extern DDXPointPtr FFB_LINE_LOOP1(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int xOrg, int yOrg);
extern DDXPointPtr FFB_LINE_LOOP2(FFBPtr ffbpriv,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int *x, int *y);
#else /* !USE_VIS */
#define FFB_STIPPLE_LOAD(_d,_s) \
do { \
volatile unsigned int *d = (_d); \
unsigned int *s = (_s); \
int i; \
\
for (i = 0; i < (32 / 2); i++, d+=2, s+=2) \
FFB_WRITE64(d, s[0], s[1]); \
} while (0)
#define FFB_PPT_BOX_LOOP(pFfb, ffb, pbox, _pbox_last, ppt) \
do { \
BoxPtr pbox_last = (BoxPtr)(_pbox_last); \
while (pbox <= pbox_last) { \
FFBFifo(pFfb, 7); \
ffb->drawop = FFB_DRAWOP_VSCROLL; \
FFB_WRITE64(&ffb->by, ppt->y, ppt->x); \
FFB_WRITE64_2(&ffb->dy, pbox->y1, pbox->x1); \
FFB_WRITE64_3(&ffb->bh, (pbox->y2 - pbox->y1), (pbox->x2 - pbox->x1)); \
pbox++; ppt++; \
} \
} while (0)
#define FFB_BOX_LOOP(pFfb, ffb, pbox, _pbox_last) \
do { \
BoxPtr pbox_last = (BoxPtr)(_pbox_last); \
while (pbox <= pbox_last) { \
FFBFifo(pFfb, 4); \
FFB_WRITE64(&ffb->by, pbox->y1, pbox->x1); \
FFB_WRITE64_2(&ffb->bh, (pbox->y2 - pbox->y1), (pbox->x2 - pbox->x1)); \
pbox++; \
} \
} while (0)
#define FFB_RECT_LOOP(pFfb, ffb, prect, _prect_last, xOrg, yOrg) \
do { \
xRectangle *prect_last = (xRectangle *)(_prect_last); \
for (; prect <= prect_last; prect++) { \
register int x, y, w, h; \
x = prect->x + xOrg; \
y = prect->y + yOrg; \
w = prect->width; \
h = prect->height; \
if (extents->x2 <= x || \
extents->x1 >= x + w || \
extents->y2 <= y || \
extents->y1 >= y + h) \
continue; \
FFBFifo(pFfb, 4); \
FFB_WRITE64(&ffb->by, y, x); \
FFB_WRITE64_2(&ffb->bh, h, w); \
} \
} while (0)
#define FFB_PPT_WIDTH_LOOP(pFfb, ffb, ppt, _ppt_last, pwidth) \
do { \
DDXPointPtr ppt_last = (DDXPointPtr)(_ppt_last); \
while (ppt <= ppt_last) { \
register int x, y, w; \
x = ppt->x; \
y = ppt->y; \
w = *pwidth++; \
FFBFifo(pFfb, 5); \
ffb->ppc = 0; \
FFB_WRITE64(&ffb->by, y, x); \
FFB_WRITE64_2(&ffb->bh, y, (x + w)); \
ppt++; \
} \
} while (0)
static __inline__ DDXPointPtr FFB_PPT_LOOP1(FFBPtr pFfb,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int xOrg, int yOrg)
{
while (ppt <= ppt_last) {
FFBFifo(pFfb, 2);
FFB_WRITE64_2(&ffb->bh, (ppt->y + yOrg), (ppt->x + xOrg));
ppt++;
}
return ppt;
}
static __inline__ DDXPointPtr FFB_PPT_LOOP2(FFBPtr pFfb,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int x, int y)
{
register int __x = x, __y = y;
while (ppt <= ppt_last) {
FFBFifo(pFfb, 2);
__x += ppt->x;
__y += ppt->y;
FFB_WRITE64_2(&ffb->bh, __y, __x);
ppt++;
}
return ppt;
}
static __inline__ DDXPointPtr FFB_LINE_LOOP1(FFBPtr pFfb,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int xOrg, int yOrg)
{
while (ppt <= ppt_last) {
FFBFifo(pFfb, 3);
ffb->ppc = 0;
FFB_WRITE64_2(&ffb->bh, (ppt->y + yOrg), (ppt->x + xOrg));
ppt++;
}
return ppt;
}
static __inline__ DDXPointPtr FFB_LINE_LOOP2(FFBPtr pFfb,
ffb_fbcPtr ffb,
DDXPointPtr ppt, DDXPointPtr ppt_last,
int *x, int *y)
{
register int __x = *x, __y = *y;
while (ppt <= ppt_last) {
FFBFifo(pFfb, 3);
ffb->ppc = 0;
__x += ppt->x;
__y += ppt->y;
FFB_WRITE64_2(&ffb->bh, __y, __x);
ppt++;
}
*x = __x;
*y = __y;
return ppt;
}
#endif /* !USE_VIS */
#endif /* FFBLOOPS_H */

View File

@@ -0,0 +1,333 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - register caching.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
* Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com)
*
* 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
* JAKUB JELINEK OR DAVID MILLER 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.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_rcache.h,v 1.1 2000/05/18 23:21:37 dawes Exp $ */
#ifndef FFBRCACHE_H
#define FFBRCACHE_H
/* We only need to write the bits which actually change,
* writing unnessary bits causes the operation to go more
* slowly. -DaveM
*
* We used to have some hairy code here which tried to
* avoid writing attribute bits unnecessarily. It has been
* removed because various two bit fields have different
* semantics. For example, for some the higher bit is the
* edit bit, for others there are three state patterns
* and zero is a special "no edit" value. Ho hum, it was
* a nice idea...
*/
#define FFB_WRITE_PPC(__fpriv, __ffb, __val, __chg_mask) \
do { unsigned int __oldval = (__fpriv)->ppc_cache; \
unsigned int __t; \
__t = (__oldval & (__chg_mask)) ^ (__val); \
if (__t) { \
unsigned int __newval = __oldval & ~(__chg_mask); \
__newval |= (__val); \
(__fpriv)->ppc_cache = __newval; \
FFBFifo((__fpriv), 1); \
(__ffb)->ppc = (__val); \
} \
} while(0)
#define FFB_WRITE_PMASK(__fpriv, __ffb, __val) \
do { if((__fpriv)->pmask_cache != (__val)) { \
(__fpriv)->pmask_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->pmask = (__val); \
} \
} while(0)
#define FFB_WRITE_ROP(__fpriv, __ffb, __val) \
do { if((__fpriv)->rop_cache != (__val)) { \
(__fpriv)->rop_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->rop = (__val); \
} \
} while(0)
#define FFB_WRITE_DRAWOP(__fpriv, __ffb, __val) \
do { if((__fpriv)->drawop_cache != (__val)) { \
(__fpriv)->drawop_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->drawop = (__val); \
} \
} while(0)
#define FFB_WRITE_FG(__fpriv, __ffb, __val) \
do { if((__fpriv)->fg_cache != (__val)) { \
(__fpriv)->fg_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->fg = (__val); \
} \
} while(0)
#define FFB_WRITE_BG(__fpriv, __ffb, __val) \
do { if((__fpriv)->bg_cache != (__val)) { \
(__fpriv)->bg_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->bg = (__val); \
} \
} while(0)
#define FFB_WRITE_FONTW(__fpriv, __ffb, __val) \
do { if((__fpriv)->fontw_cache != (__val)) { \
(__fpriv)->fontw_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->fontw = (__val); \
} \
} while(0)
#define FFB_WRITE_FONTINC(__fpriv, __ffb, __val) \
do { if((__fpriv)->fontinc_cache != (__val)) { \
(__fpriv)->fontinc_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->fontinc = (__val); \
} \
} while(0)
#define FFB_WRITE_FBC(__fpriv, __ffb, __val) \
do { if((__fpriv)->fbc_cache != (__val)) { \
(__fpriv)->fbc_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->fbc = (__val); \
} \
} while(0)
#define FFB_WRITE_WID(__fpriv, __ffb, __val) \
do { if((__fpriv)->wid_cache != (__val)) { \
(__fpriv)->wid_cache = (__val); \
FFBFifo((__fpriv), 1); \
(__ffb)->wid = (__val); \
} \
} while(0)
extern void __FFB_Attr_Raw(FFBPtr pFfb,
unsigned int ppc,
unsigned int ppc_mask,
unsigned int pmask,
unsigned int rop,
int drawop, int fg,
unsigned int fbc,
unsigned int wid);
#define FFB_ATTR_RAW(__fpriv, __ppc, __ppc_mask, __pmask, __rop, __drawop, __fg, __fbc, __wid) \
if((((__fpriv)->ppc_cache & (__ppc_mask)) != (__ppc)) || \
((__fpriv)->pmask_cache != (__pmask)) || \
((__fpriv)->rop_cache != (__rop)) || \
(((__drawop) != -1) && ((__fpriv)->drawop_cache != (__drawop))) || \
((__fpriv)->fg_cache != (__fg)) || \
((__fpriv)->fbc_cache != (__fbc)) || \
((__fpriv)->wid_cache != (__wid))) \
__FFB_Attr_Raw((__fpriv), (__ppc), (__ppc_mask), (__pmask), \
(__rop), (__drawop), (__fg), (__fbc), (__wid))
#define FFB_PPC_GCMASK (FFB_PPC_APE_MASK | FFB_PPC_CS_MASK)
/* This is for loading the FFB attributes for the case where
* where most of the values come directly from the graphics
* context and only the PPC and DRAWOP are variable.
*/
extern void __FFB_Attr_GC(FFBPtr pFfb, GCPtr pGC, WindowPtr pWin,
unsigned int ppc, int drawop);
#define FFB_ATTR_GC(__fpriv, __pgc, __pwin, __ppc, __drawop) \
do { CreatorPrivWinPtr __winpriv = CreatorGetWindowPrivate(__pwin); \
unsigned int __rop = ((__pgc)->alu | FFB_ROP_EDIT_BIT); \
unsigned int __fbc = ((__winpriv)->fbc_base); \
__fbc &= ~FFB_FBC_XE_MASK; \
__fbc |= FFB_FBC_XE_OFF; \
__rop |= (FFB_ROP_NEW << 8); \
if ((((__fpriv)->ppc_cache & FFB_PPC_GCMASK) != (__ppc))|| \
((__fpriv)->pmask_cache != ((__pgc)->planemask)) || \
((__fpriv)->rop_cache != (__rop)) || \
((__fpriv)->drawop_cache != (__drawop)) || \
((__fpriv)->fg_cache != ((__pgc)->fgPixel)) || \
((__fpriv)->fbc_cache != __fbc)) \
__FFB_Attr_GC(__fpriv, __pgc, __pwin, __ppc, __drawop); \
} while(0)
#define FFB_PPC_WINMASK (FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK)
extern void __FFB_Attr_FastfillWin(FFBPtr pFfb, WindowPtr pWin,
unsigned int ppc, unsigned int pixel);
#define FFB_ATTR_FFWIN(__fpriv, __pwin, __ppc, __pixel) \
do { CreatorPrivWinPtr __winpriv = CreatorGetWindowPrivate(__pwin); \
unsigned int ___ppc = (__ppc) | FFB_PPC_XS_WID; \
unsigned int __fbc = (__winpriv)->fbc_base; \
unsigned int __rop = (FFB_ROP_NEW|(FFB_ROP_NEW<<8)); \
if((__fpriv)->has_double_buffer) { \
__fbc &= ~FFB_FBC_WB_MASK; \
__fbc |= FFB_FBC_WB_AB; \
} \
__fbc &= ~(FFB_FBC_XE_MASK | FFB_FBC_RGBE_MASK); \
__fbc |= FFB_FBC_XE_ON | FFB_FBC_RGBE_ON; \
if (pFfb->ffb_res == ffb_res_high) \
__fbc |= FFB_FBC_WB_B; \
if ((((__fpriv)->ppc_cache & FFB_PPC_WINMASK) != (___ppc))|| \
((__fpriv)->pmask_cache != 0x00ffffff) || \
((__fpriv)->rop_cache!= __rop) || \
((__fpriv)->drawop_cache != FFB_DRAWOP_FASTFILL) || \
((__fpriv)->fg_cache != (__pixel)) || \
((__fpriv)->fbc_cache != __fbc) || \
((__fpriv)->wid_cache != ((__winpriv)->wid))) \
__FFB_Attr_FastfillWin(__fpriv, __pwin, ___ppc, __pixel);\
} while (0)
/* We have to be careful when copying windows around. For that
* case we will use either VIS copies or hw accelerated VSCROLL.
* All of the planes needs to be copied in the framebuffer from
* src to dst in order to handle child windows using different WIDs
* than the parent window being copied.
*/
/* Setup to access the smart frame buffer (SFB) directly where the
* pixel color comes from the cpu on writes.
*/
#define FFB_PPC_WINCOPY (FFB_PPC_APE_DISABLE | FFB_PPC_XS_VAR | FFB_PPC_CS_VAR)
#define FFB_PPC_WINCOPY_MASK (FFB_PPC_APE_MASK | FFB_PPC_XS_MASK | FFB_PPC_CS_MASK)
#define FFB_FBC_WINCOPY (FFB_FBC_WB_A | FFB_FBC_WM_COMBINED | FFB_FBC_WE_FORCEON | \
FFB_FBC_RB_A | FFB_FBC_SB_BOTH | FFB_FBC_XE_ON | \
FFB_FBC_ZE_OFF | FFB_FBC_YE_OFF | FFB_FBC_RGBE_ON)
#define FFB_ATTR_SFB_VAR_WINCOPY(__fpriv) \
do { unsigned int __ppc = FFB_PPC_WINCOPY; \
unsigned int __ppc_mask = FFB_PPC_WINCOPY_MASK; \
unsigned int __rop = FFB_ROP_NEW|(FFB_ROP_NEW<<8); \
unsigned int __fbc = FFB_FBC_WINCOPY; \
if((__fpriv)->has_double_buffer) { \
__fbc &= ~FFB_FBC_WB_MASK; \
__fbc |= FFB_FBC_WB_AB; \
} \
if (((__fpriv)->ppc_cache & __ppc_mask) != __ppc || \
(__fpriv)->fbc_cache != __fbc || \
(__fpriv)->rop_cache != __rop || \
(__fpriv)->pmask_cache != 0xffffffff) { \
ffb_fbcPtr __ffb = (__fpriv)->regs; \
(__fpriv)->ppc_cache &= ~__ppc_mask; \
(__fpriv)->ppc_cache |= __ppc; \
(__fpriv)->fbc_cache = __fbc; \
(__fpriv)->rop_cache = __rop; \
(__fpriv)->pmask_cache = 0xffffffff; \
(__fpriv)->rp_active = 1; \
FFBFifo(__fpriv, 4); \
(__ffb)->ppc = __ppc; \
(__ffb)->fbc = __fbc; \
(__ffb)->rop = __rop; \
(__ffb)->pmask = 0xffffffff; \
(__fpriv)->rp_active = 1; \
} \
} while(0)
extern void __FFB_Attr_SFB_VAR(FFBPtr pFfb, unsigned int ppc, unsigned int ppc_mask, unsigned int fbc,
unsigned int wid, unsigned int rop, unsigned int pmask);
#define FFB_ATTR_SFB_VAR_WIN(__fpriv, __pmask, __alu, __pwin) \
do { unsigned int __ppc = FFB_PPC_APE_DISABLE | FFB_PPC_CS_VAR | FFB_PPC_XS_WID; \
unsigned int __ppc_mask = FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK; \
unsigned int __rop = (FFB_ROP_EDIT_BIT | (__alu))|(FFB_ROP_NEW<<8); \
unsigned int __fbc = FFB_FBC_WIN(__pwin); \
if((__fpriv)->has_double_buffer) { \
__fbc &= ~FFB_FBC_WB_MASK; \
__fbc |= FFB_FBC_WB_AB; \
} \
if(((__fpriv)->ppc_cache & __ppc_mask) != __ppc || \
(__fpriv)->fbc_cache != __fbc || \
(__fpriv)->wid_cache != FFB_WID_WIN(__pwin) || \
(__fpriv)->rop_cache != __rop || \
(__fpriv)->pmask_cache != (__pmask)) \
__FFB_Attr_SFB_VAR(__fpriv, __ppc, __ppc_mask, __fbc, \
FFB_WID_WIN(__pwin), __rop, (__pmask)); \
} while(0)
/* VSCROLL Attributes:
*
* PPC) VCE_DISABLE must be set, all other attributes are effectively
* ignored since this drawop just copies pixels within the ram
* chips and bypasses the pixel processor entirely. So you
* end up with a PPC color source behavior of {ZS,YS,XS,CS}_VAR.
* FBC) all options are allowed, but the SRC/DST buffers are determined
* solely by the WB_* setting, that is, the RB_* setting is effectively
* ignored since the pixels are copied directly through the write buffer
* ROP) must be FFB_ROP_OLD (even for the X plane!)
* PMASK) all options allowed
*/
#define FFB_ATTR_VSCROLL_WINCOPY(__fpriv) \
do { unsigned int __rop = (FFB_ROP_OLD | (FFB_ROP_OLD << 8)); \
unsigned int __fbc = FFB_FBC_WINCOPY; \
if((__fpriv)->has_double_buffer) { \
__fbc &= ~FFB_FBC_WB_MASK; \
__fbc |= FFB_FBC_WB_AB; \
} \
if((__fpriv)->fbc_cache != __fbc || \
(__fpriv)->rop_cache != __rop || \
(__fpriv)->pmask_cache != 0xffffffff || \
(__fpriv)->drawop_cache != FFB_DRAWOP_VSCROLL) { \
ffb_fbcPtr __ffb = (__fpriv)->regs; \
(__fpriv)->fbc_cache = __fbc; \
(__fpriv)->rop_cache = __rop; \
(__fpriv)->pmask_cache = 0xffffffff; \
(__fpriv)->drawop_cache = FFB_DRAWOP_VSCROLL; \
(__fpriv)->rp_active = 1; \
FFBFifo(__fpriv, 4); \
(__ffb)->fbc = __fbc; \
(__ffb)->rop = __rop; \
(__ffb)->pmask = 0xffffffff; \
(__ffb)->drawop = FFB_DRAWOP_VSCROLL; \
(__fpriv)->rp_active = 1; \
} \
} while(0)
#define FFB_ATTR_VSCROLL_WIN(__fpriv, __pmask, __pwin) \
do { unsigned int __rop = (FFB_ROP_OLD | (FFB_ROP_OLD << 8)); \
unsigned int __fbc = FFB_FBC_WIN(__pwin); \
if((__fpriv)->has_double_buffer) { \
__fbc &= ~FFB_FBC_WB_MASK; \
__fbc |= FFB_FBC_WB_AB; \
} \
if((__fpriv)->fbc_cache != __fbc || \
(__fpriv)->rop_cache != __rop || \
(__fpriv)->pmask_cache != (__pmask) || \
(__fpriv)->drawop_cache != FFB_DRAWOP_VSCROLL) { \
ffb_fbcPtr __ffb = (__fpriv)->regs; \
(__fpriv)->fbc_cache = __fbc; \
(__fpriv)->rop_cache = __rop; \
(__fpriv)->pmask_cache = (__pmask); \
(__fpriv)->drawop_cache = FFB_DRAWOP_VSCROLL; \
(__fpriv)->rp_active = 1; \
FFBFifo(__fpriv, 4); \
(__ffb)->fbc = __fbc; \
(__ffb)->rop = __rop; \
(__ffb)->pmask = (__pmask); \
(__ffb)->drawop = FFB_DRAWOP_VSCROLL; \
} \
} while(0)
#define FFB_FBC_WIN(pWin) CreatorGetWindowPrivate(pWin)->fbc_base
#define FFB_WID_WIN(pWin) CreatorGetWindowPrivate(pWin)->wid
#endif /* FFBRCACHE_H */

View File

@@ -0,0 +1,522 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - register layout.
*
* Copyright (C) 1998,1999,2000 Jakub Jelinek (jakub@redhat.com)
* Copyright (C) 1998 Michal Rehacek (majkl@iname.com)
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
*
* 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
* JAKUB JELINEK, MICHAL REHACEK, OR DAVID MILLER 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.
*
*/
/* $XFree86$ */
#ifndef FFBREGS_H
#define FFBREGS_H
/* Auxilliary clips. */
typedef struct {
volatile unsigned int min;
volatile unsigned int max;
} ffb_auxclip, *ffb_auxclipPtr;
/* FFB register set. */
typedef struct _ffb_fbc {
/* Next vertex registers, on the right we list which drawops
* use said register and the logical name the register has in
* that context.
*/ /* DESCRIPTION DRAWOP(NAME) */
/*0x00*/unsigned int pad1[3]; /* Reserved */
/*0x0c*/volatile unsigned int alpha; /* ALPHA Transparency */
/*0x10*/volatile unsigned int red; /* RED */
/*0x14*/volatile unsigned int green; /* GREEN */
/*0x18*/volatile unsigned int blue; /* BLUE */
/*0x1c*/volatile unsigned int z; /* DEPTH */
/*0x20*/volatile unsigned int y; /* Y triangle(DOYF) */
/* aadot(DYF) */
/* ddline(DYF) */
/* aaline(DYF) */
/*0x24*/volatile unsigned int x; /* X triangle(DOXF) */
/* aadot(DXF) */
/* ddline(DXF) */
/* aaline(DXF) */
/*0x28*/unsigned int pad2[2]; /* Reserved */
/*0x30*/volatile unsigned int ryf; /* Y (alias to DOYF) ddline(RYF) */
/* aaline(RYF) */
/* triangle(RYF) */
/*0x34*/volatile unsigned int rxf; /* X ddline(RXF) */
/* aaline(RXF) */
/* triangle(RXF) */
/*0x38*/unsigned int pad3[2]; /* Reserved */
/*0x40*/volatile unsigned int dmyf; /* Y (alias to DOYF) triangle(DMYF) */
/*0x44*/volatile unsigned int dmxf; /* X triangle(DMXF) */
/*0x48*/unsigned int pad4[2]; /* Reserved */
/*0x50*/volatile unsigned int ebyi; /* Y (alias to RYI) polygon(EBYI) */
/*0x54*/volatile unsigned int ebxi; /* X polygon(EBXI) */
/*0x58*/unsigned int pad5[2]; /* Reserved */
/*0x60*/volatile unsigned int by; /* Y brline(RYI) */
/* fastfill(OP) */
/* polygon(YI) */
/* rectangle(YI) */
/* bcopy(SRCY) */
/* vscroll(SRCY) */
/*0x64*/volatile unsigned int bx; /* X brline(RXI) */
/* polygon(XI) */
/* rectangle(XI) */
/* bcopy(SRCX) */
/* vscroll(SRCX) */
/* fastfill(GO) */
/*0x68*/volatile unsigned int dy; /* destination Y fastfill(DSTY) */
/* bcopy(DSRY) */
/* vscroll(DSRY) */
/*0x6c*/volatile unsigned int dx; /* destination X fastfill(DSTX) */
/* bcopy(DSTX) */
/* vscroll(DSTX) */
/*0x70*/volatile unsigned int bh; /* Y (alias to RYI) brline(DYI) */
/* dot(DYI) */
/* polygon(ETYI) */
/* Height fastfill(H) */
/* bcopy(H) */
/* vscroll(H) */
/* Y count fastfill(NY) */
/*0x74*/volatile unsigned int bw; /* X dot(DXI) */
/* brline(DXI) */
/* polygon(ETXI) */
/* fastfill(W) */
/* bcopy(W) */
/* vscroll(W) */
/* fastfill(NX) */
/*0x78*/unsigned int pad6[2]; /* Reserved */
/*0x80*/unsigned int pad7[32]; /* Reserved */
/* Setup Unit's vertex state register */
/*100*/ volatile unsigned int suvtx;
/*104*/ unsigned int pad8[63]; /* Reserved */
/* Frame Buffer Control Registers */
/*200*/ volatile unsigned int ppc; /* Pixel Processor Control */
/*204*/ volatile unsigned int wid; /* Current WID */
/*208*/ volatile unsigned int fg; /* FG data */
/*20c*/ volatile unsigned int bg; /* BG data */
/*210*/ volatile unsigned int consty; /* Constant Y */
/*214*/ volatile unsigned int constz; /* Constant Z */
/*218*/ volatile unsigned int xclip; /* X Clip */
/*21c*/ volatile unsigned int dcss; /* Depth Cue Scale Slope */
/*220*/ volatile unsigned int vclipmin; /* Viewclip XY Min Bounds */
/*224*/ volatile unsigned int vclipmax; /* Viewclip XY Max Bounds */
/*228*/ volatile unsigned int vclipzmin; /* Viewclip Z Min Bounds */
/*22c*/ volatile unsigned int vclipzmax; /* Viewclip Z Max Bounds */
/*230*/ volatile unsigned int dcsf; /* Depth Cue Scale Front Bound */
/*234*/ volatile unsigned int dcsb; /* Depth Cue Scale Back Bound */
/*238*/ volatile unsigned int dczf; /* Depth Cue Z Front */
/*23c*/ volatile unsigned int dczb; /* Depth Cue Z Back */
/*240*/ unsigned int pad9; /* Reserved */
/*244*/ volatile unsigned int blendc; /* Alpha Blend Control */
/*248*/ volatile unsigned int blendc1; /* Alpha Blend Color 1 */
/*24c*/ volatile unsigned int blendc2; /* Alpha Blend Color 2 */
/*250*/ volatile unsigned int fbramitc; /* FB RAM Interleave Test Control */
/*254*/ volatile unsigned int fbc; /* Frame Buffer Control */
/*258*/ volatile unsigned int rop; /* Raster OPeration */
/*25c*/ volatile unsigned int cmp; /* Frame Buffer Compare */
/*260*/ volatile unsigned int matchab; /* Buffer AB Match Mask */
/*264*/ volatile unsigned int matchc; /* Buffer C(YZ) Match Mask */
/*268*/ volatile unsigned int magnab; /* Buffer AB Magnitude Mask */
/*26c*/ volatile unsigned int magnc; /* Buffer C(YZ) Magnitude Mask */
/*270*/ volatile unsigned int fbcfg0; /* Frame Buffer Config 0 */
/*274*/ volatile unsigned int fbcfg1; /* Frame Buffer Config 1 */
/*278*/ volatile unsigned int fbcfg2; /* Frame Buffer Config 2 */
/*27c*/ volatile unsigned int fbcfg3; /* Frame Buffer Config 3 */
/*280*/ volatile unsigned int ppcfg; /* Pixel Processor Config */
/*284*/ volatile unsigned int pick; /* Picking Control */
/*288*/ volatile unsigned int fillmode; /* FillMode */
/*28c*/ volatile unsigned int fbramwac; /* FB RAM Write Address Control */
/*290*/ volatile unsigned int pmask; /* RGB PlaneMask */
/*294*/ volatile unsigned int xpmask; /* X PlaneMask */
/*298*/ volatile unsigned int ypmask; /* Y PlaneMask */
/*29c*/ volatile unsigned int zpmask; /* Z PlaneMask */
/*2a0*/ ffb_auxclip auxclip[4]; /* Auxilliary Viewport Clip */
/* New 3dRAM III support regs */
/*2c0*/ volatile unsigned int rawblend2;
/*2c4*/ volatile unsigned int rawpreblend;
/*2c8*/ volatile unsigned int rawstencil;
/*2cc*/ volatile unsigned int rawstencilctl;
/*2d0*/ volatile unsigned int threedram1;
/*2d4*/ volatile unsigned int threedram2;
/*2d8*/ volatile unsigned int passin;
/*2dc*/ volatile unsigned int rawclrdepth;
/*2e0*/ volatile unsigned int rawpmask;
/*2e4*/ volatile unsigned int rawcsrc;
/*2e8*/ volatile unsigned int rawmatch;
/*2ec*/ volatile unsigned int rawmagn;
/*2f0*/ volatile unsigned int rawropblend;
/*2f4*/ volatile unsigned int rawcmp;
/*2f8*/ volatile unsigned int rawwac;
/*2fc*/ volatile unsigned int fbramid;
/*300*/ volatile unsigned int drawop; /* Draw OPeration */
/*304*/ unsigned int pad10[2]; /* Reserved */
/*30c*/ volatile unsigned int lpat; /* Line Pattern control */
/*310*/ unsigned int pad11; /* Reserved */
/*314*/ volatile unsigned int fontxy; /* XY Font coordinate */
/*318*/ volatile unsigned int fontw; /* Font Width */
/*31c*/ volatile unsigned int fontinc; /* Font Increment */
/*320*/ volatile unsigned int font; /* Font bits */
/*324*/ unsigned int pad12[3]; /* Reserved */
/*330*/ volatile unsigned int blend2;
/*334*/ volatile unsigned int preblend;
/*338*/ volatile unsigned int stencil;
/*33c*/ volatile unsigned int stencilctl;
/*340*/ unsigned int pad13[4]; /* Reserved */
/*350*/ volatile unsigned int dcss1; /* Depth Cue Scale Slope 1 */
/*354*/ volatile unsigned int dcss2; /* Depth Cue Scale Slope 2 */
/*358*/ volatile unsigned int dcss3; /* Depth Cue Scale Slope 3 */
/*35c*/ volatile unsigned int widpmask;
/*360*/ volatile unsigned int dcs2;
/*364*/ volatile unsigned int dcs3;
/*368*/ volatile unsigned int dcs4;
/*36c*/ unsigned int pad14; /* Reserved */
/*370*/ volatile unsigned int dcd2;
/*374*/ volatile unsigned int dcd3;
/*378*/ volatile unsigned int dcd4;
/*37c*/ unsigned int pad15; /* Reserved */
/*380*/ volatile unsigned int pattern[32]; /* area Pattern */
/*400*/ unsigned int pad16[8]; /* Reserved */
/*420*/ volatile unsigned int reset; /* chip RESET */
/*424*/ unsigned int pad17[247]; /* Reserved */
/*800*/ volatile unsigned int devid; /* Device ID */
/*804*/ unsigned int pad18[63]; /* Reserved */
/*900*/ volatile unsigned int ucsr; /* User Control & Status Register */
/*904*/ unsigned int pad19[31]; /* Reserved */
/*980*/ volatile unsigned int mer; /* Mode Enable Register */
/*984*/ unsigned int pad20[1439]; /* Reserved */
} ffb_fbc, *ffb_fbcPtr;
/* Draw operations */
#define FFB_DRAWOP_DOT 0x00
#define FFB_DRAWOP_AADOT 0x01
#define FFB_DRAWOP_BRLINECAP 0x02
#define FFB_DRAWOP_BRLINEOPEN 0x03
#define FFB_DRAWOP_DDLINE 0x04
#define FFB_DRAWOP_AALINE 0x05
#define FFB_DRAWOP_TRIANGLE 0x06
#define FFB_DRAWOP_POLYGON 0x07
#define FFB_DRAWOP_RECTANGLE 0x08
#define FFB_DRAWOP_FASTFILL 0x09
#define FFB_DRAWOP_BCOPY 0x0a /* Not implemented in any FFB, VIS is faster */
#define FFB_DRAWOP_VSCROLL 0x0b /* Up to 12x faster than BCOPY, 3-4x faster than VIS */
/* FastFill operation codes. */
#define FFB_FASTFILL_PAGE 0x01
#define FFB_FASTFILL_BLOCK 0x02
#define FFB_FASTFILL_COLOR_BLK 0x03
#define FFB_FASTFILL_BLOCK_X 0x04
/* Spanfill Unit Line Pattern */
#define FFB_LPAT_SCALEPTR 0xf0000000
#define FFB_LPAT_SCALEPTR_SHIFT 28
#define FFB_LPAT_PATPTR 0x0f000000
#define FFB_LPAT_PATPTR_SHIFT 24
#define FFB_LPAT_SCALEVAL 0x00f00000
#define FFB_LPAT_SCALEVAL_SHIFT 20
#define FFB_LPAT_PATLEN 0x000f0000
#define FFB_LPAT_PATLEN_SHIFT 16
#define FFB_LPAT_PATTERN 0x0000ffff
#define FFB_LPAT_PATTERN_SHIFT 0
/* Pixel processor control */
/* Force WID */
#define FFB_PPC_FW_DISABLE 0x800000
#define FFB_PPC_FW_ENABLE 0xc00000
#define FFB_PPC_FW_MASK 0xc00000
/* Auxiliary clip */
#define FFB_PPC_ACE_DISABLE 0x040000
#define FFB_PPC_ACE_AUX_SUB 0x080000
#define FFB_PPC_ACE_AUX_ADD 0x0c0000
#define FFB_PPC_ACE_MASK 0x0c0000
/* Depth cue */
#define FFB_PPC_DCE_DISABLE 0x020000
#define FFB_PPC_DCE_ENABLE 0x030000
#define FFB_PPC_DCE_MASK 0x030000
/* Alpha blend */
#define FFB_PPC_ABE_DISABLE 0x008000
#define FFB_PPC_ABE_ENABLE 0x00c000
#define FFB_PPC_ABE_MASK 0x00c000
/* View clip */
#define FFB_PPC_VCE_DISABLE 0x001000
#define FFB_PPC_VCE_2D 0x002000
#define FFB_PPC_VCE_3D 0x003000
#define FFB_PPC_VCE_MASK 0x003000
/* Area pattern */
#define FFB_PPC_APE_DISABLE 0x000800
#define FFB_PPC_APE_ENABLE 0x000c00
#define FFB_PPC_APE_MASK 0x000c00
/* Transparent background */
#define FFB_PPC_TBE_OPAQUE 0x000200
#define FFB_PPC_TBE_TRANSPARENT 0x000300
#define FFB_PPC_TBE_MASK 0x000300
/* Z source */
#define FFB_PPC_ZS_VAR 0x000080
#define FFB_PPC_ZS_CONST 0x0000c0
#define FFB_PPC_ZS_MASK 0x0000c0
/* Y source */
#define FFB_PPC_YS_VAR 0x000020
#define FFB_PPC_YS_CONST 0x000030
#define FFB_PPC_YS_MASK 0x000030
/* X source */
#define FFB_PPC_XS_WID 0x000004
#define FFB_PPC_XS_VAR 0x000008
#define FFB_PPC_XS_CONST 0x00000c
#define FFB_PPC_XS_MASK 0x00000c
/* Color (BGR) source */
#define FFB_PPC_CS_VAR 0x000002
#define FFB_PPC_CS_CONST 0x000003
#define FFB_PPC_CS_MASK 0x000003
/* X Clip */
#define FFB_XCLIP_XREF 0x000000ff
#define FFB_XCLIP_TEST_MASK 0x00070000
#define FFB_XCLIP_TEST_ALWAYS 0x00000000
#define FFB_XCLIP_TEST_GT 0x00010000
#define FFB_XCLIP_TEST_EQ 0x00020000
#define FFB_XCLIP_TEST_GE 0x00030000
#define FFB_XCLIP_TEST_NEVER 0x00040000
#define FFB_XCLIP_TEST_LE 0x00050000
#define FFB_XCLIP_TEST_NE 0x00060000
#define FFB_XCLIP_TEST_LT 0x00070000
/* FB Control register */
/* Write buffer dest */
#define FFB_FBC_WB_A 0x20000000
#define FFB_FBC_WB_B 0x40000000
#define FFB_FBC_WB_AB 0x60000000
#define FFB_FBC_WB_C 0x80000000
#define FFB_FBC_WB_AC 0xa0000000
#define FFB_FBC_WB_BC 0xc0000000
#define FFB_FBC_WB_ABC 0xe0000000
#define FFB_FBC_WB_MASK 0xe0000000
/* Write enable */
#define FFB_FBC_WE_FORCEOFF 0x00100000
#define FFB_FBC_WE_FORCEON 0x00200000
#define FFB_FBC_WE_USE_WMASK 0x00300000
#define FFB_FBC_WE_MASK 0x00300000
/* Write group mode */
#define FFB_FBC_WM_RSVD 0x00040000
#define FFB_FBC_WM_COMBINED 0x00080000
#define FFB_FBC_WM_SEPARATE 0x000c0000
#define FFB_FBC_WM_MASK 0x000c0000
/* Read buffer src */
#define FFB_FBC_RB_A 0x00004000
#define FFB_FBC_RB_B 0x00008000
#define FFB_FBC_RB_C 0x0000c000
#define FFB_FBC_RB_MASK 0x0000c000
/* Stereo buf dest */
#define FFB_FBC_SB_LEFT 0x00001000
#define FFB_FBC_SB_RIGHT 0x00002000
#define FFB_FBC_SB_BOTH 0x00003000
#define FFB_FBC_SB_MASK 0x00003000
/* Z plane group enable */
#define FFB_FBC_ZE_OFF 0x00000400
#define FFB_FBC_ZE_ON 0x00000800
#define FFB_FBC_ZE_MASK 0x00000c00
/* Y plane group enable */
#define FFB_FBC_YE_OFF 0x00000100
#define FFB_FBC_YE_ON 0x00000200
#define FFB_FBC_YE_MASK 0x00000300
/* X plane group enable */
#define FFB_FBC_XE_OFF 0x00000040
#define FFB_FBC_XE_ON 0x00000080
#define FFB_FBC_XE_MASK 0x000000c0
/* B plane group enable */
#define FFB_FBC_BE_OFF 0x00000010
#define FFB_FBC_BE_ON 0x00000020
#define FFB_FBC_BE_MASK 0x00000030
/* G plane group enable */
#define FFB_FBC_GE_OFF 0x00000004
#define FFB_FBC_GE_ON 0x00000008
#define FFB_FBC_GE_MASK 0x0000000c
/* R plane group enable */
#define FFB_FBC_RE_OFF 0x00000001
#define FFB_FBC_RE_ON 0x00000002
#define FFB_FBC_RE_MASK 0x00000003
/* Combined */
#define FFB_FBC_RGBE_OFF 0x00000015
#define FFB_FBC_RGBE_ON 0x0000002a
#define FFB_FBC_RGBE_MASK 0x0000003f
/* Raster OP */
#define FFB_ROP_YZ_MASK 0x008f0000
#define FFB_ROP_X_MASK 0x00008f00
#define FFB_ROP_RGB_MASK 0x0000008f
/* Now the rops themselves which get shifted into the
* above fields.
*/
#define FFB_ROP_EDIT_BIT 0x80
#define FFB_ROP_ZERO 0x80
#define FFB_ROP_NEW_AND_OLD 0x81
#define FFB_ROP_NEW_AND_NOLD 0x82
#define FFB_ROP_NEW 0x83
#define FFB_ROP_NNEW_AND_OLD 0x84
#define FFB_ROP_OLD 0x85
#define FFB_ROP_NEW_XOR_OLD 0x86
#define FFB_ROP_NEW_OR_OLD 0x87
#define FFB_ROP_NNEW_AND_NOLD 0x88
#define FFB_ROP_NNEW_XOR_NOLD 0x89
#define FFB_ROP_NOLD 0x8a
#define FFB_ROP_NEW_OR_NOLD 0x8b
#define FFB_ROP_NNEW 0x8c
#define FFB_ROP_NNEW_OR_OLD 0x8d
#define FFB_ROP_NNEW_OR_NOLD 0x8e
#define FFB_ROP_ONES 0x8f
/* FB Compare */
#define FFB_CMP_MATCHC_MASK 0x8f000000
#define FFB_CMP_MAGNC_MASK 0x00870000
#define FFB_CMP_MATCHAB_MASK 0x0000ff00
#define FFB_CMP_MAGNAB_MASK 0x000000ff
/* Compare Match codes */
#define FFB_CMP_MATCH_EDIT_BIT 0x80
#define FFB_CMP_MATCH_ALWAYS 0x80
#define FFB_CMP_MATCH_NEVER 0x81
#define FFB_CMP_MATCH_EQ 0x82
#define FFB_CMP_MATCH_NE 0x83
#define FFB_CMP_MATCH_A_ALWAYS 0xc0
#define FFB_CMP_MATCH_B_ALWAYS 0xa0
/* Compare Magnitude codes */
#define FFB_CMP_MAGN_EDIT_BIT 0x80
#define FFB_CMP_MAGN_ALWAYS 0x80
#define FFB_CMP_MAGN_GT 0x81
#define FFB_CMP_MAGN_EQ 0x82
#define FFB_CMP_MAGN_GE 0x83
#define FFB_CMP_MAGN_NEVER 0x84
#define FFB_CMP_MAGN_LE 0x85
#define FFB_CMP_MAGN_NE 0x86
#define FFB_CMP_MAGN_LT 0x87
#define FFB_CMP_MAGN_A_ALWAYS 0xc0
#define FFB_CMP_MAGN_B_ALWAYS 0xa0
/* User Control and Status */
#define FFB_UCSR_FIFO_MASK 0x00000fff
#define FFB_UCSR_PICK_NO_HIT 0x00020000
#define FFB_UCSR_PICK_HIT 0x00030000
#define FFB_UCSR_PICK_DISABLE 0x00080000
#define FFB_UCSR_PICK_ENABLE 0x000c0000
#define FFB_UCSR_FB_BUSY 0x01000000
#define FFB_UCSR_RP_BUSY 0x02000000
#define FFB_UCSR_ALL_BUSY (FFB_UCSR_RP_BUSY|FFB_UCSR_FB_BUSY)
#define FFB_UCSR_READ_ERR 0x40000000
#define FFB_UCSR_FIFO_OVFL 0x80000000
#define FFB_UCSR_ALL_ERRORS (FFB_UCSR_READ_ERR|FFB_UCSR_FIFO_OVFL)
/* Mode Enable Register */
#define FFB_MER_EIRA 0x00000080 /* Enable read-ahead, increasing */
#define FFB_MER_EDRA 0x000000c0 /* Enable read-ahead, decreasing */
#define FFB_MER_DRA 0x00000040 /* No read-ahead */
/* Alpha Blend Control */
#define FFB_BLENDC_FORCE_ONE 0x00000010 /* Defines 0xff as 1.0 */
#define FFB_BLENDC_DF_MASK 0x0000000c /* Destination Frac Mask */
#define FFB_BLENDC_DF_ZERO 0x00000000 /* Destination Frac: 0.00 */
#define FFB_BLENDC_DF_ONE 0x00000004 /* Destination Frac: 1.00 */
#define FFB_BLENDC_DF_ONE_M_A 0x00000008 /* Destination Frac: 1.00 - Xsrc */
#define FFB_BLENDC_DF_A 0x0000000c /* Destination Frac: Xsrc */
#define FFB_BLENDC_SF_MASK 0x00000003 /* Source Frac Mask */
#define FFB_BLENDC_SF_ZERO 0x00000000 /* Source Frac: 0.00 */
#define FFB_BLENDC_SF_ONE 0x00000001 /* Source Frac: 1.00 */
#define FFB_BLENDC_SF_ONE_M_A 0x00000002 /* Source Frac: 1.00 - Xsrc */
#define FFB_BLENDC_SF_A 0x00000003 /* Source Frac: Xsrc */
/* FBram Config 0 */
#define FFB_FBCFG0_RFTIME 0xff800000
#define FFB_FBCFG0_XMAX 0x007c0000
#define FFB_FBCFG0_YMAX 0x0003ffc0
#define FFB_FBCFG0_RES_MASK 0x00000030
#define FFB_FBCFG0_RES_HIGH 0x00000030 /* 1920x1360 */
#define FFB_FBCFG0_RES_STD 0x00000020 /* 1280x1024 */
#define FFB_FBCFG0_RES_STEREO 0x00000010 /* 960x580 */
#define FFB_FBCFG0_RES_PRTRAIT 0x00000000 /* 1280x2048 */
#define FFB_FBCFG0_ITRLACE 0x00000000
#define FFB_FBCFG0_SEQUENTIAL 0x00000008
#define FFB_FBCFG0_DRENA 0x00000004
#define FFB_FBCFG0_BPMODE 0x00000002
#define FFB_FBCFG0_RFRSH_RST 0x00000001
typedef struct _ffb_dac {
volatile unsigned int cfg;
volatile unsigned int cfgdata;
volatile unsigned int cur;
volatile unsigned int curdata;
} ffb_dac, *ffb_dacPtr;
/* Writing 2 32-bit registers at a time using 64-bit stores. -DaveM */
#if defined(__GNUC__) && defined(USE_VIS)
/* 64-bit register writing support.
* Note: "lo" means "low address".
*/
#define FFB_WRITE64_COMMON(__regp, __lo32, __hi32, REG0, REG1) \
do { __extension__ register unsigned int __r0 __asm__(""#REG0); \
__extension__ register unsigned int __r1 __asm__(""#REG1); \
__r0 = (__lo32); \
__r1 = (__hi32); \
__asm__ __volatile__ ("sllx\t%0, 32, %%g1\n\t" \
"srl\t%1, 0, %1\n\t" \
"or\t%%g1, %1, %%g1\n\t" \
"stx\t%%g1, %2" \
: : "r" (__r0), "r" (__r1), "m" (*(__regp)) : "g1"); \
} while(0)
#define FFB_WRITE64P(__regp, __srcp) \
do { __asm__ __volatile__ ("ldx\t%0, %%g2;" \
"stx\t%%g2, %1" \
: : "m" (*(__srcp)), "m" (*(__regp)) \
: "g2"); \
} while(0)
#define FFB_WRITE64(__regp, __lo32, __hi32) \
FFB_WRITE64_COMMON(__regp, __lo32, __hi32, g2, g3)
#define FFB_WRITE64_2(__regp, __lo32, __hi32) \
FFB_WRITE64_COMMON(__regp, __lo32, __hi32, g4, g5)
#define FFB_WRITE64_3(__regp, __lo32, __hi32) \
FFB_WRITE64_COMMON(__regp, __lo32, __hi32, o4, o5)
#else /* Do not use 64-bit writes. */
#define FFB_WRITE64(__regp, __lo32, __hi32) \
do { volatile unsigned int *__p = (__regp); \
*__p = (__lo32); \
*(__p + 1) = (__hi32); \
} while(0)
#define FFB_WRITE64P(__regp, __srcp) \
do { volatile unsigned int *__p = (__regp); \
unsigned int *__q = (__srcp); \
*__p = *__q; \
*(__p + 1) = *(__q + 1); \
} while(0)
#define FFB_WRITE64_2(__regp, __lo32, __hi32) \
FFB_WRITE64(__regp, __lo32, __hi32)
#define FFB_WRITE64_3(__regp, __lo32, __hi32) \
FFB_WRITE64(__regp, __lo32, __hi32)
#endif
#endif /* FFBREGS_H */

View File

@@ -0,0 +1,468 @@
/*
* Acceleration for the Creator and Creator3D framebuffer - WID pool management.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*
* 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
* DAVID MILLER 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.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_wid.c,v 1.2 2000/06/20 05:08:48 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ffb.h"
static void
determine_numwids(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
if (p->flags & FFB_DAC_PAC1)
p->wid_table.num_wids = 32;
else
p->wid_table.num_wids = 64;
}
static void
make_wlut_regval(ffb_dac_info_t *p, ffb_wid_info_t *wid)
{
wid->wlut_regval = 0;
if (p->flags & FFB_DAC_PAC1) {
unsigned int color_model_bits;
/* Pacifica1 format */
if (wid->buffer != 0)
wid->wlut_regval |= FFBDAC_PAC1_WLUT_DB;
if (wid->depth == 8) {
if (wid->greyscale) {
if (wid->linear)
color_model_bits = FFBDAC_PAC1_WLUT_C_8LG;
else
color_model_bits = FFBDAC_PAC1_WLUT_C_8NG;
} else {
color_model_bits = FFBDAC_PAC1_WLUT_C_8P;
}
} else {
if (wid->direct) {
color_model_bits = FFBDAC_PAC1_WLUT_C_24D;
} else {
if (wid->linear)
color_model_bits = FFBDAC_PAC1_WLUT_C_24LT;
else
color_model_bits = FFBDAC_PAC1_WLUT_C_24NT;
}
}
wid->wlut_regval |= color_model_bits;
switch (wid->channel) {
default:
case 0:
wid->wlut_regval |= FFBDAC_PAC1_WLUT_P_XO;
break;
case 1:
wid->wlut_regval |= FFBDAC_PAC1_WLUT_P_R;
break;
case 2:
wid->wlut_regval |= FFBDAC_PAC1_WLUT_P_G;
break;
case 3:
wid->wlut_regval |= FFBDAC_PAC1_WLUT_P_B;
break;
};
} else {
/* Pacifica2 format */
if (wid->buffer != 0)
wid->wlut_regval |= FFBDAC_PAC2_WLUT_DB;
if (wid->depth == 24)
wid->wlut_regval |= FFBDAC_PAC2_WLUT_DEPTH;
switch (wid->channel) {
default:
case 0:
wid->wlut_regval |= FFBDAC_PAC2_WLUT_P_XO;
break;
case 1:
wid->wlut_regval |= FFBDAC_PAC2_WLUT_P_R;
break;
case 2:
wid->wlut_regval |= FFBDAC_PAC2_WLUT_P_G;
break;
case 3:
wid->wlut_regval |= FFBDAC_PAC2_WLUT_P_B;
break;
};
if ((wid->depth == 8 && wid->greyscale == 0) ||
(wid->depth == 24 && wid->direct != 0))
wid->wlut_regval |= FFBDAC_PAC2_WLUT_LKUP;
if (wid->palette != -1)
wid->wlut_regval |=
((wid->palette << 4) & FFBDAC_PAC2_WLUT_PTBL);
}
}
static void
init_wid_table(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int i;
for (i = 0; i < table->num_wids; i++) {
table->wid_pool[i].InUse = FALSE;
table->wid_pool[i].buffer = 0;
table->wid_pool[i].depth = 24;
table->wid_pool[i].greyscale = 0;
table->wid_pool[i].linear = 0;
table->wid_pool[i].direct = 0;
table->wid_pool[i].channel = 0;
table->wid_pool[i].palette = -1;
make_wlut_regval(p, &table->wid_pool[i]);
}
table->wid_pool[table->num_wids - 1].InUse = TRUE;
table->wid_pool[table->num_wids - 1].canshare = FALSE;
}
static void
init_hw_wids(FFBPtr pFfb)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
ffb_wid_pool_t *table = &p->wid_table;
int i;
if (p->flags & FFB_DAC_PAC1)
dac->cfg = FFBDAC_PAC1_APWLUT_BASE;
else
dac->cfg = FFBDAC_PAC2_APWLUT_BASE;
for (i = 0; i < table->num_wids; i++)
dac->cfgdata = table->wid_pool[i].wlut_regval;
if (p->flags & FFB_DAC_PAC1)
dac->cfg = FFBDAC_PAC1_SPWLUT_BASE;
else
dac->cfg = FFBDAC_PAC2_SPWLUT_BASE;
for (i = 0; i < table->num_wids; i++)
dac->cfgdata = table->wid_pool[i].wlut_regval;
}
static void
init_hw_widmode(FFBPtr pFfb)
{
ffb_dacPtr dac = pFfb->dac;
ffb_dac_info_t *p = &pFfb->dac_info;
unsigned int uctrl;
/* For now we use the Combined WID mode until I figure
* out exactly how Seperate4 and Seperate8 work. We
* also disable overlays for the time being.
*/
p->wid_table.wid_shift = 0;
dac->cfg = FFBDAC_CFG_UCTRL;
uctrl = dac->cfgdata;
uctrl &= ~FFBDAC_UCTRL_WMODE;
uctrl |= FFBDAC_UCTRL_WM_COMB;
uctrl &= ~FFBDAC_UCTRL_OVENAB;
dac->cfg = FFBDAC_CFG_UCTRL;
dac->cfgdata = uctrl;
}
void
FFBWidPoolInit(FFBPtr pFfb)
{
determine_numwids(pFfb);
init_wid_table(pFfb);
init_hw_wids(pFfb);
init_hw_widmode(pFfb);
}
static void
update_wids(FFBPtr pFfb, int index)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_dacPtr dac = pFfb->dac;
unsigned int base;
int limit;
if (pFfb->vtSema)
return;
if (p->flags & FFB_DAC_PAC1)
base = FFBDAC_PAC1_SPWLUT(index);
else
base = FFBDAC_PAC2_SPWLUT(index);
DACCFG_WRITE(dac, base, p->wid_table.wid_pool[index].wlut_regval);
/* Schedule the window transfer. */
DACCFG_WRITE(dac, FFBDAC_CFG_WTCTRL,
(FFBDAC_CFG_WTCTRL_TCMD | FFBDAC_CFG_WTCTRL_TE));
limit = 1000000;
while (limit--) {
unsigned int wtctrl = DACCFG_READ(dac, FFBDAC_CFG_WTCTRL);
if ((wtctrl & FFBDAC_CFG_WTCTRL_DS) == 0)
break;
}
}
unsigned int
FFBWidAlloc(FFBPtr pFfb, int visclass, int cmap, Bool canshare)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int i, depth, direct, static_greyscale, palette, channel;
direct = 0;
static_greyscale = 0;
switch (visclass) {
case StaticGray:
static_greyscale = 1;
/* Fallthrough... */
case StaticColor:
case GrayScale:
case PseudoColor:
depth = 8;
channel = 1;
break;
case DirectColor:
direct = 1;
/* Fallthrough... */
case TrueColor:
depth = 24;
channel = 0;
break;
default:
return (unsigned int) -1;
};
palette = -1;
if (p->flags & FFB_DAC_PAC1) {
if (visclass == PseudoColor ||
visclass == GrayScale ||
visclass == DirectColor)
palette = 0;
} else {
if (visclass == PseudoColor)
palette = 0;
if (visclass == GrayScale)
palette = 1;
if (visclass == DirectColor)
palette = 2;
}
if (canshare) {
for (i = 0; i < table->num_wids; i++) {
if (table->wid_pool[i].InUse == TRUE &&
table->wid_pool[i].canshare == TRUE &&
table->wid_pool[i].palette == palette &&
table->wid_pool[i].direct == direct &&
table->wid_pool[i].greyscale == static_greyscale &&
table->wid_pool[i].channel == channel &&
table->wid_pool[i].depth == depth) {
table->wid_pool[i].refcount++;
return i << table->wid_shift;
}
}
}
for (i = 0; i < table->num_wids; i++) {
if (table->wid_pool[i].InUse == FALSE)
break;
}
if (i != table->num_wids) {
table->wid_pool[i].InUse = TRUE;
table->wid_pool[i].buffer = 0;
table->wid_pool[i].depth = depth;
table->wid_pool[i].palette = palette;
table->wid_pool[i].direct = direct;
table->wid_pool[i].greyscale = static_greyscale;
if (depth == 8)
table->wid_pool[i].channel = 1;
else
table->wid_pool[i].channel = 0;
table->wid_pool[i].refcount = 1;
table->wid_pool[i].canshare = canshare;
make_wlut_regval(p, &table->wid_pool[i]);
update_wids(pFfb, i);
return i << table->wid_shift;
}
return (unsigned int) -1;
}
void
FFBWidFree(FFBPtr pFfb, unsigned int wid)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int index = wid >> table->wid_shift;
if (index < 0 || index >= table->num_wids) {
return;
}
if (--table->wid_pool[index].refcount == 0) {
table->wid_pool[index].InUse = FALSE;
}
}
/* Double Buffering support. */
unsigned int
FFBWidUnshare(FFBPtr pFfb, unsigned int wid)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int index = wid >> table->wid_shift;
int i;
if (index < 0 || index >= table->num_wids) {
return (unsigned int) -1;
}
for (i = 0; i < table->num_wids; i++) {
if (table->wid_pool[i].InUse == FALSE)
break;
}
if (i == table->num_wids) {
return (unsigned int) -1;
}
table->wid_pool[i].InUse = TRUE;
table->wid_pool[i].buffer = 0;
table->wid_pool[i].depth = table->wid_pool[index].depth;
table->wid_pool[i].palette = table->wid_pool[index].palette;
table->wid_pool[i].direct = table->wid_pool[index].direct;
table->wid_pool[i].greyscale = table->wid_pool[index].greyscale;
table->wid_pool[i].channel = table->wid_pool[index].channel;
table->wid_pool[i].refcount = 1;
table->wid_pool[i].canshare = FALSE;
make_wlut_regval(p, &table->wid_pool[i]);
update_wids(pFfb, i);
/* Now free the original WID. */
if (--table->wid_pool[index].refcount == 0) {
table->wid_pool[index].InUse = FALSE;
}
return i << table->wid_shift;
}
unsigned int
FFBWidReshare(FFBPtr pFfb, unsigned int wid)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int index = wid >> table->wid_shift;
int i;
if (index < 0 || index >= table->num_wids) {
return wid;
}
for (i = 0; i < table->num_wids; i++) {
if (table->wid_pool[i].InUse == TRUE &&
table->wid_pool[i].canshare == TRUE &&
table->wid_pool[i].depth == table->wid_pool[index].depth &&
table->wid_pool[i].palette == table->wid_pool[index].palette &&
table->wid_pool[i].direct == table->wid_pool[index].direct &&
table->wid_pool[i].greyscale == table->wid_pool[index].greyscale &&
table->wid_pool[i].channel == table->wid_pool[index].channel)
break;
}
if (i == table->num_wids) {
/* OK, very simple, just make the old one shared. */
table->wid_pool[index].canshare = TRUE;
table->wid_pool[index].buffer = 0;
make_wlut_regval(p, &table->wid_pool[index]);
update_wids(pFfb, index);
return wid;
}
/* Ok, free the original WID. */
if (--table->wid_pool[index].refcount == 0) {
table->wid_pool[index].InUse = FALSE;
}
/* And grab a reference to the new one. */
table->wid_pool[i].refcount++;
/* And return the shared one. */
return i << table->wid_shift;
}
void
FFBWidChangeBuffer(FFBPtr pFfb, unsigned int wid, int visible)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int index = wid >> table->wid_shift;
int buffer;
if (index < 0 || index >= table->num_wids)
return;
buffer = (table->wid_pool[index].buffer ^= 1);
if (visible) {
unsigned int bit;
if (p->flags & FFB_DAC_PAC1)
bit = FFBDAC_PAC1_WLUT_DB;
else
bit = FFBDAC_PAC2_WLUT_DB;
if (buffer)
table->wid_pool[index].wlut_regval |= bit;
else
table->wid_pool[index].wlut_regval &= ~bit;
update_wids(pFfb, index);
}
}
/* Used by DRI part of driver. */
Bool
FFBWidIsShared(FFBPtr pFfb, unsigned int wid)
{
ffb_dac_info_t *p = &pFfb->dac_info;
ffb_wid_pool_t *table = &p->wid_table;
int index = wid >> table->wid_shift;
if (index < 0 || index >= table->num_wids)
return TRUE;
if (table->wid_pool[index].canshare == TRUE)
return TRUE;
return FALSE;
}