update to xf86-video-geode 2.11.6. Tested on a Alix 3C3.
This commit is contained in:
parent
c31b066623
commit
47491b577c
@ -28,6 +28,6 @@ MAINTAINERCLEANFILES = ChangeLog
|
||||
.PHONY: ChangeLog
|
||||
|
||||
ChangeLog:
|
||||
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
|
||||
$(CHANGELOG_CMD)
|
||||
|
||||
dist-hook: ChangeLog
|
||||
|
@ -90,7 +90,6 @@ am__remove_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@
|
||||
@ -110,6 +109,7 @@ CCAS = @CCAS@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
@ -122,6 +122,7 @@ DEPDIR = @DEPDIR@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DRIVER_NAME = @DRIVER_NAME@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
@ -132,6 +133,9 @@ F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
|
||||
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
|
||||
I386ARCH_FALSE = @I386ARCH_FALSE@
|
||||
I386ARCH_TRUE = @I386ARCH_TRUE@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
@ -152,6 +156,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
@ -164,19 +169,18 @@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
|
||||
PCIACCESS_LIBS = @PCIACCESS_LIBS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XEXT_CFLAGS = @XEXT_CFLAGS@
|
||||
XEXT_LIBS = @XEXT_LIBS@
|
||||
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@
|
||||
@ -193,24 +197,32 @@ build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
moduledir = @moduledir@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
@ -661,7 +673,7 @@ uninstall-info: uninstall-info-recursive
|
||||
.PHONY: ChangeLog
|
||||
|
||||
ChangeLog:
|
||||
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
|
||||
$(CHANGELOG_CMD)
|
||||
|
||||
dist-hook: ChangeLog
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
@ -1,13 +1,101 @@
|
||||
AMD Geode GX and LX Xorg graphics Driver
|
||||
May 9, 2007
|
||||
========================================
|
||||
xf86-video-geode -- AMD Geode GX and LX graphics driver for X.org
|
||||
=================================================================
|
||||
README last updated: 2009-09-09
|
||||
|
||||
GIT repository:
|
||||
git://anongit.freedesktop.org/git/xorg/driver/xf86-video-geode
|
||||
|
||||
Gitweb browser:
|
||||
http://cgit.freedesktop.org/xorg/driver/xf86-video-geode
|
||||
|
||||
Project homepage:
|
||||
http://www.x.org/wiki/GeodeDriver
|
||||
|
||||
= Introduction =
|
||||
|
||||
This is the X graphics driver for the AMD Geode GX and LX processors.
|
||||
The GX driver features XAA and EXA support for graphics acceleration,
|
||||
and the LX driver supports EXA (including compositing). Both drivers
|
||||
suppport dynamic rotation with XRandR, and Xv overlay support.
|
||||
support dynamic rotation with XRandR, and Xv overlay support.
|
||||
|
||||
= Roadmap =
|
||||
|
||||
Support for X servers older than 1.4 is expected to be dropped in the
|
||||
near future. If your distribution still hasn't upgraded, please urge
|
||||
them to get around it soon.
|
||||
|
||||
Support for old GX1 Geodes by Cyrix and NSC will be reintroduced soon,
|
||||
at which point xf86-video-cyrix and xf86-video-nsc will be retired.
|
||||
|
||||
Until then, the current situation for Geode coverage is as follow:
|
||||
|
||||
xf86-video-geode
|
||||
* Geode LX (a.k.a. GX3) PCI ID 0x1022:0x2081
|
||||
* Geode GX (a.k.a. GX2) PCI ID 0x100B:0x0030 (rebranded GX2)
|
||||
|
||||
xf86-video-nsc
|
||||
* Geode GX2 (a.k.a. GX2) PCI ID 0x100B:0x0030 (a.k.a. "Red Cloud")
|
||||
* Geode SCx200 (a.k.a. GX1) PCI ID 0x100B:0x0504
|
||||
* Geode SC1400 (a.k.a. GX1) PCI ID 0x100B:0x0104
|
||||
|
||||
xf86-video-cyrix
|
||||
* Geode MediaGX (a.k.a. GX1) PCI ID 0x1078:0x0104
|
||||
|
||||
Please note that both NSC and GEODE support GX2. This is indeed correct.
|
||||
However, only GEODE has up-to-date code, while NSC is deprecated.
|
||||
|
||||
= Dependencies =
|
||||
|
||||
As of version 2.11.4, this driver depends upon X server 1.5 or newer,
|
||||
because the GX Randr code utilizes dixSetPrivate whose API was modified
|
||||
in a non backward-compatible way.
|
||||
|
||||
#ifdef'ing the changes from f1268f3ba8404129d358db3bb1e66f3841f7018a
|
||||
and b28abde0276ddd7f687242f3886f98b0e49a7fc2 might make it possible
|
||||
to build this driver against older X servers. Patches are welcome.
|
||||
|
||||
As of version 2.9.0, this driver depends on X server 1.3 or newer,
|
||||
because it utilizes the new common DDC probing libraries from X.Org.
|
||||
|
||||
If necessary, it might be possible to create autoconf macros to make
|
||||
this driver compile against older X servers, following this example:
|
||||
|
||||
http://lists.freedesktop.org/archives/xorg-commit/2007-February/010341.html
|
||||
|
||||
Patches accomplishing the same trick for the Geode driver are welcome.
|
||||
|
||||
= FAQ =
|
||||
|
||||
Q: Why doesn't this GEODE driver work at WXGA (wide screen) resolutions?
|
||||
|
||||
A: Make sure that TFT Panel support is disabled in the BIOS settings,
|
||||
otherwise resolutions will be restricted to traditional VGA modes.
|
||||
The GEODE offers a choice between CRT-only, CRT+TFT, TFT-only for
|
||||
output device and selecting CRT-only removes the VGA restriction.
|
||||
|
||||
Q: How do I produce useful information whenever submiting a bug report?
|
||||
|
||||
A: See http://www.x.org/wiki/Development/Documentation/ServerDebugging
|
||||
and follow the instructions.
|
||||
|
||||
Q: How do I test development snapshots from the upstream GIT repository?
|
||||
|
||||
A: Run the following commands from a command line interpreter shell...
|
||||
1. git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-geode
|
||||
2. Debian/Ubuntu: apt-get install autoconf automake libtool xutils-dev
|
||||
apt-get install build-dep xserver-xorg-video-geode
|
||||
Fedora/Red Hat: yum install autoconf automake libtool xorg-x11-util-macros
|
||||
yum-builddep xorg-x11-drv-geode
|
||||
3. cd xf86-video-geode
|
||||
4. ./autogen.sh
|
||||
5. make distcheck
|
||||
...then install the driver manually.
|
||||
|
||||
Q: What is the preferred method for submitting patches to this driver?
|
||||
|
||||
A: See http://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
||||
and submit the patches as attachments to the Geode X.org mailing list
|
||||
or to the X.org Bugzilla against component "Driver/geode".
|
||||
|
||||
= Configuration options =
|
||||
|
||||
@ -27,7 +115,7 @@ The following options may be added to the section:
|
||||
SWCursor: Enable software cursors (essentially disabling HW cursor support)
|
||||
NoCompression: Disable video bandwidth compression
|
||||
NoAccel: Disable hardware assisted acceleration
|
||||
AccelMethod: "EXA" (default) or "XAA"
|
||||
AccelMethod: "XAA" (default) or "EXA"
|
||||
Rotate: Select a orientation to start with - LEFT, INVERT, CCW
|
||||
NoPanel: Disable panel support
|
||||
OSMImageBuffers: Set the number of image buffers (XAA only)
|
||||
@ -46,6 +134,4 @@ ExaScratch: Specify the amount of extra EXA scratch buffer (in bytes)
|
||||
FBSize: Specify the size of the video space (in bytes)
|
||||
PanelGeometry: Specify the geometry of the attached panel ("<width>x<height>")
|
||||
|
||||
|
||||
|
||||
|
||||
= EOF =
|
||||
|
1027
driver/xf86-video-geode/aclocal.m4
vendored
1027
driver/xf86-video-geode/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,9 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* xextproto 7.1 available */
|
||||
#undef HAVE_XEXTPROTO_71
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
|
11070
driver/xf86-video-geode/configure
vendored
11070
driver/xf86-video-geode/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([xf86-video-geode],
|
||||
2.10.0,
|
||||
2.11.6,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode],
|
||||
xf86-video-geode)
|
||||
|
||||
@ -30,6 +30,10 @@ AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
AC_CONFIG_AUX_DIR(.)
|
||||
|
||||
# Require xorg-macros: XORG_CHANGELOG
|
||||
m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.2)
|
||||
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
@ -83,6 +87,10 @@ XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
|
||||
|
||||
# Checks for pkg-config packages
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
|
||||
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
|
||||
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
|
||||
HAVE_XEXTPROTO_71="no")
|
||||
AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
|
||||
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
|
||||
|
||||
# Checks for libraries.
|
||||
@ -125,6 +133,7 @@ AC_SUBST([DRIVER_NAME])
|
||||
|
||||
XORG_MANPAGE_SECTIONS
|
||||
XORG_RELEASE_VERSION
|
||||
XORG_CHANGELOG
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
|
@ -1,8 +1,8 @@
|
||||
# ltmain.sh - Provide generalized library-building support services.
|
||||
# NOTE: Changing this file will not affect anything until you rerun configure.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
|
||||
# 2007, 2008 Free Software Foundation, Inc.
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -43,14 +43,22 @@ EXIT_FAILURE=1
|
||||
|
||||
PROGRAM=ltmain.sh
|
||||
PACKAGE=libtool
|
||||
VERSION=1.5.22
|
||||
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
|
||||
VERSION=1.5.26
|
||||
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
|
||||
|
||||
# See if we are running on zsh, and set the options which allow our
|
||||
# commands through without removal of \ escapes.
|
||||
if test -n "${ZSH_VERSION+set}" ; then
|
||||
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
|
||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
||||
# is contrary to our usage. Disable this feature.
|
||||
alias -g '${1+"$@"}'='"$@"'
|
||||
setopt NO_GLOB_SUBST
|
||||
else
|
||||
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
|
||||
fi
|
||||
BIN_SH=xpg4; export BIN_SH # for Tru64
|
||||
DUALCASE=1; export DUALCASE # for MKS sh
|
||||
|
||||
# Check that we have a working $echo.
|
||||
if test "X$1" = X--no-reexec; then
|
||||
@ -105,11 +113,19 @@ esac
|
||||
# These must not be set unconditionally because not all systems understand
|
||||
# e.g. LANG=C (notably SCO).
|
||||
# We save the old values to restore during execute mode.
|
||||
if test "${LC_ALL+set}" = set; then
|
||||
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
|
||||
fi
|
||||
if test "${LANG+set}" = set; then
|
||||
save_LANG="$LANG"; LANG=C; export LANG
|
||||
lt_env=
|
||||
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
|
||||
do
|
||||
eval "if test \"\${$lt_var+set}\" = set; then
|
||||
save_$lt_var=\$$lt_var
|
||||
lt_env=\"$lt_var=\$$lt_var \$lt_env\"
|
||||
$lt_var=C
|
||||
export $lt_var
|
||||
fi"
|
||||
done
|
||||
|
||||
if test -n "$lt_env"; then
|
||||
lt_env="env $lt_env"
|
||||
fi
|
||||
|
||||
# Make sure IFS has a sensible default
|
||||
@ -136,6 +152,8 @@ duplicate_deps=no
|
||||
preserve_args=
|
||||
lo2o="s/\\.lo\$/.${objext}/"
|
||||
o2lo="s/\\.${objext}\$/.lo/"
|
||||
extracted_archives=
|
||||
extracted_serial=0
|
||||
|
||||
#####################################
|
||||
# Shell function definitions:
|
||||
@ -196,7 +214,13 @@ func_win32_libid ()
|
||||
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
|
||||
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
|
||||
win32_nmres=`eval $NM -f posix -A $1 | \
|
||||
$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
|
||||
$SED -n -e '1,100{
|
||||
/ I /{
|
||||
s,.*,import,
|
||||
p
|
||||
q
|
||||
}
|
||||
}'`
|
||||
case $win32_nmres in
|
||||
import*) win32_libid_type="x86 archive import";;
|
||||
*) win32_libid_type="x86 archive static";;
|
||||
@ -327,7 +351,17 @@ func_extract_archives ()
|
||||
*) my_xabs=`pwd`"/$my_xlib" ;;
|
||||
esac
|
||||
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
|
||||
my_xdir="$my_gentop/$my_xlib"
|
||||
my_xlib_u=$my_xlib
|
||||
while :; do
|
||||
case " $extracted_archives " in
|
||||
*" $my_xlib_u "*)
|
||||
extracted_serial=`expr $extracted_serial + 1`
|
||||
my_xlib_u=lt$extracted_serial-$my_xlib ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
extracted_archives="$extracted_archives $my_xlib_u"
|
||||
my_xdir="$my_gentop/$my_xlib_u"
|
||||
|
||||
$show "${rm}r $my_xdir"
|
||||
$run ${rm}r "$my_xdir"
|
||||
@ -454,11 +488,12 @@ do
|
||||
;;
|
||||
|
||||
--version)
|
||||
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
|
||||
$echo
|
||||
$echo "Copyright (C) 2005 Free Software Foundation, Inc."
|
||||
$echo "This is free software; see the source for copying conditions. There is NO"
|
||||
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
echo "\
|
||||
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
|
||||
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
@ -755,9 +790,11 @@ if test -z "$show_help"; then
|
||||
*.class) xform=class ;;
|
||||
*.cpp) xform=cpp ;;
|
||||
*.cxx) xform=cxx ;;
|
||||
*.f90) xform=f90 ;;
|
||||
*.[fF][09]?) xform=[fF][09]. ;;
|
||||
*.for) xform=for ;;
|
||||
*.java) xform=java ;;
|
||||
*.obj) xform=obj ;;
|
||||
*.sx) xform=sx ;;
|
||||
esac
|
||||
|
||||
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
|
||||
@ -926,7 +963,7 @@ EOF
|
||||
$run $rm "$lobj" "$output_obj"
|
||||
|
||||
$show "$command"
|
||||
if $run eval "$command"; then :
|
||||
if $run eval $lt_env "$command"; then :
|
||||
else
|
||||
test -n "$output_obj" && $run $rm $removelist
|
||||
exit $EXIT_FAILURE
|
||||
@ -998,7 +1035,7 @@ EOF
|
||||
command="$command$suppress_output"
|
||||
$run $rm "$obj" "$output_obj"
|
||||
$show "$command"
|
||||
if $run eval "$command"; then :
|
||||
if $run eval $lt_env "$command"; then :
|
||||
else
|
||||
$run $rm $removelist
|
||||
exit $EXIT_FAILURE
|
||||
@ -1131,6 +1168,7 @@ EOF
|
||||
thread_safe=no
|
||||
vinfo=
|
||||
vinfo_number=no
|
||||
single_module="${wl}-single_module"
|
||||
|
||||
func_infer_tag $base_compile
|
||||
|
||||
@ -1138,8 +1176,9 @@ EOF
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-all-static | -static)
|
||||
if test "X$arg" = "X-all-static"; then
|
||||
-all-static | -static | -static-libtool-libs)
|
||||
case $arg in
|
||||
-all-static)
|
||||
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
|
||||
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
|
||||
fi
|
||||
@ -1147,12 +1186,20 @@ EOF
|
||||
dlopen_self=$dlopen_self_static
|
||||
fi
|
||||
prefer_static_libs=yes
|
||||
else
|
||||
;;
|
||||
-static)
|
||||
if test -z "$pic_flag" && test -n "$link_static_flag"; then
|
||||
dlopen_self=$dlopen_self_static
|
||||
fi
|
||||
prefer_static_libs=built
|
||||
fi
|
||||
;;
|
||||
-static-libtool-libs)
|
||||
if test -z "$pic_flag" && test -n "$link_static_flag"; then
|
||||
dlopen_self=$dlopen_self_static
|
||||
fi
|
||||
prefer_static_libs=yes
|
||||
;;
|
||||
esac
|
||||
build_libtool_libs=no
|
||||
build_old_libs=yes
|
||||
break
|
||||
@ -1600,7 +1647,7 @@ EOF
|
||||
continue
|
||||
;;
|
||||
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
|
||||
compiler_flags="$compiler_flags $arg"
|
||||
compile_command="$compile_command $arg"
|
||||
finalize_command="$finalize_command $arg"
|
||||
@ -1608,6 +1655,11 @@ EOF
|
||||
continue
|
||||
;;
|
||||
|
||||
-multi_module)
|
||||
single_module="${wl}-multi_module"
|
||||
continue
|
||||
;;
|
||||
|
||||
-module)
|
||||
module=yes
|
||||
continue
|
||||
@ -1621,10 +1673,11 @@ EOF
|
||||
# -m* pass through architecture-specific compiler args for GCC
|
||||
# -m*, -t[45]*, -txscale* pass through architecture-specific
|
||||
# compiler args for GCC
|
||||
# -pg pass through profiling flag for GCC
|
||||
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
|
||||
# -F/path gives path to uninstalled frameworks, gcc on darwin
|
||||
# @file GCC response files
|
||||
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
|
||||
-t[45]*|-txscale*|@*)
|
||||
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
|
||||
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
|
||||
|
||||
# Unknown arguments in both finalize_command and compile_command need
|
||||
# to be aesthetically quoted because they are evaled later.
|
||||
@ -1652,9 +1705,9 @@ EOF
|
||||
|
||||
-no-install)
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
|
||||
# The PATH hackery in wrapper scripts is required on Windows
|
||||
# in order for the loader to find any dlls it needs.
|
||||
# and Darwin in order for the loader to find any dlls it needs.
|
||||
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
|
||||
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
|
||||
fast_install=no
|
||||
@ -1713,7 +1766,7 @@ EOF
|
||||
continue
|
||||
;;
|
||||
|
||||
-static)
|
||||
-static | -static-libtool-libs)
|
||||
# The effects of -static are defined in a previous loop.
|
||||
# We used to do the same as -all-static on platforms that
|
||||
# didn't have a PIC flag, but the assumption that the effects
|
||||
@ -2106,7 +2159,7 @@ EOF
|
||||
lib=
|
||||
found=no
|
||||
case $deplib in
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
|
||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
|
||||
if test "$linkmode,$pass" = "prog,link"; then
|
||||
compile_deplibs="$deplib $compile_deplibs"
|
||||
finalize_deplibs="$deplib $finalize_deplibs"
|
||||
@ -2122,7 +2175,12 @@ EOF
|
||||
continue
|
||||
fi
|
||||
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
|
||||
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
|
||||
if test "$linkmode" = lib; then
|
||||
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
|
||||
else
|
||||
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
|
||||
fi
|
||||
for searchdir in $searchdirs; do
|
||||
for search_ext in .la $std_shrext .so .a; do
|
||||
# Search the libtool library
|
||||
lib="$searchdir/lib${name}${search_ext}"
|
||||
@ -2503,7 +2561,9 @@ EOF
|
||||
|
||||
if test "$linkmode,$pass" = "prog,link"; then
|
||||
if test -n "$library_names" &&
|
||||
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
|
||||
{ { test "$prefer_static_libs" = no ||
|
||||
test "$prefer_static_libs,$installed" = "built,yes"; } ||
|
||||
test -z "$old_library"; }; then
|
||||
# We need to hardcode the library path
|
||||
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
|
||||
# Make sure the rpath contains only unique directories.
|
||||
@ -2916,12 +2976,18 @@ EOF
|
||||
# we do not want to link against static libs,
|
||||
# but need to link against shared
|
||||
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
|
||||
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
|
||||
if test -n "$deplibrary_names" ; then
|
||||
for tmp in $deplibrary_names ; do
|
||||
depdepl=$tmp
|
||||
done
|
||||
if test -f "$path/$depdepl" ; then
|
||||
if test -f "$deplibdir/$depdepl" ; then
|
||||
depdepl="$deplibdir/$depdepl"
|
||||
elif test -f "$path/$depdepl" ; then
|
||||
depdepl="$path/$depdepl"
|
||||
else
|
||||
# Can't find it, oh well...
|
||||
depdepl=
|
||||
fi
|
||||
# do not add paths which are already there
|
||||
case " $newlib_search_path " in
|
||||
@ -3069,9 +3135,10 @@ EOF
|
||||
|
||||
case $linkmode in
|
||||
oldlib)
|
||||
if test -n "$deplibs"; then
|
||||
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
|
||||
fi
|
||||
case " $deplibs" in
|
||||
*\ -l* | *\ -L*)
|
||||
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
|
||||
esac
|
||||
|
||||
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
|
||||
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
|
||||
@ -3199,7 +3266,7 @@ EOF
|
||||
# which has an extra 1 added just for fun
|
||||
#
|
||||
case $version_type in
|
||||
darwin|linux|osf|windows)
|
||||
darwin|linux|osf|windows|none)
|
||||
current=`expr $number_major + $number_minor`
|
||||
age="$number_minor"
|
||||
revision="$number_revision"
|
||||
@ -3210,9 +3277,10 @@ EOF
|
||||
age="0"
|
||||
;;
|
||||
irix|nonstopux)
|
||||
current=`expr $number_major + $number_minor - 1`
|
||||
current=`expr $number_major + $number_minor`
|
||||
age="$number_minor"
|
||||
revision="$number_minor"
|
||||
lt_irix_increment=no
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@ -3271,7 +3339,8 @@ EOF
|
||||
versuffix="$major.$age.$revision"
|
||||
# Darwin ld doesn't like 0 for these options...
|
||||
minor_current=`expr $current + 1`
|
||||
verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
|
||||
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
|
||||
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
|
||||
;;
|
||||
|
||||
freebsd-aout)
|
||||
@ -3285,8 +3354,11 @@ EOF
|
||||
;;
|
||||
|
||||
irix | nonstopux)
|
||||
major=`expr $current - $age + 1`
|
||||
|
||||
if test "X$lt_irix_increment" = "Xno"; then
|
||||
major=`expr $current - $age`
|
||||
else
|
||||
major=`expr $current - $age + 1`
|
||||
fi
|
||||
case $version_type in
|
||||
nonstopux) verstring_prefix=nonstopux ;;
|
||||
*) verstring_prefix=sgi ;;
|
||||
@ -3437,11 +3509,11 @@ EOF
|
||||
fi
|
||||
|
||||
# Eliminate all temporary directories.
|
||||
for path in $notinst_path; do
|
||||
lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
|
||||
deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
|
||||
dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
|
||||
done
|
||||
#for path in $notinst_path; do
|
||||
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
|
||||
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
|
||||
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
|
||||
#done
|
||||
|
||||
if test -n "$xrpath"; then
|
||||
# If the user specified any rpath flags, then add them.
|
||||
@ -3542,13 +3614,12 @@ EOF
|
||||
int main() { return 0; }
|
||||
EOF
|
||||
$rm conftest
|
||||
$LTCC $LTCFLAGS -o conftest conftest.c $deplibs
|
||||
if test "$?" -eq 0 ; then
|
||||
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
|
||||
ldd_output=`ldd conftest`
|
||||
for i in $deplibs; do
|
||||
name=`expr $i : '-l\(.*\)'`
|
||||
# If $name is empty we are operating on a -L argument.
|
||||
if test "$name" != "" && test "$name" -ne "0"; then
|
||||
if test "$name" != "" && test "$name" != "0"; then
|
||||
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
|
||||
case " $predeps $postdeps " in
|
||||
*" $i "*)
|
||||
@ -3587,9 +3658,7 @@ EOF
|
||||
# If $name is empty we are operating on a -L argument.
|
||||
if test "$name" != "" && test "$name" != "0"; then
|
||||
$rm conftest
|
||||
$LTCC $LTCFLAGS -o conftest conftest.c $i
|
||||
# Did it work?
|
||||
if test "$?" -eq 0 ; then
|
||||
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
|
||||
ldd_output=`ldd conftest`
|
||||
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
|
||||
case " $predeps $postdeps " in
|
||||
@ -3621,7 +3690,7 @@ EOF
|
||||
droppeddeps=yes
|
||||
$echo
|
||||
$echo "*** Warning! Library $i is needed by this library but I was not able to"
|
||||
$echo "*** make it link in! You will probably need to install it or some"
|
||||
$echo "*** make it link in! You will probably need to install it or some"
|
||||
$echo "*** library that it depends on before this library will be fully"
|
||||
$echo "*** functional. Installing it before continuing would be even better."
|
||||
fi
|
||||
@ -3907,7 +3976,10 @@ EOF
|
||||
test -n "$hardcode_libdirs"; then
|
||||
libdir="$hardcode_libdirs"
|
||||
if test -n "$hardcode_libdir_flag_spec_ld"; then
|
||||
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
|
||||
case $archive_cmds in
|
||||
*\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
|
||||
*) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
|
||||
esac
|
||||
else
|
||||
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
|
||||
fi
|
||||
@ -4217,9 +4289,10 @@ EOF
|
||||
;;
|
||||
|
||||
obj)
|
||||
if test -n "$deplibs"; then
|
||||
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
|
||||
fi
|
||||
case " $deplibs" in
|
||||
*\ -l* | *\ -L*)
|
||||
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
|
||||
esac
|
||||
|
||||
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
|
||||
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
|
||||
@ -4266,12 +4339,14 @@ EOF
|
||||
reload_conv_objs=
|
||||
gentop=
|
||||
# reload_cmds runs $LD directly, so let us get rid of
|
||||
# -Wl from whole_archive_flag_spec
|
||||
# -Wl from whole_archive_flag_spec and hope we can get by with
|
||||
# turning comma into space..
|
||||
wl=
|
||||
|
||||
if test -n "$convenience"; then
|
||||
if test -n "$whole_archive_flag_spec"; then
|
||||
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
|
||||
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
|
||||
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
|
||||
else
|
||||
gentop="$output_objdir/${obj}x"
|
||||
generated="$generated $gentop"
|
||||
@ -4719,16 +4794,16 @@ static const void *lt_preloaded_setup() {
|
||||
case $host in
|
||||
*cygwin* | *mingw* )
|
||||
if test -f "$output_objdir/${outputname}.def" ; then
|
||||
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
|
||||
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
|
||||
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
|
||||
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
|
||||
else
|
||||
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
|
||||
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
|
||||
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
|
||||
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
|
||||
fi
|
||||
;;
|
||||
* )
|
||||
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
|
||||
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
|
||||
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
|
||||
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@ -4743,13 +4818,13 @@ static const void *lt_preloaded_setup() {
|
||||
# really was required.
|
||||
|
||||
# Nullify the symbol file.
|
||||
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
|
||||
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
|
||||
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
|
||||
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
|
||||
fi
|
||||
|
||||
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
|
||||
# Replace the output file specification.
|
||||
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
|
||||
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
|
||||
link_command="$compile_command$compile_rpath"
|
||||
|
||||
# We have no uninstalled library dependencies, so finalize right now.
|
||||
@ -4836,7 +4911,7 @@ static const void *lt_preloaded_setup() {
|
||||
if test "$fast_install" != no; then
|
||||
link_command="$finalize_var$compile_command$finalize_rpath"
|
||||
if test "$fast_install" = yes; then
|
||||
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
|
||||
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
|
||||
else
|
||||
# fast_install is set to needless
|
||||
relink_command=
|
||||
@ -4873,7 +4948,7 @@ static const void *lt_preloaded_setup() {
|
||||
fi
|
||||
done
|
||||
relink_command="(cd `pwd`; $relink_command)"
|
||||
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
|
||||
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
|
||||
fi
|
||||
|
||||
# Quote $echo for shipping.
|
||||
@ -5280,6 +5355,20 @@ EOF
|
||||
Xsed='${SED} -e 1s/^X//'
|
||||
sed_quote_subst='$sed_quote_subst'
|
||||
|
||||
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
|
||||
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
|
||||
# is contrary to our usage. Disable this feature.
|
||||
alias -g '\${1+\"\$@\"}'='\"\$@\"'
|
||||
setopt NO_GLOB_SUBST
|
||||
else
|
||||
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
|
||||
fi
|
||||
BIN_SH=xpg4; export BIN_SH # for Tru64
|
||||
DUALCASE=1; export DUALCASE # for MKS sh
|
||||
|
||||
# The HP-UX ksh and POSIX shell print the target directory to stdout
|
||||
# if CDPATH is set.
|
||||
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||
@ -5422,7 +5511,7 @@ else
|
||||
;;
|
||||
esac
|
||||
$echo >> $output "\
|
||||
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
|
||||
\$echo \"\$0: cannot exec \$program \$*\"
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
else
|
||||
@ -5608,7 +5697,7 @@ fi\
|
||||
done
|
||||
# Quote the link command for shipping.
|
||||
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
|
||||
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
|
||||
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
|
||||
if test "$hardcode_automatic" = yes ; then
|
||||
relink_command=
|
||||
fi
|
||||
@ -5957,9 +6046,9 @@ relink_command=\"$relink_command\""
|
||||
|
||||
if test -n "$inst_prefix_dir"; then
|
||||
# Stick the inst_prefix_dir data into the link command.
|
||||
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
|
||||
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
|
||||
else
|
||||
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
|
||||
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
|
||||
fi
|
||||
|
||||
$echo "$modename: warning: relinking \`$file'" 1>&2
|
||||
@ -6168,7 +6257,7 @@ relink_command=\"$relink_command\""
|
||||
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
|
||||
outputname="$tmpdir/$file"
|
||||
# Replace the output file specification.
|
||||
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
|
||||
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
|
||||
|
||||
$show "$relink_command"
|
||||
if $run eval "$relink_command"; then :
|
||||
@ -6345,8 +6434,10 @@ relink_command=\"$relink_command\""
|
||||
if test -f "$dir/$objdir/$dlname"; then
|
||||
dir="$dir/$objdir"
|
||||
else
|
||||
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
|
||||
exit $EXIT_FAILURE
|
||||
if test ! -f "$dir/$dlname"; then
|
||||
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
@ -6410,12 +6501,12 @@ relink_command=\"$relink_command\""
|
||||
fi
|
||||
|
||||
# Restore saved environment variables
|
||||
if test "${save_LC_ALL+set}" = set; then
|
||||
LC_ALL="$save_LC_ALL"; export LC_ALL
|
||||
fi
|
||||
if test "${save_LANG+set}" = set; then
|
||||
LANG="$save_LANG"; export LANG
|
||||
fi
|
||||
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
|
||||
do
|
||||
eval "if test \"\${save_$lt_var+set}\" = set; then
|
||||
$lt_var=\$save_$lt_var; export $lt_var
|
||||
fi"
|
||||
done
|
||||
|
||||
# Now prepare to actually exec the command.
|
||||
exec_cmd="\$cmd$args"
|
||||
@ -6772,9 +6863,9 @@ The following components of LINK-COMMAND are treated specially:
|
||||
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
|
||||
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
|
||||
-export-symbols SYMFILE
|
||||
try to export only the symbols listed in SYMFILE
|
||||
try to export only the symbols listed in SYMFILE
|
||||
-export-symbols-regex REGEX
|
||||
try to export only the symbols matching REGEX
|
||||
try to export only the symbols matching REGEX
|
||||
-LLIBDIR search LIBDIR for required installed libraries
|
||||
-lNAME OUTPUT-FILE requires the installed library libNAME
|
||||
-module build a library that can dlopened
|
||||
@ -6788,9 +6879,11 @@ The following components of LINK-COMMAND are treated specially:
|
||||
-release RELEASE specify package release information
|
||||
-rpath LIBDIR the created library will eventually be installed in LIBDIR
|
||||
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
|
||||
-static do not do any dynamic linking of libtool libraries
|
||||
-static do not do any dynamic linking of uninstalled libtool libraries
|
||||
-static-libtool-libs
|
||||
do not do any dynamic linking of libtool libraries
|
||||
-version-info CURRENT[:REVISION[:AGE]]
|
||||
specify library version info [each variable defaults to 0]
|
||||
specify library version info [each variable defaults to 0]
|
||||
|
||||
All other options (arguments beginning with \`-') are ignored.
|
||||
|
||||
|
@ -59,10 +59,11 @@ geode_drv_la_SOURCES = \
|
||||
panel.c \
|
||||
lx_driver.c \
|
||||
lx_cursor.c \
|
||||
lx_memory.c \
|
||||
lx_panel.c \
|
||||
lx_output.c \
|
||||
lx_display.c \
|
||||
lx_video.c \
|
||||
lx_regacc.c \
|
||||
lx_rotate.c \
|
||||
lx_randr.c \
|
||||
lx_exa.c \
|
||||
cimarron.c \
|
||||
geode_pcirename.h
|
||||
|
@ -79,8 +79,8 @@ am_geode_drv_la_OBJECTS = geode_driver.lo geode_common.lo \
|
||||
geode_dcon.lo geode_ddc.lo geode_msr.lo gx_driver.lo \
|
||||
gx_accel.lo gx_cursor.lo gx_video.lo gx_regacc.lo gx_rotate.lo \
|
||||
gx_randr.lo durango.lo panel.lo lx_driver.lo lx_cursor.lo \
|
||||
lx_video.lo lx_regacc.lo lx_rotate.lo lx_randr.lo lx_exa.lo \
|
||||
cimarron.lo
|
||||
lx_memory.lo lx_panel.lo lx_output.lo lx_display.lo \
|
||||
lx_video.lo lx_exa.lo cimarron.lo
|
||||
geode_drv_la_OBJECTS = $(am_geode_drv_la_OBJECTS)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@ -116,6 +116,7 @@ CCAS = @CCAS@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
@ -128,6 +129,7 @@ DEPDIR = @DEPDIR@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DRIVER_NAME = @DRIVER_NAME@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
@ -138,6 +140,9 @@ F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
|
||||
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
|
||||
I386ARCH_FALSE = @I386ARCH_FALSE@
|
||||
I386ARCH_TRUE = @I386ARCH_TRUE@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
@ -158,6 +163,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
@ -170,19 +176,18 @@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
|
||||
PCIACCESS_LIBS = @PCIACCESS_LIBS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XEXT_CFLAGS = @XEXT_CFLAGS@
|
||||
XEXT_LIBS = @XEXT_LIBS@
|
||||
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@
|
||||
@ -199,24 +204,32 @@ build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
distcleancheck_listfiles = @distcleancheck_listfiles@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
moduledir = @moduledir@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
@ -263,10 +276,11 @@ geode_drv_la_SOURCES = \
|
||||
panel.c \
|
||||
lx_driver.c \
|
||||
lx_cursor.c \
|
||||
lx_memory.c \
|
||||
lx_panel.c \
|
||||
lx_output.c \
|
||||
lx_display.c \
|
||||
lx_video.c \
|
||||
lx_regacc.c \
|
||||
lx_rotate.c \
|
||||
lx_randr.c \
|
||||
lx_exa.c \
|
||||
cimarron.c \
|
||||
geode_pcirename.h
|
||||
@ -429,11 +443,12 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_rotate.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_video.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_cursor.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_display.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_driver.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_exa.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_randr.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_regacc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_rotate.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_memory.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_output.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_panel.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_video.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panel.Plo@am__quote@
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) 2006 Advanced Micro Devices, Inc.
|
||||
* (c) 2006-2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@ -28,6 +28,7 @@
|
||||
#define _GEODE_H_
|
||||
|
||||
#include "geode_pcirename.h"
|
||||
#include "config.h"
|
||||
|
||||
#include "xaa.h"
|
||||
#include "exa.h"
|
||||
@ -59,7 +60,7 @@
|
||||
#define LX 0x20
|
||||
|
||||
#define PCI_VENDOR_ID_CYRIX 0x1078
|
||||
#define PCI_VENDOR_ID_NS 0x100B
|
||||
#define PCI_VENDOR_ID_NS 0x100b
|
||||
#define PCI_VENDOR_ID_AMD 0x1022
|
||||
|
||||
#define PCI_CHIP_5530 0x0104
|
||||
@ -88,46 +89,22 @@
|
||||
#define GFX2(func) gfx2_##func
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LX
|
||||
#define LX_FILL_RECT_SUPPORT 1
|
||||
#define LX_BRES_LINE_SUPPORT 1
|
||||
#define LX_DASH_LINE_SUPPORT 1
|
||||
#define LX_MONO_8X8_PAT_SUPPORT 1
|
||||
#define LX_CLREXP_8X8_PAT_SUPPORT 1
|
||||
#define LX_SCR2SCREXP_SUPPORT 1
|
||||
#define LX_SCR2SCRCPY_SUPPORT 1
|
||||
#define LX_CPU2SCREXP_SUPPORT 1
|
||||
#define LX_SCANLINE_SUPPORT 1
|
||||
#define LX_USE_OFFSCRN_MEM 1
|
||||
#define LX_WRITE_PIXMAP_SUPPORT 1
|
||||
#endif
|
||||
|
||||
#define DEBUGTIM 0
|
||||
#define DEBUGLVL 0
|
||||
|
||||
#ifndef DEBUGTIM
|
||||
#define DEBUGTIM 0
|
||||
#endif
|
||||
#ifndef DEBUGLVL
|
||||
#define DEBUGLVL 0
|
||||
#endif
|
||||
|
||||
#define GEODEPTR(p) ((GeodeRec *)((p)->driverPrivate))
|
||||
|
||||
#define DEFAULT_IMG_LINE_BUFS 20
|
||||
#define DEFAULT_CLR_LINE_BUFS 20
|
||||
#define DEFAULT_EXA_SCRATCH_BFRSZ 0x40000
|
||||
|
||||
/* 64x64 cursor used as 32x32 */
|
||||
#define HW_CURSOR_W 64
|
||||
#define HW_CURSOR_H 64
|
||||
/* the LX hardware (and Cimarron) require a cursor memory size of 48x64.. */
|
||||
#define LX_CURSOR_HW_WIDTH 48
|
||||
#define LX_CURSOR_HW_HEIGHT 64
|
||||
|
||||
/* ...but xorg requires the cursor width to be a multiple of 32. This is
|
||||
the size of the *actual* cursor. */
|
||||
#define LX_CURSOR_MAX_WIDTH 32
|
||||
#define LX_CURSOR_MAX_HEIGHT 32
|
||||
|
||||
/* FIXME: Get rid of this from GX */
|
||||
|
||||
#define MYDBG 1
|
||||
#if defined(MYDBG)
|
||||
#define DEBUGMSG(cond, drv_msg) if((cond)) xf86DrvMsg drv_msg
|
||||
#else
|
||||
#define DEBUGMSG(cond, drv_msg)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LX
|
||||
extern unsigned char cim_inb(unsigned short port);
|
||||
@ -139,17 +116,13 @@ extern void cim_outd(unsigned short port, unsigned long data);
|
||||
|
||||
#include "cim_rtns.h"
|
||||
|
||||
#define CIM_CMD_BFR_SZ 0x200000L
|
||||
#define CIM_CMD_BFR_MIN 0x20000L
|
||||
|
||||
typedef struct tag_CIM_DISPLAYTIMING
|
||||
typedef struct _CIM_DISPLAYTIMING
|
||||
{
|
||||
unsigned short wPitch;
|
||||
unsigned short wBpp;
|
||||
|
||||
VG_DISPLAY_MODE vgDisplayMode;
|
||||
}
|
||||
CIM_DISPLAYTIMING;
|
||||
} CIM_DISPLAYTIMING;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GX
|
||||
@ -172,18 +145,6 @@ extern void gfx_outd(unsigned short port, unsigned long data);
|
||||
#undef Q_WORD
|
||||
#include "panel.h"
|
||||
|
||||
typedef struct __TVPARAMS
|
||||
{
|
||||
unsigned int dwFlags;
|
||||
unsigned short wWidth;
|
||||
unsigned short wHeight;
|
||||
unsigned short wStandard;
|
||||
unsigned short wType;
|
||||
unsigned short wOutput;
|
||||
unsigned short wResolution;
|
||||
Bool bState;
|
||||
} TVPARAMS;
|
||||
|
||||
typedef struct tag_GFX_DISPLAYTIMING
|
||||
{
|
||||
unsigned int dwDotClock;
|
||||
@ -204,31 +165,20 @@ typedef struct tag_GFX_DISPLAYTIMING
|
||||
unsigned short wPolarity;
|
||||
} GFX_DISPLAYTIMING;
|
||||
|
||||
/* TV Timings */
|
||||
typedef struct __TVTIMING
|
||||
{
|
||||
unsigned long HorzTim;
|
||||
unsigned long HorzSync;
|
||||
unsigned long VertSync;
|
||||
unsigned long LineEnd;
|
||||
unsigned long VertDownscale;
|
||||
unsigned long HorzScaling;
|
||||
unsigned long TimCtrl1;
|
||||
unsigned long TimCtrl2;
|
||||
unsigned long Subfreq;
|
||||
unsigned long DispPos;
|
||||
unsigned long DispSize;
|
||||
unsigned long Debug;
|
||||
unsigned long DacCtrl;
|
||||
unsigned int DotClock;
|
||||
} TVTIMING;
|
||||
#endif
|
||||
|
||||
typedef struct _VESARec
|
||||
{
|
||||
xf86Int10InfoPtr pInt;
|
||||
}
|
||||
VESARec;
|
||||
} VESARec;
|
||||
|
||||
typedef struct _GeodeMemRec
|
||||
{
|
||||
struct _GeodeMemRec *next;
|
||||
struct _GeodeMemRec *prev;
|
||||
unsigned int offset;
|
||||
int size;
|
||||
} GeodeMemRec, *GeodeMemPtr;
|
||||
|
||||
#define OUTPUT_PANEL 0x01
|
||||
#define OUTPUT_CRT 0x02
|
||||
@ -238,10 +188,8 @@ VESARec;
|
||||
|
||||
typedef struct _geodeRec
|
||||
{
|
||||
/* Common */
|
||||
|
||||
/* Common for both GX and LX */
|
||||
int Output; /* Bitmask indicating the valid output options */
|
||||
|
||||
Bool HWCursor;
|
||||
Bool NoAccel;
|
||||
Bool useVGA;
|
||||
@ -254,40 +202,118 @@ typedef struct _geodeRec
|
||||
Bool starting;
|
||||
Bool tryCompression;
|
||||
Bool tryHWCursor;
|
||||
unsigned int shadowSize;
|
||||
unsigned int shadowOffset;
|
||||
|
||||
ExaOffscreenArea *shadowArea;
|
||||
|
||||
DisplayModePtr curMode;
|
||||
VG_COMPRESSION_DATA CBData;
|
||||
int mm_width, mm_height; /* physical display size */
|
||||
|
||||
unsigned long CursorStartOffset;
|
||||
unsigned int CursorSize;
|
||||
xf86CursorInfoPtr CursorInfo;
|
||||
int CursorXHot;
|
||||
int CursorYHot;
|
||||
|
||||
/* Geometry information */
|
||||
unsigned int maxWidth; /* Maximum possible width of the screen */
|
||||
unsigned int maxHeight; /* Maximum possible height of the screen */
|
||||
|
||||
int Pitch; /* display FB pitch */
|
||||
|
||||
int displayPitch; /* The pitch ofthe visible area */
|
||||
int displayOffset; /* The offset of the visible area */
|
||||
int displaySize; /* The size of the visibile area */
|
||||
|
||||
/* Framebuffer memory */
|
||||
|
||||
unsigned char *FBBase;
|
||||
unsigned int FBAvail;
|
||||
|
||||
/* EXA structures */
|
||||
|
||||
ExaDriverPtr pExa;
|
||||
unsigned int exaBfrOffset;
|
||||
unsigned int exaBfrSz;
|
||||
|
||||
/* Other structures */
|
||||
|
||||
EntityInfoPtr pEnt;
|
||||
ScreenBlockHandlerProcPtr BlockHandler; /* needed for video */
|
||||
XF86VideoAdaptorPtr adaptor;
|
||||
|
||||
/* State save structures */
|
||||
unsigned long FBDisplayOffset;
|
||||
unsigned long PrevDisplayOffset;
|
||||
|
||||
VESARec *vesa;
|
||||
|
||||
int FBCompressionEnable;
|
||||
|
||||
VG_CURSOR_DATA FBCursor;
|
||||
|
||||
/* Save the Cursor offset of the FB */
|
||||
unsigned long FBCursorOffset;
|
||||
unsigned char FBBIOSMode;
|
||||
|
||||
/* Hooks */
|
||||
|
||||
void (*PointerMoved) (int index, int x, int y);
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
Bool(*CreateScreenResources) (ScreenPtr);
|
||||
|
||||
/* ===== LX specific items ===== */
|
||||
|
||||
/* Flags */
|
||||
Bool Scale;
|
||||
|
||||
DisplayModePtr panelMode; /* The mode for the panel (if attached) */
|
||||
|
||||
/* Command buffer information */
|
||||
unsigned long CmdBfrOffset;
|
||||
unsigned long CmdBfrSize;
|
||||
|
||||
/* Memory Management */
|
||||
GeodeMemPtr offscreenList;
|
||||
unsigned int offscreenStart;
|
||||
unsigned int offscreenSize;
|
||||
|
||||
/* Save state */
|
||||
VG_COMPRESSION_DATA CBData;
|
||||
VG_COMPRESSION_DATA FBCBData;
|
||||
CIM_DISPLAYTIMING FBcimdisplaytiming;
|
||||
|
||||
/* ===== GX specific items ===== */
|
||||
|
||||
/* Flags */
|
||||
Bool Panel;
|
||||
|
||||
int PanelX;
|
||||
int PanelY;
|
||||
|
||||
/* Framebuffer memory */
|
||||
int displayPitch; /* The pitch ofthe visible area */
|
||||
int displayOffset; /* The offset of the visible area */
|
||||
|
||||
unsigned long FBLinearAddr;
|
||||
unsigned char *FBBase;
|
||||
unsigned int FBAvail;
|
||||
unsigned int FBOffset;
|
||||
unsigned int FBSize;
|
||||
DisplayModePtr curMode;
|
||||
|
||||
unsigned int shadowSize;
|
||||
unsigned int shadowOffset;
|
||||
|
||||
int FBVGAActive;
|
||||
|
||||
xf86CursorInfoPtr CursorInfo;
|
||||
|
||||
/* XAA structures */
|
||||
|
||||
unsigned int cpySrcOffset;
|
||||
int cpySrcPitch, cpySrcBpp;
|
||||
int cpyDx, cpyDy;
|
||||
unsigned int cmpSrcOffset;
|
||||
int cmpSrcPitch, cmpSrcBpp;
|
||||
unsigned int cmpSrcFmt, cmpDstFmt;
|
||||
int cmpOp;
|
||||
|
||||
unsigned char **AccelImageWriteBuffers;
|
||||
int NoOfImgBuffers;
|
||||
unsigned char **AccelColorExpandBuffers;
|
||||
int NoOfColorExpandLines;
|
||||
XAAInfoRecPtr AccelInfoRec;
|
||||
|
||||
/* Save state */
|
||||
unsigned long FBCompressionOffset;
|
||||
unsigned short FBCompressionPitch;
|
||||
unsigned short FBCompressionSize;
|
||||
GFX_DISPLAYTIMING FBgfxdisplaytiming;
|
||||
|
||||
/* Hooks */
|
||||
void (*WritePixmap) (ScrnInfoPtr pScrni, int x, int y, int w, int h,
|
||||
unsigned char *src, int srcwidth, int rop,
|
||||
unsigned int planemask, int trans, int bpp, int depth);
|
||||
|
||||
/* Video information */
|
||||
int video_x;
|
||||
@ -302,99 +328,6 @@ typedef struct _geodeRec
|
||||
int video_offset;
|
||||
ScrnInfoPtr video_scrnptr;
|
||||
BOOL OverlayON;
|
||||
int videoKey;
|
||||
|
||||
/* EXA structures */
|
||||
|
||||
ExaDriverPtr pExa;
|
||||
unsigned int exaBfrOffset;
|
||||
unsigned int exaBfrSz;
|
||||
|
||||
/* XAA structures */
|
||||
unsigned char **AccelImageWriteBuffers;
|
||||
int NoOfImgBuffers;
|
||||
unsigned char **AccelColorExpandBuffers;
|
||||
int NoOfColorExpandLines;
|
||||
XAAInfoRecPtr AccelInfoRec;
|
||||
|
||||
/* Other structures */
|
||||
|
||||
EntityInfoPtr pEnt;
|
||||
ScreenBlockHandlerProcPtr BlockHandler; /* needed for video */
|
||||
XF86VideoAdaptorPtr adaptor;
|
||||
|
||||
/* State save structures */
|
||||
|
||||
gfx_vga_struct FBgfxVgaRegs;
|
||||
TVTIMING FBtvtiming;
|
||||
GFX_DISPLAYTIMING FBgfxdisplaytiming;
|
||||
CIM_DISPLAYTIMING FBcimdisplaytiming;
|
||||
|
||||
unsigned int FBTVActive;
|
||||
unsigned int FBSupport;
|
||||
unsigned long FBDisplayOffset;
|
||||
unsigned long PrevDisplayOffset;
|
||||
|
||||
VESARec *vesa;
|
||||
|
||||
int FBCompressionEnable;
|
||||
VG_COMPRESSION_DATA FBCBData;
|
||||
VG_CURSOR_DATA FBCursor;
|
||||
unsigned long FBCompressionOffset;
|
||||
unsigned short FBCompressionPitch;
|
||||
unsigned short FBCompressionSize;
|
||||
|
||||
/* Save the Cursor offset of the FB */
|
||||
unsigned long FBCursorOffset;
|
||||
unsigned char FBBIOSMode;
|
||||
|
||||
/* Hooks */
|
||||
|
||||
void (*WritePixmap) (ScrnInfoPtr pScrni, int x, int y, int w, int h,
|
||||
unsigned char *src, int srcwidth, int rop,
|
||||
unsigned int planemask, int trans, int bpp, int depth);
|
||||
|
||||
void (*PointerMoved) (int index, int x, int y);
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
Bool(*CreateScreenResources) (ScreenPtr);
|
||||
|
||||
/* LX only */
|
||||
|
||||
unsigned long CmdBfrOffset;
|
||||
unsigned long CmdBfrSize;
|
||||
|
||||
#ifdef HAVE_TVSUPPORT
|
||||
Bool TVSupport;
|
||||
int tv_encoder;
|
||||
int tv_bus_fmt;
|
||||
int tv_flags;
|
||||
int tv_601_fmt;
|
||||
int tv_601_flags;
|
||||
int tv_conversion;
|
||||
int tv_vsync_shift;
|
||||
int tv_vsync_shift_count;
|
||||
int tv_vsync_select;
|
||||
int tvox, tvoy;
|
||||
|
||||
TVPARAMS TvParam;
|
||||
|
||||
int TVOx, TVOy, TVOw, TVOh;
|
||||
Bool TV_Overscan_On;
|
||||
#endif
|
||||
|
||||
/* To be killed! */
|
||||
|
||||
int FBVGAActive;
|
||||
unsigned int cpySrcOffset;
|
||||
int cpySrcPitch, cpySrcBpp;
|
||||
int cpyDx, cpyDy;
|
||||
unsigned int cmpSrcOffset;
|
||||
int cmpSrcPitch, cmpSrcBpp;
|
||||
unsigned int cmpSrcFmt, cmpDstFmt;
|
||||
int cmpOp;
|
||||
|
||||
Bool Panel;
|
||||
|
||||
}
|
||||
GeodeRec, *GeodePtr;
|
||||
|
||||
@ -406,16 +339,14 @@ enum
|
||||
LX_OPTION_HW_CURSOR,
|
||||
LX_OPTION_NOCOMPRESSION,
|
||||
LX_OPTION_NOACCEL,
|
||||
LX_OPTION_ACCEL_METHOD,
|
||||
LX_OPTION_EXA_SCRATCH_BFRSZ,
|
||||
LX_OPTION_TV_SUPPORT,
|
||||
LX_OPTION_TV_OUTPUT,
|
||||
LX_OPTION_TV_OVERSCAN,
|
||||
LX_OPTION_ROTATE,
|
||||
LX_OPTION_NOPANEL,
|
||||
LX_OPTION_COLOR_KEY,
|
||||
LX_OPTION_FBSIZE,
|
||||
LX_OPTION_PANEL_GEOMETRY,
|
||||
LX_OPTION_PANEL_MODE,
|
||||
LX_OPTION_DONT_PROGRAM
|
||||
}
|
||||
LX_GeodeOpts;
|
||||
@ -435,10 +366,6 @@ enum
|
||||
GX_OPTION_TV_OVERSCAN,
|
||||
GX_OPTION_ROTATE,
|
||||
GX_OPTION_NOPANEL,
|
||||
GX_OPTION_FLATPANEL_INFO,
|
||||
GX_OPTION_FLATPANEL_IN_BIOS,
|
||||
GX_OPTION_COLOR_KEY,
|
||||
GX_OPTION_OSM,
|
||||
GX_OPTION_OSM_IMG_BUFS,
|
||||
GX_OPTION_OSM_CLR_BUFS,
|
||||
GX_OPTION_FBSIZE,
|
||||
@ -448,16 +375,9 @@ enum
|
||||
GX_GeodeOpts;
|
||||
#endif
|
||||
|
||||
/* OLPC defines */
|
||||
|
||||
#define DCON_DEFAULT_XRES 1200
|
||||
#define DCON_DEFAULT_YRES 900
|
||||
#define DCON_DEFAULT_BPP 16
|
||||
#define DCON_DEFAULT_REFRESH 50
|
||||
|
||||
/* geode_dcon.c */
|
||||
extern Bool dcon_init(ScrnInfoPtr pScrni);
|
||||
extern int DCONDPMSSet(ScrnInfoPtr pScrni, int mode, int flags);
|
||||
extern int DCONDPMSSet(ScrnInfoPtr pScrni, int mode);
|
||||
|
||||
/* geode_common.c */
|
||||
|
||||
@ -479,6 +399,8 @@ Bool RegionsEqual(RegionPtr A, RegionPtr B);
|
||||
|
||||
void GeodeProbeDDC(ScrnInfoPtr pScrni, int index);
|
||||
xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index);
|
||||
Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name);
|
||||
|
||||
int GeodeGetFPGeometry(const char *str, int *width, int *height);
|
||||
void GeodePointerMoved(int index, int x, int y);
|
||||
void GeodeFreeScreen(int scrnIndex, int flags);
|
||||
@ -498,7 +420,8 @@ void GXShowCursor(ScrnInfoPtr pScrni);
|
||||
/* gx_randr.c */
|
||||
Rotation GXGetRotation(ScreenPtr pScreen);
|
||||
Bool GXRandRInit(ScreenPtr pScreen, int rotation);
|
||||
Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize);
|
||||
extern _X_EXPORT Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
|
||||
int rate, RRScreenSizePtr pSize);
|
||||
|
||||
/* gx_rotate.c */
|
||||
Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode);
|
||||
@ -515,24 +438,36 @@ void LXSetupChipsetFPtr(ScrnInfoPtr pScrn);
|
||||
|
||||
/* lx_cursor.c */
|
||||
Bool LXHWCursorInit(ScreenPtr pScrn);
|
||||
void LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src);
|
||||
void LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src);
|
||||
void LXHideCursor(ScrnInfoPtr pScrni);
|
||||
void LXShowCursor(ScrnInfoPtr pScrni);
|
||||
|
||||
/* lx_randr.c */
|
||||
Rotation LXGetRotation(ScreenPtr pScreen);
|
||||
Bool LXRandRInit(ScreenPtr pScreen, int rotation);
|
||||
Bool LXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize);
|
||||
|
||||
/* lx_rotate.c */
|
||||
Bool LXSetRotatePitch(ScrnInfoPtr pScrni);
|
||||
Bool LXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode);
|
||||
Bool LXAllocShadow(ScrnInfoPtr pScrni);
|
||||
|
||||
/* lx_exa.c */
|
||||
Bool LXExaInit(ScreenPtr pScreen);
|
||||
|
||||
/* lx_video.c */
|
||||
void LXInitVideo(ScreenPtr pScrn);
|
||||
|
||||
/* lx_output.c */
|
||||
void LXSetupOutput(ScrnInfoPtr);
|
||||
|
||||
/* lx_panel.c */
|
||||
DisplayModePtr LXGetLegacyPanelMode(void);
|
||||
DisplayModePtr LXGetManualPanelMode(char *modestr);
|
||||
|
||||
void LXAdjustFrame(int scrnIndex, int x, int y, int flags);
|
||||
|
||||
/* lx_display.c */
|
||||
void LXSetupCrtc(ScrnInfoPtr pScrni);
|
||||
|
||||
/* lx_memory.c */
|
||||
GeodeMemPtr GeodeAllocOffscreen(GeodeRec * pGeode, int size, int align);
|
||||
void GeodeFreeOffscreen(GeodeRec * pGeode, GeodeMemPtr ptr);
|
||||
void LXInitOffscreen(ScrnInfoPtr pScrni);
|
||||
void GeodeCloseOffscreen(ScrnInfoPtr pScrni);
|
||||
unsigned int GeodeOffscreenFreeSize(GeodeRec * pGeode);
|
||||
|
||||
/* lx_cursor.c */
|
||||
Bool LXCursorInit(ScreenPtr pScrn);
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,6 @@
|
||||
/* Includes that are used by all drivers */
|
||||
#include <xf86.h>
|
||||
#include <xf86_OSproc.h>
|
||||
#include <xf86Resources.h>
|
||||
#include <compiler.h>
|
||||
|
||||
#include "geode.h"
|
||||
@ -45,13 +44,13 @@ dcon_present(void)
|
||||
static int _dval = -1;
|
||||
|
||||
if (_dval == -1)
|
||||
_dval = (access("/sys/devices/platform/dcon", F_OK) == 0);
|
||||
_dval = (access("/sys/class/power_supply/olpc-ac", F_OK) == 0);
|
||||
|
||||
return (Bool) _dval;
|
||||
}
|
||||
|
||||
int
|
||||
DCONDPMSSet(ScrnInfoPtr pScrni, int mode, int flags)
|
||||
DCONDPMSSet(ScrnInfoPtr pScrni, int mode)
|
||||
{
|
||||
static int failed = -1;
|
||||
int fd;
|
||||
@ -92,19 +91,39 @@ dcon_init(ScrnInfoPtr pScrni)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
pGeode->mm_width = 0;
|
||||
pGeode->mm_height = 0;
|
||||
|
||||
if (!dcon_present()) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "No DCON is present\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pGeode->panelMode = xnfcalloc(1, sizeof(DisplayModeRec));
|
||||
if (pGeode->panelMode == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Set up the panel mode structure automagically */
|
||||
|
||||
pGeode->panelMode->type = M_T_DRIVER|M_T_PREFERRED;
|
||||
pGeode->panelMode->Clock = 57275;
|
||||
pGeode->panelMode->HDisplay = 1200;
|
||||
pGeode->panelMode->HSyncStart = 1208;
|
||||
pGeode->panelMode->HSyncEnd = 1216;
|
||||
pGeode->panelMode->HTotal = 1240;
|
||||
pGeode->panelMode->VDisplay = 900;
|
||||
pGeode->panelMode->VSyncStart = 905;
|
||||
pGeode->panelMode->VSyncEnd = 908;
|
||||
pGeode->panelMode->VTotal = 912;
|
||||
pGeode->panelMode->Flags = V_NHSYNC | V_NVSYNC;
|
||||
|
||||
pGeode->mm_width = 152;
|
||||
pGeode->mm_height = 114;
|
||||
|
||||
xf86SetModeDefaultName(pGeode->panelMode);
|
||||
|
||||
/* TODO: Print board revision once sysfs exports it. */
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "DCON detected.\n");
|
||||
|
||||
/* Panel size setup */
|
||||
pGeode->PanelX = DCON_DEFAULT_XRES;
|
||||
pGeode->PanelY = DCON_DEFAULT_YRES;
|
||||
|
||||
/* FIXME: Mode setup should go here */
|
||||
/* FIXME: Controller setup should go here */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define DDC_CLK_LOW (DDC_SCL_PIN << 16)
|
||||
|
||||
#define CS5536_ISA_DEVICE 0x20901022
|
||||
#define CS5535_ISA_DEVICE 0x002b100b
|
||||
|
||||
static unsigned short
|
||||
geode_gpio_iobase(void)
|
||||
@ -64,11 +65,16 @@ geode_gpio_iobase(void)
|
||||
struct pci_device *pci;
|
||||
|
||||
/* The CS5536 GPIO device is always in the same slot: 00:0f.0 */
|
||||
/* The CS5535 device should be in same slot as well */
|
||||
|
||||
pci = pci_device_find_by_slot(0, 0, 0xF, 0x0);
|
||||
|
||||
if (pci == NULL)
|
||||
return 0;
|
||||
|
||||
if (pci_device_probe(pci) != 0)
|
||||
return 0;
|
||||
|
||||
/* The GPIO I/O address is in resource 1 */
|
||||
return (unsigned short)pci->regions[1].base_addr;
|
||||
#else
|
||||
@ -76,8 +82,12 @@ geode_gpio_iobase(void)
|
||||
|
||||
Tag = pciFindFirst(CS5536_ISA_DEVICE, 0xFFFFFFFF);
|
||||
|
||||
if (Tag == PCI_NOT_FOUND)
|
||||
return 0;
|
||||
if (Tag == PCI_NOT_FOUND) {
|
||||
Tag = pciFindFirst(CS5535_ISA_DEVICE, 0xFFFFFFFF);
|
||||
|
||||
if (Tag == PCI_NOT_FOUND)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The GPIO I/O address is in resource 1 */
|
||||
return (unsigned short)(pciReadLong(Tag, 0x14) & ~1);
|
||||
@ -106,19 +116,18 @@ geode_ddc_getbits(I2CBusPtr b, int *scl, int *sda)
|
||||
*sda = (dat & DDC_DATA_HIGH) ? 1 : 0;
|
||||
}
|
||||
|
||||
static xf86MonPtr
|
||||
GeodeGetDDC(ScrnInfoPtr pScrni)
|
||||
Bool
|
||||
GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name)
|
||||
{
|
||||
xf86MonPtr mon = NULL;
|
||||
I2CBusPtr bus;
|
||||
unsigned long ddciobase;
|
||||
unsigned int ddciobase;
|
||||
|
||||
ddciobase = geode_gpio_iobase();
|
||||
|
||||
if (ddciobase == 0) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Could not find the GPIO I/O base\n");
|
||||
return NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* The GPIO pins for DDC are multiplexed with a
|
||||
@ -130,43 +139,49 @@ GeodeGetDDC(ScrnInfoPtr pScrni)
|
||||
(inl(ddciobase + GPIO_OUT_AUX1) & DDC_DATA_HIGH)) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"GPIO pins are in serial mode. Assuming no DDC\n");
|
||||
return NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Set up the pins */
|
||||
|
||||
outl(ddciobase + GPIO_OUT_ENABLE, DDC_DATA_HIGH | DDC_CLK_HIGH);
|
||||
outl(ddciobase + GPIO_IN_ENABLE, DDC_DATA_HIGH | DDC_CLK_HIGH);
|
||||
|
||||
bus = xf86CreateI2CBusRec();
|
||||
|
||||
if (bus == NULL) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Could not create the I2C structre\n");
|
||||
goto err;
|
||||
}
|
||||
if (!bus)
|
||||
return FALSE;
|
||||
|
||||
bus->BusName = "CS5536 DDC BUS";
|
||||
bus->BusName = name;
|
||||
bus->scrnIndex = pScrni->scrnIndex;
|
||||
|
||||
bus->I2CGetBits = geode_ddc_getbits;
|
||||
bus->I2CPutBits = geode_ddc_putbits;
|
||||
bus->DriverPrivate.ptr = (void *)(ddciobase);
|
||||
|
||||
if (xf86I2CBusInit(bus)) {
|
||||
mon = xf86DoEDID_DDC2(pScrni->scrnIndex, bus);
|
||||
if (!xf86I2CBusInit(bus))
|
||||
return FALSE;
|
||||
|
||||
*ptr = bus;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static xf86MonPtr
|
||||
GeodeGetDDC(ScrnInfoPtr pScrni)
|
||||
{
|
||||
xf86MonPtr mon = NULL;
|
||||
I2CBusPtr bus;
|
||||
|
||||
if (!GeodeI2CInit(pScrni, &bus, "CS5536 DDC BUS"))
|
||||
return NULL;
|
||||
|
||||
mon = xf86DoEDID_DDC2(pScrni->scrnIndex, bus);
|
||||
|
||||
#if (XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,4,99,0,0))
|
||||
if (mon)
|
||||
xf86DDCApplyQuirks(pScrni->scrnIndex, mon);
|
||||
if (mon)
|
||||
xf86DDCApplyQuirks(pScrni->scrnIndex, mon);
|
||||
#endif
|
||||
}
|
||||
|
||||
xf86DestroyI2CBusRec(bus, FALSE, FALSE);
|
||||
|
||||
err:
|
||||
outl(ddciobase + GPIO_OUT_ENABLE, DDC_DATA_LOW | DDC_CLK_LOW);
|
||||
outl(ddciobase + GPIO_IN_ENABLE, DDC_DATA_LOW | DDC_CLK_LOW);
|
||||
|
||||
return mon;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,9 @@
|
||||
/* Includes that are used by all drivers */
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
|
||||
#include "xf86Resources.h"
|
||||
#endif
|
||||
#include "compiler.h"
|
||||
#include "xf86PciInfo.h"
|
||||
#include "xf86Pci.h"
|
||||
@ -72,8 +74,13 @@
|
||||
#ifdef DPMSExtension
|
||||
#include "globals.h"
|
||||
#include "opaque.h"
|
||||
#ifdef HAVE_XEXTPROTO_71
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#else
|
||||
#define DPMS_SERVER
|
||||
#include <X11/extensions/dpms.h>
|
||||
#endif
|
||||
|
||||
#endif /* DPMSExtension */
|
||||
|
||||
/* A few things all drivers should have */
|
||||
@ -191,16 +198,14 @@ OptionInfoRec LX_GeodeOptions[] = {
|
||||
{LX_OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE},
|
||||
{LX_OPTION_NOCOMPRESSION, "NoCompression", OPTV_BOOLEAN, {0}, FALSE},
|
||||
{LX_OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE},
|
||||
{LX_OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE},
|
||||
{LX_OPTION_TV_SUPPORT, "TV", OPTV_ANYSTR, {0}, FALSE},
|
||||
{LX_OPTION_TV_OUTPUT, "TV_Output", OPTV_ANYSTR, {0}, FALSE},
|
||||
{LX_OPTION_TV_OVERSCAN, "TVOverscan", OPTV_ANYSTR, {0}, FALSE},
|
||||
{LX_OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE},
|
||||
{LX_OPTION_NOPANEL, "NoPanel", OPTV_BOOLEAN, {0}, FALSE},
|
||||
{LX_OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
|
||||
{LX_OPTION_EXA_SCRATCH_BFRSZ, "ExaScratch", OPTV_INTEGER, {0}, FALSE},
|
||||
{LX_OPTION_FBSIZE, "FBSize", OPTV_INTEGER, {0}, FALSE},
|
||||
{LX_OPTION_PANEL_GEOMETRY, "PanelGeometry", OPTV_STRING, {0}, FALSE},
|
||||
{LX_OPTION_PANEL_MODE, "PanelMode", OPTV_STRING, {0}, FALSE},
|
||||
{-1, NULL, OPTV_NONE, {0}, FALSE}
|
||||
};
|
||||
|
||||
@ -219,7 +224,6 @@ OptionInfoRec GX_GeodeOptions[] = {
|
||||
{GX_OPTION_TV_OVERSCAN, "TVOverscan", OPTV_ANYSTR, {0}, FALSE},
|
||||
{GX_OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE},
|
||||
{GX_OPTION_NOPANEL, "NoPanel", OPTV_BOOLEAN, {0}, FALSE},
|
||||
{GX_OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
|
||||
{GX_OPTION_OSM_IMG_BUFS, "OSMImageBuffers", OPTV_INTEGER, {0}, FALSE},
|
||||
{GX_OPTION_OSM_CLR_BUFS, "OSMColorExpBuffers", OPTV_INTEGER, {0}, FALSE},
|
||||
{GX_OPTION_FBSIZE, "FBSize", OPTV_INTEGER, {0}, FALSE},
|
||||
@ -232,69 +236,6 @@ OptionInfoRec no_GeodeOptions[] = {
|
||||
{-1, NULL, OPTV_NONE, {0}, FALSE}
|
||||
};
|
||||
|
||||
/* List of symbols from other modules that this module references.The purpose
|
||||
* is that to avoid unresolved symbol warnings
|
||||
*/
|
||||
const char *amdVgahwSymbols[] = {
|
||||
"vgaHWGetHWRec",
|
||||
"vgaHWUnlock",
|
||||
"vgaHWInit",
|
||||
"vgaHWSave",
|
||||
"vgaHWRestore",
|
||||
"vgaHWProtect",
|
||||
"vgaHWGetIOBase",
|
||||
"vgaHWMapMem",
|
||||
"vgaHWLock",
|
||||
"vgaHWFreeHWRec",
|
||||
"vgaHWSaveScreen",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *amdVbeSymbols[] = {
|
||||
"VBEInit",
|
||||
"vbeDoEDID",
|
||||
"vbeFree",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *amdInt10Symbols[] = {
|
||||
"xf86ExecX86int10",
|
||||
"xf86InitInt10",
|
||||
"xf86Int10AllocPages",
|
||||
"xf86Int10Addr",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *amdFbSymbols[] = {
|
||||
"fbScreenInit",
|
||||
"fbPictureInit",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *amdXaaSymbols[] = {
|
||||
"XAADestroyInfoRec",
|
||||
"XAACreateInfoRec",
|
||||
"XAAInit",
|
||||
"XAAScreenIndex",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *amdExaSymbols[] = {
|
||||
"exaGetVersion",
|
||||
"exaDriverInit",
|
||||
"exaDriverFini",
|
||||
"exaOffscreenAlloc",
|
||||
"exaOffscreenFree",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *amdRamdacSymbols[] = {
|
||||
"xf86InitCursor",
|
||||
"xf86CreateCursorInfoRec",
|
||||
"xf86DestroyCursorInfoRec",
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef XFree86LOADER
|
||||
|
||||
/* Module loader interface */
|
||||
@ -344,9 +285,6 @@ GeodeSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
|
||||
init = TRUE;
|
||||
xf86AddDriver(&GEODE, Module, flag);
|
||||
|
||||
LoaderRefSymLists(amdVgahwSymbols, amdVbeSymbols,
|
||||
amdFbSymbols, amdXaaSymbols, amdInt10Symbols, amdRamdacSymbols, NULL);
|
||||
|
||||
return (pointer) TRUE;
|
||||
}
|
||||
|
||||
@ -365,12 +303,6 @@ AmdSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
|
||||
#endif
|
||||
);
|
||||
|
||||
/* Tell the loader about symbols from other modules that this
|
||||
* module might refer to.
|
||||
*/
|
||||
LoaderRefSymLists(amdVgahwSymbols, amdVbeSymbols,
|
||||
amdFbSymbols, amdXaaSymbols,
|
||||
amdInt10Symbols, amdRamdacSymbols, NULL);
|
||||
return (pointer) TRUE;
|
||||
}
|
||||
|
||||
@ -546,11 +478,12 @@ AmdProbe(DriverPtr drv, int flags)
|
||||
/* so take the first one */
|
||||
for (i = 0; i < numUsed; i++) {
|
||||
/* Allocate a ScrnInfoRec */
|
||||
ScrnInfoPtr pScrni = xf86AllocateScreen(drv, 0);
|
||||
|
||||
ScrnInfoPtr pScrni = NULL;
|
||||
EntityInfoPtr pEnt = xf86GetEntityInfo(usedChips[i]);
|
||||
PciChipsets *p_id;
|
||||
|
||||
pScrni = xf86ConfigPciEntity(pScrni, 0, usedChips[i],
|
||||
GeodePCIchipsets, NULL, NULL, NULL, NULL, NULL);
|
||||
for (p_id = GeodePCIchipsets; p_id->numChipset != -1;
|
||||
p_id++) {
|
||||
if (pEnt->chipset == p_id->numChipset) {
|
||||
@ -587,8 +520,7 @@ AmdProbe(DriverPtr drv, int flags)
|
||||
drvr_setup(pScrni);
|
||||
|
||||
foundScreen = TRUE;
|
||||
xf86ConfigActivePciEntity(pScrni, usedChips[i],
|
||||
GeodePCIchipsets, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1757,8 +1757,8 @@ amd_gx_exa_Composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
|
||||
int maskY, int dstX, int dstY, int width, int height)
|
||||
{
|
||||
int op, current_line, max_lines, lines, pass, scratchPitch;
|
||||
unsigned int srcOffset, srcOfs=0, srcPitch, srcPch=0, srcBpp;
|
||||
unsigned int dstOffset, dstOfs=0, dstPitch, dstPch=0, dstBpp;
|
||||
unsigned int srcOffset, srcOfs = 0, srcPitch, srcPch = 0, srcBpp;
|
||||
unsigned int dstOffset, dstOfs = 0, dstPitch, dstPch = 0, dstBpp;
|
||||
unsigned int sizes, strides, blt_mode = 0, rop = 0;
|
||||
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
|
||||
|
||||
|
@ -35,7 +35,9 @@
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
|
||||
#include "xf86Resources.h"
|
||||
#endif
|
||||
#include "xf86cmap.h"
|
||||
#include "compiler.h"
|
||||
#include "mipointer.h"
|
||||
@ -68,15 +70,10 @@
|
||||
#define GX_GP_REG_SIZE 0x4000
|
||||
#define GX_VID_REG_SIZE 0x4000
|
||||
|
||||
extern OptionInfoRec GX_GeodeOptions[];
|
||||
#define DEFAULT_IMG_LINE_BUFS 20
|
||||
#define DEFAULT_CLR_LINE_BUFS 20
|
||||
|
||||
extern const char *amdVgahwSymbols[];
|
||||
extern const char *amdVbeSymbols[];
|
||||
extern const char *amdInt10Symbols[];
|
||||
extern const char *amdFbSymbols[];
|
||||
extern const char *amdXaaSymbols[];
|
||||
extern const char *amdExaSymbols[];
|
||||
extern const char *amdRamdacSymbols[];
|
||||
extern OptionInfoRec GX_GeodeOptions[];
|
||||
|
||||
unsigned char *XpressROMPtr;
|
||||
|
||||
@ -200,12 +197,11 @@ GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate)
|
||||
}
|
||||
|
||||
if (pGeode->tryHWCursor) {
|
||||
pGeode->CursorSize = 1024;
|
||||
|
||||
if (pGeode->CursorSize <= fbavail) {
|
||||
if (fbavail >= 1024) {
|
||||
pGeode->CursorStartOffset = fboffset;
|
||||
fboffset += pGeode->CursorSize;
|
||||
fbavail -= pGeode->CursorSize;
|
||||
fboffset += 1024;
|
||||
fbavail -= 1024;
|
||||
pGeode->HWCursor = TRUE;
|
||||
} else {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
@ -425,8 +421,10 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
|
||||
return FALSE;
|
||||
|
||||
pEnt = xf86GetEntityInfo(pScrni->entityList[0]);
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (pEnt->resources)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1);
|
||||
|
||||
@ -513,7 +511,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
|
||||
pGeode->tryCompression = TRUE;
|
||||
|
||||
pGeode->NoAccel = FALSE;
|
||||
pGeode->useEXA = TRUE;
|
||||
pGeode->useEXA = FALSE;
|
||||
|
||||
pGeode->Panel = (pGeode->Output & OUTPUT_PANEL) ? TRUE : FALSE;
|
||||
|
||||
@ -584,7 +582,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
|
||||
pGeode->useEXA = FALSE;
|
||||
else if (xf86NameCmp(s, "EXA"))
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Unknown accleration method %s. Defaulting to EXA.\n", s);
|
||||
"Unknown accleration method %s. Defaulting to XAA.\n", s);
|
||||
}
|
||||
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO,
|
||||
@ -620,7 +618,6 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
|
||||
|
||||
if (!xf86LoadSubModule(pScrni, "int10"))
|
||||
return FALSE;
|
||||
xf86LoaderReqSymLists(amdInt10Symbols, NULL);
|
||||
|
||||
pVesa = pGeode->vesa;
|
||||
|
||||
@ -652,9 +649,6 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
|
||||
else
|
||||
pScrni->videoRam = pGeode->pEnt->device->videoRam;
|
||||
|
||||
pGeode->maxWidth = GX_MAX_WIDTH;
|
||||
pGeode->maxHeight = GX_MAX_HEIGHT;
|
||||
|
||||
GeodeClockRange = (ClockRangePtr) xnfcalloc(sizeof(ClockRange), 1);
|
||||
GeodeClockRange->next = NULL;
|
||||
GeodeClockRange->minClock = 25175;
|
||||
@ -700,34 +694,27 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xf86LoaderReqSymLists(amdFbSymbols, NULL);
|
||||
|
||||
if (pGeode->NoAccel == FALSE) {
|
||||
const char *module = (pGeode->useEXA) ? "exa" : "xaa";
|
||||
const char **symbols = (pGeode->useEXA) ?
|
||||
&amdExaSymbols[0] : &amdXaaSymbols[0];
|
||||
|
||||
if (!xf86LoadSubModule(pScrni, module)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xf86LoaderReqSymLists(symbols, NULL);
|
||||
}
|
||||
|
||||
if (pGeode->tryHWCursor == TRUE) {
|
||||
if (!xf86LoadSubModule(pScrni, "ramdac")) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xf86LoaderReqSymLists(amdRamdacSymbols, NULL);
|
||||
}
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86RegisterResources(pGeode->pEnt->index, NULL, ResExclusive)) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Couldn't register the resources.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -789,9 +776,7 @@ GXAdjustFrame(int scrnIndex, int x, int y, int flags)
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
unsigned long offset;
|
||||
|
||||
offset =
|
||||
pGeode->FBOffset + y * pGeode->Pitch +
|
||||
x * (pScrni->bitsPerPixel >> 3);
|
||||
offset = y * pGeode->Pitch + x * (pScrni->bitsPerPixel >> 3);
|
||||
|
||||
gfx_set_display_offset(offset);
|
||||
}
|
||||
@ -1253,7 +1238,7 @@ GXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv)
|
||||
|
||||
if (pGeode->useEXA) {
|
||||
|
||||
if (!(pGeode->pExa = xnfcalloc(sizeof(ExaDriverRec), 1))) {
|
||||
if (!(pGeode->pExa = exaDriverAlloc())) {
|
||||
xf86DrvMsg(scrnIndex, X_ERROR,
|
||||
"Couldn't allocate the EXA structure.\n");
|
||||
pGeode->NoAccel = TRUE;
|
||||
@ -1269,8 +1254,8 @@ GXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv)
|
||||
pExa->pixmapOffsetAlign = 32;
|
||||
pExa->pixmapPitchAlign = 32;
|
||||
pExa->flags = EXA_OFFSCREEN_PIXMAPS;
|
||||
pExa->maxX = pGeode->maxWidth - 1;
|
||||
pExa->maxY = pGeode->maxHeight - 1;
|
||||
pExa->maxX = GX_MAX_WIDTH - 1;
|
||||
pExa->maxY = GX_MAX_HEIGHT - 1;
|
||||
}
|
||||
} else {
|
||||
pGeode->AccelImageWriteBuffers =
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "xf86Module.h"
|
||||
#include "mipointer.h"
|
||||
#include "windowstr.h"
|
||||
#include "inputstr.h"
|
||||
#include <X11/extensions/randr.h>
|
||||
#include <randrstr.h>
|
||||
|
||||
@ -55,20 +56,17 @@ typedef struct _GXRandRInfo
|
||||
Rotation supported_rotations; /* driver supported */
|
||||
} XF86RandRInfoRec, *XF86RandRInfoPtr;
|
||||
|
||||
#define AMD_OLDPRIV (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
|
||||
|
||||
#if AMD_OLDPRIV
|
||||
|
||||
static int GXRandRIndex;
|
||||
|
||||
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
|
||||
#define OLD_VIDEODRV_INTERFACE (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
|
||||
|
||||
#if OLD_VIDEODRV_INTERFACE
|
||||
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
|
||||
#define XF86RANDRSET(p, v) (p)->devPrivates[GXRandRIndex].ptr = v
|
||||
#else
|
||||
|
||||
static DevPrivateKey GXRandRKey;
|
||||
|
||||
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
|
||||
dixLookupPrivate(&(p)->devPrivates, GXRandRKey));
|
||||
|
||||
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
|
||||
dixLookupPrivate(&(p)->devPrivates, &GXRandRIndex))
|
||||
#define XF86RANDRSET(p, v) dixSetPrivate(&(p)->devPrivates, &GXRandRIndex, v)
|
||||
#endif
|
||||
|
||||
static int
|
||||
@ -209,7 +207,7 @@ GXRandRSetMode(ScreenPtr pScreen,
|
||||
* Get the new Screen pixmap ptr as SwitchMode might have called
|
||||
* ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back...
|
||||
* Unfortunately.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
pspix = (*pScreen->GetScreenPixmap) (pScreen);
|
||||
@ -333,10 +331,8 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
|
||||
if (GXRandRGeneration != serverGeneration) {
|
||||
GXRandRGeneration = serverGeneration;
|
||||
}
|
||||
#if AMD_OLDPRIV
|
||||
#if OLD_VIDEODRV_INTERFACE
|
||||
GXRandRIndex = AllocateScreenPrivateIndex();
|
||||
#else
|
||||
GXRandRKey = &GXRandRKey;
|
||||
#endif
|
||||
|
||||
pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1);
|
||||
@ -362,10 +358,7 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
|
||||
pRandr->supported_rotations = rotation;
|
||||
pRandr->maxX = pRandr->maxY = 0;
|
||||
|
||||
#if AMD_OLDPRIV
|
||||
pScreen->devPrivates[GXRandRIndex].ptr = pRandr;
|
||||
#else
|
||||
dixSetPrivate(&pScreen->devPrivates, GXRandRKey, pRandr);
|
||||
#endif
|
||||
XF86RANDRSET(pScreen, pRandr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -45,7 +45,6 @@
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86Resources.h"
|
||||
#include "compiler.h"
|
||||
#include "xf86PciInfo.h"
|
||||
#include "xf86Pci.h"
|
||||
@ -406,7 +405,7 @@ GXSetupImageVideo(ScreenPtr pScrn)
|
||||
adapt->QueryImageAttributes = GeodeQueryImageAttributes;
|
||||
|
||||
pPriv->filter = 0;
|
||||
pPriv->colorKey = pGeode->videoKey;
|
||||
pPriv->colorKey = 0;
|
||||
pPriv->colorKeyMode = 0;
|
||||
pPriv->videoStatus = 0;
|
||||
#if DBUF
|
||||
@ -809,7 +808,7 @@ GXSetVideoPosition(int x, int y, int width, int height,
|
||||
|
||||
/* Take care of panning when panel is present */
|
||||
|
||||
startAddress = gfx_get_display_offset() - pGeode->FBOffset;
|
||||
startAddress = gfx_get_display_offset();
|
||||
DeltaY = startAddress / pGeode->Pitch;
|
||||
DeltaX = startAddress & (pGeode->Pitch - 1);
|
||||
DeltaX /= (pScrni->bitsPerPixel >> 3);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2003-2007 Advanced Micro Devices, Inc.
|
||||
/* Copyright (c) 2003-2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
@ -28,193 +28,28 @@
|
||||
#endif
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86Pci.h"
|
||||
#include "xf86PciInfo.h"
|
||||
#include "xf86i2c.h"
|
||||
#include "xf86Crtc.h"
|
||||
#include "geode.h"
|
||||
|
||||
/* Forward declarations of the functions */
|
||||
static void LXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg);
|
||||
static void LXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y);
|
||||
static Bool LXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs);
|
||||
extern void LXSetVideoPosition(int x, int y, int width, int height,
|
||||
short src_w, short src_h, short drw_w,
|
||||
short drw_h, int id, int offset, ScrnInfoPtr pScrn);
|
||||
|
||||
Bool
|
||||
LXHWCursorInit(ScreenPtr pScrn)
|
||||
LXCursorInit(ScreenPtr pScrn)
|
||||
{
|
||||
ScrnInfoPtr pScrni = xf86Screens[pScrn->myNum];
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
xf86CursorInfoPtr infoPtr;
|
||||
|
||||
infoPtr = xf86CreateCursorInfoRec();
|
||||
if (!infoPtr)
|
||||
return FALSE;
|
||||
/* the geode structure is intiallized with the cursor infoRec */
|
||||
pGeode->CursorInfo = infoPtr;
|
||||
infoPtr->MaxWidth = 32;
|
||||
infoPtr->MaxHeight = 32;
|
||||
/* seeting up the cursor flags */
|
||||
infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
|
||||
return xf86_cursors_init(pScrn,
|
||||
LX_CURSOR_MAX_WIDTH, LX_CURSOR_MAX_HEIGHT,
|
||||
HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
|
||||
HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
|
||||
|
||||
infoPtr->SetCursorColors = LXSetCursorColors;
|
||||
infoPtr->SetCursorPosition = LXSetCursorPosition;
|
||||
infoPtr->LoadCursorImage = LXLoadCursorImage;
|
||||
infoPtr->HideCursor = LXHideCursor;
|
||||
infoPtr->ShowCursor = LXShowCursor;
|
||||
infoPtr->UseHWCursor = LXUseHWCursor;
|
||||
|
||||
return (xf86InitCursor(pScrn, infoPtr));
|
||||
}
|
||||
|
||||
static void
|
||||
LXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg)
|
||||
{
|
||||
vg_set_mono_cursor_colors(bg, fg);
|
||||
}
|
||||
|
||||
static void
|
||||
LXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
int savex, savey;
|
||||
int newX, newY;
|
||||
int hsx, hsy;
|
||||
|
||||
/* Adjust xf86HWCursor messing about */
|
||||
|
||||
savex = x + pScrni->frameX0;
|
||||
savey = y + pScrni->frameY0;
|
||||
|
||||
switch (pGeode->rotation) {
|
||||
default:
|
||||
ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__,
|
||||
pGeode->rotation);
|
||||
case RR_Rotate_0:
|
||||
newX = savex;
|
||||
newY = savey;
|
||||
hsx = 31;
|
||||
hsy = 31;
|
||||
break;
|
||||
|
||||
case RR_Rotate_270:
|
||||
newX = savey;
|
||||
newY = pScrni->pScreen->width - savex;
|
||||
hsx = 31;
|
||||
hsy = 0;
|
||||
break;
|
||||
|
||||
case RR_Rotate_180:
|
||||
newX = pScrni->pScreen->width - savex;
|
||||
newY = pScrni->pScreen->height - savey;
|
||||
hsx = 0;
|
||||
hsy = 0;
|
||||
break;
|
||||
|
||||
case RR_Rotate_90:
|
||||
newX = pScrni->pScreen->height - savey;
|
||||
newY = savex;
|
||||
hsx = 0;
|
||||
hsy = 31;
|
||||
break;
|
||||
}
|
||||
|
||||
newX -= pScrni->frameX0;
|
||||
newY -= pScrni->frameY0;
|
||||
|
||||
{
|
||||
VG_PANNING_COORDINATES panning;
|
||||
|
||||
vg_set_cursor_position(newX + hsx, newY + hsy, &panning);
|
||||
}
|
||||
|
||||
vg_set_cursor_enable(1);
|
||||
|
||||
/* FIXME: Adjust for video panning? */
|
||||
HARDWARE_CURSOR_INVERT_MASK |
|
||||
HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
|
||||
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 |
|
||||
HARDWARE_CURSOR_ARGB);
|
||||
}
|
||||
|
||||
void
|
||||
LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src)
|
||||
LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src)
|
||||
{
|
||||
int i, n, x, y, newX, newY;
|
||||
unsigned long andMask[32], xorMask[32];
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
unsigned long mskb, rowb;
|
||||
unsigned char *rowp = &src[0];
|
||||
unsigned char *mskp = &src[128];
|
||||
|
||||
if (src != NULL) {
|
||||
mskb = rowb = 0;
|
||||
for (y = 32; --y >= 0;)
|
||||
andMask[y] = xorMask[y] = 0;
|
||||
for (y = 0; y < 32; ++y) {
|
||||
for (x = 0; x < 32; ++x) {
|
||||
if ((i = x & 7) == 0) {
|
||||
rowb = (*rowp & *mskp);
|
||||
mskb = ~(*mskp);
|
||||
++rowp;
|
||||
++mskp;
|
||||
}
|
||||
|
||||
switch (pGeode->rotation) {
|
||||
default:
|
||||
ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__,
|
||||
pGeode->rotation);
|
||||
case RR_Rotate_0:
|
||||
newX = x;
|
||||
newY = y;
|
||||
break;
|
||||
case RR_Rotate_270:
|
||||
newX = y;
|
||||
newY = 31 - x;
|
||||
break;
|
||||
case RR_Rotate_180:
|
||||
newX = 31 - x;
|
||||
newY = 31 - y;
|
||||
break;
|
||||
case RR_Rotate_90:
|
||||
newX = 31 - y;
|
||||
newY = x;
|
||||
break;
|
||||
}
|
||||
|
||||
i = 7 - i;
|
||||
n = 31 - newX;
|
||||
andMask[newY] |= (((mskb >> i) & 1) << n);
|
||||
xorMask[newY] |= (((rowb >> i) & 1) << n);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (y = 32; --y >= 0;) {
|
||||
andMask[y] = ~0;
|
||||
xorMask[y] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
vg_set_mono_cursor_shape32(pGeode->CursorStartOffset, &andMask[0],
|
||||
&xorMask[0], 31, 31);
|
||||
vg_set_color_cursor_shape(pGeode->CursorStartOffset, src,
|
||||
LX_CURSOR_MAX_WIDTH, LX_CURSOR_MAX_HEIGHT,
|
||||
LX_CURSOR_MAX_WIDTH * 4, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
LXHideCursor(ScrnInfoPtr pScrni)
|
||||
{
|
||||
vg_set_cursor_enable(0);
|
||||
}
|
||||
|
||||
void
|
||||
LXShowCursor(ScrnInfoPtr pScrni)
|
||||
{
|
||||
vg_set_cursor_enable(1);
|
||||
}
|
||||
|
||||
static Bool
|
||||
LXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs)
|
||||
{
|
||||
ScrnInfoPtr pScrni = XF86SCRNINFO(pScrn);
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
return pGeode->HWCursor;
|
||||
}
|
||||
|
496
driver/xf86-video-geode/src/lx_display.c
Normal file
496
driver/xf86-video-geode/src/lx_display.c
Normal file
@ -0,0 +1,496 @@
|
||||
/* Copyright (c) 2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Neither the name of the Advanced Micro Devices, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xf86.h"
|
||||
#include "geode.h"
|
||||
#include "xf86Crtc.h"
|
||||
#include "cim/cim_defs.h"
|
||||
#include "cim/cim_regs.h"
|
||||
|
||||
typedef struct _LXOutputPrivateRec
|
||||
{
|
||||
int video_enable;
|
||||
unsigned long video_flags;
|
||||
GeodeMemPtr rotate_mem;
|
||||
} LXCrtcPrivateRec, *LXCrtcPrivatePtr;
|
||||
|
||||
static void
|
||||
lx_enable_dac_power(ScrnInfoPtr pScrni, int option)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
df_set_crt_enable(DF_CRT_ENABLE);
|
||||
|
||||
/* Turn off the DAC if we don't need the CRT */
|
||||
|
||||
if (option && (!(pGeode->Output & OUTPUT_CRT))) {
|
||||
unsigned int misc = READ_VID32(DF_VID_MISC);
|
||||
|
||||
misc |= DF_DAC_POWER_DOWN;
|
||||
WRITE_VID32(DF_VID_MISC, misc);
|
||||
}
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL)
|
||||
df_set_panel_enable(1);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_disable_dac_power(ScrnInfoPtr pScrni, int option)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL)
|
||||
df_set_panel_enable(0);
|
||||
|
||||
if (pGeode->Output & OUTPUT_CRT) {
|
||||
|
||||
/* Wait for the panel to finish its procedure */
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL)
|
||||
while ((READ_VID32(DF_POWER_MANAGEMENT) & 2) == 0) ;
|
||||
df_set_crt_enable(option);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
lx_set_panel_mode(VG_DISPLAY_MODE * mode, DisplayModePtr pMode)
|
||||
{
|
||||
int hsync, vsync;
|
||||
|
||||
mode->mode_width = mode->panel_width = pMode->HDisplay;
|
||||
mode->mode_height = mode->panel_height = pMode->VDisplay;
|
||||
|
||||
mode->hactive = pMode->HDisplay;
|
||||
mode->hblankstart = pMode->HDisplay;
|
||||
mode->hsyncstart = pMode->HSyncStart;
|
||||
mode->hsyncend = pMode->HSyncEnd;
|
||||
mode->hblankend = pMode->HTotal;
|
||||
mode->htotal = pMode->HTotal;
|
||||
|
||||
mode->vactive = pMode->VDisplay;
|
||||
mode->vblankstart = pMode->VDisplay;
|
||||
mode->vsyncstart = pMode->VSyncStart;
|
||||
mode->vsyncend = pMode->VSyncEnd;
|
||||
mode->vblankend = pMode->VTotal;
|
||||
mode->vtotal = pMode->VTotal;
|
||||
|
||||
mode->vactive_even = pMode->VDisplay;
|
||||
mode->vblankstart_even = pMode->VDisplay;
|
||||
mode->vsyncstart_even = pMode->VSyncStart;
|
||||
mode->vsyncend_even = pMode->VSyncEnd;
|
||||
mode->vblankend_even = pMode->VTotal;
|
||||
mode->vtotal_even = pMode->VTotal;
|
||||
|
||||
mode->frequency = (int)((pMode->Clock / 1000.0) * 0x10000);
|
||||
|
||||
/* In panel mode, Cimarron purposely swizzles these,
|
||||
* so we swizzle them first */
|
||||
|
||||
hsync = (pMode->Flags & V_NHSYNC) ? 0 : 1;
|
||||
vsync = (pMode->Flags & V_NVSYNC) ? 0 : 1;
|
||||
|
||||
mode->flags |= (hsync) ? VG_MODEFLAG_NEG_HSYNC : 0;
|
||||
mode->flags |= (vsync) ? VG_MODEFLAG_NEG_VSYNC : 0;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_set_crt_mode(VG_DISPLAY_MODE * mode, DisplayModePtr pMode)
|
||||
{
|
||||
int hsync, vsync;
|
||||
|
||||
mode->mode_width = mode->panel_width = pMode->HDisplay;
|
||||
mode->mode_height = mode->panel_height = pMode->VDisplay;
|
||||
|
||||
mode->hactive = pMode->CrtcHDisplay;
|
||||
mode->hblankstart = pMode->CrtcHBlankStart;
|
||||
mode->hsyncstart = pMode->CrtcHSyncStart;
|
||||
mode->hsyncend = pMode->CrtcHSyncEnd;
|
||||
mode->hblankend = pMode->CrtcHBlankEnd;
|
||||
mode->htotal = pMode->CrtcHTotal;
|
||||
|
||||
mode->vactive = pMode->CrtcVDisplay;
|
||||
mode->vblankstart = pMode->CrtcVBlankStart;
|
||||
mode->vsyncstart = pMode->CrtcVSyncStart;
|
||||
mode->vsyncend = pMode->CrtcVSyncEnd;
|
||||
mode->vblankend = pMode->CrtcVBlankEnd;
|
||||
mode->vtotal = pMode->CrtcVTotal;
|
||||
|
||||
mode->vactive_even = pMode->CrtcVDisplay;
|
||||
mode->vblankstart_even = pMode->CrtcVBlankStart;
|
||||
mode->vsyncstart_even = pMode->CrtcVSyncStart;
|
||||
mode->vsyncend_even = pMode->CrtcVSyncEnd;
|
||||
mode->vblankend_even = pMode->CrtcVBlankEnd;
|
||||
mode->vtotal_even = pMode->CrtcVTotal;
|
||||
|
||||
mode->frequency = (int)((pMode->Clock / 1000.0) * 0x10000);
|
||||
|
||||
hsync = (pMode->Flags & V_NHSYNC) ? 1 : 0;
|
||||
vsync = (pMode->Flags & V_NVSYNC) ? 1 : 0;
|
||||
|
||||
mode->flags |= (hsync) ? VG_MODEFLAG_NEG_HSYNC : 0;
|
||||
mode->flags |= (vsync) ? VG_MODEFLAG_NEG_VSYNC : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
lx_set_mode(ScrnInfoPtr pScrni, DisplayModePtr pMode, int bpp)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
VG_DISPLAY_MODE mode;
|
||||
int ret;
|
||||
|
||||
memset(&mode, 0, sizeof(mode));
|
||||
|
||||
mode.flags |= pGeode->Output & OUTPUT_CRT ? VG_MODEFLAG_CRT_AND_FP : 0;
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL) {
|
||||
mode.flags |= VG_MODEFLAG_PANELOUT;
|
||||
if (pGeode->Output & OUTPUT_CRT)
|
||||
mode.flags |= VG_MODEFLAG_CRT_AND_FP;
|
||||
}
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL && pGeode->Scale)
|
||||
lx_set_panel_mode(&mode, pGeode->panelMode);
|
||||
else
|
||||
lx_set_crt_mode(&mode, pMode);
|
||||
|
||||
mode.src_width = pMode->HDisplay;
|
||||
mode.src_height = pMode->VDisplay;
|
||||
|
||||
/* Set the filter coefficients to the default values */
|
||||
vg_set_scaler_filter_coefficients(NULL, NULL);
|
||||
|
||||
ret = vg_set_custom_mode(&mode, bpp);
|
||||
return (ret == CIM_STATUS_OK) ? 0 : -1;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_dpms(xf86CrtcPtr crtc, int mode)
|
||||
{
|
||||
ScrnInfoPtr pScrni = crtc->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
if (pGeode->Output & OUTPUT_DCON)
|
||||
DCONDPMSSet(pScrni, mode);
|
||||
|
||||
switch (mode) {
|
||||
case DPMSModeOn:
|
||||
lx_enable_dac_power(pScrni, 1);
|
||||
break;
|
||||
|
||||
case DPMSModeStandby:
|
||||
lx_disable_dac_power(pScrni, DF_CRT_STANDBY);
|
||||
break;
|
||||
|
||||
case DPMSModeSuspend:
|
||||
lx_disable_dac_power(pScrni, DF_CRT_SUSPEND);
|
||||
break;
|
||||
|
||||
case DPMSModeOff:
|
||||
lx_disable_dac_power(pScrni, DF_CRT_DISABLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
lx_crtc_lock(xf86CrtcPtr crtc)
|
||||
{
|
||||
/* Wait until the GPU is idle */
|
||||
gp_wait_until_idle();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_unlock(xf86CrtcPtr crtc)
|
||||
{
|
||||
/* Nothing to do here */
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_prepare(xf86CrtcPtr crtc)
|
||||
{
|
||||
LXCrtcPrivatePtr lx_crtc = crtc->driver_private;
|
||||
|
||||
/* Disable the video */
|
||||
df_get_video_enable(&lx_crtc->video_enable, &lx_crtc->video_flags);
|
||||
|
||||
if (lx_crtc->video_enable)
|
||||
df_set_video_enable(0, 0);
|
||||
|
||||
/* Turn off compression */
|
||||
vg_set_compression_enable(0);
|
||||
|
||||
/* Hide the cursor */
|
||||
crtc->funcs->hide_cursor(crtc);
|
||||
|
||||
/* Turn off the display */
|
||||
crtc->funcs->dpms(crtc, DPMSModeOff);
|
||||
}
|
||||
|
||||
static Bool
|
||||
lx_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
|
||||
DisplayModePtr adjusted_mode)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
|
||||
DisplayModePtr adjusted_mode, int x, int y)
|
||||
{
|
||||
ScrnInfoPtr pScrni = crtc->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
DF_VIDEO_SOURCE_PARAMS vs_odd, vs_even;
|
||||
|
||||
df_get_video_source_configuration(&vs_odd, &vs_even);
|
||||
|
||||
/* Note - the memory gets adjusted when virtualX/virtualY
|
||||
* gets changed - so we don't need to worry about it here
|
||||
*/
|
||||
|
||||
if (lx_set_mode(pScrni, adjusted_mode, pScrni->bitsPerPixel))
|
||||
ErrorF("ERROR! Unable to set the mode!\n");
|
||||
|
||||
/* The output gets turned in in the output code as
|
||||
* per convention */
|
||||
|
||||
vg_set_display_pitch(pGeode->Pitch);
|
||||
gp_set_bpp(pScrni->bitsPerPixel);
|
||||
|
||||
/* Set the acceleration offset if we are drawing to a shadow */
|
||||
if (crtc->rotatedData != NULL)
|
||||
vg_set_display_offset((unsigned int)((char *)crtc->rotatedData -
|
||||
(char *)pGeode->FBBase));
|
||||
else
|
||||
vg_set_display_offset(0);
|
||||
|
||||
/* FIXME: Whats up with X and Y? Does that come into play
|
||||
* here? */
|
||||
|
||||
df_configure_video_source(&vs_odd, &vs_even);
|
||||
|
||||
vg_wait_vertical_blank();
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_commit(xf86CrtcPtr crtc)
|
||||
{
|
||||
LXCrtcPrivatePtr lx_crtc = crtc->driver_private;
|
||||
ScrnInfoPtr pScrni = crtc->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
/* Turn back on the sreen */
|
||||
crtc->funcs->dpms(crtc, DPMSModeOn);
|
||||
|
||||
/* Turn on compression */
|
||||
|
||||
if (pGeode->Compression) {
|
||||
vg_configure_compression(&(pGeode->CBData));
|
||||
vg_set_compression_enable(1);
|
||||
}
|
||||
|
||||
/* Load the cursor */
|
||||
if (crtc->scrn->pScreen != NULL) {
|
||||
xf86_reload_cursors(crtc->scrn->pScreen);
|
||||
crtc->funcs->hide_cursor(crtc);
|
||||
crtc->cursor_shown = FALSE;
|
||||
}
|
||||
|
||||
/* Renable the video */
|
||||
|
||||
if (lx_crtc->video_enable)
|
||||
df_set_video_enable(lx_crtc->video_enable, lx_crtc->video_flags);
|
||||
|
||||
lx_crtc->video_enable = 0;
|
||||
lx_crtc->video_flags = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 * red, CARD16 * green,
|
||||
CARD16 * blue, int size)
|
||||
{
|
||||
unsigned int dcfg;
|
||||
int i;
|
||||
|
||||
assert(size == 256);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
unsigned int val = (*red << 8) | *green | (*blue >> 8);
|
||||
|
||||
df_set_video_palette_entry(i, val);
|
||||
}
|
||||
|
||||
/* df_set_video_palette_entry automatically turns on
|
||||
* gamma for video - if this gets called, we assume that
|
||||
* RandR wants it set for graphics, so reverse cimarron
|
||||
*/
|
||||
|
||||
dcfg = READ_VID32(DF_DISPLAY_CONFIG);
|
||||
dcfg &= ~DF_DCFG_GV_PAL_BYP;
|
||||
WRITE_VID32(DF_DISPLAY_CONFIG, dcfg);
|
||||
}
|
||||
|
||||
static void *
|
||||
lx_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
|
||||
{
|
||||
ScrnInfoPtr pScrni = crtc->scrn;
|
||||
GeodePtr pGeode = GEODEPTR(pScrni);
|
||||
LXCrtcPrivatePtr lx_crtc = crtc->driver_private;
|
||||
unsigned int rpitch, size;
|
||||
|
||||
rpitch = pScrni->displayWidth * (pScrni->bitsPerPixel / 8);
|
||||
size = rpitch * height;
|
||||
|
||||
lx_crtc->rotate_mem = GeodeAllocOffscreen(pGeode, size, 4);
|
||||
|
||||
if (lx_crtc->rotate_mem == NULL) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Couldn't allocate the shadow memory for rotation\n");
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
" You need 0x%x bytes, but only 0x%x bytes are available\n",
|
||||
size, GeodeOffscreenFreeSize(pGeode));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(pGeode->FBBase + lx_crtc->rotate_mem->offset, 0, size);
|
||||
return pGeode->FBBase + lx_crtc->rotate_mem->offset;
|
||||
}
|
||||
|
||||
static PixmapPtr
|
||||
lx_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
|
||||
{
|
||||
ScrnInfoPtr pScrni = crtc->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
PixmapPtr rpixmap;
|
||||
|
||||
if (!data)
|
||||
data = lx_crtc_shadow_allocate(crtc, width, height);
|
||||
|
||||
rpixmap = GetScratchPixmapHeader(pScrni->pScreen,
|
||||
width, height, pScrni->depth, pScrni->bitsPerPixel, pGeode->Pitch,
|
||||
data);
|
||||
|
||||
if (rpixmap == NULL) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Couldn't allocate shadow pixmap for rotated CRTC\n");
|
||||
}
|
||||
|
||||
return rpixmap;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rpixmap, void *data)
|
||||
{
|
||||
ScrnInfoPtr pScrni = crtc->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
LXCrtcPrivatePtr lx_crtc = crtc->driver_private;
|
||||
|
||||
if (rpixmap)
|
||||
FreeScratchPixmapHeader(rpixmap);
|
||||
|
||||
if (data) {
|
||||
gp_wait_until_idle();
|
||||
GeodeFreeOffscreen(pGeode, lx_crtc->rotate_mem);
|
||||
lx_crtc->rotate_mem = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg)
|
||||
{
|
||||
vg_set_mono_cursor_colors(bg, fg);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
|
||||
{
|
||||
VG_PANNING_COORDINATES panning;
|
||||
vg_set_cursor_position(x, y, &panning);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_show_cursor(xf86CrtcPtr crtc)
|
||||
{
|
||||
vg_set_cursor_enable(1);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_hide_cursor(xf86CrtcPtr crtc)
|
||||
{
|
||||
vg_set_cursor_enable(0);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
|
||||
{
|
||||
LXLoadARGBCursorImage(crtc->scrn, (unsigned char *) image);
|
||||
}
|
||||
|
||||
static const xf86CrtcFuncsRec lx_crtc_funcs = {
|
||||
.dpms = lx_crtc_dpms,
|
||||
.lock = lx_crtc_lock,
|
||||
.unlock = lx_crtc_unlock,
|
||||
.mode_fixup = lx_crtc_mode_fixup,
|
||||
.prepare = lx_crtc_prepare,
|
||||
.mode_set = lx_crtc_mode_set,
|
||||
.commit = lx_crtc_commit,
|
||||
.gamma_set = lx_crtc_gamma_set,
|
||||
.shadow_create = lx_crtc_shadow_create,
|
||||
.shadow_allocate = lx_crtc_shadow_allocate,
|
||||
.shadow_destroy = lx_crtc_shadow_destroy,
|
||||
.set_cursor_colors = lx_crtc_set_cursor_colors,
|
||||
.set_cursor_position = lx_crtc_set_cursor_position,
|
||||
.show_cursor = lx_crtc_show_cursor,
|
||||
.hide_cursor = lx_crtc_hide_cursor,
|
||||
.load_cursor_argb = lx_crtc_load_cursor_argb,
|
||||
};
|
||||
|
||||
void
|
||||
LXSetupCrtc(ScrnInfoPtr pScrni)
|
||||
{
|
||||
xf86CrtcPtr crtc;
|
||||
LXCrtcPrivatePtr lxpriv;
|
||||
|
||||
crtc = xf86CrtcCreate(pScrni, &lx_crtc_funcs);
|
||||
|
||||
if (crtc == NULL) {
|
||||
ErrorF("ERROR - failed to create a CRTC\n");
|
||||
return;
|
||||
}
|
||||
|
||||
lxpriv = xnfcalloc(sizeof(LXCrtcPrivateRec), 1);
|
||||
|
||||
if (!lxpriv) {
|
||||
xf86CrtcDestroy(crtc);
|
||||
ErrorF("unable to allocate memory for lxpriv\n");
|
||||
return;
|
||||
}
|
||||
|
||||
crtc->driver_private = lxpriv;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Advanced Micro Devices, Inc.
|
||||
* Copyright (c) 2007-2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@ -30,6 +30,8 @@
|
||||
support multiple pass operations?
|
||||
*/
|
||||
|
||||
/* To support PictOptAdd with a mask */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@ -43,6 +45,9 @@
|
||||
|
||||
#include "geode_blend.h"
|
||||
|
||||
#define F(x) IntToxFixed(x)
|
||||
#define I(x) xFixedToInt(x)
|
||||
|
||||
static const struct exa_format_t
|
||||
{
|
||||
int exa;
|
||||
@ -68,6 +73,7 @@ static const struct exa_format_t
|
||||
#define COMP_TYPE_MASK 0
|
||||
#define COMP_TYPE_ONEPASS 1
|
||||
#define COMP_TYPE_TWOPASS 3
|
||||
#define COMP_TYPE_ROTATE 5
|
||||
|
||||
static struct
|
||||
{
|
||||
@ -86,6 +92,10 @@ static struct
|
||||
unsigned int bufferOffset;
|
||||
struct exa_format_t *srcFormat;
|
||||
struct exa_format_t *dstFormat;
|
||||
|
||||
int rotate;
|
||||
PictTransform *transform;
|
||||
|
||||
} exaScratch;
|
||||
|
||||
static const int SDfn[16] = {
|
||||
@ -285,6 +295,7 @@ lx_prepare_solid(PixmapPtr pxMap, int alu, Pixel planemask, Pixel fg)
|
||||
exaScratch.op = op;
|
||||
|
||||
gp_set_solid_source(fg);
|
||||
|
||||
gp_set_strides(pitch, pitch);
|
||||
gp_write_parameters();
|
||||
return TRUE;
|
||||
@ -340,15 +351,11 @@ lx_do_copy(PixmapPtr pxDst, int srcX, int srcY,
|
||||
gp_declare_blt(lx_copy_flags(srcX, srcY, dstX, dstY, w, h,
|
||||
exaScratch.op));
|
||||
|
||||
//gp_declare_blt(0);
|
||||
|
||||
srcOffset = exaScratch.srcOffset + (exaScratch.srcPitch * srcY) +
|
||||
(exaScratch.srcBpp) * srcX;
|
||||
|
||||
dstOffset = exaGetPixmapOffset(pxDst) + (dstPitch * dstY) +
|
||||
(dstBpp * dstX);
|
||||
|
||||
flags = 0;
|
||||
dstOffset = exaGetPixmapOffset(pxDst) +
|
||||
(dstPitch * dstY) + (dstBpp * dstX);
|
||||
|
||||
if (dstX > srcX)
|
||||
flags |= CIMGP_NEGXDIR;
|
||||
@ -461,18 +468,70 @@ lx_get_format(PicturePtr p)
|
||||
return (&lx_exa_formats[i]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
ErrorF("Couldn't match on format %x\n", format);
|
||||
ErrorF("BPP = %d, type = %d, ARGB(%d,%d,%d,%d)n",
|
||||
PICT_FORMAT_BPP(format),
|
||||
PICT_FORMAT_TYPE(format),
|
||||
PICT_FORMAT_A(format),
|
||||
PICT_FORMAT_R(format), PICT_FORMAT_G(format), PICT_FORMAT_B(format));
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
lx_process_transform(PicturePtr pSrc)
|
||||
{
|
||||
PictTransformPtr t = pSrc->transform;
|
||||
xFixed c0 = t->matrix[0][0];
|
||||
xFixed s0 = t->matrix[0][1];
|
||||
xFixed s1 = t->matrix[1][0];
|
||||
xFixed c1 = t->matrix[1][1];
|
||||
|
||||
/* If the transform doesn't have any rotation
|
||||
* or scaling components, then just grab the
|
||||
* translate coordinates */
|
||||
|
||||
if (t->matrix[0][0] == 0 &&
|
||||
t->matrix[0][1] == 0 &&
|
||||
t->matrix[1][0] == 0 && t->matrix[1][1] == 0) {
|
||||
exaScratch.transform = pSrc->transform;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Otherwise, see if this is a simple
|
||||
* rotate transform - if it isn't, then
|
||||
* we have to punt back to software */
|
||||
|
||||
if (t->matrix[2][2] != F(1))
|
||||
return FALSE;
|
||||
|
||||
/* The rotate matrix looks like this:
|
||||
* [ cos X -sin x
|
||||
* sin X cos X ]
|
||||
*
|
||||
* Where X is the angle. We do a simple
|
||||
* check first - if [0,0] != [1,1], then
|
||||
* scaling was specified too, and we can
|
||||
* bail, and if [0,1] != -[1,1] then this
|
||||
* isn't scaling that we can handle.
|
||||
*/
|
||||
|
||||
if ((c0 != c1) || (s0 != -s1))
|
||||
return FALSE;
|
||||
|
||||
/* Now, figure out what angle we want - we
|
||||
* can only accelerate right angle rotations,
|
||||
* so this turns into an easy set of if statements */
|
||||
|
||||
if (c0 == F(1) && s1 == F(0))
|
||||
exaScratch.rotate = RR_Rotate_0;
|
||||
else if (c0 == F(0) && s1 == F(1))
|
||||
exaScratch.rotate = RR_Rotate_90;
|
||||
else if (c0 == F(-1) && s1 == F(0))
|
||||
exaScratch.rotate = RR_Rotate_180;
|
||||
else if (c0 == F(0) && s1 == F(-1))
|
||||
exaScratch.rotate = RR_Rotate_270;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
exaScratch.transform = pSrc->transform;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
lx_check_composite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst)
|
||||
{
|
||||
@ -488,6 +547,9 @@ lx_check_composite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (pMsk && op == PictOpAdd)
|
||||
return FALSE;
|
||||
|
||||
/* Check that the filter matches what we support */
|
||||
|
||||
switch (pSrc->filter) {
|
||||
@ -498,13 +560,21 @@ lx_check_composite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst)
|
||||
break;
|
||||
|
||||
default:
|
||||
ErrorF("invalid filter %d\n", pSrc->filter);
|
||||
/* WE don't support bilinear or convolution filters */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* We don't handle transforms */
|
||||
/* We don't support any mask transforms */
|
||||
if (pMsk && pMsk->transform)
|
||||
return FALSE;
|
||||
|
||||
if (pSrc->transform)
|
||||
/* Keep an eye out for source rotation transforms - those we can
|
||||
* do something about */
|
||||
|
||||
exaScratch.rotate = RR_Rotate_0;
|
||||
exaScratch.transform = NULL;
|
||||
|
||||
if (pSrc->transform && !lx_process_transform(pSrc))
|
||||
return FALSE;
|
||||
|
||||
/* XXX - I don't understand PICT_a8 enough - so I'm punting */
|
||||
@ -537,21 +607,25 @@ lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk,
|
||||
/* Make sure operations that need alpha bits have them */
|
||||
/* If a mask is enabled, the alpha will come from there */
|
||||
|
||||
if (!pMsk && (!srcFmt->alphabits && usesSrcAlpha(op))) {
|
||||
ErrorF("EXA: Source needs alpha bits\n");
|
||||
if (!pMsk && (!srcFmt->alphabits && usesSrcAlpha(op)))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!pMsk && (!dstFmt->alphabits && usesDstAlpha(op))) {
|
||||
ErrorF("EXA: Dest needs alpha bits\n");
|
||||
if (!pMsk && (!dstFmt->alphabits && usesDstAlpha(op)))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* FIXME: See a way around this! */
|
||||
|
||||
if (srcFmt->alphabits == 0 && dstFmt->alphabits != 0)
|
||||
return FALSE;
|
||||
|
||||
/* If this is a rotate operation, then make sure the src and dst
|
||||
* formats are the same */
|
||||
|
||||
if (exaScratch.rotate != RR_Rotate_0 && srcFmt != dstFmt) {
|
||||
ErrorF("EXA: Can't rotate and convert formats at the same time\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Set up the scratch buffer with the information we need */
|
||||
|
||||
exaScratch.srcFormat = (struct exa_format_t *)srcFmt;
|
||||
@ -612,6 +686,8 @@ lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk,
|
||||
} else {
|
||||
if (usesPasses(op))
|
||||
exaScratch.type = COMP_TYPE_TWOPASS;
|
||||
else if (exaScratch.rotate != RR_Rotate_0)
|
||||
exaScratch.type = COMP_TYPE_ROTATE;
|
||||
else
|
||||
exaScratch.type = COMP_TYPE_ONEPASS;
|
||||
|
||||
@ -685,8 +761,6 @@ get_op_type(struct exa_format_t *src, struct exa_format_t *dst, int type)
|
||||
* ifdefed out until such time that we are sure its not needed
|
||||
*/
|
||||
|
||||
#if 1
|
||||
|
||||
static void
|
||||
lx_composite_onepass(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
unsigned long srcOffset, int width, int height)
|
||||
@ -715,99 +789,6 @@ lx_composite_onepass(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
gp_screen_to_screen_convert(dstOffset, srcOffset, width, height, 0);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* XXX - For now, we assume that the conversion will fit */
|
||||
|
||||
static void
|
||||
lx_composite_onepass(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
unsigned long srcOffset, int width, int height)
|
||||
{
|
||||
struct blend_ops_t *opPtr;
|
||||
int apply, type;
|
||||
int sbpp = lx_get_bpp_from_format(exaScratch.srcFormat->fmt);
|
||||
|
||||
/* Copy the destination into the scratch buffer */
|
||||
|
||||
gp_declare_blt(0);
|
||||
|
||||
gp_set_bpp(sbpp);
|
||||
|
||||
gp_set_source_format(exaScratch.dstFormat->fmt);
|
||||
|
||||
gp_set_raster_operation(0xCC);
|
||||
gp_set_strides(exaScratch.srcPitch, exaGetPixmapPitch(pxDst));
|
||||
gp_screen_to_screen_convert(exaScratch.bufferOffset, dstOffset, width,
|
||||
height, 0);
|
||||
|
||||
/* Do the blend */
|
||||
|
||||
opPtr = &lx_alpha_ops[exaScratch.op * 2];
|
||||
apply = (exaScratch.srcFormat->alphabits == 0) ?
|
||||
CIMGP_APPLY_BLEND_TO_RGB : CIMGP_APPLY_BLEND_TO_ALL;
|
||||
|
||||
gp_declare_blt(0);
|
||||
gp_set_bpp(sbpp);
|
||||
|
||||
type =
|
||||
get_op_type(exaScratch.srcFormat, exaScrach.dstFormat, opPtr->type);
|
||||
|
||||
gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0);
|
||||
|
||||
gp_set_strides(exaScratch.srcPitch, exaScratch.srcPitch);
|
||||
gp_screen_to_screen_blt(exaScratch.bufferOffset, srcOffset,
|
||||
width, height, 0);
|
||||
|
||||
/* And copy back */
|
||||
|
||||
gp_declare_blt(0);
|
||||
gp_set_bpp(pxDst->drawable.bitsPerPixel);
|
||||
gp_set_source_format(exaScratch.srcFormat->fmt);
|
||||
gp_set_raster_operation(0xCC);
|
||||
gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch);
|
||||
gp_screen_to_screen_convert(dstOffset, exaScratch.bufferOffset,
|
||||
width, height, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
lx_composite_convert(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
unsigned long srcOffset, int width, int height)
|
||||
{
|
||||
/* Step 1 - copy the destination into the scratch buffer */
|
||||
|
||||
gp_declare_blt(0);
|
||||
gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt));
|
||||
|
||||
gp_set_raster_operation(0xCC);
|
||||
gp_set_strides(exaGetPixmapPitch(pxDst), exaGetPixmapPitch(pxDst));
|
||||
|
||||
gp_screen_to_screen_blt(exaScratch.bufferOffset, dstOffset, width, height,
|
||||
0);
|
||||
|
||||
/* Step 2 - Do the original blend */
|
||||
|
||||
lx_composite_onepass(pxDst, exaScratch.bufferOffset, srcOffset, width,
|
||||
height);
|
||||
|
||||
/* Step 3 - copy back and fixup the alpha */
|
||||
gp_declare_blt(0);
|
||||
gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt));
|
||||
gp_set_strides(exaGetPixmapPitch(pxDst), exaGetPixmapPitch(pxDst));
|
||||
|
||||
/* FIXME: Does this alpha value need to be changed for the mode? */
|
||||
|
||||
gp_set_alpha_operation(CIMGP_ALPHA_TIMES_A, CIMGP_CONSTANT_ALPHA,
|
||||
CIMGP_CHANNEL_A_SOURCE, CIMGP_APPLY_BLEND_TO_ALPHA, 1);
|
||||
|
||||
gp_screen_to_screen_blt(dstOffset, exaScratch.bufferOffset, width, height,
|
||||
0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* This function handles the multipass blend functions */
|
||||
|
||||
static void
|
||||
@ -876,6 +857,39 @@ lx_composite_multipass(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
width, height, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_composite_rotate(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
unsigned int srcOffset, int width, int height)
|
||||
{
|
||||
int degrees = 0;
|
||||
|
||||
gp_declare_blt(0);
|
||||
gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt));
|
||||
gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch);
|
||||
|
||||
lx_set_source_format(exaScratch.srcFormat->fmt,
|
||||
exaScratch.dstFormat->fmt);
|
||||
|
||||
gp_set_raster_operation(0xCC);
|
||||
|
||||
/* RandR rotation is counter-clockwise, our rotation
|
||||
* is clockwise, so adjust the numbers accordingly */
|
||||
|
||||
switch (exaScratch.rotate) {
|
||||
case RR_Rotate_90:
|
||||
degrees = 270;
|
||||
break;
|
||||
case RR_Rotate_180:
|
||||
degrees = 180;
|
||||
break;
|
||||
case RR_Rotate_270:
|
||||
degrees = 90;
|
||||
break;
|
||||
}
|
||||
|
||||
gp_rotate_blt(dstOffset, srcOffset, width, height, degrees);
|
||||
}
|
||||
|
||||
static void
|
||||
lx_do_composite_mask(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
unsigned int maskOffset, int width, int height)
|
||||
@ -897,46 +911,114 @@ lx_do_composite_mask(PixmapPtr pxDst, unsigned long dstOffset,
|
||||
(exaGetPixmapPitch((px)) * (y)) + \
|
||||
((((px)->drawable.bitsPerPixel + 7) / 8) * (x)) )
|
||||
|
||||
#define GetSrcOffset(_x, _y) (exaScratch.srcOffset + ((_y) * exaScratch.srcPitch) + \
|
||||
((_x) * exaScratch.srcBpp))
|
||||
|
||||
static void
|
||||
transformPoint(PictTransform * t, xPointFixed * point)
|
||||
{
|
||||
PictVector v;
|
||||
|
||||
v.vector[0] = point->x;
|
||||
v.vector[1] = point->y;
|
||||
v.vector[2] = xFixed1;
|
||||
|
||||
if (t != NULL)
|
||||
PictureTransformPoint(t, &v);
|
||||
|
||||
point->x = v.vector[0];
|
||||
point->y = v.vector[1];
|
||||
}
|
||||
|
||||
static void
|
||||
lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
|
||||
int maskY, int dstX, int dstY, int width, int height)
|
||||
{
|
||||
|
||||
struct blend_ops_t *opPtr = &lx_alpha_ops[exaScratch.op * 2];
|
||||
|
||||
unsigned int dstOffset, srcOffset;
|
||||
unsigned int dstOffset, srcOffset = 0;
|
||||
|
||||
unsigned int opX = dstX;
|
||||
unsigned int opY = dstY;
|
||||
unsigned int opWidth = width;
|
||||
unsigned int opHeight = height;
|
||||
xPointFixed srcPoint;
|
||||
|
||||
if (exaScratch.type == COMP_TYPE_MASK)
|
||||
srcOffset = exaScratch.srcOffset + (maskY * exaScratch.srcPitch) +
|
||||
(maskX * exaScratch.srcBpp);
|
||||
else
|
||||
srcOffset = exaScratch.srcOffset + (srcY * exaScratch.srcPitch) +
|
||||
(srcX * exaScratch.srcBpp);
|
||||
int opX = dstX;
|
||||
int opY = dstY;
|
||||
int opWidth = width;
|
||||
int opHeight = height;
|
||||
|
||||
/* Adjust the width / height of the operation the size of the source */
|
||||
/* Transform the source coordinates */
|
||||
|
||||
if (exaScratch.srcWidth < width)
|
||||
if (exaScratch.type == COMP_TYPE_MASK) {
|
||||
srcPoint.x = F(maskX);
|
||||
srcPoint.y = F(maskY);
|
||||
} else {
|
||||
srcPoint.x = F(srcX);
|
||||
srcPoint.y = F(srcY);
|
||||
}
|
||||
|
||||
/* srcX, srcY point to the upper right side of the bounding box
|
||||
* in the unrotated coordinate space. Depending on the orientation,
|
||||
* we have to translate the coordinates to point to the origin of
|
||||
* the rectangle in the source pixmap */
|
||||
|
||||
switch (exaScratch.rotate) {
|
||||
case RR_Rotate_270:
|
||||
srcPoint.x += F(width);
|
||||
|
||||
opWidth = height;
|
||||
opHeight = width;
|
||||
break;
|
||||
|
||||
case RR_Rotate_180:
|
||||
srcPoint.x += F(width);
|
||||
srcPoint.y += F(height);
|
||||
|
||||
srcX += width;
|
||||
srcY += height;
|
||||
break;
|
||||
|
||||
case RR_Rotate_90:
|
||||
srcPoint.y += F(height);
|
||||
|
||||
opWidth = height;
|
||||
opHeight = width;
|
||||
break;
|
||||
}
|
||||
|
||||
transformPoint(exaScratch.transform, &srcPoint);
|
||||
|
||||
/* Adjust the point to fit into the pixmap */
|
||||
|
||||
if (I(srcPoint.x) < 0) {
|
||||
opWidth += I(srcPoint.x);
|
||||
srcPoint.x = F(0);
|
||||
}
|
||||
|
||||
if (I(srcPoint.y) < 0) {
|
||||
opHeight += I(srcPoint.y);
|
||||
srcPoint.y = F(0);
|
||||
}
|
||||
|
||||
srcOffset = GetSrcOffset(I(srcPoint.x), I(srcPoint.y));
|
||||
|
||||
if (exaScratch.srcWidth < opWidth)
|
||||
opWidth = exaScratch.srcWidth;
|
||||
|
||||
if (exaScratch.srcHeight < height)
|
||||
if (exaScratch.srcHeight < opHeight)
|
||||
opHeight = exaScratch.srcHeight;
|
||||
|
||||
while (1) {
|
||||
|
||||
dstOffset = GetPixmapOffset(pxDst, opX, opY);
|
||||
|
||||
switch (exaScratch.type) {
|
||||
|
||||
case COMP_TYPE_MASK:{
|
||||
int direction =
|
||||
(opPtr->channel == CIMGP_CHANNEL_A_SOURCE) ? 0 : 1;
|
||||
|
||||
if (direction == 1) {
|
||||
dstOffset =
|
||||
GetPixmapOffset(exaScratch.srcPixmap, dstX, dstY);
|
||||
GetPixmapOffset(exaScratch.srcPixmap, opX, opY);
|
||||
lx_do_composite_mask(exaScratch.srcPixmap, dstOffset,
|
||||
srcOffset, opWidth, opHeight);
|
||||
} else {
|
||||
@ -954,6 +1036,10 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
|
||||
case COMP_TYPE_TWOPASS:
|
||||
lx_composite_multipass(pxDst, dstOffset, srcOffset, opWidth,
|
||||
opHeight);
|
||||
|
||||
case COMP_TYPE_ROTATE:
|
||||
lx_composite_rotate(pxDst, dstOffset, srcOffset, opWidth,
|
||||
opHeight);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -988,6 +1074,50 @@ lx_done(PixmapPtr ptr)
|
||||
{
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
lx_upload_to_screen(PixmapPtr pxDst, int x, int y, int w, int h,
|
||||
char *src, int src_pitch)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
|
||||
int dst_pitch = exaGetPixmapPitch(pxDst);
|
||||
int cpp = (pxDst->drawable.bitsPerPixel + 7) / 8;
|
||||
|
||||
char *dst;
|
||||
int offset = exaGetPixmapOffset(pxDst);
|
||||
|
||||
dst = (char *)(pGeode->FBBase + offset + (y * dst_pitch) + (x * cpp));
|
||||
int i;
|
||||
|
||||
for (i = 0; i < h; i++) {
|
||||
memcpy(dst, src, w * cpp);
|
||||
dst += dst_pitch;
|
||||
src += src_pitch;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EXA_VERSION_MINOR >= 2
|
||||
|
||||
static Bool
|
||||
lx_exa_pixmap_is_offscreen(PixmapPtr pPixmap)
|
||||
{
|
||||
ScrnInfoPtr pScrni = xf86Screens[pPixmap->drawable.pScreen->myNum];
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
void *start = (void *)(pGeode->FBBase);
|
||||
void *end =
|
||||
(void *)(pGeode->FBBase + pGeode->offscreenStart +
|
||||
pGeode->offscreenSize);
|
||||
|
||||
if ((void *)pPixmap->devPrivate.ptr >= start &&
|
||||
(void *)pPixmap->devPrivate.ptr < end)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Bool
|
||||
LXExaInit(ScreenPtr pScreen)
|
||||
{
|
||||
@ -1013,6 +1143,13 @@ LXExaInit(ScreenPtr pScreen)
|
||||
pExa->PrepareComposite = lx_prepare_composite;
|
||||
pExa->Composite = lx_do_composite;
|
||||
pExa->DoneComposite = lx_done;
|
||||
//pExa->UploadToScreen = lx_upload_to_screen;
|
||||
|
||||
#if EXA_VERSION_MINOR >= 2
|
||||
pExa->PixmapIsOffscreen = lx_exa_pixmap_is_offscreen;
|
||||
#endif
|
||||
|
||||
//pExa->flags = EXA_OFFSCREEN_PIXMAPS;
|
||||
|
||||
return exaDriverInit(pScreen, pGeode->pExa);
|
||||
}
|
||||
|
315
driver/xf86-video-geode/src/lx_memory.c
Normal file
315
driver/xf86-video-geode/src/lx_memory.c
Normal file
@ -0,0 +1,315 @@
|
||||
/* Copyright (c) 2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Neither the name of the Advanced Micro Devices, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*/
|
||||
|
||||
#include "xf86.h"
|
||||
#include "geode.h"
|
||||
#include "cim/cim_regs.h"
|
||||
|
||||
#define ALIGN(x,y) (((x) + (y) - 1) / (y) * (y))
|
||||
#define LX_CB_PITCH 544
|
||||
|
||||
/* Geode offscreen memory allocation functions. This is
|
||||
overengineered for the simple hardware that we have, but
|
||||
there are multiple functions that may want to independently
|
||||
allocate and free memory (crtc->shadow_alloc and Xv). This
|
||||
provides a semi-robust mechanism for doing that.
|
||||
*/
|
||||
|
||||
/* Return the number of free bytes */
|
||||
|
||||
unsigned int
|
||||
GeodeOffscreenFreeSize(GeodeRec * pGeode)
|
||||
{
|
||||
GeodeMemPtr ptr = pGeode->offscreenList;
|
||||
|
||||
if (ptr == NULL)
|
||||
return pGeode->offscreenSize;
|
||||
|
||||
for (; ptr->next; ptr = ptr->next) ;
|
||||
return (pGeode->offscreenStart + pGeode->offscreenSize)
|
||||
- (ptr->offset + ptr->size);
|
||||
}
|
||||
|
||||
void
|
||||
GeodeFreeOffscreen(GeodeRec * pGeode, GeodeMemPtr ptr)
|
||||
{
|
||||
/* There is a clear memory leak here, but
|
||||
* but it is unlikely that the first block of
|
||||
* "allocated" memory is going to be released
|
||||
* individually.
|
||||
*/
|
||||
|
||||
if (ptr->prev == NULL)
|
||||
pGeode->offscreenList = ptr->next;
|
||||
else
|
||||
ptr->prev->next = ptr->next;
|
||||
|
||||
if (ptr->next)
|
||||
ptr->next->prev = ptr->prev;
|
||||
|
||||
xfree(ptr);
|
||||
}
|
||||
|
||||
/* Allocate the "rest" of the offscreen memory - this is for
|
||||
situations where we have very little video memory, and we
|
||||
want to take as much of it as we can for EXA
|
||||
*/
|
||||
|
||||
static GeodeMemPtr
|
||||
GeodeAllocRemainder(GeodeRec * pGeode)
|
||||
{
|
||||
GeodeMemPtr nptr, ptr = pGeode->offscreenList;
|
||||
|
||||
if (!pGeode->offscreenList) {
|
||||
pGeode->offscreenList = xcalloc(1, sizeof(*nptr));
|
||||
pGeode->offscreenList->offset = pGeode->offscreenStart;
|
||||
pGeode->offscreenList->size = pGeode->offscreenSize;
|
||||
pGeode->offscreenList->next = NULL;
|
||||
pGeode->offscreenList->prev = NULL;
|
||||
|
||||
return pGeode->offscreenList;
|
||||
}
|
||||
|
||||
/* Go to the end of the list of allocated stuff */
|
||||
for (; ptr->next; ptr = ptr->next) ;
|
||||
|
||||
nptr = xcalloc(1, sizeof(*nptr));
|
||||
nptr->offset = ptr->offset + ptr->size;
|
||||
nptr->size = pGeode->offscreenSize -
|
||||
(nptr->offset - pGeode->offscreenStart);
|
||||
|
||||
nptr->next = ptr->next;
|
||||
nptr->prev = ptr;
|
||||
ptr->next = nptr;
|
||||
|
||||
return nptr;
|
||||
}
|
||||
|
||||
/* Allocate 'size' bytes of offscreen memory.
|
||||
*/
|
||||
|
||||
GeodeMemPtr
|
||||
GeodeAllocOffscreen(GeodeRec * pGeode, int size, int align)
|
||||
{
|
||||
GeodeMemPtr ptr = pGeode->offscreenList;
|
||||
GeodeMemPtr nptr;
|
||||
|
||||
unsigned int offset;
|
||||
|
||||
if (!pGeode->offscreenList) {
|
||||
|
||||
if (size > pGeode->offscreenSize)
|
||||
return NULL;
|
||||
|
||||
offset = ALIGN(pGeode->offscreenStart, align);
|
||||
|
||||
pGeode->offscreenList = xcalloc(1, sizeof(*nptr));
|
||||
pGeode->offscreenList->offset = offset;
|
||||
pGeode->offscreenList->size = size;
|
||||
pGeode->offscreenList->next = NULL;
|
||||
|
||||
return pGeode->offscreenList;
|
||||
}
|
||||
|
||||
while (ptr) {
|
||||
unsigned int gap;
|
||||
|
||||
if (ptr->next == NULL)
|
||||
gap = pGeode->offscreenSize + pGeode->offscreenStart;
|
||||
|
||||
else
|
||||
gap = ptr->next->offset;
|
||||
|
||||
gap = gap - (ptr->offset + ptr->size);
|
||||
gap = ALIGN(gap, align);
|
||||
|
||||
if (size < gap) {
|
||||
offset = ptr->offset + ptr->size;
|
||||
offset = ALIGN(ptr->offset + ptr->size, align);
|
||||
|
||||
nptr = xcalloc(1, sizeof(*nptr));
|
||||
nptr->offset = offset;
|
||||
nptr->size = size;
|
||||
nptr->next = ptr->next;
|
||||
nptr->prev = ptr;
|
||||
ptr->next = nptr;
|
||||
|
||||
return nptr;
|
||||
}
|
||||
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Carve out the space for the visible screen, and carve out
|
||||
the usual suspects that need offscreen memory
|
||||
*/
|
||||
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
void
|
||||
LXInitOffscreen(ScrnInfoPtr pScrni)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
unsigned int fbavail;
|
||||
GeodeMemPtr ptr;
|
||||
|
||||
/* The scratch buffer is always used */
|
||||
fbavail = pGeode->FBAvail - GP3_SCRATCH_BUFFER_SIZE;
|
||||
|
||||
pGeode->displaySize = MAX(pScrni->virtualX, pScrni->virtualY)
|
||||
* pGeode->Pitch;
|
||||
|
||||
pGeode->offscreenStart = pGeode->displaySize;
|
||||
pGeode->offscreenSize = fbavail - pGeode->displaySize;
|
||||
|
||||
/* Allocate the usual memory suspects */
|
||||
if (pGeode->tryCompression) {
|
||||
int size = pScrni->virtualY * LX_CB_PITCH;
|
||||
|
||||
/* The compression buffer needs to be 16 byte aligned */
|
||||
ptr = GeodeAllocOffscreen(pGeode, size, 16);
|
||||
|
||||
if (ptr != NULL) {
|
||||
pGeode->CBData.compression_offset = ptr->offset;
|
||||
pGeode->CBData.size = LX_CB_PITCH;
|
||||
pGeode->CBData.pitch = LX_CB_PITCH;
|
||||
|
||||
pGeode->Compression = TRUE;
|
||||
} else {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Not enough memory for compression\n");
|
||||
pGeode->Compression = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (pGeode->tryHWCursor) {
|
||||
ptr = GeodeAllocOffscreen(pGeode,
|
||||
LX_CURSOR_HW_WIDTH * 4 * LX_CURSOR_HW_HEIGHT, 4);
|
||||
|
||||
if (ptr != NULL) {
|
||||
pGeode->CursorStartOffset = ptr->offset;
|
||||
pGeode->HWCursor = TRUE;
|
||||
} else {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Not enough memory for the hardware cursor\n");
|
||||
pGeode->HWCursor = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pGeode->NoAccel && pGeode->pExa) {
|
||||
int size;
|
||||
|
||||
/* Try to get the scratch buffer for blending */
|
||||
pGeode->exaBfrOffset = 0;
|
||||
|
||||
if (pGeode->exaBfrSz > 0) {
|
||||
ptr = GeodeAllocOffscreen(pGeode, pGeode->exaBfrSz, 4);
|
||||
if (ptr != NULL)
|
||||
pGeode->exaBfrOffset = ptr->offset;
|
||||
}
|
||||
|
||||
pGeode->pExa->offScreenBase = 0;
|
||||
pGeode->pExa->memorySize = 0;
|
||||
|
||||
/* This might cause complaints - in order to avoid using
|
||||
xorg.conf as much as possible, we make assumptions about
|
||||
what a "default" memory map would look like. After
|
||||
discussion, we agreed that the default driver should assume
|
||||
the user will want to use rotation and video overlays, and
|
||||
EXA will get whatever is leftover.
|
||||
*/
|
||||
|
||||
/* Get the amount of offscreen memory still left */
|
||||
size = GeodeOffscreenFreeSize(pGeode);
|
||||
|
||||
/* Deduct the maxmimum size of a video overlay */
|
||||
size -= 0x200000;
|
||||
|
||||
/* Deduct the probable size of a shadow buffer */
|
||||
size -= pScrni->virtualX *
|
||||
(pScrni->virtualY * (pScrni->bitsPerPixel >> 3));
|
||||
|
||||
/* Align the size to a K boundary */
|
||||
size &= ~1023;
|
||||
|
||||
/* Allocate the EXA offscreen space */
|
||||
ptr = GeodeAllocOffscreen(pGeode, size, 4);
|
||||
|
||||
if (ptr == NULL) {
|
||||
/* If we couldn't allocate what we wanted,
|
||||
* then allocate whats left */
|
||||
|
||||
ptr = GeodeAllocRemainder(pGeode);
|
||||
}
|
||||
|
||||
if (ptr != NULL) {
|
||||
pGeode->pExa->offScreenBase = ptr->offset;
|
||||
pGeode->pExa->memorySize = ptr->offset + ptr->size;
|
||||
}
|
||||
}
|
||||
|
||||
/* Show the memory map for diagnostic purposes */
|
||||
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO, "LX video memory:\n");
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Display: 0x%x bytes\n",
|
||||
pGeode->displaySize);
|
||||
|
||||
if (pGeode->Compression)
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Compression: 0x%x bytes\n",
|
||||
pScrni->virtualY * LX_CB_PITCH);
|
||||
|
||||
if (pGeode->HWCursor)
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Cursor: 0x%x bytes\n",
|
||||
LX_CURSOR_HW_WIDTH * 4 * LX_CURSOR_HW_HEIGHT);
|
||||
|
||||
if (pGeode->pExa->offScreenBase)
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO, " EXA: 0x%x bytes\n",
|
||||
(unsigned int)(pGeode->pExa->memorySize -
|
||||
pGeode->pExa->offScreenBase));
|
||||
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_INFO, " FREE: 0x%x bytes\n",
|
||||
GeodeOffscreenFreeSize(pGeode));
|
||||
}
|
||||
|
||||
/* Called as we go down, so blitz everybody */
|
||||
|
||||
void
|
||||
GeodeCloseOffscreen(ScrnInfoPtr pScrni)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
GeodeMemPtr ptr = pGeode->offscreenList;
|
||||
GeodeMemPtr nptr;
|
||||
|
||||
while (ptr) {
|
||||
nptr = ptr->next;
|
||||
xfree(ptr);
|
||||
ptr = nptr;
|
||||
}
|
||||
|
||||
pGeode->offscreenList = NULL;
|
||||
}
|
283
driver/xf86-video-geode/src/lx_output.c
Normal file
283
driver/xf86-video-geode/src/lx_output.c
Normal file
@ -0,0 +1,283 @@
|
||||
/* Copyright (c) 2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Neither the name of the Advanced Micro Devices, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xf86.h"
|
||||
#include "X11/Xatom.h"
|
||||
#include "geode.h"
|
||||
#include "xf86Modes.h"
|
||||
#include "xf86Crtc.h"
|
||||
#include "cim/cim_defs.h"
|
||||
#include "cim/cim_regs.h"
|
||||
|
||||
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
|
||||
|
||||
typedef struct _LXOutputPrivateRec
|
||||
{
|
||||
I2CBusPtr pDDCBus;
|
||||
} LXOutputPrivateRec, *LXOutputPrivatePtr;
|
||||
|
||||
static Atom scale_atom;
|
||||
|
||||
static void
|
||||
lx_create_resources(xf86OutputPtr output)
|
||||
{
|
||||
int ret;
|
||||
char *s;
|
||||
ScrnInfoPtr pScrni = output->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
/* Scaling is only used for panels */
|
||||
|
||||
if (!(pGeode->Output & OUTPUT_PANEL))
|
||||
return;
|
||||
|
||||
scale_atom = MAKE_ATOM("scale");
|
||||
ret = RRConfigureOutputProperty(output->randr_output,
|
||||
scale_atom, FALSE, FALSE, FALSE, 0, NULL);
|
||||
|
||||
if (ret) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"RRConfigureOutputProperty error %d\n", ret);
|
||||
}
|
||||
|
||||
s = "on";
|
||||
ret = RRChangeOutputProperty(output->randr_output, scale_atom,
|
||||
XA_STRING, 8, PropModeReplace, strlen(s), (pointer) s, FALSE, FALSE);
|
||||
|
||||
if (ret) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"RRCharOutputProperty error %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
lx_output_set_property(xf86OutputPtr output, Atom property,
|
||||
RRPropertyValuePtr value)
|
||||
{
|
||||
ScrnInfoPtr pScrni = output->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
Bool scale = pGeode->Scale;
|
||||
char *s;
|
||||
int ret;
|
||||
|
||||
if (property != scale_atom)
|
||||
return FALSE;
|
||||
|
||||
if (value->type != XA_STRING || value->format != 8)
|
||||
return FALSE;
|
||||
|
||||
s = (char *)value->data;
|
||||
|
||||
if (value->size == 2 && !strncmp("on", s, 2))
|
||||
pGeode->Scale = TRUE;
|
||||
else if (value->size == 3 && !strncmp("off", s, 3))
|
||||
pGeode->Scale = FALSE;
|
||||
|
||||
if (pGeode->Scale != scale && output->crtc) {
|
||||
xf86CrtcPtr crtc = output->crtc;
|
||||
|
||||
if (crtc->enabled) {
|
||||
ret = xf86CrtcSetMode(crtc, &crtc->desiredMode,
|
||||
crtc->desiredRotation, crtc->desiredX, crtc->desiredY);
|
||||
|
||||
if (!ret) {
|
||||
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
|
||||
"Failed to set mode after property change!\n");
|
||||
|
||||
pGeode->Scale = scale;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_dpms(xf86OutputPtr output, int mode)
|
||||
{
|
||||
/* DPMS is handled by the CRTC */
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_prepare(xf86OutputPtr output)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_commit(xf86OutputPtr output)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_save(xf86OutputPtr output)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_restore(xf86OutputPtr output)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
static int
|
||||
lx_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
|
||||
{
|
||||
ScrnInfoPtr pScrni = output->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
/* No scaling > for modes with > 1024 width */
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL) {
|
||||
if ((pMode->HDisplay != pGeode->panelMode->HDisplay) &&
|
||||
pMode->HDisplay > 1024)
|
||||
return MODE_BAD;
|
||||
}
|
||||
|
||||
return MODE_OK;
|
||||
}
|
||||
|
||||
static Bool
|
||||
lx_output_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
|
||||
DisplayModePtr adjusted_mode)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_mode_set(xf86OutputPtr output, DisplayModePtr mode,
|
||||
DisplayModePtr adjusted_mode)
|
||||
{
|
||||
ScrnInfoPtr pScrni = output->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
/* Configure the output path */
|
||||
|
||||
if (pGeode->Output & OUTPUT_PANEL)
|
||||
df_set_output_path((pGeode->Output & OUTPUT_CRT) ?
|
||||
DF_DISPLAY_CRT_FP : DF_DISPLAY_FP);
|
||||
else
|
||||
df_set_output_path(DF_DISPLAY_CRT);
|
||||
}
|
||||
|
||||
static xf86OutputStatus
|
||||
lx_output_detect(xf86OutputPtr output)
|
||||
{
|
||||
/* We assume that there is always something
|
||||
* out there */
|
||||
|
||||
return XF86OutputStatusConnected;
|
||||
}
|
||||
|
||||
static DisplayModePtr
|
||||
lx_output_get_modes(xf86OutputPtr output)
|
||||
{
|
||||
ScrnInfoPtr pScrni = output->scrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
LXOutputPrivatePtr lx_output = output->driver_private;
|
||||
|
||||
xf86MonPtr mon;
|
||||
DisplayModePtr modes;
|
||||
|
||||
if (!(pGeode->Output & OUTPUT_PANEL)) {
|
||||
mon = xf86OutputGetEDID(output, lx_output->pDDCBus);
|
||||
xf86OutputSetEDID(output, mon);
|
||||
modes = xf86OutputGetEDIDModes(output);
|
||||
} else {
|
||||
modes = xf86DuplicateMode(pGeode->panelMode);
|
||||
}
|
||||
|
||||
return modes;
|
||||
}
|
||||
|
||||
static void
|
||||
lx_output_destroy(xf86OutputPtr output)
|
||||
{
|
||||
if (output->driver_private)
|
||||
xfree(output->driver_private);
|
||||
|
||||
output->driver_private = NULL;
|
||||
}
|
||||
|
||||
static const xf86OutputFuncsRec lx_output_funcs = {
|
||||
.create_resources = lx_create_resources,
|
||||
.dpms = lx_output_dpms,
|
||||
.save = lx_output_save,
|
||||
.restore = lx_output_restore,
|
||||
.mode_valid = lx_output_mode_valid,
|
||||
.mode_fixup = lx_output_mode_fixup,
|
||||
.prepare = lx_output_prepare,
|
||||
.mode_set = lx_output_mode_set,
|
||||
.commit = lx_output_commit,
|
||||
.detect = lx_output_detect,
|
||||
.get_modes = lx_output_get_modes,
|
||||
.set_property = lx_output_set_property,
|
||||
.destroy = lx_output_destroy,
|
||||
};
|
||||
|
||||
void
|
||||
LXSetupOutput(ScrnInfoPtr pScrni)
|
||||
{
|
||||
xf86OutputPtr output;
|
||||
LXOutputPrivatePtr lxpriv;
|
||||
GeodePtr pGeode = GEODEPTR(pScrni);
|
||||
|
||||
output = xf86OutputCreate(pScrni, &lx_output_funcs, "default");
|
||||
|
||||
lxpriv = xnfcalloc(1, sizeof(LXOutputPrivateRec));
|
||||
|
||||
if (!lxpriv) {
|
||||
xf86OutputDestroy(output);
|
||||
return;
|
||||
}
|
||||
|
||||
output->driver_private = lxpriv;
|
||||
output->interlaceAllowed = TRUE;
|
||||
output->doubleScanAllowed = TRUE;
|
||||
|
||||
/* Set up the DDC bus */
|
||||
|
||||
GeodeI2CInit(pScrni, &lxpriv->pDDCBus, "CS5536 DDC");
|
||||
|
||||
if (pScrni->monitor->widthmm && pScrni->monitor->heightmm) {
|
||||
/* prioritize the admin's screen size */
|
||||
output->mm_width = pScrni->monitor->widthmm;
|
||||
output->mm_height = pScrni->monitor->heightmm;
|
||||
} else if (pGeode->mm_width && pGeode->mm_height) {
|
||||
/* if we have a panel that we're certain of the size of, set it */
|
||||
output->mm_width = pScrni->monitor->widthmm = pGeode->mm_width;
|
||||
output->mm_height = pScrni->monitor->heightmm = pGeode->mm_height;
|
||||
}
|
||||
|
||||
/* We only have one CRTC, and this output is tied to it */
|
||||
output->possible_crtcs = 1;
|
||||
}
|
142
driver/xf86-video-geode/src/lx_panel.c
Normal file
142
driver/xf86-video-geode/src/lx_panel.c
Normal file
@ -0,0 +1,142 @@
|
||||
/* Copyright (c) 2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Neither the name of the Advanced Micro Devices, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*/
|
||||
|
||||
/* Reference: Video Graphics Suite Specification:
|
||||
* VG Config Register (0x00) page 16
|
||||
* VG FP Register (0x02) page 18
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "xf86.h"
|
||||
#include "compiler.h"
|
||||
#include "xf86Modes.h"
|
||||
#include "geode.h"
|
||||
|
||||
#define LX_READ_VG(reg) \
|
||||
(outw(0xAC1C,0xFC53), outw(0xAC1C,0x0200|(reg)), inw(0xAC1E))
|
||||
|
||||
/* This is borrowed from xerver/hw/xfree86/modes */
|
||||
|
||||
#define MODEPREFIX NULL, NULL, NULL, 0, M_T_DRIVER
|
||||
#define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
|
||||
|
||||
DisplayModeRec lx_panel_modes[] = {
|
||||
{MODEPREFIX, 31200, 320, 354, 384, 400, 0, 240, 249, 253, 260, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 320x200@75 */
|
||||
{MODEPREFIX, 25175, 640, 656, 744, 800, 0, 480, 490, 492, 525, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 640x480@60 */
|
||||
{MODEPREFIX, 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 880x600@60 */
|
||||
{MODEPREFIX, 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 1024x768@60 */
|
||||
{MODEPREFIX, 81600, 1152, 1216, 1336, 1520, 0, 864, 865, 868, 895, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 1152x864@60 */
|
||||
{MODEPREFIX, 108000, 1028, 1328, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 1280x1024@60 */
|
||||
{MODEPREFIX, 162000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
|
||||
V_NHSYNC | V_NVSYNC, MODESUFFIX}
|
||||
, /* 1600x100@60 */
|
||||
};
|
||||
|
||||
/* Get the legacy panel size from VSA, and return the associated mode rec */
|
||||
|
||||
DisplayModePtr
|
||||
LXGetLegacyPanelMode(void)
|
||||
{
|
||||
unsigned short reg = LX_READ_VG(0x00);
|
||||
unsigned char ret = (reg >> 8) & 0x07;
|
||||
|
||||
if ((ret == 1 || ret == 5)) {
|
||||
|
||||
reg = LX_READ_VG(0x02);
|
||||
ret = (reg >> 3) & 0x07;
|
||||
|
||||
/* 7 is a "reserved" value - if we get it, we can only
|
||||
* assume that a panel doesn't exist (or it hasn't been
|
||||
* configured in the BIOS)
|
||||
*/
|
||||
|
||||
if (ret < 7)
|
||||
return &lx_panel_modes[ret];
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Construct a moderec from the specified panel mode */
|
||||
|
||||
DisplayModePtr
|
||||
LXGetManualPanelMode(char *modestr)
|
||||
{
|
||||
int clock;
|
||||
int hactive, hsstart, hsend, htotal;
|
||||
int vactive, vsstart, vsend, vtotal;
|
||||
DisplayModePtr mode;
|
||||
char sname[32];
|
||||
|
||||
int ret = sscanf(modestr, "%d %d %d %d %d %d %d %d %d",
|
||||
&clock,
|
||||
&hactive, &hsstart, &hsend, &htotal,
|
||||
&vactive, &vsstart, &vsend, &vtotal);
|
||||
|
||||
if (ret != 9)
|
||||
return NULL;
|
||||
|
||||
mode = xnfcalloc(1, sizeof(DisplayModeRec));
|
||||
|
||||
if (mode == NULL)
|
||||
return NULL;
|
||||
|
||||
sprintf(sname, "%dx%d", hactive, vactive);
|
||||
|
||||
mode->name = xnfalloc(strlen(sname) + 1);
|
||||
|
||||
mode->type = M_T_DRIVER | M_T_PREFERRED;
|
||||
mode->Clock = clock;
|
||||
mode->HDisplay = hactive;
|
||||
mode->HSyncStart = hsstart;
|
||||
mode->HSyncEnd = hsend;
|
||||
mode->HTotal = htotal;
|
||||
mode->VDisplay = vactive;
|
||||
mode->VSyncStart = vsstart;
|
||||
mode->VSyncEnd = vsend;
|
||||
mode->VTotal = vtotal;
|
||||
|
||||
mode->prev = mode->next = NULL;
|
||||
|
||||
return mode;
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Neither the name of the Advanced Micro Devices, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is the main file used to add Cimarron graphics support to a software
|
||||
* project. The main reason to have a single file include the other files
|
||||
* is that it centralizes the location of the compiler options. This file
|
||||
* should be tuned for a specific implementation, and then modified as needed
|
||||
* for new Cimarron releases. The releases.txt file indicates any updates to
|
||||
* this main file, such as a new definition for a new hardware platform.
|
||||
*
|
||||
* In other words, this file should be copied from the Cimarron source files
|
||||
* once when a software project starts, and then maintained as necessary.
|
||||
* It should not be recopied with new versions of Cimarron unless the
|
||||
* developer is willing to tune the file again for the specific project.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "cim_defs.h"
|
||||
|
||||
extern unsigned char *cim_vid_ptr;
|
||||
|
||||
void cim_write_vid32(unsigned long offset, unsigned long value);
|
||||
unsigned long cim_read_vid32(unsigned long offset);
|
||||
|
||||
void
|
||||
cim_write_vid32(unsigned long offset, unsigned long value)
|
||||
{
|
||||
WRITE_VID32(offset, value);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
cim_read_vid32(unsigned long offset)
|
||||
{
|
||||
unsigned long value;
|
||||
|
||||
value = READ_VID32(offset);
|
||||
return value;
|
||||
}
|
@ -1,277 +0,0 @@
|
||||
/* Copyrightg (c) 2007 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Neither the name of the Advanced Micro Devices, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xf86.h"
|
||||
#include "shadow.h"
|
||||
#include "geode.h"
|
||||
|
||||
static void
|
||||
LXShadowSave(ScreenPtr pScreen, ExaOffscreenArea * area)
|
||||
{
|
||||
ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum];
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
if (area == pGeode->shadowArea)
|
||||
pGeode->shadowArea = NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
LXWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
|
||||
CARD32 * size, void *closure)
|
||||
{
|
||||
ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum];
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
*size = pGeode->displayPitch;
|
||||
|
||||
return (pGeode->FBBase + pGeode->displayOffset) +
|
||||
row * pGeode->displayPitch + offset;
|
||||
}
|
||||
|
||||
static void
|
||||
LXUpdateFunc(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||
{
|
||||
RegionPtr damage = shadowDamage(pBuf);
|
||||
|
||||
int nbox = REGION_NUM_RECTS(damage);
|
||||
BoxPtr pbox = REGION_RECTS(damage);
|
||||
int x, y, w, h, degrees = 0;
|
||||
FbStride shaStride;
|
||||
FbBits *shaBits;
|
||||
int shaBpp, dx = 0, dy = 0, dw, dh;
|
||||
int shaXoff, shaYoff;
|
||||
unsigned int srcOffset, dstOffset;
|
||||
PixmapPtr pShadow = pBuf->pPixmap;
|
||||
ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum];
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
fbGetDrawable(&pShadow->drawable, shaBits, shaStride, shaBpp, shaXoff,
|
||||
shaYoff);
|
||||
|
||||
/* Set up the blt */
|
||||
|
||||
gp_wait_until_idle();
|
||||
gp_declare_blt(0);
|
||||
|
||||
gp_set_bpp(pScrni->bitsPerPixel);
|
||||
|
||||
switch (shaBpp) {
|
||||
case 8:
|
||||
gp_set_source_format(CIMGP_SOURCE_FMT_3_3_2);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
gp_set_source_format(CIMGP_SOURCE_FMT_0_5_6_5);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
case 32:
|
||||
gp_set_source_format(CIMGP_SOURCE_FMT_8_8_8_8);
|
||||
break;
|
||||
}
|
||||
|
||||
gp_set_raster_operation(0xCC);
|
||||
gp_write_parameters();
|
||||
|
||||
while (nbox--) {
|
||||
x = pbox->x1;
|
||||
y = pbox->y1;
|
||||
w = (pbox->x2 - pbox->x1);
|
||||
h = pbox->y2 - pbox->y1;
|
||||
|
||||
srcOffset =
|
||||
((unsigned long)shaBits) - ((unsigned long)pGeode->FBBase);
|
||||
srcOffset += (y * pGeode->Pitch) + (x * (shaBpp >> 3));
|
||||
|
||||
switch (pGeode->rotation) {
|
||||
case RR_Rotate_0:
|
||||
dx = x;
|
||||
dy = y;
|
||||
dw = w;
|
||||
dh = h;
|
||||
degrees = 0;
|
||||
break;
|
||||
|
||||
case RR_Rotate_90:
|
||||
dx = (pScrni->pScreen->height - 1) - (y + (h - 1));
|
||||
dy = x;
|
||||
dw = h;
|
||||
dh = w;
|
||||
degrees = 90;
|
||||
break;
|
||||
|
||||
case RR_Rotate_180:
|
||||
dx = (pScrni->pScreen->width - 1) - (x + (w - 1));
|
||||
dy = (pScrni->pScreen->height - 1) - (y + (h - 1));
|
||||
dw = w;
|
||||
dh = h;
|
||||
|
||||
degrees = 180;
|
||||
break;
|
||||
|
||||
case RR_Rotate_270:
|
||||
dy = (pScrni->pScreen->width - 1) - (x + (w - 1));
|
||||
dx = y;
|
||||
dw = h;
|
||||
dh = w;
|
||||
|
||||
degrees = 270;
|
||||
break;
|
||||
}
|
||||
|
||||
dstOffset = pGeode->displayOffset +
|
||||
(dy * pGeode->displayPitch) + (dx * (pScrni->bitsPerPixel >> 3));
|
||||
|
||||
gp_declare_blt(CIMGP_BLTFLAGS_HAZARD);
|
||||
gp_set_strides(pGeode->displayPitch, pGeode->Pitch);
|
||||
gp_rotate_blt(dstOffset, srcOffset, w, h, degrees);
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
LXSetRotatePitch(ScrnInfoPtr pScrni)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
pScrni->displayWidth = pGeode->displayWidth;
|
||||
|
||||
if (pGeode->Compression)
|
||||
pGeode->Pitch = GeodeCalculatePitchBytes(pScrni->displayWidth,
|
||||
pScrni->bitsPerPixel);
|
||||
else
|
||||
pGeode->Pitch = (pScrni->displayWidth * (pScrni->bitsPerPixel >> 3));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Bool
|
||||
LXAllocShadow(ScrnInfoPtr pScrni)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
PixmapPtr pPixmap;
|
||||
|
||||
int size;
|
||||
|
||||
if (pGeode->rotation == RR_Rotate_0) {
|
||||
|
||||
if (pGeode->shadowArea) {
|
||||
exaOffscreenFree(pScrni->pScreen, pGeode->shadowArea);
|
||||
pGeode->shadowArea = NULL;
|
||||
}
|
||||
|
||||
pScrni->fbOffset = pGeode->displayOffset;
|
||||
} else {
|
||||
if (pGeode->rotation == RR_Rotate_90
|
||||
|| pGeode->rotation == RR_Rotate_270)
|
||||
size = pGeode->displayPitch * pScrni->virtualX;
|
||||
else
|
||||
size = pGeode->displayPitch * pScrni->virtualY;
|
||||
|
||||
if (pGeode->shadowArea) {
|
||||
|
||||
if (pGeode->shadowArea->size < size) {
|
||||
exaOffscreenFree(pScrni->pScreen, pGeode->shadowArea);
|
||||
pGeode->shadowArea = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (pGeode->shadowArea == NULL) {
|
||||
pGeode->shadowArea =
|
||||
exaOffscreenAlloc(pScrni->pScreen, size, 32, TRUE,
|
||||
LXShadowSave, pGeode);
|
||||
|
||||
if (pGeode->shadowArea == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pScrni->fbOffset = pGeode->shadowArea->offset;
|
||||
}
|
||||
|
||||
pPixmap = pScrni->pScreen->GetScreenPixmap(pScrni->pScreen);
|
||||
|
||||
pScrni->pScreen->ModifyPixmapHeader(pPixmap,
|
||||
pScrni->pScreen->width,
|
||||
pScrni->pScreen->height,
|
||||
pScrni->pScreen->rootDepth,
|
||||
pScrni->bitsPerPixel,
|
||||
PixmapBytePad(pScrni->displayWidth, pScrni->pScreen->rootDepth),
|
||||
(pointer) (pGeode->FBBase + pScrni->fbOffset));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Bool
|
||||
LXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
Rotation curr = pGeode->rotation;
|
||||
unsigned int curdw = pScrni->displayWidth;
|
||||
PixmapPtr pPixmap;
|
||||
BOOL ret;
|
||||
|
||||
pPixmap = pScrni->pScreen->GetScreenPixmap(pScrni->pScreen);
|
||||
pGeode->rotation = LXGetRotation(pScrni->pScreen);
|
||||
|
||||
/* Leave if we have nothing to do */
|
||||
|
||||
if (pGeode->rotation == curr && pGeode->curMode == mode) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
shadowRemove(pScrni->pScreen, NULL);
|
||||
|
||||
LXSetRotatePitch(pScrni);
|
||||
|
||||
if (pGeode->rotation != RR_Rotate_0) {
|
||||
|
||||
ret = shadowAdd(pScrni->pScreen, pPixmap, LXUpdateFunc,
|
||||
LXWindowLinear, pGeode->rotation, NULL);
|
||||
|
||||
if (!ret)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (LXAllocShadow(pScrni))
|
||||
return TRUE;
|
||||
|
||||
error:
|
||||
/* Restore the old rotation */
|
||||
pScrni->displayWidth = curdw;
|
||||
|
||||
if (curr & (RR_Rotate_0 | RR_Rotate_180)) {
|
||||
pScrni->pScreen->width = pScrni->virtualX;
|
||||
pScrni->pScreen->height = pScrni->virtualY;
|
||||
} else {
|
||||
pScrni->pScreen->width = pScrni->virtualY;
|
||||
pScrni->pScreen->height = pScrni->virtualX;
|
||||
}
|
||||
|
||||
pGeode->rotation = curr;
|
||||
return FALSE;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Advanced Micro Devices, Inc.
|
||||
* Copyright (c) 2006-2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2007 Advanced Micro Devices, Inc.
|
||||
/* Copyright (c) 2007-2008 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
@ -38,7 +38,6 @@
|
||||
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86Resources.h"
|
||||
#include "compiler.h"
|
||||
#include "xf86PciInfo.h"
|
||||
#include "xf86Pci.h"
|
||||
@ -100,8 +99,7 @@ static XF86ImageRec Images[] = {
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *area;
|
||||
int offset;
|
||||
GeodeMemPtr vidmem;
|
||||
RegionRec clip;
|
||||
CARD32 filter;
|
||||
CARD32 colorKey;
|
||||
@ -130,38 +128,6 @@ LXCopyFromSys(GeodeRec * pGeode, unsigned char *src, unsigned int dst,
|
||||
gp_color_bitmap_to_screen_blt(dst, 0, w, h, src, srcPitch);
|
||||
}
|
||||
|
||||
static void
|
||||
LXVideoSave(ScreenPtr pScreen, ExaOffscreenArea * area)
|
||||
{
|
||||
ScrnInfoPtr pScrni = xf86Screens[pScreen->myNum];
|
||||
|
||||
GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni);
|
||||
|
||||
if (area == pPriv->area)
|
||||
pPriv->area = NULL;
|
||||
|
||||
LXStopVideo(pScrni, (void *)pPriv, TRUE);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
LXAllocateVidMem(ScrnInfoPtr pScrni, void **memp, int size)
|
||||
{
|
||||
ExaOffscreenArea *area = *memp;
|
||||
|
||||
if (area != NULL) {
|
||||
if (area->size >= size)
|
||||
return area->offset;
|
||||
|
||||
exaOffscreenFree(pScrni->pScreen, area);
|
||||
}
|
||||
|
||||
area = exaOffscreenAlloc(pScrni->pScreen, size, 16, TRUE,
|
||||
LXVideoSave, NULL);
|
||||
|
||||
*memp = area;
|
||||
return (area == NULL) ? 0 : area->offset;
|
||||
}
|
||||
|
||||
static void
|
||||
LXSetColorkey(ScrnInfoPtr pScrni, GeodePortPrivRec * pPriv)
|
||||
{
|
||||
@ -221,6 +187,24 @@ struct
|
||||
|
||||
/* Copy planar YUV data */
|
||||
|
||||
static Bool
|
||||
LXAllocMem(GeodeRec *pGeode, GeodePortPrivRec *pPriv, int size)
|
||||
{
|
||||
if (!pPriv->vidmem || pPriv->vidmem->size < size) {
|
||||
if (pPriv->vidmem)
|
||||
GeodeFreeOffscreen(pGeode, pPriv->vidmem);
|
||||
|
||||
pPriv->vidmem = GeodeAllocOffscreen(pGeode, size, 4);
|
||||
|
||||
if (pPriv->vidmem == NULL) {
|
||||
ErrorF("Could not allocate memory for the video\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
LXCopyPlanar(ScrnInfoPtr pScrni, int id, unsigned char *buf,
|
||||
short x1, short y1, short x2, short y2,
|
||||
@ -252,12 +236,8 @@ LXCopyPlanar(ScrnInfoPtr pScrni, int id, unsigned char *buf,
|
||||
size = YDstPitch * height;
|
||||
size += UVDstPitch * height;
|
||||
|
||||
pPriv->offset = LXAllocateVidMem(pScrni, &pPriv->area, size);
|
||||
|
||||
if (pPriv->offset == 0) {
|
||||
ErrorF("Error allocating an offscreen region.\n");
|
||||
if (LXAllocMem(pGeode, pPriv, size) == FALSE)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* The top of the source region we want to copy */
|
||||
top = y1 & ~1;
|
||||
@ -282,19 +262,21 @@ LXCopyPlanar(ScrnInfoPtr pScrni, int id, unsigned char *buf,
|
||||
|
||||
/* Copy Y */
|
||||
|
||||
LXCopyFromSys(pGeode, buf + YSrcOffset, pPriv->offset + YDstOffset,
|
||||
YDstPitch, YSrcPitch, lines, pixels);
|
||||
LXCopyFromSys(pGeode, buf + YSrcOffset,
|
||||
pPriv->vidmem->offset + YDstOffset, YDstPitch, YSrcPitch, lines,
|
||||
pixels);
|
||||
|
||||
/* Copy U + V at the same time */
|
||||
|
||||
LXCopyFromSys(pGeode, buf + USrcOffset, pPriv->offset + UDstOffset,
|
||||
UVDstPitch, UVSrcPitch, lines, pixels >> 1);
|
||||
LXCopyFromSys(pGeode, buf + USrcOffset,
|
||||
pPriv->vidmem->offset + UDstOffset, UVDstPitch, UVSrcPitch, lines,
|
||||
pixels >> 1);
|
||||
|
||||
videoScratch.dstOffset = pPriv->offset + YDstOffset;
|
||||
videoScratch.dstOffset = pPriv->vidmem->offset + YDstOffset;
|
||||
videoScratch.dstPitch = YDstPitch;
|
||||
videoScratch.UVPitch = UVDstPitch;
|
||||
videoScratch.UDstOffset = pPriv->offset + UDstOffset;
|
||||
videoScratch.VDstOffset = pPriv->offset + VDstOffset;
|
||||
videoScratch.UDstOffset = pPriv->vidmem->offset + UDstOffset;
|
||||
videoScratch.VDstOffset = pPriv->vidmem->offset + VDstOffset;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -315,12 +297,8 @@ LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf,
|
||||
|
||||
lines = ((dstPitch * height) + pGeode->Pitch - 1) / pGeode->Pitch;
|
||||
|
||||
pPriv->offset = LXAllocateVidMem(pScrni, &pPriv->area, height * dstPitch);
|
||||
|
||||
if (pPriv->offset == 0) {
|
||||
ErrorF("Error while allocating an offscreen region.\n");
|
||||
if (LXAllocMem(pGeode, pPriv, lines) == FALSE)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* The top of the source region we want to copy */
|
||||
top = y1;
|
||||
@ -335,7 +313,7 @@ LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf,
|
||||
srcOffset = (top * srcPitch) + left;
|
||||
|
||||
/* Calculate the destination offset */
|
||||
dstOffset = pPriv->offset + (top * dstPitch) + left;
|
||||
dstOffset = pPriv->vidmem->offset + (top * dstPitch) + left;
|
||||
|
||||
/* Make the copy happen */
|
||||
|
||||
@ -481,6 +459,7 @@ LXPutImage(ScrnInfoPtr pScrni,
|
||||
GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data;
|
||||
INT32 x1, x2, y1, y2;
|
||||
BoxRec dstBox;
|
||||
Bool ret;
|
||||
|
||||
if (pGeode->rotation != RR_Rotate_0)
|
||||
return Success;
|
||||
@ -513,20 +492,16 @@ LXPutImage(ScrnInfoPtr pScrni,
|
||||
dstBox.y1 -= pScrni->frameY0;
|
||||
dstBox.y2 -= pScrni->frameY0;
|
||||
|
||||
switch (id) {
|
||||
case FOURCC_YV12:
|
||||
case FOURCC_I420:
|
||||
LXCopyPlanar(pScrni, id, buf, x1, y1, x2, y2, width, height, data);
|
||||
break;
|
||||
|
||||
case FOURCC_UYVY:
|
||||
case FOURCC_YUY2:
|
||||
case FOURCC_Y800:
|
||||
case FOURCC_RGB565:
|
||||
LXCopyPacked(pScrni, id, buf, x1, y1, x2, y2, width, height, data);
|
||||
break;
|
||||
}
|
||||
if (id == FOURCC_YV12 || id == FOURCC_I420)
|
||||
ret = LXCopyPlanar(pScrni, id, buf, x1, y1, x2, y2, width,
|
||||
height, data);
|
||||
else
|
||||
ret = LXCopyPacked(pScrni, id, buf, x1, y1, x2, y2, width,
|
||||
height, data);
|
||||
|
||||
if (ret == FALSE)
|
||||
return BadAlloc;
|
||||
|
||||
if (!RegionsEqual(&pPriv->clip, clipBoxes) ||
|
||||
(drawW != pPriv->pwidth || drawH != pPriv->pheight)) {
|
||||
REGION_COPY(pScrni->pScreen, &pPriv->clip, clipBoxes);
|
||||
@ -542,7 +517,6 @@ LXPutImage(ScrnInfoPtr pScrni,
|
||||
}
|
||||
|
||||
pPriv->videoStatus = CLIENT_VIDEO_ON;
|
||||
pGeode->OverlayON = TRUE;
|
||||
|
||||
return Success;
|
||||
}
|
||||
@ -622,15 +596,14 @@ LXStopVideo(ScrnInfoPtr pScrni, pointer data, Bool exit)
|
||||
WRITE_VID32(DF_VID_MISC, val | DF_GAMMA_BYPASS_BOTH);
|
||||
}
|
||||
|
||||
if (pPriv->area) {
|
||||
exaOffscreenFree(pScrni->pScreen, pPriv->area);
|
||||
pPriv->area = NULL;
|
||||
if (pPriv->vidmem) {
|
||||
GeodeFreeOffscreen(pGeode, pPriv->vidmem);
|
||||
pPriv->vidmem = NULL;
|
||||
}
|
||||
|
||||
pPriv->videoStatus = 0;
|
||||
|
||||
/* Eh? */
|
||||
pGeode->OverlayON = FALSE;
|
||||
} else if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
|
||||
pPriv->videoStatus |= OFF_TIMER;
|
||||
pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
|
||||
@ -684,9 +657,10 @@ LXVidBlockHandler(int i, pointer blockData, pointer pTimeout,
|
||||
}
|
||||
} else {
|
||||
if (pPriv->freeTime < now) {
|
||||
if (pPriv->area) {
|
||||
exaOffscreenFree(pScrni->pScreen, pPriv->area);
|
||||
pPriv->area = NULL;
|
||||
|
||||
if (pPriv->vidmem) {
|
||||
GeodeFreeOffscreen(pGeode, pPriv->vidmem);
|
||||
pPriv->vidmem = NULL;
|
||||
}
|
||||
|
||||
pPriv->videoStatus = 0;
|
||||
@ -740,8 +714,9 @@ LXSetupImageVideo(ScreenPtr pScrn)
|
||||
/* Use the common function */
|
||||
adapt->QueryImageAttributes = GeodeQueryImageAttributes;
|
||||
|
||||
pPriv->vidmem = NULL;
|
||||
pPriv->filter = 0;
|
||||
pPriv->colorKey = pGeode->videoKey;
|
||||
pPriv->colorKey = 0;
|
||||
pPriv->colorKeyMode = 0;
|
||||
pPriv->videoStatus = 0;
|
||||
pPriv->pwidth = 0;
|
||||
@ -767,8 +742,7 @@ LXSetupImageVideo(ScreenPtr pScrn)
|
||||
|
||||
struct OffscreenPrivRec
|
||||
{
|
||||
void *area;
|
||||
int offset;
|
||||
GeodeMemPtr vidmem;
|
||||
Bool isOn;
|
||||
};
|
||||
|
||||
@ -825,9 +799,8 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w,
|
||||
unsigned short h, XF86SurfacePtr surface)
|
||||
{
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
void *area = NULL;
|
||||
int pitch, lines;
|
||||
unsigned offset;
|
||||
GeodeMemPtr vidmem;
|
||||
struct OffscreenPrivRec *pPriv;
|
||||
|
||||
if (w > 1024 || h > 1024)
|
||||
@ -839,9 +812,9 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w,
|
||||
pitch = ((w << 1) + 15) & ~15;
|
||||
lines = ((pitch * h) + (pGeode->Pitch - 1)) / pGeode->Pitch;
|
||||
|
||||
offset = LXAllocateVidMem(pScrni, &area, lines);
|
||||
vidmem = GeodeAllocOffscreen(pGeode, lines, 4);
|
||||
|
||||
if (offset == 0) {
|
||||
if (vidmem == NULL) {
|
||||
ErrorF("Error while allocating an offscreen region.\n");
|
||||
return BadAlloc;
|
||||
}
|
||||
@ -857,15 +830,14 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w,
|
||||
|
||||
if (pPriv && surface->pitches && surface->offsets) {
|
||||
|
||||
pPriv->area = area;
|
||||
pPriv->offset = offset;
|
||||
pPriv->vidmem = vidmem;
|
||||
|
||||
pPriv->isOn = FALSE;
|
||||
|
||||
surface->pScrn = pScrni;
|
||||
surface->id = id;
|
||||
surface->pitches[0] = pitch;
|
||||
surface->offsets[0] = offset;
|
||||
surface->offsets[0] = vidmem->offset;
|
||||
surface->devPrivate.ptr = (pointer) pPriv;
|
||||
|
||||
return Success;
|
||||
@ -877,8 +849,8 @@ LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w,
|
||||
if (surface->pitches)
|
||||
xfree(surface->pitches);
|
||||
|
||||
if (area)
|
||||
exaOffscreenFree(pScrni->pScreen, area);
|
||||
if (vidmem)
|
||||
GeodeFreeOffscreen(pGeode, vidmem);
|
||||
|
||||
return BadAlloc;
|
||||
}
|
||||
@ -899,13 +871,14 @@ LXFreeSurface(XF86SurfacePtr surface)
|
||||
struct OffscreenPrivRec *pPriv = (struct OffscreenPrivRec *)
|
||||
surface->devPrivate.ptr;
|
||||
ScrnInfoPtr pScrni = surface->pScrn;
|
||||
GeodeRec *pGeode = GEODEPTR(pScrni);
|
||||
|
||||
if (pPriv->isOn)
|
||||
LXStopSurface(surface);
|
||||
|
||||
if (pPriv->area) {
|
||||
exaOffscreenFree(pScrni->pScreen, pPriv->area);
|
||||
pPriv->area = NULL;
|
||||
if (pPriv->vidmem) {
|
||||
GeodeFreeOffscreen(pGeode, pPriv->vidmem);
|
||||
pPriv->vidmem = NULL;
|
||||
}
|
||||
|
||||
xfree(surface->pitches);
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "xf86.h"
|
||||
#include <X11/extensions/Xv.h>
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86Resources.h"
|
||||
#include "compiler.h"
|
||||
#include "xf86xv.h"
|
||||
#include "fourcc.h"
|
||||
@ -1723,7 +1722,7 @@ static MODULESETUPPROTO(z4lSetup);
|
||||
static XF86ModuleVersionInfo z4lVersionRec = {
|
||||
"ztv",
|
||||
MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2,
|
||||
XF86_VERSION_CURRENT, 0, 0, 1,
|
||||
XORG_VERSION_CURRENT, 0, 0, 1,
|
||||
ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_NONE,
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user