Update to xf86-video-openchrome 0.2.904.

Tested by myself and kevlo@ on V800 and V855 chipsets.
This commit is contained in:
matthieu 2009-11-24 16:54:55 +00:00
parent 2baec57bee
commit c3d957f5fb
40 changed files with 1676 additions and 1532 deletions

View File

@ -1,3 +1,111 @@
2009-09-26 Bartosz Kosiorek <gang65@poczta.onet.pl>
Save/restore ECK Clock Synthesizer
* src/via_driver.c: (VIASave), (VIARestore):
* src/via_driver.h:
2009-09-21 Bartosz Kosiorek <gang65@poczta.onet.pl>
Fixed bug with panel autodetection using
ViaPanelGetNativeModeFromScratchPad function
* src/via_panel.c:
2009-09-21 Bartosz Kosiorek <gang65@poczta.onet.pl>
Fixed problem with backlite (Ticket #308)
* src/via_lvds.c: (ViaLVDSSoftwarePowerFirstSequence),
(ViaLVDSSoftwarePowerSecondSequence),
(ViaLVDSHardwarePowerFirstSequence),
(ViaLVDSHardwarePowerSecondSequence), (ViaLVDSPower):
2009-09-15 Bartosz Kosiorek <gang65@poczta.onet.pl>
TV-out VT1625 chip support
* src/via_bios.h:
* src/via_crtc.c: (ViaFirstCRTCSetMode):
* src/via_display.c: (ViaDisplayEnableDVO), (ViaDisplayDisableDVO),
(ViaDisplaySetStreamOnDVO):
* src/via_driver.c: (VIASetupDefaultOptions), (VIAPreInit):
* src/via_mode.c: (ViaTVSetMode), (ViaOutputsSelect), (ViaModeSet):
* src/via_vt162x.c: (ViaSetTVClockSource), (VT1622ModeI2C),
(VT1622ModeCrtc):
* src/via_vt162x.h:
2009-09-15 Bartosz Kosiorek <gang65@poczta.onet.pl>
Cursor support speedup
* src/via_cursor.c: (viaHWCursorInit), (viaCursorStore),
(viaCursorRestore), (viaShowCursor), (viaHideCursor),
(viaSetCursorPosition), (viaLoadCursorImage), (viaLoadCursorARGB):
2009-09-14 Bartosz Kosiorek <gang65@poczta.onet.pl>
Removed two old variables:
pBIOSInfo->panelX
pBIOSInfo->panelY
and replaced it by:
pBIOSInfo->Panel->NativeMode->Width
pBIOSInfo->Panel->NativeMode->Height
* src/via_bios.h:
* src/via_driver.c: (VIASetupDefaultOptions):
* src/via_mode.c: (ViaPanelGetIndex), (VIASetLCDMode),
(ViaModePrimaryLegacy), (ViaModeSecondaryLegacy):
* src/via_swov.c: (SetVideoWindow):
* src/via_video.c: (DecideOverlaySupport):
2009-09-10 Bartosz Kosiorek <gang65@poczta.onet.pl>
Fix bug with DFP Power Off (ticket #317)
* src/via_mode.c: (ViaDFPPower):
2009-08-20 Bartosz Kosiorek <gang65@poczta.onet.pl>
Fix bug with wrong panel size value (http://www.openchrome.org/trac/ticket/301)
This bug appeared only when UseLegacyModeSwitch was TRUE
* src/via_driver.c: (VIASetupDefaultOptions):
* src/via_video.c: (DecideOverlaySupport):
2009-08-17 Bartosz Kosiorek <gang65@poczta.onet.pl>
Added support of the VIA OpenBook
* src/via_id.c:
2009-08-08 Bartosz Kosiorek <gang65@poczta.onet.pl>
Added support for screen rotate upside-down and remove "magic numbers"
* src/via_driver.c:
* src/via_driver.h:
* src/via_shadow.c:
2009-07-28 Jon Nettleton <jon.nettleton@gmail.com>
Forgot to remove an old Dot Clock entry from the table.
* src/via_mode.h:
2009-07-28 Jon Nettleton <jon.nettleton@gmail.com>
XO 1.5 Panel patch contributed by Xavier Bachelot.
Fixup some of the Dotclock code and add working plls
for the XO 1.5
* src/via_bios.h:
* src/via_mode.c: (ViaSetDotclock), (ViaSetPrimaryDotclock),
(ViaSetSecondaryDotclock):
* src/via_mode.h:
* src/via_panel.c:
2009-03-21 Xavier Bachelot <xavier@bachelot.org> 2009-03-21 Xavier Bachelot <xavier@bachelot.org>
* src/via_bios.h: * src/via_bios.h:

View File

@ -131,6 +131,8 @@ EXEEXT = @EXEEXT@
F77 = @F77@ F77 = @F77@
FFLAGS = @FFLAGS@ FFLAGS = @FFLAGS@
GREP = @GREP@ GREP = @GREP@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -163,6 +165,8 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@ XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@ XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@

View File

@ -1,3 +1,72 @@
openchrome 0.2.904 (09/10/2009)
-------------------------------
* New features :
- Basic VX855 support.
- VX800 support.
- CX700, VX800 integrated TMDS support.
- ARGB cursor support.
- Panel modesetting code rework.
* Bug fixes and enhancements :
- Add checking of the initialization of the XFree86 framebuffer manager.
- Save/restore ECK Clock Synthesizer.
- Fix bug with panel autodetection.
- Fixed problem with backlite (Ticket #308).
- Better VT1625 chipset support.
- Cursor support speedup.
- Fix bug with wrong panel size (Ticket #301).
- Remove build warnings and removed unused variables.
- Unified variable names with RandR.
- RandR initial support.
- Updated manpage.
- Add rotate upside-down and remove "Magic numbers".
- Disable TMDS by default for now, output detection is not working properly.
- Fix hardlock on resolution change.
- Remove loader symbol lists.
- XO-1.5 panel patch and dot clock fixup.
- Switch on LVDS pads only for active channel.
- Modify PLL generation and add VX855 support.
- Fix cursor on secondary.
- Fix a segfault on shutdown in ViaCleanupXVMC when there's no Xv.
- Fix null pointer dereference in viaExaCheckComposite.
- Clean up duplicate defines in via_regs.h.
- Remove VT8454B LCD flag.
- Make sure Chrome9 chipsets use software rasterizer for 3D.
- Cosmetic fix for ViaMMIODisable.
- Fix DFP pad mask.
- Fix possible use of uninitialized variable (ticket#292).
- Fix use of uninitialized variable.
- Fix 2D engine init.
- ViaPanelGetIndex: 1 bugfix and 1 cosmetic fix.
- Set P4M890 primary FIFO.
- Initialize CRTC before a mode switch. Fix bug #260.
- Small bug fixes for XAA and EXA.
- Minor bug fixes and tweaks.
- Remove support for old EXA.
- Fix 2d initialization for P4M900.
- Temporary workaround for freedesktop bug 21563.
- Adjust monitor values to handle preset LCD panel and TV modes.
- Fix placement of pVia->FrameBufferBase to MapFB.
- Clean up compile warnings.
- Fix crash worked around by XaaNoImageWriteRect.
- Restore panel backlight after VT switch (Ticket #29).
- XvMC Unichrome Pro allocation fixes.
- Add more needed modes to ViaPanelModes.
- XvMC symbol visibility.
- Properly link XvMC.
- Hide overlay when video is invisible (ticket #266).
- Allow FullHD with DDR400.
- Add missing 640x480 PAL mode for VT1625.
- Remove support for pre-xorg 7.1rc1 Xv ABI.
* New boards :
- Axper XP-M8VM800, Gigabyte M704 / RoverPC A700GQ, IBM AnyPlace Kiosk 3xx,
ECS P4M890T-M v2.0, Foxconn P4M800P7MB-RS2H, Haier A60-440256080BD,
Lenovo S12, Mitac 8624 (w/ P4M890), MSI K8M Neo-V (broken pci id),
MSI P4M900M3-L, Packard Bell Lima (ASUS MBP5VDZ-NVM), Samsung NC20,
Twinhead H12V, Twinhead M6, VIA Epia M700. VIA Openbook, Sharp PC-AE30J.
openchrome 0.2.903 (19/08/2008) openchrome 0.2.903 (19/08/2008)
------------------------------- -------------------------------
* Enhancements and bug fixes: * Enhancements and bug fixes:

View File

@ -13,11 +13,13 @@ SUPPORTED CHIPSETS :
- P4M890 (VT3327) - P4M890 (VT3327)
- K8M890 (VT3336) - K8M890 (VT3336)
- P4M900/VN896 (VT3364) - P4M900/VN896 (VT3364)
- VX800 (VT3353)
- VX855 (VT3409)
SUPPORTED FEATURES : SUPPORTED FEATURES :
-------------------- --------------------
- Free modesetting for Unichrome and Unichrome Pro chipset. - Free modesetting for Unichrome, Unichrome Pro and Chrome9 chipsets.
- VBE modesetting for everything not natively supported. - VBE modesetting for everything not natively supported.
- TV-out support. - TV-out support.
- EXA acceleration. - EXA acceleration.
@ -42,7 +44,7 @@ KNOWN BUGS/LIMITATIONS :
* XvMC * XvMC
- The hardware MPEG4 acceleration that is present on some chipsets is not - The hardware MPEG4 acceleration that is present on some chipsets is not
implemented. implemented.
- No XvMC support for CX700 (new, unsupported engine). - No XvMC support for CX700 and newer (new, unsupported engine).
- No XvMC support for K8M890, P4M890 and P4M900/VN896 (need to get dri working - No XvMC support for K8M890, P4M890 and P4M900/VN896 (need to get dri working
for them first). for them first).
@ -55,10 +57,11 @@ KNOWN BUGS/LIMITATIONS :
In other words, there is no dual screen support. In other words, there is no dual screen support.
* Misc. * Misc.
- Add-on and integrated TMDS encoders are not supported, except thru VBE. - Add-on TMDS encoders are not supported, except thru VBE.
- CX700, VX800 and VX855 integrated TMDS is supported.
* Chrome9 * Chrome9
- Chrome9 chipsets' family (P4M900 and K8M890) currently doesn't - Chrome9 chipsets' family (P4M900, K8M890, VX800, VX855) currently doesn't
support neither AGP DMA nor 3D acceleration. support neither AGP DMA nor 3D acceleration.

View File

@ -47,6 +47,9 @@
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* xextproto 7.1 available */
#undef HAVE_XEXTPROTO_71
/* Name of package */ /* Name of package */
#undef PACKAGE #undef PACKAGE

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.62 for xf86-video-openchrome 0.2.903. # Generated by GNU Autoconf 2.62 for xf86-video-openchrome 0.2.904.
# #
# Report bugs to <http://www.openchrome.org/trac/report/1>. # Report bugs to <http://www.openchrome.org/trac/report/1>.
# #
@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='xf86-video-openchrome' PACKAGE_NAME='xf86-video-openchrome'
PACKAGE_TARNAME='xf86-video-openchrome' PACKAGE_TARNAME='xf86-video-openchrome'
PACKAGE_VERSION='0.2.903' PACKAGE_VERSION='0.2.904'
PACKAGE_STRING='xf86-video-openchrome 0.2.903' PACKAGE_STRING='xf86-video-openchrome 0.2.904'
PACKAGE_BUGREPORT='http://www.openchrome.org/trac/report/1' PACKAGE_BUGREPORT='http://www.openchrome.org/trac/report/1'
ac_unique_file="Makefile.am" ac_unique_file="Makefile.am"
@ -900,6 +900,10 @@ LIBTOOL
PKG_CONFIG PKG_CONFIG
XORG_CFLAGS XORG_CFLAGS
XORG_LIBS XORG_LIBS
XEXT_CFLAGS
XEXT_LIBS
HAVE_XEXTPROTO_71_TRUE
HAVE_XEXTPROTO_71_FALSE
PCIACCESS_CFLAGS PCIACCESS_CFLAGS
PCIACCESS_LIBS PCIACCESS_LIBS
DRI_TRUE DRI_TRUE
@ -957,6 +961,8 @@ FFLAGS
PKG_CONFIG PKG_CONFIG
XORG_CFLAGS XORG_CFLAGS
XORG_LIBS XORG_LIBS
XEXT_CFLAGS
XEXT_LIBS
PCIACCESS_CFLAGS PCIACCESS_CFLAGS
PCIACCESS_LIBS PCIACCESS_LIBS
DRI_CFLAGS DRI_CFLAGS
@ -1515,7 +1521,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures xf86-video-openchrome 0.2.903 to adapt to many kinds of systems. \`configure' configures xf86-video-openchrome 0.2.904 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1586,7 +1592,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of xf86-video-openchrome 0.2.903:";; short | recursive ) echo "Configuration of xf86-video-openchrome 0.2.904:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1637,6 +1643,8 @@ Some influential environment variables:
PKG_CONFIG path to pkg-config utility PKG_CONFIG path to pkg-config utility
XORG_CFLAGS C compiler flags for XORG, overriding pkg-config XORG_CFLAGS C compiler flags for XORG, overriding pkg-config
XORG_LIBS linker flags for XORG, overriding pkg-config XORG_LIBS linker flags for XORG, overriding pkg-config
XEXT_CFLAGS C compiler flags for XEXT, overriding pkg-config
XEXT_LIBS linker flags for XEXT, overriding pkg-config
PCIACCESS_CFLAGS PCIACCESS_CFLAGS
C compiler flags for PCIACCESS, overriding pkg-config C compiler flags for PCIACCESS, overriding pkg-config
PCIACCESS_LIBS PCIACCESS_LIBS
@ -1712,7 +1720,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
xf86-video-openchrome configure 0.2.903 xf86-video-openchrome configure 0.2.904
generated by GNU Autoconf 2.62 generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1726,7 +1734,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by xf86-video-openchrome $as_me 0.2.903, which was It was created by xf86-video-openchrome $as_me 0.2.904, which was
generated by GNU Autoconf 2.62. Invocation command line was generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@ $ $0 $@
@ -2380,7 +2388,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='xf86-video-openchrome' PACKAGE='xf86-video-openchrome'
VERSION='0.2.903' VERSION='0.2.904'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -4439,7 +4447,7 @@ ia64-*-hpux*)
;; ;;
*-*-irix6*) *-*-irix6*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo '#line 4442 "configure"' > conftest.$ac_ext echo '#line 4450 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_compile) 2>&5
ac_status=$? ac_status=$?
@ -7547,11 +7555,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7550: $lt_compile\"" >&5) (eval echo "\"\$as_me:7558: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:7554: \$? = $ac_status" >&5 echo "$as_me:7562: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@ -7837,11 +7845,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7840: $lt_compile\"" >&5) (eval echo "\"\$as_me:7848: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:7844: \$? = $ac_status" >&5 echo "$as_me:7852: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@ -7941,11 +7949,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7944: $lt_compile\"" >&5) (eval echo "\"\$as_me:7952: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:7948: \$? = $ac_status" >&5 echo "$as_me:7956: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
@ -10341,7 +10349,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 10344 "configure" #line 10352 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@ -10441,7 +10449,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 10444 "configure" #line 10452 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@ -12850,11 +12858,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12853: $lt_compile\"" >&5) (eval echo "\"\$as_me:12861: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:12857: \$? = $ac_status" >&5 echo "$as_me:12865: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@ -12954,11 +12962,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12957: $lt_compile\"" >&5) (eval echo "\"\$as_me:12965: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:12961: \$? = $ac_status" >&5 echo "$as_me:12969: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
@ -14537,11 +14545,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:14540: $lt_compile\"" >&5) (eval echo "\"\$as_me:14548: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:14544: \$? = $ac_status" >&5 echo "$as_me:14552: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@ -14641,11 +14649,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:14644: $lt_compile\"" >&5) (eval echo "\"\$as_me:14652: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:14648: \$? = $ac_status" >&5 echo "$as_me:14656: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
@ -16856,11 +16864,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16859: $lt_compile\"" >&5) (eval echo "\"\$as_me:16867: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:16863: \$? = $ac_status" >&5 echo "$as_me:16871: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@ -17146,11 +17154,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:17149: $lt_compile\"" >&5) (eval echo "\"\$as_me:17157: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:17153: \$? = $ac_status" >&5 echo "$as_me:17161: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
@ -17250,11 +17258,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:17253: $lt_compile\"" >&5) (eval echo "\"\$as_me:17261: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:17257: \$? = $ac_status" >&5 echo "$as_me:17265: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
@ -21299,6 +21307,91 @@ else
$as_echo "yes" >&6; } $as_echo "yes" >&6; }
: :
fi fi
pkg_failed=no
{ $as_echo "$as_me:$LINENO: checking for XEXT" >&5
$as_echo_n "checking for XEXT... " >&6; }
if test -n "$PKG_CONFIG"; then
if test -n "$XEXT_CFLAGS"; then
pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS"
else
if test -n "$PKG_CONFIG" && \
{ ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xextproto >= 7.0.99.1\"") >&5
($PKG_CONFIG --exists --print-errors "xextproto >= 7.0.99.1") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
pkg_cv_XEXT_CFLAGS=`$PKG_CONFIG --cflags "xextproto >= 7.0.99.1" 2>/dev/null`
else
pkg_failed=yes
fi
fi
else
pkg_failed=untried
fi
if test -n "$PKG_CONFIG"; then
if test -n "$XEXT_LIBS"; then
pkg_cv_XEXT_LIBS="$XEXT_LIBS"
else
if test -n "$PKG_CONFIG" && \
{ ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xextproto >= 7.0.99.1\"") >&5
($PKG_CONFIG --exists --print-errors "xextproto >= 7.0.99.1") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
pkg_cv_XEXT_LIBS=`$PKG_CONFIG --libs "xextproto >= 7.0.99.1" 2>/dev/null`
else
pkg_failed=yes
fi
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xextproto >= 7.0.99.1"`
else
XEXT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xextproto >= 7.0.99.1"`
fi
# Put the nasty error message in config.log where it belongs
echo "$XEXT_PKG_ERRORS" >&5
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
HAVE_XEXTPROTO_71="no"
elif test $pkg_failed = untried; then
HAVE_XEXTPROTO_71="no"
else
XEXT_CFLAGS=$pkg_cv_XEXT_CFLAGS
XEXT_LIBS=$pkg_cv_XEXT_LIBS
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_XEXTPROTO_71="yes";
cat >>confdefs.h <<\_ACEOF
#define HAVE_XEXTPROTO_71 1
_ACEOF
fi
if test "$HAVE_XEXTPROTO_71" = "yes" ; then
HAVE_XEXTPROTO_71_TRUE=
HAVE_XEXTPROTO_71_FALSE='#'
else
HAVE_XEXTPROTO_71_TRUE='#'
HAVE_XEXTPROTO_71_FALSE=
fi
sdkdir=$(pkg-config --variable=sdkdir xorg-server) sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries. # Checks for libraries.
@ -22476,6 +22569,13 @@ $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;} Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
if test -z "${HAVE_XEXTPROTO_71_TRUE}" && test -z "${HAVE_XEXTPROTO_71_FALSE}"; then
{ { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_XEXTPROTO_71\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
$as_echo "$as_me: error: conditional \"HAVE_XEXTPROTO_71\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${DRI_TRUE}" && test -z "${DRI_FALSE}"; then if test -z "${DRI_TRUE}" && test -z "${DRI_FALSE}"; then
{ { $as_echo "$as_me:$LINENO: error: conditional \"DRI\" was never defined. { { $as_echo "$as_me:$LINENO: error: conditional \"DRI\" was never defined.
Usually this means the macro was only invoked conditionally." >&5 Usually this means the macro was only invoked conditionally." >&5
@ -22833,7 +22933,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by xf86-video-openchrome $as_me 0.2.903, which was This file was extended by xf86-video-openchrome $as_me 0.2.904, which was
generated by GNU Autoconf 2.62. Invocation command line was generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -22886,7 +22986,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\ ac_cs_version="\\
xf86-video-openchrome config.status 0.2.903 xf86-video-openchrome config.status 0.2.904
configured by $0, generated by GNU Autoconf 2.62, configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -22,7 +22,7 @@
AC_PREREQ(2.57) AC_PREREQ(2.57)
AC_INIT([xf86-video-openchrome], AC_INIT([xf86-video-openchrome],
0.2.903, 0.2.904,
[http://www.openchrome.org/trac/report/1], [http://www.openchrome.org/trac/report/1],
xf86-video-openchrome) xf86-video-openchrome)
@ -71,6 +71,10 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for pkg-config packages # Checks for pkg-config packages
PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm $REQUIRED_MODULES]) PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm $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) sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries. # Checks for libraries.

View File

@ -133,6 +133,8 @@ EXEEXT = @EXEEXT@
F77 = @F77@ F77 = @F77@
FFLAGS = @FFLAGS@ FFLAGS = @FFLAGS@
GREP = @GREP@ GREP = @GREP@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -165,6 +167,8 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@ XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@ XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@

View File

@ -2127,17 +2127,6 @@ EOF
;; ;;
esac esac
for pass in $passes; do for pass in $passes; do
# The preopen pass in lib mode reverses $deplibs; put it back here
# so that -L comes before libs that need it for instance...
if test "$linkmode,$pass" = "lib,link"; then
## FIXME: Find the place where the list is rebuilt in the wrong
## order, and fix it there properly
tmp_deplibs=
for deplib in $deplibs; do
tmp_deplibs="$deplib $tmp_deplibs"
done
deplibs="$tmp_deplibs"
fi
if test "$linkmode,$pass" = "lib,link" || if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan"; then test "$linkmode,$pass" = "prog,scan"; then
libs="$deplibs" libs="$deplibs"

View File

@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.3 2009/06/25 21:27:18 matthieu Exp $ # $Id: Makefile.am,v 1.4 2009/11/24 16:54:55 matthieu Exp $
# #
# Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# #
@ -59,4 +59,4 @@ SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
sed $(MAN_SUBSTS) < $< > $@ sed $(MAN_SUBSTS) < $< > $@
@DRIVER_NAME@.man: @DRIVER_NAME@.man:
ln -s -f $(top_srcdir)/src/@DRIVER_NAME@.man . ln -s -f $(top_srcdir)/man/@DRIVER_NAME@.man .

View File

@ -14,7 +14,7 @@
@SET_MAKE@ @SET_MAKE@
# $Id: Makefile.in,v 1.5 2009/06/25 21:27:18 matthieu Exp $ # $Id: Makefile.in,v 1.6 2009/11/24 16:54:55 matthieu Exp $
# #
# Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# #
@ -124,6 +124,8 @@ EXEEXT = @EXEEXT@
F77 = @F77@ F77 = @F77@
FFLAGS = @FFLAGS@ FFLAGS = @FFLAGS@
GREP = @GREP@ GREP = @GREP@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -156,6 +158,8 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@ XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@ XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@
@ -424,7 +428,7 @@ uninstall-am: uninstall-drivermanDATA uninstall-info-am
sed $(MAN_SUBSTS) < $< > $@ sed $(MAN_SUBSTS) < $< > $@
@DRIVER_NAME@.man: @DRIVER_NAME@.man:
ln -s -f $(top_srcdir)/src/@DRIVER_NAME@.man . ln -s -f $(top_srcdir)/man/@DRIVER_NAME@.man .
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:

View File

@ -7,7 +7,7 @@ openchrome \- video driver for VIA Unichromes
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B "Section \*qDevice\*q" .B "Section \*qDevice\*q"
.BI " Identifier \*q" string \*q .BI " Identifier \*q" devname \*q
.B " Driver \*qopenchrome\*q" .B " Driver \*qopenchrome\*q"
\ \ ... \ \ ...
.B EndSection .B EndSection
@ -20,9 +20,9 @@ Unichrome graphics engine.
.PP .PP
The The
.B openchrome .B openchrome
driver supports the following chipsets: CLE266, KM400/KN400, CN400, CN700, driver supports the following chipsets: CLE266, KM400/KN400/KM400A/P4M800,
K8M800/K8N800, PM800/PN800, P4M800Pro, VN800, PM880, K8M890/K8N890, CN400/PM800/PN800/PM880, K8M800, CN700/VM800/P4M800Pro, CX700, P4M890, K8M890,
CN896, VN896, and P4M900. P4M900/VN896/CN896, VX800 and VX855.
The driver includes 2D acceleration and Xv video overlay extensions. The driver includes 2D acceleration and Xv video overlay extensions.
Flat panel, TV, and VGA outputs are supported, depending on the hardware Flat panel, TV, and VGA outputs are supported, depending on the hardware
configuration. configuration.
@ -160,8 +160,8 @@ system. The sizes 640x480, 800x600, 1024x768, 1280x1024, and 1400x1050
are supported. are supported.
.TP .TP
.BI "Option \*qRotate\*q \*q" string \*q .BI "Option \*qRotate\*q \*q" string \*q
Rotates the display either clockwise ("CW") or counterclockwise ("CCW"). Rotates the display either clockwise ("CW"), counterclockwise ("CCW") and
Rotation is only supported unaccelerated. upside-down ("UD"). Rotation is only supported unaccelerated.
.TP .TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q .BI "Option \*qShadowFB\*q \*q" boolean \*q
Enables the use of a shadow frame buffer. This is required when Enables the use of a shadow frame buffer. This is required when
@ -185,6 +185,10 @@ Specifies which TV output to use. The driver supports "S-Video",
EPIA boards the composite-video port is shared with audio-out and EPIA boards the composite-video port is shared with audio-out and
is selected via a jumper. is selected via a jumper.
.TP .TP
.BI "Option \*qTVPort\*q \*q" string \*q
Specifies TV port. The driver currently supports "DVP0", "DVP1",
"DFPHigh" and "DFPLow" ports.
.TP
.BI "Option \*qTVType\*q \*q" string \*q .BI "Option \*qTVType\*q \*q" string \*q
Specifies TV output format. The driver currently supports "NTSC" and Specifies TV output format. The driver currently supports "NTSC" and
"PAL" timings only. "PAL" timings only.
@ -230,6 +234,6 @@ overscan). These modes are made available by the driver; modelines
provided in __xconfigfile__ will be ignored. provided in __xconfigfile__ will be ignored.
.SH "SEE ALSO" .SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
.SH AUTHORS .SH AUTHORS
Authors include: ... Authors include: ...

View File

@ -1,603 +0,0 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# Perl script to create a ChangeLog entry with names of files
# and functions from a svn diff.
#
# Darin Adler <darin@bentspoon.com>, started 20 April 2000
# Java support added by Maciej Stachowiak <mjs@eazel.com>
# Adapted for subversion by Thomas Hellstrom <unichrome-at-shipmail-dot-org>
# last updated 11 May 2005
#
# (Someone put a license in here, like maybe GPL.)
#
# TODO:
# For new files, just say "New file" instead of listing
# function names.
# List functions that have been removed too.
# Decide what a good logical order is for the changed files
# other than a normal text "sort" (top level first?)
# (group directories?) (.h before .c?)
# Leave a diff file behind if asked, but in unified format.
# Handle C++ and yacc source files too (other languages?).
# Help merge when there are ChangeLog conflicts or if there's
# already a partly written ChangeLog entry.
# Add command line option to put the ChangeLog into a separate
# file or just spew it out stdout.
# Figure out how to allow -z options from .cvsrc to work without
# letting other bad options work. Currently the -f disables
# everything from the .cvsrc.
# Add CVS version numbers for each file too (can't do that until
# the changes are checked in, though).
# Work around diff stupidity where deleting a function that starts
# with a comment makes diff think that the following function
# has been changed (if the following function starts with a comment
# with the same first line, such as /**)
# Work around diff stupidity where deleting an entire function and
# the blank lines before it makes diff think you've changed the
# previous function.
use diagnostics;
use strict;
use English;
use Text::Wrap;
# For each file, build a list of modified lines.
# Use line numbers from the "after" side of each diff.
print STDERR " Running svn diff to find changes.\n";
my %changed_line_ranges;
my $file;
open DIFF, "svn diff --diff-cmd diff -x -N |" or die "The svn diff failed: $OS_ERROR.\n";
while (<DIFF>)
{
$file = $1 if /^Index: (\S+)$/;
if (defined $file
and $file ne "ChangeLog"
and (/^\d+(,\d+)?[acd](\d+)(,(\d+))?/ or /^Binary files/) )
{
push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ];
}
}
close DIFF;
if (!%changed_line_ranges)
{
print STDERR " No changes found.\n";
exit;
}
# For each ".c" file, convert line range to function list.
print STDERR " Extracting affected function names from C source files.\n";
my %function_lists;
foreach my $file (keys %changed_line_ranges)
{
# An empty function list still indicates that something changed.
$function_lists{$file} = "";
# Only look for function names in .c files.
next unless $file =~ /\.(c|java)/;
# Find all the functions in the file.
open SOURCE, $file or next;
my @function_ranges = get_function_line_ranges(\*SOURCE, $file);
close SOURCE;
# Find all the modified functions.
my @functions;
my %saw_function;
my @change_ranges = (@{$changed_line_ranges{$file}}, []);
my @change_range = (0, 0);
FUNCTION: foreach my $function_range_ref (@function_ranges)
{
my @function_range = @$function_range_ref;
# Advance to successive change ranges.
for (;; @change_range = @{shift @change_ranges})
{
last FUNCTION unless @change_range;
# If past this function, move on to the next one.
next FUNCTION if $change_range[0] > $function_range[1];
# If an overlap with this function range, record the function name.
if ($change_range[1] >= $function_range[0]
and $change_range[0] <= $function_range[1])
{
if (!$saw_function{$function_range[2]})
{
$saw_function{$function_range[2]} = 1;
push @functions, $function_range[2];
}
next FUNCTION;
}
}
}
# Format the list of functions now.
$function_lists{$file} = " (" . join("), (", @functions) . "):" if @functions;
}
# Get some pieces of the ChangeLog we are about to write.
my $date = sprintf "%d-%02d-%02d",
1900 + (localtime $BASETIME)[5], # year
1 + (localtime $BASETIME)[4], # month
(localtime $BASETIME)[3]; # day within month
my $name = $ENV{CHANGE_LOG_NAME}
|| $ENV{REAL_NAME}
|| (getpwuid $REAL_USER_ID)[6]
|| "set REAL_NAME environment variable";
my $email_address = $ENV{CHANGE_LOG_EMAIL_ADDRESS}
|| $ENV{EMAIL_ADDRESS}
|| "set EMAIL_ADDRESS environment variable";
# Find the change logs.
my %has_log;
my %files;
foreach my $file (sort keys %function_lists)
{
my $prefix = $file;
my $has_log = 0;
while ($prefix)
{
$prefix =~ s-/[^/]+/?$-/- or $prefix = "";
$has_log = $has_log{$prefix};
if (!defined $has_log)
{
$has_log = -f "${prefix}ChangeLog";
$has_log{$prefix} = $has_log;
}
last if $has_log;
}
if (!$has_log)
{
print STDERR "No ChangeLog found for $file.\n";
}
else
{
push @{$files{$prefix}}, $file;
}
}
# Get the latest ChangeLog files from svn.
my $logs = "";
foreach my $prefix (sort keys %files)
{
$logs .= " ${prefix}ChangeLog";
}
if ($logs)
{
print STDERR " Updating ChangeLog files from svn repository.\n";
open ERRORS, "svn update$logs |" or die "The svn update of ChangeLog files failed: $OS_ERROR.\n";
print STDERR " $ARG" while <ERRORS>;
close ERRORS;
}
# Write out a new ChangeLog file.
foreach my $prefix (sort keys %files)
{
print STDERR " Editing the ${prefix}ChangeLog file.\n";
open OLD_CHANGE_LOG, "${prefix}ChangeLog" or die "Could not open ${prefix}ChangeLog file: $OS_ERROR.\n";
# It's less efficient to read the whole thing into memory than it would be
# to read it while we prepend to it later, but I like doing this part first.
my @old_change_log = <OLD_CHANGE_LOG>;
close OLD_CHANGE_LOG;
open CHANGE_LOG, "> ${prefix}ChangeLog" or die "Could not write ${prefix}ChangeLog\n.";
print CHANGE_LOG "$date $name <$email_address>\n\n";
print CHANGE_LOG "\treviewed by: <delete if not using a buddy>\n\n";
foreach my $file (sort @{$files{$prefix}})
{
my $file_stem = substr $file, length $prefix;
my $lines = wrap("\t", "\t", "XX$file_stem:$function_lists{$file}");
$lines =~ s/^\tXX/\t* /;
print CHANGE_LOG "$lines\n";
}
print CHANGE_LOG "\n", @old_change_log;
close CHANGE_LOG;
print STDERR " Done editing ${prefix}ChangeLog.\n";
}
# Done.
exit;
sub get_function_line_ranges
{
my ($file_handle, $file_name) = @_;
if ($file_name =~ /\.c$/) {
return get_function_line_ranges_for_c ($file_handle, $file_name);
} elsif ($file_name =~ /\.java$/) {
return get_function_line_ranges_for_java ($file_handle, $file_name);
}
return ();
}
# Read a file and get all the line ranges of the things that look like C functions.
# A function name is the last word before an open parenthesis before the outer
# level open brace. A function starts at the first character after the last close
# brace or semicolon before the function name and ends at the close brace.
# Comment handling is simple-minded but will work for all but pathological cases.
#
# Result is a list of triples: [ start_line, end_line, function_name ].
sub get_function_line_ranges_for_c
{
my ($file_handle, $file_name) = @_;
my @ranges;
my $in_comment = 0;
my $in_macro = 0;
my $in_parentheses = 0;
my $in_braces = 0;
my $word = "";
my $potential_start = 0;
my $potential_name = "";
my $start = 0;
my $name = "";
while (<$file_handle>)
{
# Handle continued multi-line comment.
if ($in_comment)
{
next unless s-.*\*/--;
$in_comment = 0;
}
# Handle continued macro.
if ($in_macro)
{
$in_macro = 0 unless /\\$/;
next;
}
# Handle start of macro (or any preprocessor directive).
if (/^\s*\#/)
{
$in_macro = 1 if /^([^\\]|\\.)*\\$/;
next;
}
# Handle comments and quoted text.
while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy
{
my $match = $1;
if ($match eq "/*")
{
if (!s-/\*.*?\*/--)
{
s-/\*.*--;
$in_comment = 1;
}
}
elsif ($match eq "//")
{
s-//.*--;
}
else # ' or "
{
if (!s-$match([^\\]|\\.)*?$match--)
{
warn "mismatched quotes at line $INPUT_LINE_NUMBER in $file_name\n";
s-$match.*--;
}
}
}
# Find function names.
while (m-(\w+|[(){};])-g)
{
# Open parenthesis.
if ($1 eq "(")
{
$potential_name = $word unless $in_parentheses;
$in_parentheses++;
next;
}
# Close parenthesis.
if ($1 eq ")")
{
$in_parentheses--;
next;
}
# Open brace.
if ($1 eq "{")
{
# Promote potiential name to real function name at the
# start of the outer level set of braces (function body?).
if (!$in_braces and $potential_start)
{
$start = $potential_start;
$name = $potential_name;
}
$in_braces++;
next;
}
# Close brace.
if ($1 eq "}")
{
$in_braces--;
# End of an outer level set of braces.
# This could be a function body.
if (!$in_braces and $name)
{
push @ranges, [ $start, $INPUT_LINE_NUMBER, $name ];
$name = "";
}
$potential_start = 0;
$potential_name = "";
next;
}
# Semicolon.
if ($1 eq ";")
{
$potential_start = 0;
$potential_name = "";
next;
}
# Word.
$word = $1;
if (!$in_parentheses)
{
$potential_start = 0;
$potential_name = "";
}
if (!$potential_start)
{
$potential_start = $INPUT_LINE_NUMBER;
$potential_name = "";
}
}
}
warn "mismatched braces in $file_name\n" if $in_braces;
warn "mismatched parentheses in $file_name\n" if $in_parentheses;
return @ranges;
}
# Read a file and get all the line ranges of the things that look like Java
# classes, interfaces and methods.
#
# A class or interface name is the word that immediately follows
# `class' or `interface' when followed by an open curly brace and not
# a semicolon. It can appear at the top level, or inside another class
# or interface block, but not inside a function block
#
# A class or interface starts at the first character after the first close
# brace or after the function name and ends at the close brace.
#
# A function name is the last word before an open parenthesis before
# an open brace rather than a semicolon. It can appear at top level or
# inside a class or interface block, but not inside a function block.
#
# A function starts at the first character after the first close
# brace or after the function name and ends at the close brace.
#
# Comment handling is simple-minded but will work for all but pathological cases.
#
# Result is a list of triples: [ start_line, end_line, function_name ].
sub get_function_line_ranges_for_java
{
my ($file_handle, $file_name) = @_;
my @current_scopes;
my @ranges;
my $in_comment = 0;
my $in_macro = 0;
my $in_parentheses = 0;
my $in_braces = 0;
my $in_non_block_braces = 0;
my $class_or_interface_just_seen = 0;
my $word = "";
my $potential_start = 0;
my $potential_name = "";
my $potential_name_is_class_or_interface = 0;
my $start = 0;
my $name = "";
my $current_name_is_class_or_interface = 0;
while (<$file_handle>)
{
# Handle continued multi-line comment.
if ($in_comment)
{
next unless s-.*\*/--;
$in_comment = 0;
}
# Handle continued macro.
if ($in_macro)
{
$in_macro = 0 unless /\\$/;
next;
}
# Handle start of macro (or any preprocessor directive).
if (/^\s*\#/)
{
$in_macro = 1 if /^([^\\]|\\.)*\\$/;
next;
}
# Handle comments and quoted text.
while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy
{
my $match = $1;
if ($match eq "/*")
{
if (!s-/\*.*?\*/--)
{
s-/\*.*--;
$in_comment = 1;
}
}
elsif ($match eq "//")
{
s-//.*--;
}
else # ' or "
{
if (!s-$match([^\\]|\\.)*?$match--)
{
warn "mismatched quotes at line $INPUT_LINE_NUMBER in $file_name\n";
s-$match.*--;
}
}
}
# Find function names.
while (m-(\w+|[(){};])-g)
{
# Open parenthesis.
if ($1 eq "(")
{
if (!$in_parentheses) {
$potential_name = $word;
$potential_name_is_class_or_interface = 0;
}
$in_parentheses++;
next;
}
# Close parenthesis.
if ($1 eq ")")
{
$in_parentheses--;
next;
}
# Open brace.
if ($1 eq "{")
{
# Promote potiential name to real function name at the
# start of the outer level set of braces (function/class/interface body?).
if (!$in_non_block_braces
and (!$in_braces or $current_name_is_class_or_interface)
and $potential_start)
{
if ($name)
{
push @ranges, [ $start, ($INPUT_LINE_NUMBER - 1),
join ('.', @current_scopes) ];
}
$current_name_is_class_or_interface = $potential_name_is_class_or_interface;
$start = $potential_start;
$name = $potential_name;
push (@current_scopes, $name);
} else {
$in_non_block_braces++;
}
$potential_name = "";
$potential_start = 0;
$in_braces++;
next;
}
# Close brace.
if ($1 eq "}")
{
$in_braces--;
# End of an outer level set of braces.
# This could be a function body.
if (!$in_non_block_braces)
{
if ($name)
{
push @ranges, [ $start, $INPUT_LINE_NUMBER,
join ('.', @current_scopes) ];
pop (@current_scopes);
if (@current_scopes)
{
$current_name_is_class_or_interface = 1;
$start = $INPUT_LINE_NUMBER + 1;
$name = $current_scopes[$#current_scopes-1];
}
else
{
$current_name_is_class_or_interface = 0;
$start = 0;
$name = "";
}
}
}
else
{
$in_non_block_braces-- if $in_non_block_braces;
}
$potential_start = 0;
$potential_name = "";
next;
}
# Semicolon.
if ($1 eq ";")
{
$potential_start = 0;
$potential_name = "";
next;
}
if ($1 eq "class" or $1 eq "interface")
{
$class_or_interface_just_seen = 1;
next;
}
# Word.
$word = $1;
if (!$in_parentheses)
{
if ($class_or_interface_just_seen) {
$potential_name = $word;
$potential_start = $INPUT_LINE_NUMBER;
$class_or_interface_just_seen = 0;
$potential_name_is_class_or_interface = 1;
next;
}
}
if (!$potential_start)
{
$potential_start = $INPUT_LINE_NUMBER;
$potential_name = "";
}
$class_or_interface_just_seen = 0;
}
}
warn "mismatched braces in $file_name\n" if $in_braces;
warn "mismatched parentheses in $file_name\n" if $in_parentheses;
return @ranges;
}

View File

@ -168,6 +168,8 @@ EXEEXT = @EXEEXT@
F77 = @F77@ F77 = @F77@
FFLAGS = @FFLAGS@ FFLAGS = @FFLAGS@
GREP = @GREP@ GREP = @GREP@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -200,6 +202,8 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
VERSION = @VERSION@ VERSION = @VERSION@
XEXT_CFLAGS = @XEXT_CFLAGS@
XEXT_LIBS = @XEXT_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@ XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@ XORG_LIBS = @XORG_LIBS@
XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@

View File

@ -0,0 +1 @@
#define BUILDCOMMENT "(openchrome 0.2.904 release)"

View File

@ -327,6 +327,12 @@
#define VIDEO_FIFO_PRETHRESHOLD_VT3336 250 #define VIDEO_FIFO_PRETHRESHOLD_VT3336 250
#define VIDEO_EXPIRE_NUM_VT3336 31 #define VIDEO_EXPIRE_NUM_VT3336 31
/* Those values are only valid for IGA1 */
#define VIDEO_FIFO_DEPTH_VT3409 400
#define VIDEO_FIFO_THRESHOLD_VT3409 320
#define VIDEO_FIFO_PRETHRESHOLD_VT3409 230
#define VIDEO_EXPIRE_NUM_VT3409 160
/* ALPHA_V3_FIFO_CONTROL 0x278 /* ALPHA_V3_FIFO_CONTROL 0x278
* IA2 has 32 level FIFO for packet mode video format * IA2 has 32 level FIFO for packet mode video format
* 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable * 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable

View File

@ -195,6 +195,7 @@ viaFlushPCI(ViaCommandBuffer * buf)
*/ */
switch (pVia->Chipset) { switch (pVia->Chipset) {
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
while ((VIAGETREG(VIA_REG_STATUS) & while ((VIAGETREG(VIA_REG_STATUS) &
(VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5)) (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5))
&& (loop++ < MAXLOOP)) ; && (loop++ < MAXLOOP)) ;
@ -471,7 +472,7 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn)
VIASETREG(i, 0x0); VIASETREG(i, 0x0);
} }
if (pVia->Chipset == VIA_VX800) { if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) {
for (i = 0x44; i < 0x5c; i += 4) { for (i = 0x44; i < 0x5c; i += 4) {
VIASETREG(i, 0x0); VIASETREG(i, 0x0);
} }
@ -480,6 +481,7 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn)
/* Make the VIA_REG() macro magic work */ /* Make the VIA_REG() macro magic work */
switch (pVia->Chipset) { switch (pVia->Chipset) {
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
pVia->TwodRegs = via_2d_regs_m1; pVia->TwodRegs = via_2d_regs_m1;
break; break;
default: default:
@ -527,6 +529,7 @@ viaAccelSync(ScrnInfoPtr pScrn)
switch (pVia->Chipset) { switch (pVia->Chipset) {
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
while ((VIAGETREG(VIA_REG_STATUS) & while ((VIAGETREG(VIA_REG_STATUS) &
(VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5 | VIA_3D_ENG_BUSY_H5)) (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5 | VIA_3D_ENG_BUSY_H5))
&& (loop++ < MAXLOOP)) ; && (loop++ < MAXLOOP)) ;
@ -587,7 +590,7 @@ viaPitchHelper(VIAPtr pVia, unsigned dstPitch, unsigned srcPitch)
unsigned val = (dstPitch >> 3) << 16 | (srcPitch >> 3); unsigned val = (dstPitch >> 3) << 16 | (srcPitch >> 3);
RING_VARS; RING_VARS;
if (pVia->Chipset != VIA_VX800) { if (pVia->Chipset != VIA_VX800 && pVia->Chipset != VIA_VX855) {
val |= VIA_PITCH_ENABLE; val |= VIA_PITCH_ENABLE;
} }
OUT_RING_H1(VIA_REG(pVia, PITCH), val); OUT_RING_H1(VIA_REG(pVia, PITCH), val);
@ -1289,17 +1292,23 @@ viaInitXAA(ScreenPtr pScreen)
* test with x11perf -shmput500! * test with x11perf -shmput500!
*/ */
if (pVia->Chipset != VIA_K8M800 && switch (pVia->Chipset) {
pVia->Chipset != VIA_K8M890 && case VIA_K8M800:
pVia->Chipset != VIA_P4M900 && case VIA_K8M890:
pVia->Chipset != VIA_VX800) case VIA_P4M900:
case VIA_VX800:
case VIA_VX855:
break;
default:
xaaptr->ImageWriteFlags |= NO_GXCOPY; xaaptr->ImageWriteFlags |= NO_GXCOPY;
break;
}
xaaptr->SetupForImageWrite = viaSetupForImageWrite; xaaptr->SetupForImageWrite = viaSetupForImageWrite;
xaaptr->SubsequentImageWriteRect = viaSubsequentImageWriteRect; xaaptr->SubsequentImageWriteRect = viaSubsequentImageWriteRect;
xaaptr->ImageWriteBase = pVia->BltBase; xaaptr->ImageWriteBase = pVia->BltBase;
if (pVia->Chipset == VIA_VX800) if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855)
xaaptr->ImageWriteRange = VIA_MMIO_BLTSIZE; xaaptr->ImageWriteRange = VIA_MMIO_BLTSIZE;
else else
xaaptr->ImageWriteRange = (64 * 1024); xaaptr->ImageWriteRange = (64 * 1024);
@ -2015,7 +2024,8 @@ viaExaUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst)
dstPitch = 8; dstPitch = 8;
if (dstPitch * h > pVia->exaScratchSize * 1024) { if (dstPitch * h > pVia->exaScratchSize * 1024) {
ErrorF("EXA UploadToScratch Failed %u %u %u %u\n", ErrorF("EXA UploadToScratch Failed %u %u %u %u\n",
dstPitch, h, dstPitch * h, pVia->exaScratchSize * 1024); (unsigned int)dstPitch, h, (unsigned int)(dstPitch * h),
pVia->exaScratchSize * 1024);
return FALSE; return FALSE;
} }
@ -2354,8 +2364,28 @@ viaInitAccel(ScreenPtr pScreen)
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
BoxRec AvailFBArea; BoxRec AvailFBArea;
int maxY; int maxY;
Bool ret;
Bool nPOTSupported; Bool nPOTSupported;
/* HW Limitation are described here:
*
* 1. H2/H5/H6 2D source and destination:
* Pitch: (1 << 14) - 1 = 16383
* Dimension: (1 << 12) = 4096
* X, Y position: (1 << 12) - 1 = 4095.
*
* 2. H2 3D engine Render target:
* Pitch: (1 << 14) - 1 = 16383
* Clip Rectangle: 0 - 2047
*
* 3. H5/H6 3D engine Render target:
* Pitch: ((1 << 10) - 1)*32 = 32736
* Clip Rectangle: Color Window, 12bits. As Spec saied: 0 - 2048
* Scissor is the same as color window.
* */
pVia->VQStart = 0; pVia->VQStart = 0;
if (((pVia->FBFreeEnd - pVia->FBFreeStart) >= VIA_VQ_SIZE) if (((pVia->FBFreeEnd - pVia->FBFreeStart) >= VIA_VQ_SIZE)
&& pVia->VQEnable) { && pVia->VQEnable) {
@ -2425,6 +2455,10 @@ viaInitAccel(ScreenPtr pScreen)
return TRUE; return TRUE;
} }
/*
* Finally, we set up the memory space available to the pixmap
* cache.
*/
AvailFBArea.x1 = 0; AvailFBArea.x1 = 0;
AvailFBArea.y1 = 0; AvailFBArea.y1 = 0;
AvailFBArea.x2 = pScrn->displayWidth; AvailFBArea.x2 = pScrn->displayWidth;
@ -2447,10 +2481,25 @@ viaInitAccel(ScreenPtr pScreen)
if (maxY > 4 * pScrn->virtualY) if (maxY > 4 * pScrn->virtualY)
maxY = 4 * pScrn->virtualY; maxY = 4 * pScrn->virtualY;
/* Non-rotate */
AvailFBArea.y2 = maxY;
pVia->FBFreeStart = (maxY + 1) * pVia->Bpl; pVia->FBFreeStart = (maxY + 1) * pVia->Bpl;
AvailFBArea.y2 = maxY; /*
xf86InitFBManager(pScreen, &AvailFBArea); * Initialization of the XFree86 framebuffer manager is done via
* Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox)
* FullBox represents the area of the framebuffer that the manager
* is allowed to manage. This is typically a box with a width
* of pScrn->displayWidth and a height of as many lines as can be fit
* within the total video memory
*/
ret = xf86InitFBManager(pScreen, &AvailFBArea);
if (ret != TRUE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "VIAInitAccel xf86InitFBManager init failed\n");
}
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Frame Buffer From (%d,%d) To (%d,%d)\n",
AvailFBArea.x1, AvailFBArea.y1, AvailFBArea.x2, AvailFBArea.y2));
VIAInitLinear(pScreen); VIAInitLinear(pScreen);
pVia->driSize = (pVia->FBFreeEnd - pVia->FBFreeStart - pVia->Bpl); pVia->driSize = (pVia->FBFreeEnd - pVia->FBFreeStart - pVia->Bpl);

View File

@ -244,6 +244,11 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode)
hwp->writeSeq(hwp, 0x18, 0x26); /* 152/4 = 38 */ hwp->writeSeq(hwp, 0x18, 0x26); /* 152/4 = 38 */
hwp->writeSeq(hwp, 0x22, 0x10); /* 64/4 = 16 */ hwp->writeSeq(hwp, 0x22, 0x10); /* 64/4 = 16 */
break; break;
case VIA_VX855:
hwp->writeSeq(hwp, 0x16, 0x50); /* 320/4 = 80 */
hwp->writeSeq(hwp, 0x17, 0xC7); /* 400/2-1 = 199 */
hwp->writeSeq(hwp, 0x18, 0x50); /* 320/4 = 80 */
hwp->writeSeq(hwp, 0x22, 0x28); /* 160/4 = 40 */
default: default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetPrimaryFIFO: " xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetPrimaryFIFO: "
"Chipset %d not implemented\n", pVia->Chipset); "Chipset %d not implemented\n", pVia->Chipset);
@ -412,6 +417,8 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode)
else else
ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); ViaCrtcMask(hwp, 0x94, 0x20, 0x7F);
break; break;
case VIA_VX855:
break;
default: default:
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetSecondaryFIFO: " xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetSecondaryFIFO: "
"Chipset %d not implemented\n", pVia->Chipset); "Chipset %d not implemented\n", pVia->Chipset);

View File

@ -42,6 +42,7 @@
#define VIA_PANEL10X6 13 #define VIA_PANEL10X6 13
#define VIA_PANEL14X9 14 #define VIA_PANEL14X9 14
#define VIA_PANEL1280X720 15 #define VIA_PANEL1280X720 15
#define VIA_PANEL12X9 16
#define VIA_PANEL_INVALID 255 #define VIA_PANEL_INVALID 255
#define TVTYPE_NONE 0x00 #define TVTYPE_NONE 0x00
@ -98,6 +99,13 @@
#define VIA_DI_12BIT 0x00 #define VIA_DI_12BIT 0x00
#define VIA_DI_24BIT 0x01 #define VIA_DI_24BIT 0x01
/* Digital Port */
#define VIA_DI_PORT_NONE 0x0
#define VIA_DI_PORT_DVP0 0x1
#define VIA_DI_PORT_DVP1 0x2
#define VIA_DI_PORT_DFPLOW 0x4
#define VIA_DI_PORT_DFPHIGH 0x8
typedef struct ViaPanelMode { typedef struct ViaPanelMode {
int Width ; int Width ;
int Height ; int Height ;
@ -159,8 +167,6 @@ typedef struct _VIABIOSINFO {
Bool SetDVI; Bool SetDVI;
/* LCD Simultaneous Expand Mode HWCursor Y Scale */ /* LCD Simultaneous Expand Mode HWCursor Y Scale */
Bool scaleY; Bool scaleY;
int panelX;
int panelY;
int resY; int resY;
/* DFP */ /* DFP */
@ -187,6 +193,7 @@ typedef struct _VIABIOSINFO {
int TVDeflicker; int TVDeflicker;
CARD8 TVRegs[0xFF]; CARD8 TVRegs[0xFF];
int TVNumRegs; int TVNumRegs;
int TVDIPort;
/* TV Callbacks */ /* TV Callbacks */
void (*TVSave) (ScrnInfoPtr pScrn); void (*TVSave) (ScrnInfoPtr pScrn);

View File

@ -33,6 +33,7 @@
#include "via_vgahw.h" #include "via_vgahw.h"
#include "via_ch7xxx.h" #include "via_ch7xxx.h"
#include "via_id.h" #include "via_id.h"
#include <unistd.h>
#ifdef HAVE_DEBUG #ifdef HAVE_DEBUG
/* /*

View File

@ -173,6 +173,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
case VIA_CX700: case VIA_CX700:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
break; break;
default: default:
ViaSeqMask(hwp, 0x16, 0x08, 0xBF); ViaSeqMask(hwp, 0x16, 0x08, 0xBF);
@ -276,6 +277,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
case VIA_CX700: case VIA_CX700:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
break; break;
default: default:
/* some leftovers */ /* some leftovers */
@ -302,7 +304,8 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
temp += 0x03; temp += 0x03;
temp &= ~0x03; temp &= ~0x03;
} }
hwp->writeSeq(hwp, 0x1C, (temp >> 1) & 0xFF);
hwp->writeSeq(hwp, 0x1C, ((temp >> 1)+1) & 0xFF);
ViaSeqMask(hwp, 0x1D, temp >> 9, 0x03); ViaSeqMask(hwp, 0x1D, temp >> 9, 0x03);
switch (pVia->ChipId) { switch (pVia->ChipId) {
@ -310,6 +313,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
case VIA_CX700: case VIA_CX700:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
break; break;
default: default:
/* some leftovers */ /* some leftovers */
@ -429,6 +433,7 @@ ViaSecondCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
case VIA_CX700: case VIA_CX700:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
break; break;
default: default:
ViaSeqMask(hwp, 0x16, 0x08, 0xBF); ViaSeqMask(hwp, 0x16, 0x08, 0xBF);
@ -512,6 +517,7 @@ ViaSecondCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
case VIA_CX700: case VIA_CX700:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
break; break;
default: default:
/* some leftovers */ /* some leftovers */

View File

@ -76,7 +76,7 @@ viaHWCursorInit(ScreenPtr pScreen)
pVia->CursorARGBSupported = TRUE; pVia->CursorARGBSupported = TRUE;
pVia->CursorMaxWidth = 64; pVia->CursorMaxWidth = 64;
pVia->CursorMaxHeight = 64; pVia->CursorMaxHeight = 64;
pVia->CursorSize = pVia->CursorMaxWidth * (pVia->CursorMaxHeight + 1) * 4; pVia->CursorSize = pVia->CursorMaxWidth * (pVia->CursorMaxHeight + 1) << 2;
break; break;
} }
@ -97,6 +97,7 @@ viaHWCursorInit(ScreenPtr pScreen)
case VIA_P4M890: case VIA_P4M890:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) { if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
pVia->CursorRegControl = VIA_REG_HI_CONTROL0; pVia->CursorRegControl = VIA_REG_HI_CONTROL0;
pVia->CursorRegBase = VIA_REG_HI_BASE0; pVia->CursorRegBase = VIA_REG_HI_BASE0;
@ -164,6 +165,7 @@ viaHWCursorInit(ScreenPtr pScreen)
case VIA_P4M890: case VIA_P4M890:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) { if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, 0x00FFFFFF);
VIASETREG(VIA_REG_V327_HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(VIA_REG_V327_HI_INVTCOLOR, 0x00FFFFFF);
@ -222,6 +224,7 @@ viaCursorStore(ScrnInfoPtr pScrn)
case VIA_P4M890: case VIA_P4M890:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) { if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
pVia->CursorPrimHiInvtColor = VIAGETREG(VIA_REG_PRIM_HI_INVTCOLOR); pVia->CursorPrimHiInvtColor = VIAGETREG(VIA_REG_PRIM_HI_INVTCOLOR);
pVia->CursorV327HiInvtColor = VIAGETREG(VIA_REG_V327_HI_INVTCOLOR); pVia->CursorV327HiInvtColor = VIAGETREG(VIA_REG_V327_HI_INVTCOLOR);
@ -261,6 +264,7 @@ viaCursorRestore(ScrnInfoPtr pScrn)
case VIA_P4M890: case VIA_P4M890:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) { if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, pVia->CursorPrimHiInvtColor); VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, pVia->CursorPrimHiInvtColor);
VIASETREG(VIA_REG_V327_HI_INVTCOLOR, pVia->CursorV327HiInvtColor); VIASETREG(VIA_REG_V327_HI_INVTCOLOR, pVia->CursorV327HiInvtColor);
@ -287,9 +291,23 @@ void
viaShowCursor(ScrnInfoPtr pScrn) viaShowCursor(ScrnInfoPtr pScrn)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
CARD32 temp;
CARD32 control = pVia->CursorRegControl;
switch(pVia->Chipset) {
case VIA_CX700:
case VIA_P4M890:
case VIA_P4M900:
case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
VIASETREG(VIA_REG_HI_CONTROL0, 0x36000005);
}
if (pVia->pBIOSInfo->SecondCRTC->IsActive) {
VIASETREG(VIA_REG_HI_CONTROL1, 0xb6000005);
}
break;
default:
/*temp = 0x76000005;
temp = temp =
(1 << 30) | (1 << 30) |
(1 << 29) | (1 << 29) |
@ -298,11 +316,14 @@ viaShowCursor(ScrnInfoPtr pScrn)
(1 << 25) | (1 << 25) |
(1 << 2) | (1 << 2) |
(1 << 0); (1 << 0);
*/
/* Duoview */
if (pVia->CursorPipe) if (pVia->CursorPipe)
temp |= (1 << 31); VIASETREG(VIA_REG_ALPHA_CONTROL, 0xF6000005);
else
VIASETREG(control, temp); VIASETREG(VIA_REG_ALPHA_CONTROL, 0x76000005);
}
} }
void void
@ -310,20 +331,33 @@ viaHideCursor(ScrnInfoPtr pScrn)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
CARD32 temp; CARD32 temp;
CARD32 control = pVia->CursorRegControl;
temp = VIAGETREG(control); switch(pVia->Chipset) {
VIASETREG(control, temp & 0xFFFFFFFE); case VIA_CX700:
case VIA_P4M890:
case VIA_P4M900:
case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
temp = VIAGETREG(VIA_REG_HI_CONTROL0);
VIASETREG(VIA_REG_HI_CONTROL0, temp & 0xFFFFFFFA);
}
if (pVia->pBIOSInfo->SecondCRTC->IsActive) {
temp = VIAGETREG(VIA_REG_HI_CONTROL1);
VIASETREG(VIA_REG_HI_CONTROL1, temp & 0xFFFFFFFA);
}
break;
default:
temp = VIAGETREG(VIA_REG_ALPHA_CONTROL);
VIASETREG(VIA_REG_ALPHA_CONTROL, temp & 0xFFFFFFFA);
}
} }
static void static void
viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
CARD32 temp;
CARD32 control = pVia->CursorRegControl;
CARD32 offset = pVia->CursorRegOffset;
CARD32 pos = pVia->CursorRegPos;
unsigned xoff, yoff; unsigned xoff, yoff;
if (x < 0) { if (x < 0) {
@ -340,13 +374,27 @@ viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
yoff = 0; yoff = 0;
} }
temp = VIAGETREG(control); switch(pVia->Chipset) {
VIASETREG(control, temp & 0xFFFFFFFE); case VIA_CX700:
case VIA_P4M890:
case VIA_P4M900:
case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
VIASETREG(VIA_REG_HI_POS0, ((x << 16) | (y & 0x07ff)));
VIASETREG(VIA_REG_HI_OFFSET0, ((xoff << 16) | (yoff & 0x07ff)));
}
if (pVia->pBIOSInfo->SecondCRTC->IsActive) {
VIASETREG(VIA_REG_HI_POS1, ((x << 16) | (y & 0x07ff)));
VIASETREG(VIA_REG_HI_OFFSET1, ((xoff << 16) | (yoff & 0x07ff)));
}
break;
VIASETREG(pos, ((x << 16) | (y & 0x07ff))); default:
VIASETREG(offset, ((xoff << 16) | (yoff & 0x07ff))); VIASETREG(VIA_REG_ALPHA_POS, ((x << 16) | (y & 0x07ff)));
VIASETREG(VIA_REG_ALPHA_OFFSET, ((xoff << 16) | (yoff & 0x07ff)));
}
VIASETREG(control, temp);
} }
static Bool static Bool
@ -379,20 +427,14 @@ static void
viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
CARD32 control = pVia->CursorRegControl;
CARD32 temp; CARD32 temp;
CARD32 *dst; CARD32 *dst;
CARD8 *src;
CARD8 chunk; CARD8 chunk;
int i, j; int i, j;
temp = VIAGETREG(control);
VIASETREG(control, temp & 0xFFFFFFFE);
pVia->CursorARGB = FALSE; pVia->CursorARGB = FALSE;
dst = (CARD32*)(pVia->cursorMap); dst = (CARD32*)(pVia->cursorMap);
src = (CARD8*)s;
if (pVia->CursorARGBSupported) { if (pVia->CursorARGBSupported) {
#define ARGB_PER_CHUNK (8 * sizeof (chunk) / 2) #define ARGB_PER_CHUNK (8 * sizeof (chunk) / 2)
@ -405,10 +447,28 @@ viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s)
pVia->CursorFG = mono_cursor_color[3]; pVia->CursorFG = mono_cursor_color[3];
pVia->CursorBG = mono_cursor_color[2]; pVia->CursorBG = mono_cursor_color[2];
} else { } else {
memcpy(dst, src, pVia->CursorSize); memcpy(dst, (CARD8*)s, pVia->CursorSize);
} }
switch(pVia->Chipset) {
case VIA_CX700:
case VIA_P4M890:
case VIA_P4M900:
case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
temp = VIAGETREG(VIA_REG_HI_CONTROL0);
VIASETREG(VIA_REG_HI_CONTROL0, temp & 0xFFFFFFFE);
}
if (pVia->pBIOSInfo->SecondCRTC->IsActive) {
temp = VIAGETREG(VIA_REG_HI_CONTROL1);
VIASETREG(VIA_REG_HI_CONTROL1, temp & 0xFFFFFFFE);
}
break;
VIASETREG(control, temp); default:
temp = VIAGETREG(VIA_REG_ALPHA_CONTROL);
VIASETREG(VIA_REG_ALPHA_CONTROL, temp);
}
} }
static void static void
@ -441,50 +501,51 @@ viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
pVia->CursorFG = fg; pVia->CursorFG = fg;
pVia->CursorBG = bg; pVia->CursorBG = bg;
switch(pVia->Chipset) {
case VIA_CX700:
case VIA_P4M890:
case VIA_P4M900:
case VIA_VX800:
case VIA_VX855:
if (pVia->pBIOSInfo->FirstCRTC->IsActive) {
temp = VIAGETREG(VIA_REG_HI_CONTROL0);
VIASETREG(VIA_REG_HI_CONTROL0, temp & 0xFFFFFFFE);
}
if (pVia->pBIOSInfo->SecondCRTC->IsActive) {
temp = VIAGETREG(VIA_REG_HI_CONTROL1);
VIASETREG(VIA_REG_HI_CONTROL1, temp & 0xFFFFFFFE);
}
break;
default:
VIASETREG(control, temp); VIASETREG(control, temp);
} }
}
static void static void
viaLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs) viaLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
CARD32 control = pVia->CursorRegControl;
int x, y, w, h; int x, y, w, h;
CARD32 *image; CARD32 *image = (CARD32*)pCurs->bits->argb;
CARD32 *dst; CARD32 *dst = (CARD32*)pVia->cursorMap;
CARD32 *src;
CARD32 temp;
temp = VIAGETREG(control);
VIASETREG(control, temp & 0xFFFFFFFE);
pVia->CursorARGB = TRUE; pVia->CursorARGB = TRUE;
dst = (CARD32*)pVia->cursorMap;
image = pCurs->bits->argb;
w = pCurs->bits->width; w = pCurs->bits->width;
if (w > pVia->CursorMaxWidth)
w = pVia->CursorMaxWidth;
h = pCurs->bits->height; h = pCurs->bits->height;
if (h > pVia->CursorMaxHeight)
h = pVia->CursorMaxHeight;
for (y = 0; y < h; y++) { for (y = 0; y < h; y++) {
src = image;
image += pCurs->bits->width;
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
*dst++ = *src++; *dst++ = *image++;
/* pad to the right with transparent */
for (; x < pVia->CursorMaxHeight; x++) for (; x < pVia->CursorMaxHeight; x++)
*dst++ = 0; *dst++ = 0;
} }
/* pad below with transparent */
for (; y < pVia->CursorMaxHeight; y++) for (; y < pVia->CursorMaxHeight; y++)
for (x = 0; x < pVia->CursorMaxWidth; x++) for (x = 0; x < pVia->CursorMaxWidth; x++)
*dst++ = 0; *dst++ = 0;
VIASETREG(control, temp);
} }

View File

@ -111,6 +111,38 @@ ViaDisplayDisableCRT(ScrnInfoPtr pScrn)
ViaCrtcMask(hwp, 0x36, 0x30, 0x30); ViaCrtcMask(hwp, 0x36, 0x30, 0x30);
} }
void
ViaDisplayEnableDVO(ScrnInfoPtr pScrn, int port)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDisplayEnableDVO, port: %d\n", port));
switch (port) {
case VIA_DI_PORT_DVP0:
ViaSeqMask(hwp, 0x1E, 0xC0, 0xC0);
break;
case VIA_DI_PORT_DVP1:
ViaSeqMask(hwp, 0x1E, 0x30, 0x30);
break;
}
}
void
ViaDisplayDisableDVO(ScrnInfoPtr pScrn, int port)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDisplayDisableDVO, port: %d\n", port));
switch (port) {
case VIA_DI_PORT_DVP0:
ViaSeqMask(hwp, 0x1E, 0x00, 0xC0);
break;
case VIA_DI_PORT_DVP1:
ViaSeqMask(hwp, 0x1E, 0x00, 0x30);
break;
}
}
/* /*
* Sets the primary or secondary display stream on CRT. * Sets the primary or secondary display stream on CRT.
*/ */
@ -143,3 +175,32 @@ ViaDisplaySetStreamOnDFP(ScrnInfoPtr pScrn, Bool primary)
ViaCrtcMask(hwp, 0x99, 0x10, 0x10); ViaCrtcMask(hwp, 0x99, 0x10, 0x10);
} }
void
ViaDisplaySetStreamOnDVO(ScrnInfoPtr pScrn, int port, Bool primary)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
int regNum;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDisplaySetStreamOnDVO, port: %d\n", port));
switch (port) {
case VIA_DI_PORT_DVP0:
regNum = 0x96;
break;
case VIA_DI_PORT_DVP1:
regNum = 0x9B;
break;
case VIA_DI_PORT_DFPLOW:
regNum = 0x97;
break;
case VIA_DI_PORT_DFPHIGH:
regNum = 0x99;
break;
}
if (primary)
ViaCrtcMask(hwp, regNum, 0x00, 0x10);
else
ViaCrtcMask(hwp, regNum, 0x10, 0x10);
}

View File

@ -592,6 +592,7 @@ VIADRIScreenInit(ScreenPtr pScreen)
case VIA_K8M890: case VIA_K8M890:
case VIA_P4M900: case VIA_P4M900:
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
pDRIInfo->clientDriverName = "swrast"; pDRIInfo->clientDriverName = "swrast";
break; break;
default: default:
@ -890,10 +891,17 @@ VIADRIKernelInit(ScreenPtr pScreen, VIAPtr pVia)
drmInfo.sarea_priv_offset = sizeof(OPENCHROMEDRISAREARec); drmInfo.sarea_priv_offset = sizeof(OPENCHROMEDRISAREARec);
drmInfo.fb_offset = pVia->frameBufferHandle; drmInfo.fb_offset = pVia->frameBufferHandle;
drmInfo.mmio_offset = pVia->registerHandle; drmInfo.mmio_offset = pVia->registerHandle;
if (pVia->IsPCI)
if (pVia->IsPCI) {
drmInfo.agpAddr = (CARD32) NULL; drmInfo.agpAddr = (CARD32) NULL;
else } else {
/*For AMD64*/
#ifndef __x86_64__
drmInfo.agpAddr = (CARD32)pVia->agpAddr; drmInfo.agpAddr = (CARD32)pVia->agpAddr;
#else
drmInfo.agpAddr = (CARD64)pVia->agpAddr;
#endif
}
if ((drmCommandWrite(pVia->drmFD, DRM_VIA_MAP_INIT, &drmInfo, if ((drmCommandWrite(pVia->drmFD, DRM_VIA_MAP_INIT, &drmInfo,
sizeof(drm_via_init_t))) < 0) sizeof(drm_via_init_t))) < 0)

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,11 @@
#include "vgaHW.h" #include "vgaHW.h"
#include "xf86.h" #include "xf86.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h" #include "xf86Resources.h"
#endif
#include "xf86Pci.h" #include "xf86Pci.h"
#include "xf86PciInfo.h" #include "xf86PciInfo.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
@ -100,11 +104,19 @@
#define DRIVER_NAME "openchrome" #define DRIVER_NAME "openchrome"
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define PATCHLEVEL 903 #define PATCHLEVEL 904
#define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL) #define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL)
#define VIA_VQ_SIZE (256 * 1024) #define VIA_VQ_SIZE (256 * 1024)
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#define VIA_RES_SHARED RES_SHARED_VGA
#define VIA_RES_UNDEF RES_UNDEFINED
#else
#define VIA_RES_SHARED NULL
#define VIA_RES_UNDEF NULL
#endif
typedef struct { typedef struct {
CARD8 SR08, SR0A, SR0F; CARD8 SR08, SR0A, SR0F;
@ -114,7 +126,7 @@ typedef struct {
CARD8 SR1F, SR20, SR21, SR22,SR23,SR24,SR25,SR26; CARD8 SR1F, SR20, SR21, SR22,SR23,SR24,SR25,SR26;
CARD8 SR27, SR28, SR29, SR2A,SR2B,SR2C,SR2D,SR2E; CARD8 SR27, SR28, SR29, SR2A,SR2B,SR2C,SR2D,SR2E;
CARD8 SR2F, SR30, SR31, SR32,SR33,SR34,SR40,SR41; CARD8 SR2F, SR30, SR31, SR32,SR33,SR34,SR40,SR41;
CARD8 SR42, SR43, SR44, SR45,SR46,SR47; CARD8 SR42, SR43, SR44, SR45,SR46,SR47,SR48,SR49;
CARD8 SR4A, SR4B, SR4C; CARD8 SR4A, SR4B, SR4C;
/* extended CRTC registers */ /* extended CRTC registers */
@ -229,7 +241,7 @@ typedef struct _VIA {
Bool hwcursor; Bool hwcursor;
Bool NoAccel; Bool NoAccel;
Bool shadowFB; Bool shadowFB;
int rotate; Rotation rotate;
Bool vbeSR; Bool vbeSR;
int agpMem; int agpMem;
@ -295,6 +307,9 @@ typedef struct _VIA {
char * dBounce; char * dBounce;
#endif #endif
/* Rotation */
Bool RandRRotation;
/* BIOS Info Ptr */ /* BIOS Info Ptr */
VIABIOSInfoPtr pBIOSInfo; VIABIOSInfoPtr pBIOSInfo;
struct ViaCardIdStruct* Id; struct ViaCardIdStruct* Id;

View File

@ -1,270 +0,0 @@
/*
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) OR COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef _VIA_DRM_H_
#define _VIA_DRM_H_
/* WARNING: These defines must be the same as what the Xserver uses.
* if you change them, you must change the defines in the Xserver.
*/
#ifndef _VIA_DEFINES_
#define _VIA_DEFINES_
#if !defined(__KERNEL__) && !defined(_KERNEL)
#include "via_drmclient.h"
#endif
#define VIA_NR_SAREA_CLIPRECTS 8
#define VIA_NR_XVMC_PORTS 10
#define VIA_NR_XVMC_LOCKS 5
#define VIA_MAX_CACHELINE_SIZE 64
#define XVMCLOCKPTR(saPriv,lockNo) \
((volatile drm_hw_lock_t *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
(VIA_MAX_CACHELINE_SIZE - 1)) & \
~(VIA_MAX_CACHELINE_SIZE - 1)) + \
VIA_MAX_CACHELINE_SIZE*(lockNo)))
/* Each region is a minimum of 64k, and there are at most 64 of them.
*/
#define VIA_NR_TEX_REGIONS 64
#define VIA_LOG_MIN_TEX_REGION_SIZE 16
#endif
#define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
#define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
#define VIA_UPLOAD_CTX 0x4
#define VIA_UPLOAD_BUFFERS 0x8
#define VIA_UPLOAD_TEX0 0x10
#define VIA_UPLOAD_TEX1 0x20
#define VIA_UPLOAD_CLIPRECTS 0x40
#define VIA_UPLOAD_ALL 0xff
/* VIA specific ioctls */
#define DRM_VIA_ALLOCMEM 0x00
#define DRM_VIA_FREEMEM 0x01
#define DRM_VIA_AGP_INIT 0x02
#define DRM_VIA_FB_INIT 0x03
#define DRM_VIA_MAP_INIT 0x04
#define DRM_VIA_DEC_FUTEX 0x05
#define NOT_USED
#define DRM_VIA_DMA_INIT 0x07
#define DRM_VIA_CMDBUFFER 0x08
#define DRM_VIA_FLUSH 0x09
#define DRM_VIA_PCICMD 0x0a
#define DRM_VIA_CMDBUF_SIZE 0x0b
#define NOT_USED
#define DRM_VIA_WAIT_IRQ 0x0d
#define DRM_VIA_DMA_BLIT 0x0e
#define DRM_VIA_BLIT_SYNC 0x0f
#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
#define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
#define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
drm_via_cmdbuf_size_t)
#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
/* Indices into buf.Setup where various bits of state are mirrored per
* context and per buffer. These can be fired at the card as a unit,
* or in a piecewise fashion as required.
*/
#define VIA_TEX_SETUP_SIZE 8
/* Flags for clear ioctl
*/
#define VIA_FRONT 0x1
#define VIA_BACK 0x2
#define VIA_DEPTH 0x4
#define VIA_STENCIL 0x8
#define VIA_MEM_VIDEO 0 /* matches drm constant */
#define VIA_MEM_AGP 1 /* matches drm constant */
#define VIA_MEM_SYSTEM 2
#define VIA_MEM_MIXED 3
#define VIA_MEM_UNKNOWN 4
typedef struct {
uint32_t offset;
uint32_t size;
} drm_via_agp_t;
typedef struct {
uint32_t offset;
uint32_t size;
} drm_via_fb_t;
typedef struct {
uint32_t context;
uint32_t type;
uint32_t size;
unsigned long index;
unsigned long offset;
} drm_via_mem_t;
typedef struct _drm_via_init {
enum {
VIA_INIT_MAP = 0x01,
VIA_CLEANUP_MAP = 0x02
} func;
unsigned long sarea_priv_offset;
unsigned long fb_offset;
unsigned long mmio_offset;
unsigned long agpAddr;
} drm_via_init_t;
typedef struct _drm_via_futex {
enum {
VIA_FUTEX_WAIT = 0x00,
VIA_FUTEX_WAKE = 0X01
} func;
uint32_t ms;
uint32_t lock;
uint32_t val;
} drm_via_futex_t;
typedef struct _drm_via_dma_init {
enum {
VIA_INIT_DMA = 0x01,
VIA_CLEANUP_DMA = 0x02,
VIA_DMA_INITIALIZED = 0x03
} func;
unsigned long offset;
unsigned long size;
unsigned long reg_pause_addr;
} drm_via_dma_init_t;
typedef struct _drm_via_cmdbuffer {
char __user *buf;
unsigned long size;
} drm_via_cmdbuffer_t;
/* Warning: If you change the SAREA structure you must change the Xserver
* structure as well */
typedef struct _drm_via_tex_region {
unsigned char next, prev; /* indices to form a circular LRU */
unsigned char inUse; /* owned by a client, or free? */
int age; /* tracked by clients to update local LRU's */
} drm_via_tex_region_t;
typedef struct _drm_via_sarea {
unsigned int dirty;
unsigned int nbox;
drm_clip_rect_t boxes[VIA_NR_SAREA_CLIPRECTS];
drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
int texAge; /* last time texture was uploaded */
int ctxOwner; /* last context to upload state */
int vertexPrim;
/*
* Below is for XvMC.
* We want the lock integers alone on, and aligned to, a cache line.
* Therefore this somewhat strange construct.
*/
char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
/* Used by the 3d driver only at this point, for pageflipping:
*/
unsigned int pfCurrentOffset;
} drm_via_sarea_t;
typedef struct _drm_via_cmdbuf_size {
enum {
VIA_CMDBUF_SPACE = 0x01,
VIA_CMDBUF_LAG = 0x02
} func;
int wait;
uint32_t size;
} drm_via_cmdbuf_size_t;
typedef enum {
VIA_IRQ_ABSOLUTE = 0x0,
VIA_IRQ_RELATIVE = 0x1,
VIA_IRQ_SIGNAL = 0x10000000,
VIA_IRQ_FORCE_SEQUENCE = 0x20000000
} via_irq_seq_type_t;
#define VIA_IRQ_FLAGS_MASK 0xF0000000
enum drm_via_irqs{drm_via_irq_hqv0 = 0,
drm_via_irq_hqv1,
drm_via_irq_dma0_dd,
drm_via_irq_dma0_td,
drm_via_irq_dma1_dd,
drm_via_irq_dma1_td,
drm_via_irq_num};
struct drm_via_wait_irq_request{
unsigned irq;
via_irq_seq_type_t type;
uint32_t sequence;
uint32_t signal;
};
typedef union drm_via_irqwait {
struct drm_via_wait_irq_request request;
struct drm_wait_vblank_reply reply;
} drm_via_irqwait_t;
typedef struct drm_via_blitsync {
uint32_t sync_handle;
unsigned engine;
} drm_via_blitsync_t;
typedef struct drm_via_dmablit {
uint32_t num_lines;
uint32_t line_length;
uint32_t fb_addr;
uint32_t fb_stride;
unsigned char *mem_addr;
uint32_t mem_stride;
int bounce_buffer;
int to_fb;
drm_via_blitsync_t sync;
} drm_via_dmablit_t;
#endif /* _VIA_DRM_H_ */

View File

@ -92,6 +92,7 @@ static struct ViaCardIdStruct ViaCardId[] = {
{"Shuttle FX21", VIA_K8M800, 0x1297, 0x3052, VIA_DEVICE_CRT}, {"Shuttle FX21", VIA_K8M800, 0x1297, 0x3052, VIA_DEVICE_CRT},
{"Shuttle FX83", VIA_K8M800, 0x1297, 0xF683, VIA_DEVICE_CRT | VIA_DEVICE_TV}, {"Shuttle FX83", VIA_K8M800, 0x1297, 0xF683, VIA_DEVICE_CRT | VIA_DEVICE_TV},
{"Sharp Actius AL27", VIA_K8M800, 0x13BD, 0x1044, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Sharp Actius AL27", VIA_K8M800, 0x13BD, 0x1044, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Sharp PC-AE30J", VIA_K8M800, 0x13BD, 0x104B, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Giga-byte GA-K8VM800M", VIA_K8M800, 0x1458, 0xD000, VIA_DEVICE_CRT}, {"Giga-byte GA-K8VM800M", VIA_K8M800, 0x1458, 0xD000, VIA_DEVICE_CRT},
{"MSI K8M Neo-V", VIA_K8M800, 0x1462, 0x0320, VIA_DEVICE_CRT}, {"MSI K8M Neo-V", VIA_K8M800, 0x1462, 0x0320, VIA_DEVICE_CRT},
{"MSI K8MM-V", VIA_K8M800, 0x1462, 0x7142, VIA_DEVICE_CRT}, {"MSI K8MM-V", VIA_K8M800, 0x1462, 0x7142, VIA_DEVICE_CRT},
@ -134,6 +135,7 @@ static struct ViaCardIdStruct ViaCardId[] = {
/*** P4M800Pro, VN800, CN700 ***/ /*** P4M800Pro, VN800, CN700 ***/
{"Clevo/RoverBook Partner E419L", VIA_VM800, 0x1019, 0x0F75, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo/RoverBook Partner E419L", VIA_VM800, 0x1019, 0x0F75, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Haier A60-440256080BD", VIA_VM800, 0x1019, 0x0F79, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"PCChips P23G", VIA_VM800, 0x1019, 0x1623, VIA_DEVICE_CRT}, {"PCChips P23G", VIA_VM800, 0x1019, 0x1623, VIA_DEVICE_CRT},
{"ECS P4M800PRO-M", VIA_VM800, 0x1019, 0x2122, VIA_DEVICE_CRT}, {"ECS P4M800PRO-M", VIA_VM800, 0x1019, 0x2122, VIA_DEVICE_CRT},
{"ECS C7VCM", VIA_VM800, 0x1019, 0xAA2D, VIA_DEVICE_CRT}, {"ECS C7VCM", VIA_VM800, 0x1019, 0xAA2D, VIA_DEVICE_CRT},
@ -154,6 +156,7 @@ static struct ViaCardIdStruct ViaCardId[] = {
{"Clevo M5xxS", VIA_VM800, 0x1558, 0x5406, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo M5xxS", VIA_VM800, 0x1558, 0x5406, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Biostar P4M80-M4 / P4VMA-M", VIA_VM800, 0x1565, 0x1202, VIA_DEVICE_CRT}, {"Biostar P4M80-M4 / P4VMA-M", VIA_VM800, 0x1565, 0x1202, VIA_DEVICE_CRT},
{"Biostar P4M800 Pro-M7", VIA_VM800, 0x1565, 0x1206, VIA_DEVICE_CRT}, {"Biostar P4M800 Pro-M7", VIA_VM800, 0x1565, 0x1206, VIA_DEVICE_CRT},
{"Packard Bell Lima (ASUS MBP5VDZ-NVM)", VIA_VM800, 0x1631, 0xE018, VIA_DEVICE_CRT},
{"Fujitsu/Siemens Amilo Pro V2030", VIA_VM800, 0x1734, 0x109B, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Fujitsu/Siemens Amilo Pro V2030", VIA_VM800, 0x1734, 0x109B, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Fujitsu/Siemens Amilo Pro V2035", VIA_VM800, 0x1734, 0x10AE, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Fujitsu/Siemens Amilo Pro V2035", VIA_VM800, 0x1734, 0x10AE, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Fujitsu/Siemens Amilo Pro V2055", VIA_VM800, 0x1734, 0x10CA, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Fujitsu/Siemens Amilo Pro V2055", VIA_VM800, 0x1734, 0x10CA, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
@ -185,6 +188,7 @@ static struct ViaCardIdStruct ViaCardId[] = {
{"MSI VR321", VIA_P4M900, 0x1462, 0x3355, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"MSI VR321", VIA_P4M900, 0x1462, 0x3355, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"MSI P4M900M / P4M900M2-F/L", VIA_P4M900, 0x1462, 0x7255, VIA_DEVICE_CRT}, {"MSI P4M900M / P4M900M2-F/L", VIA_P4M900, 0x1462, 0x7255, VIA_DEVICE_CRT},
{"MSI P4M900M3-L", VIA_P4M900, 0x1462, 0x7387, VIA_DEVICE_CRT}, {"MSI P4M900M3-L", VIA_P4M900, 0x1462, 0x7387, VIA_DEVICE_CRT},
{"Twinhead H12V", VIA_P4M900, 0x14FF, 0xA00F, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Everex NC1501/NC1503", VIA_P4M900, 0x1509, 0x1E30, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Everex NC1501/NC1503", VIA_P4M900, 0x1509, 0x1E30, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Clevo M660SE", VIA_P4M900, 0x1558, 0x0664, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo M660SE", VIA_P4M900, 0x1558, 0x0664, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Clevo M660SR", VIA_P4M900, 0x1558, 0x0669, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Clevo M660SR", VIA_P4M900, 0x1558, 0x0669, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
@ -207,6 +211,7 @@ static struct ViaCardIdStruct ViaCardId[] = {
/*** P4M890, VN890 ***/ /*** P4M890, VN890 ***/
{"PCChips P29G", VIA_P4M890, 0x1019, 0x1629, VIA_DEVICE_CRT}, {"PCChips P29G", VIA_P4M890, 0x1019, 0x1629, VIA_DEVICE_CRT},
{"ECS P4M890T-M v2.0", VIA_P4M890, 0x1019, 0x2171, VIA_DEVICE_CRT},
{"PCChips ????", VIA_P4M890, 0x1019, 0x2174, VIA_DEVICE_CRT}, {"PCChips ????", VIA_P4M890, 0x1019, 0x2174, VIA_DEVICE_CRT},
{"Asustek P5V-VM ULTRA", VIA_P4M890, 0x1043, 0x81B5, VIA_DEVICE_CRT}, {"Asustek P5V-VM ULTRA", VIA_P4M890, 0x1043, 0x81B5, VIA_DEVICE_CRT},
{"Asustek P5V-VM DH", VIA_P4M890, 0x1043, 0x81CE, VIA_DEVICE_CRT}, {"Asustek P5V-VM DH", VIA_P4M890, 0x1043, 0x81CE, VIA_DEVICE_CRT},
@ -219,8 +224,13 @@ static struct ViaCardIdStruct ViaCardId[] = {
/*** VX800 ***/ /*** VX800 ***/
{"VIA Epia M700", VIA_VX800, 0x1106, 0x1122, VIA_DEVICE_CRT}, {"VIA Epia M700", VIA_VX800, 0x1106, 0x1122, VIA_DEVICE_CRT},
{"VIA OpenBook", VIA_VX800, 0x1170, 0x0311, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, /* VIA OpenBook eNote VBE8910 */
{"Samsung NC20", VIA_VX800, 0x144d, 0xc04e, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Samsung NC20", VIA_VX800, 0x144d, 0xc04e, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Quanta DreamBook Light IL1", VIA_VX800, 0x152d, 0x0771, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Quanta DreamBook Light IL1", VIA_VX800, 0x152d, 0x0771, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
{"Lenovo S12", VIA_VX800, 0x17aa, 0x388c, VIA_DEVICE_CRT | VIA_DEVICE_LCD},
/*** VX855 ***/
{"VIA VT8562C", VIA_VX855, 0x1106, 0x5122, VIA_DEVICE_CRT},
/* keep this */ /* keep this */
{NULL, VIA_UNKNOWN, 0x0000, 0x0000, VIA_DEVICE_NONE} {NULL, VIA_UNKNOWN, 0x0000, 0x0000, VIA_DEVICE_NONE}
@ -264,15 +274,15 @@ ViaCheckCardId(ScrnInfoPtr pScrn)
if ((Id->Chip == pVia->Chipset) && if ((Id->Chip == pVia->Chipset) &&
(Id->Vendor == SUBVENDOR_ID(pVia->PciInfo)) && (Id->Vendor == SUBVENDOR_ID(pVia->PciInfo)) &&
(Id->Device == SUBSYS_ID(pVia->PciInfo))) { (Id->Device == SUBSYS_ID(pVia->PciInfo))) {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %s.\n", Id->String); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %s. Card-Ids (%4X|%4X)\n", Id->String, SUBVENDOR_ID(pVia->PciInfo), SUBSYS_ID(pVia->PciInfo));
pVia->Id = Id; pVia->Id = Id;
return; return;
} }
} }
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Unknown Card-Ids (%4X|%4X|%4X); please report to openchrome-users@openchrome.org\n", "Unknown Card-Ids (%4X|%4X|%4X), Chipset: %s; please report to openchrome-users@openchrome.org\n",
DEVICE_ID(pVia->PciInfo), SUBVENDOR_ID(pVia->PciInfo), SUBSYS_ID(pVia->PciInfo)); DEVICE_ID(pVia->PciInfo), SUBVENDOR_ID(pVia->PciInfo), SUBSYS_ID(pVia->PciInfo), pScrn->chipset);
pVia->Id = NULL; pVia->Id = NULL;
} }

View File

@ -38,6 +38,7 @@ enum VIACHIPTAGS {
VIA_CX700, VIA_CX700,
VIA_P4M890, VIA_P4M890,
VIA_VX800, VIA_VX800,
VIA_VX855,
VIA_LAST VIA_LAST
}; };
@ -54,6 +55,7 @@ enum VIACHIPTAGS {
#define PCI_CHIP_VT3324 0x3157 /* CX700 */ #define PCI_CHIP_VT3324 0x3157 /* CX700 */
#define PCI_CHIP_VT3327 0x3343 /* P4M890 */ #define PCI_CHIP_VT3327 0x3343 /* P4M890 */
#define PCI_CHIP_VT3353 0x1122 /* VX800 */ #define PCI_CHIP_VT3353 0x1122 /* VX800 */
#define PCI_CHIP_VT3409 0x5122 /* VX855/VX875 */
/* There is some conflicting information about the two major revisions of /* There is some conflicting information about the two major revisions of
* the CLE266, often labelled Ax and Cx. The dividing line seems to be * the CLE266, often labelled Ax and Cx. The dividing line seems to be

View File

@ -35,10 +35,121 @@
#include "via_driver.h" #include "via_driver.h"
#include "via_vgahw.h" #include "via_vgahw.h"
#include "via_id.h" #include "via_id.h"
#include <unistd.h>
/*
1. Formula:
2^13 X 0.0698uSec [1/14.318MHz] = 8192 X 0.0698uSec =572.1uSec
Timer = Counter x 572 uSec
2. Note:
0.0698 uSec is too small to compute for hardware. So we multify a
reference value(2^13) to make it big enough to compute for hardware.
3. Note:
The meaning of the TD0~TD3 are count of the clock.
TD(sec) = (sec)/(per clock) x (count of clocks)
*/
#define TD0 200
#define TD1 25
#define TD2 0
#define TD3 25
static void
ViaLVDSSoftwarePowerFirstSequence(ScrnInfoPtr pScrn, Bool on)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSSoftwarePowerFirstSequence: %d\n", on));
if (on) {
/* Software control power sequence ON*/
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0x7F);
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x01);
usleep(TD0);
/* VDD ON*/
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x10);
usleep(TD1);
/* DATA ON */
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x08);
usleep(TD2);
/* VEE ON (unused on vt3353)*/
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x04);
usleep(TD3);
/* Back-Light ON */
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) | 0x02);
} else {
/* Back-Light OFF */
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xFD);
usleep(TD3);
/* VEE OFF (unused on vt3353)*/
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xFB);
usleep(TD2);
/* DATA OFF */
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xF7);
usleep(TD1);
/* VDD OFF */
hwp->writeCrtc(hwp, 0x91, hwp->readCrtc(hwp, 0x91) & 0xEF);
}
}
static void
ViaLVDSSoftwarePowerSecondSequence(ScrnInfoPtr pScrn, Bool on)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSSoftwarePowerSecondSequence: %d\n", on));
if (on) {
/* Secondary power hardware power sequence enable 0:off 1: on */
hwp->writeCrtc(hwp, 0xD4, hwp->readCrtc(hwp, 0xD4) & 0xFD);
/* Software control power sequence ON */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x01);
usleep(TD0);
/* VDD ON*/
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x10);
usleep(TD1);
/* DATA ON */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x08);
usleep(TD2);
/* VEE ON (unused on vt3353)*/
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x04);
usleep(TD3);
/* Back-Light ON */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) | 0x02);
} else {
/* Back-Light OFF */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xFD);
usleep(TD3);
/* VEE OFF */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xFB);
/* Delay TD2 msec. */
usleep(TD2);
/* DATA OFF */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xF7);
/* Delay TD1 msec. */
usleep(TD1);
/* VDD OFF */
hwp->writeCrtc(hwp, 0xD3, hwp->readCrtc(hwp, 0xD3) & 0xEF);
}
}
static void static void
ViaLVDSPowerFirstSequence(ScrnInfoPtr pScrn, Bool on) ViaLVDSHardwarePowerFirstSequence(ScrnInfoPtr pScrn, Bool on)
{ {
vgaHWPtr hwp = VGAHWPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn);
@ -59,7 +170,7 @@ ViaLVDSPowerFirstSequence(ScrnInfoPtr pScrn, Bool on)
} }
static void static void
ViaLVDSPowerSecondSequence(ScrnInfoPtr pScrn, Bool on) ViaLVDSHardwarePowerSecondSequence(ScrnInfoPtr pScrn, Bool on)
{ {
vgaHWPtr hwp = VGAHWPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn);
@ -83,15 +194,10 @@ static void
ViaLVDSDFPPower(ScrnInfoPtr pScrn, Bool on) ViaLVDSDFPPower(ScrnInfoPtr pScrn, Bool on)
{ {
vgaHWPtr hwp = VGAHWPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
if (on) { /* Switch DFP High/Low pads on or off for channels active at EnterVT(). */
/* Turn DFP High/Low pad on. */ ViaSeqMask(hwp, 0x2A, on ? pVia->SavedReg.SR2A : 0, 0x0F);
hwp->writeSeq(hwp, 0x2A, hwp->readSeq(hwp, 0x2A) | 0x0F);
} else {
/* Turn DFP High/Low pad off. */
hwp->writeSeq(hwp, 0x2A, hwp->readSeq(hwp, 0x2A) & 0xF0);
}
} }
static void static void
@ -114,9 +220,24 @@ ViaLVDSPowerChannel(ScrnInfoPtr pScrn, Bool on)
void void
ViaLVDSPower(ScrnInfoPtr pScrn, Bool on) ViaLVDSPower(ScrnInfoPtr pScrn, Bool on)
{ {
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSPower\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSPower %d\n", on));
ViaLVDSPowerFirstSequence(pScrn, on); VIAPtr pVia = VIAPTR(pScrn);
ViaLVDSPowerSecondSequence(pScrn, on);
/*
* VX800, CX700 have HW issue, so we'd better use SW power sequence
* Fix Ticket #308
*/
switch (pVia->Chipset) {
case VIA_VX800:
case VIA_CX700:
ViaLVDSSoftwarePowerFirstSequence(pScrn, on);
ViaLVDSSoftwarePowerSecondSequence(pScrn, on);
break;
default:
ViaLVDSHardwarePowerFirstSequence(pScrn, on);
ViaLVDSHardwarePowerSecondSequence(pScrn, on);
}
ViaLVDSDFPPower(pScrn, on); ViaLVDSDFPPower(pScrn, on);
ViaLVDSPowerChannel(pScrn, on); ViaLVDSPowerChannel(pScrn, on);
} }

View File

@ -39,6 +39,7 @@
#include "via_driver.h" #include "via_driver.h"
#include "via_vgahw.h" #include "via_vgahw.h"
#include "via_id.h" #include "via_id.h"
#include <unistd.h>
/* /*
* Modetable nonsense. * Modetable nonsense.
@ -250,6 +251,10 @@ ViaTVSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (pBIOSInfo->TVModeCrtc) if (pBIOSInfo->TVModeCrtc)
pBIOSInfo->TVModeCrtc(pScrn, mode); pBIOSInfo->TVModeCrtc(pScrn, mode);
/* TV reset. */
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x00);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x80);
} }
void void
@ -299,7 +304,7 @@ ViaDFPDetect(ScrnInfoPtr pScrn)
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDFPDetect\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDFPDetect\n"));
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
xf86MonPtr monPtr = NULL; xf86MonPtr monPtr = NULL;
if (pVia->pI2CBus2) if (pVia->pI2CBus2)
@ -371,8 +376,10 @@ ViaOutputsDetect(ScrnInfoPtr pScrn)
} }
} }
if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800)) { switch (pVia->Chipset) {
case VIA_CX700:
case VIA_VX800:
case VIA_VX855:
if (ViaDFPDetect(pScrn)) { if (ViaDFPDetect(pScrn)) {
pBIOSInfo->DfpPresent = TRUE; pBIOSInfo->DfpPresent = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@ -382,6 +389,7 @@ ViaOutputsDetect(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"DFP is disconnected.\n"); "DFP is disconnected.\n");
} }
break;
} }
} }
@ -491,6 +499,8 @@ ViaOutputsSelect(ScrnInfoPtr pScrn)
pBIOSInfo->CrtPresent = TRUE; pBIOSInfo->CrtPresent = TRUE;
pBIOSInfo->CrtActive = TRUE; pBIOSInfo->CrtActive = TRUE;
} }
if (pBIOSInfo->TVActive)
pBIOSInfo->FirstCRTC->IsActive = TRUE ;
} }
if (!pVia->UseLegacyModeSwitch) { if (!pVia->UseLegacyModeSwitch) {
if (pBIOSInfo->CrtActive) if (pBIOSInfo->CrtActive)
@ -499,8 +509,14 @@ ViaOutputsSelect(ScrnInfoPtr pScrn)
pBIOSInfo->FirstCRTC->IsActive = TRUE ; pBIOSInfo->FirstCRTC->IsActive = TRUE ;
if (pBIOSInfo->Panel->IsActive) { if (pBIOSInfo->Panel->IsActive) {
pVia->pBIOSInfo->SecondCRTC->IsActive = TRUE ; pVia->pBIOSInfo->SecondCRTC->IsActive = TRUE ;
if (pVia->Chipset == VIA_P4M900 || pVia->Chipset == VIA_CX700 || pVia->Chipset == VIA_VX800 ) switch (pVia->Chipset) {
case VIA_P4M900:
case VIA_CX700:
case VIA_VX800:
case VIA_VX855:
pVia->pBIOSInfo->Lvds->IsActive = TRUE ; pVia->pBIOSInfo->Lvds->IsActive = TRUE ;
break;
}
} }
} }
@ -536,13 +552,14 @@ VIAGetPanelSize(ScrnInfoPtr pScrn)
int height = 0; int height = 0;
Bool ret; Bool ret;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSize\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSize (UseLegacyModeSwitch)\n"));
ret = ViaPanelGetSizeFromDDCv1(pScrn, &width, &height); ret = ViaPanelGetSizeFromDDCv1(pScrn, &width, &height);
if (!ret) if (!ret)
ret = ViaPanelGetSizeFromDDCv2(pScrn, &width); ret = ViaPanelGetSizeFromDDCv2(pScrn, &width);
if (ret) { if (ret) {
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID returned resolution %d x %d \n", width, height));
switch (width) { switch (width) {
case 640: case 640:
pBIOSInfo->Panel->NativeModeIndex = VIA_PANEL6X4; pBIOSInfo->Panel->NativeModeIndex = VIA_PANEL6X4;
@ -571,6 +588,7 @@ VIAGetPanelSize(ScrnInfoPtr pScrn)
} }
} else { } else {
pBIOSInfo->Panel->NativeModeIndex = hwp->readCrtc(hwp, 0x3F) >> 4; pBIOSInfo->Panel->NativeModeIndex = hwp->readCrtc(hwp, 0x3F) >> 4;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to get information from EDID. Resolution from Scratchpad: %d \n", pBIOSInfo->Panel->NativeModeIndex));
if (pBIOSInfo->Panel->NativeModeIndex == 0) { if (pBIOSInfo->Panel->NativeModeIndex == 0) {
/* VIA_PANEL6X4 == 0, but that value equals unset */ /* VIA_PANEL6X4 == 0, but that value equals unset */
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to " xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to "
@ -665,13 +683,6 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode)
} }
} }
if ((mode->PrivSize != sizeof(struct ViaModePriv))
|| (mode->Private != (void *)&ViaPanelPrivate)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"ViaPanelGetIndex: Mode not supported by Panel.\n");
return FALSE;
}
if (!ViaGetResolutionIndex(pScrn, mode)) { if (!ViaGetResolutionIndex(pScrn, mode)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel does not support this" xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel does not support this"
" resolution: %s\n", mode->name); " resolution: %s\n", mode->name);
@ -681,8 +692,8 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode)
for (i = 0; ViaResolutionTable[i].Index != VIA_RES_INVALID; i++) { for (i = 0; ViaResolutionTable[i].Index != VIA_RES_INVALID; i++) {
if (ViaResolutionTable[i].PanelIndex if (ViaResolutionTable[i].PanelIndex
== pBIOSInfo->Panel->NativeModeIndex) { == pBIOSInfo->Panel->NativeModeIndex) {
pBIOSInfo->panelX = ViaResolutionTable[i].X; pBIOSInfo->Panel->NativeMode->Width = ViaResolutionTable[i].X;
pBIOSInfo->panelY = ViaResolutionTable[i].Y; pBIOSInfo->Panel->NativeMode->Height = ViaResolutionTable[i].Y;
break; break;
} }
} }
@ -693,8 +704,8 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode)
return FALSE; return FALSE;
} }
if ((pBIOSInfo->panelX != mode->CrtcHDisplay) if ((pBIOSInfo->Panel->NativeMode->Width != mode->CrtcHDisplay)
|| (pBIOSInfo->panelY != mode->CrtcVDisplay)) { || (pBIOSInfo->Panel->NativeMode->Height != mode->CrtcVDisplay)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelGetIndex: Non-native" xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelGetIndex: Non-native"
" resolutions are broken.\n"); " resolutions are broken.\n");
return FALSE; return FALSE;
@ -719,7 +730,7 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode)
pBIOSInfo->PanelIndex = i; pBIOSInfo->PanelIndex = i;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelGetIndex:" DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelGetIndex:"
"index: %d (%dx%d)\n", pBIOSInfo->PanelIndex, "index: %d (%dx%d)\n", pBIOSInfo->PanelIndex,
pBIOSInfo->panelX, pBIOSInfo->panelY)); pBIOSInfo->Panel->NativeMode->Width, pBIOSInfo->Panel->NativeMode->Height));
return TRUE; return TRUE;
} }
@ -832,7 +843,7 @@ ViaGetMemoryBandwidth(ScrnInfoPtr pScrn)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaGetMemoryBandwidth\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaGetMemoryBandwidth. Memory type: %d\n", pVia->MemClk));
switch (pVia->MemClk) { switch (pVia->MemClk) {
case VIA_MEM_SDR66: case VIA_MEM_SDR66:
@ -873,7 +884,7 @@ ViaValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
if (pVia->pVbe) if (pVia->pVbe)
return MODE_OK; return MODE_OK;
DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "ViaValidMode: Validating %s (%d)\n", DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "ViaValidMode: Validating %s (Clock: %d)\n",
mode->name, mode->Clock)); mode->name, mode->Clock));
if (mode->Flags & V_INTERLACE) if (mode->Flags & V_INTERLACE)
@ -968,23 +979,48 @@ ViaSetUseExternalClock(vgaHWPtr hwp)
* *
*/ */
static void static void
ViaSetPrimaryDotclock(ScrnInfoPtr pScrn, CARD32 clock) ViaSetDotclock(ScrnInfoPtr pScrn, CARD32 clock, int base, int probase)
{ {
vgaHWPtr hwp = VGAHWPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
DEBUG(xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, DEBUG(xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO,
"ViaSetPrimaryDotclock to 0x%06x\n", (unsigned)clock)); "ViaSetDotclock to 0x%06x\n", (unsigned)clock));
if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400)) { if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400)) {
hwp->writeSeq(hwp, 0x46, clock >> 8); hwp->writeSeq(hwp, base, clock >> 8);
hwp->writeSeq(hwp, 0x47, clock & 0xFF); hwp->writeSeq(hwp, base+1, clock & 0xFF);
} else { /* unichrome pro */ } else { /* unichrome pro */
hwp->writeSeq(hwp, 0x44, clock >> 16); union pllparams pll;
hwp->writeSeq(hwp, 0x45, (clock >> 8) & 0xFF); int dtz, dr, dn, dm;
hwp->writeSeq(hwp, 0x46, clock & 0xFF); pll.packed = clock;
dtz = pll.params.dtz;
dr = pll.params.dr;
dn = pll.params.dn;
dm = pll.params.dm;
/* The VX855 does not modify dm/dn, but earlier chipsets do. */
if (pVia->Chipset != VIA_VX855) {
dm -= 2;
dn -= 2;
} }
hwp->writeSeq(hwp, probase, dm & 0xff);
hwp->writeSeq(hwp, probase+1, ((dm >> 8) & 0x03) | (dr << 2) | ((dtz & 1) << 7));
hwp->writeSeq(hwp, probase+2, (dn & 0x7f) | ((dtz & 2) << 6));
}
}
/*
*
*/
static void
ViaSetPrimaryDotclock(ScrnInfoPtr pScrn, CARD32 clock)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
ViaSetDotclock(pScrn, clock, 0x46, 0x44);
ViaSeqMask(hwp, 0x40, 0x02, 0x02); ViaSeqMask(hwp, 0x40, 0x02, 0x02);
ViaSeqMask(hwp, 0x40, 0x00, 0x02); ViaSeqMask(hwp, 0x40, 0x00, 0x02);
} }
@ -996,24 +1032,23 @@ static void
ViaSetSecondaryDotclock(ScrnInfoPtr pScrn, CARD32 clock) ViaSetSecondaryDotclock(ScrnInfoPtr pScrn, CARD32 clock)
{ {
vgaHWPtr hwp = VGAHWPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
DEBUG(xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, ViaSetDotclock(pScrn, clock, 0x44, 0x4A);
"ViaSetSecondaryDotclock to 0x%06x\n", (unsigned)clock));
if ((pVia->Chipset == VIA_CLE266) || (pVia->Chipset == VIA_KM400)) {
hwp->writeSeq(hwp, 0x44, clock >> 8);
hwp->writeSeq(hwp, 0x45, clock & 0xFF);
} else { /* unichrome pro */
hwp->writeSeq(hwp, 0x4A, clock >> 16);
hwp->writeSeq(hwp, 0x4B, (clock >> 8) & 0xFF);
hwp->writeSeq(hwp, 0x4C, clock & 0xFF);
}
ViaSeqMask(hwp, 0x40, 0x04, 0x04); ViaSeqMask(hwp, 0x40, 0x04, 0x04);
ViaSeqMask(hwp, 0x40, 0x00, 0x04); ViaSeqMask(hwp, 0x40, 0x00, 0x04);
} }
/*
*
*/
static void
ViaSetECKDotclock(ScrnInfoPtr pScrn, CARD32 clock)
{
/* Does the non-pro chip have an ECK clock ? */
ViaSetDotclock(pScrn, clock, 0, 0x47);
}
/* /*
* Broken, only does native mode decently. I (Luc) personally broke this. * Broken, only does native mode decently. I (Luc) personally broke this.
*/ */
@ -1065,8 +1100,8 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaVgahwWrite(hwp, 0x300 + port, offset, 0x301 + port, data); ViaVgahwWrite(hwp, 0x300 + port, offset, 0x301 + port, data);
} }
if ((mode->CrtcHDisplay != pBIOSInfo->panelX) if ((mode->CrtcHDisplay != pBIOSInfo->Panel->NativeMode->Width)
|| (mode->CrtcVDisplay != pBIOSInfo->panelY)) { || (mode->CrtcVDisplay != pBIOSInfo->Panel->NativeMode->Height)) {
VIALCDModeEntryPtr Main; VIALCDModeEntryPtr Main;
VIALCDMPatchEntryPtr Patch1, Patch2; VIALCDMPatchEntryPtr Patch1, Patch2;
int numPatch1, numPatch2; int numPatch1, numPatch2;
@ -1162,7 +1197,7 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
for (i = 0; i < numPatch2; i++, Patch2++) { for (i = 0; i < numPatch2; i++, Patch2++) {
if (Patch2->Mode == modeNum) { if (Patch2->Mode == modeNum) {
if (!pBIOSInfo->Center if (!pBIOSInfo->Center
&& (mode->CrtcHDisplay == pBIOSInfo->panelX)) && (mode->CrtcHDisplay == pBIOSInfo->Panel->NativeMode->Width))
pBIOSInfo->scaleY = FALSE; pBIOSInfo->scaleY = FALSE;
for (j = 0; j < Patch2->numEntry; j++) { for (j = 0; j < Patch2->numEntry; j++) {
@ -1247,7 +1282,7 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
static CARD32 static CARD32
ViaComputeDotClock(unsigned clock) ViaComputeDotClock(unsigned clock)
{ {
double fvco, fout, fref, err, minErr; double fout, fref, err, minErr;
CARD32 dr, dn, dm, maxdm, maxdn; CARD32 dr, dn, dm, maxdm, maxdn;
CARD32 factual, best; CARD32 factual, best;
@ -1281,15 +1316,16 @@ ViaComputeProDotClock(unsigned clock)
{ {
double fvco, fout, fref, err, minErr; double fvco, fout, fref, err, minErr;
CARD32 dr = 0, dn, dm, maxdm, maxdn; CARD32 dr = 0, dn, dm, maxdm, maxdn;
CARD32 factual, bestClock; CARD32 factual;
union pllparams bestClock;
fref = 14.318e6; fref = 14.318e6;
fout = (double)clock * 1.e3; fout = (double)clock * 1.e3;
factual = ~0; factual = ~0;
maxdm = factual / 14318000U - 2; maxdm = factual / 14318000U;
minErr = 1.e10; minErr = 1.e10;
bestClock = 0U; bestClock.packed = 0U;
do { do {
fvco = fout * (1 << dr); fvco = fout * (1 << dr);
@ -1300,30 +1336,31 @@ ViaComputeProDotClock(unsigned clock)
} }
if (clock < 30000) if (clock < 30000)
maxdn = 6; maxdn = 8;
else if (clock < 45000) else if (clock < 45000)
maxdn = 5; maxdn = 7;
else if (clock < 170000) else if (clock < 170000)
maxdn = 4; maxdn = 6;
else else
maxdn = 3; maxdn = 5;
for (dn = 0; dn < maxdn; ++dn) { for (dn = 2; dn < maxdn; ++dn) {
for (dm = 0; dm < maxdm; ++dm) { for (dm = 2; dm < maxdm; ++dm) {
factual = 14318000U * (dm + 2); factual = 14318000U * dm;
factual /= (dn + 2) << dr; factual /= dn << dr;
if ((err = fabs((double)factual / fout - 1.)) < 0.005) { if ((err = fabs((double)factual / fout - 1.)) < 0.005) {
if (err < minErr) { if (err < minErr) {
minErr = err; minErr = err;
bestClock = ((dm & 0xff) << 16) | bestClock.params.dtz = 1;
(((1 << 7) | (dr << 2) | ((dm & 0x300) >> 8)) << 8) bestClock.params.dr = dr;
| (dn & 0x7f); bestClock.params.dn = dn;
bestClock.params.dm = dm;
} }
} }
} }
} }
return bestClock; return bestClock.packed;
} }
/* /*
@ -1348,12 +1385,13 @@ ViaModeDotClockTranslate(ScrnInfoPtr pScrn, DisplayModePtr mode)
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"ViaComputeDotClock %d : %04x : %04x\n", "ViaComputeDotClock %d : %04x : %04x\n",
mode->Clock, best1, best2)); mode->Clock, (unsigned int)best1, (unsigned int)best2));
return best2; return best2;
} else { } else {
for (i = 0; ViaDotClocks[i].DotClock; i++) for (i = 0; ViaDotClocks[i].DotClock; i++)
if (ViaDotClocks[i].DotClock == mode->Clock) if (ViaDotClocks[i].DotClock == mode->Clock)
return ViaDotClocks[i].UniChromePro; return ViaDotClocks[i].UniChromePro.packed;
return ViaComputeProDotClock(mode->Clock); return ViaComputeProDotClock(mode->Clock);
} }
@ -1370,7 +1408,7 @@ ViaModePrimaryLegacy(ScrnInfoPtr pScrn, DisplayModePtr mode)
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModePrimary\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModePrimaryLegacy\n"));
DEBUG(ViaPrintMode(pScrn, mode)); DEBUG(ViaPrintMode(pScrn, mode));
/* Turn off Screen */ /* Turn off Screen */
@ -1449,7 +1487,7 @@ ViaModeSecondaryLegacy(ScrnInfoPtr pScrn, DisplayModePtr mode)
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModeSecondary\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModeSecondaryLegacy\n"));
DEBUG(ViaPrintMode(pScrn, mode)); DEBUG(ViaPrintMode(pScrn, mode));
/* Turn off Screen */ /* Turn off Screen */
@ -1557,15 +1595,16 @@ ViaDFPPower(ScrnInfoPtr pScrn, Bool On)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDFPPower: Off.\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDFPPower: Off.\n");
#endif #endif
vgaHWPtr hwp = VGAHWPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
/* Display Channel Select */ /* Display Channel Select */
ViaCrtcMask(hwp, 0xD2, 0x30, 0x30); ViaCrtcMask(hwp, 0xD2, 0x30, 0x30);
if (On)
/* Power on TMDS */ /* Power on TMDS */
ViaCrtcMask(hwp, 0xD2, 0x00, 0x08); ViaCrtcMask(hwp, 0xD2, 0x00, 0x08);
else
/* Power off TMDS */
ViaCrtcMask(hwp, 0xD2, 0x08, 0x08);
} }
@ -1584,6 +1623,20 @@ ViaModeFirstCRTC(ScrnInfoPtr pScrn, DisplayModePtr mode)
pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, mode); pBIOSInfo->Clock = ViaModeDotClockTranslate(pScrn, mode);
pBIOSInfo->ClockExternal = FALSE; pBIOSInfo->ClockExternal = FALSE;
/* Enable MMIO & PCI burst (1 wait state) */
switch (pVia->Chipset) {
case VIA_CLE266:
case VIA_KM400:
case VIA_K8M800:
case VIA_PM800:
case VIA_VM800:
ViaSeqMask(hwp, 0x1A, 0x06, 0x06);
break;
default:
ViaSeqMask(hwp, 0x1A, 0x0C, 0x0C);
break;
}
ViaSetPrimaryFIFO(pScrn, mode); ViaSetPrimaryFIFO(pScrn, mode);
ViaSetPrimaryDotclock(pScrn, pBIOSInfo->Clock); ViaSetPrimaryDotclock(pScrn, pBIOSInfo->Clock);
@ -1669,6 +1722,13 @@ ViaModeSet(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaDFPPower(pScrn, TRUE); ViaDFPPower(pScrn, TRUE);
} }
if (pBIOSInfo->TVActive) {
/* TV on FirstCrtc */
ViaDisplaySetStreamOnDVO(pScrn, pBIOSInfo->TVDIPort, TRUE);
ViaDisplayEnableDVO(pScrn, pBIOSInfo->TVDIPort);
ViaTVSetMode(pScrn, mode);
}
ViaModeFirstCRTC(pScrn, mode); ViaModeFirstCRTC(pScrn, mode);
} else { } else {
ViaDisplayDisableCRT(pScrn); ViaDisplayDisableCRT(pScrn);

View File

@ -35,6 +35,15 @@
#define VIA_BW_DDR400 498000000 /* > 1920x1080@60Hz@32bpp */ #define VIA_BW_DDR400 498000000 /* > 1920x1080@60Hz@32bpp */
#define VIA_BW_DDR667 922000000 #define VIA_BW_DDR667 922000000
union pllparams {
struct {
CARD32 dtz : 2;
CARD32 dr : 3;
CARD32 dn : 7;
CARD32 dm :10;
} params;
CARD32 packed;
};
/* /*
* simple lookup table for dotclocks * simple lookup table for dotclocks
@ -43,51 +52,52 @@
static struct ViaDotClock { static struct ViaDotClock {
int DotClock; int DotClock;
CARD16 UniChrome; CARD16 UniChrome;
CARD32 UniChromePro; union pllparams UniChromePro;
} ViaDotClocks[] = { } ViaDotClocks[] = {
{ 25200, 0x513C, 0xa79004 }, { 25200, 0x513C, /* 0xa79004 */ { 1, 4, 6, 169 } },
{ 25312, 0xC763, 0xc49005 }, { 25312, 0xC763, /* 0xc49005 */ { 1, 4, 7, 198 } },
{ 26591, 0x471A, 0xce9005 }, { 26591, 0x471A, /* 0xce9005 */ { 1, 4, 7, 208 } },
{ 31500, 0xC558, 0xae9003 }, { 31500, 0xC558, /* 0xae9003 */ { 1, 4, 5, 176 } },
{ 31704, 0x471F, 0xaf9002 }, { 31704, 0x471F, /* 0xaf9002 */ { 1, 4, 4, 177 } },
{ 32663, 0xC449, 0x479000 }, { 32663, 0xC449, /* 0x479000 */ { 1, 4, 2, 73 } },
{ 33750, 0x4721, 0x959002 }, { 33750, 0x4721, /* 0x959002 */ { 1, 4, 4, 151 } },
{ 35500, 0x5877, 0x759001 }, { 35500, 0x5877, /* 0x759001 */ { 1, 4, 3, 119 } },
{ 36000, 0x5879, 0x9f9002 }, { 36000, 0x5879, /* 0x9f9002 */ { 1, 4, 4, 161 } },
{ 39822, 0xC459, 0x578c02 }, { 39822, 0xC459, /* 0x578c02 */ { 1, 3, 4, 89 } },
{ 40000, 0x515F, 0x848c04 }, { 40000, 0x515F, /* 0x848c04 */ { 1, 3, 6, 134 } },
{ 41164, 0x4417, 0x2c8c00 }, { 41164, 0x4417, /* 0x2c8c00 */ { 1, 3, 2, 46 } },
{ 46981, 0x5069, 0x678c02 }, { 46981, 0x5069, /* 0x678c02 */ { 1, 3, 4, 105 } },
{ 49500, 0xC353, 0xa48c04 }, { 49500, 0xC353, /* 0xa48c04 */ { 3, 3, 5, 138 } },
{ 50000, 0xC354, 0x368c00 }, { 50000, 0xC354, /* 0x368c00 */ { 1, 3, 2, 56 } },
{ 56300, 0x4F76, 0x3d8c00 }, { 56300, 0x4F76, /* 0x3d8c00 */ { 1, 3, 2, 63 } },
{ 57284, 0x4E70, 0x3e8c00 }, { 57275, 0, /* 0x3e8c00 */ { 1, 3, 5, 157 } }, /* For XO 1.5 no need for a unichrome clock */
{ 64995, 0x0D3B, 0x6b8c01 }, { 57284, 0x4E70, /* 0x3e8c00 */ { 1, 3, 2, 64 } },
{ 65000, 0x0D3B, 0x6b8c01 }, /* Slightly unstable on PM800 */ { 64995, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } },
{ 65028, 0x866D, 0x6b8c01 }, { 65000, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, /* Slightly unstable on PM800 */
{ 74480, 0x156E, 0x288800 }, { 65028, 0x866D, /* 0x6b8c01 */ { 1, 3, 3, 109 } },
{ 75000, 0x156E, 0x288800 }, { 74480, 0x156E, /* 0x288800 */ { 1, 2, 2, 42 } },
{ 78800, 0x442C, 0x2a8800 }, { 75000, 0x156E, /* 0x288800 */ { 1, 2, 2, 42 } },
{ 81135, 0x0622, 0x428801 }, { 78800, 0x442C, /* 0x2a8800 */ { 1, 2, 2, 44 } },
{ 81613, 0x4539, 0x708803 }, { 81135, 0x0622, /* 0x428801 */ { 1, 2, 3, 68 } },
{ 94500, 0x4542, 0x4d8801 }, { 81613, 0x4539, /* 0x708803 */ { 1, 2, 5, 114 } },
{ 108000, 0x0B53, 0x778802 }, { 94500, 0x4542, /* 0x4d8801 */ { 1, 2, 3, 79 } },
{ 108280, 0x4879, 0x778802 }, { 108000, 0x0B53, /* 0x778802 */ { 1, 2, 4, 121 } },
{ 122000, 0x0D6F, 0x428800 }, { 108280, 0x4879, /* 0x778802 */ { 1, 2, 4, 121 } },
{ 122726, 0x073C, 0x878802 }, { 122000, 0x0D6F, /* 0x428800 */ { 1, 2, 2, 68 } },
{ 135000, 0x0742, 0x6f8801 }, { 122726, 0x073C, /* 0x878802 */ { 1, 2, 4, 137 } },
{ 148500, 0x0853, 0x518800 }, { 135000, 0x0742, /* 0x6f8801 */ { 1, 2, 3, 113 } },
{ 155800, 0x0857, 0x558402 }, { 148500, 0x0853, /* 0x518800 */ { 1, 2, 2, 83 } },
{ 157500, 0x422C, 0x2a8400 }, { 155800, 0x0857, /* 0x558402 */ { 1, 1, 4, 87 } },
{ 161793, 0x4571, 0x6f8403 }, { 157500, 0x422C, /* 0x2a8400 */ { 1, 1, 2, 44 } },
{ 162000, 0x0A71, 0x6f8403 }, { 161793, 0x4571, /* 0x6f8403 */ { 1, 1, 5, 113 } },
{ 175500, 0x4231, 0x2f8400 }, { 162000, 0x0A71, /* 0x6f8403 */ { 1, 1, 5, 113 } },
{ 189000, 0x0542, 0x4d8401 }, { 175500, 0x4231, /* 0x2f8400 */ { 1, 1, 2, 49 } },
{ 202500, 0x0763, 0x6F8402 }, { 189000, 0x0542, /* 0x4d8401 */ { 1, 1, 3, 79 } },
{ 204800, 0x0764, 0x548401 }, { 202500, 0x0763, /* 0x6F8402 */ { 1, 1, 4, 113 } },
{ 218300, 0x043D, 0x3b8400 }, { 204800, 0x0764, /* 0x548401 */ { 1, 1, 3, 86 } },
{ 229500, 0x0660, 0x3e8400 }, /* Not tested on Pro */ { 218300, 0x043D, /* 0x3b8400 */ { 1, 1, 2, 61 } },
{ 0, 0, 0 } { 229500, 0x0660, /* 0x3e8400 */ { 1, 1, 2, 64 } }, /* Not tested on Pro } */
{ 0, 0, { 0, 0, 0, 0 } }
}; };
/* /*
@ -126,6 +136,8 @@ static DisplayModeRec ViaPanelModes[] = {
{ MODEPREFIX("1152x864"), 81613, 1152, 1216, 1336, 1520, 0, 864, 864, 867, 895, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1152x864"), 81613, 1152, 1216, 1336, 1520, 0, 864, 864, 867, 895, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX },
{ MODEPREFIX("1280x768"), 81135, 1280, 1328, 1440, 1688, 0, 768, 770, 776, 802, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX }, { MODEPREFIX("1280x768"), 81135, 1280, 1328, 1440, 1688, 0, 768, 770, 776, 802, 0, V_PHSYNC | V_NVSYNC, MODESUFFIX },
{ MODEPREFIX("1280x720"), 74600, 1280, 1341, 1474, 1688, 0, 720, 721, 724, 746, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1280x720"), 74600, 1280, 1341, 1474, 1688, 0, 720, 721, 724, 746, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX },
{ MODEPREFIX("1280x800"), 83500, 1280, 1352, 1480, 1680, 0, 800, 803, 809, 831, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX },
{ MODEPREFIX("1200x900"), 57275, 1200, 1208, 1216, 1240, 0, 900, 905, 908, 912, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX },
{ MODEPREFIX("1280x960"), 108280, 1280, 1376, 1488, 1800, 0, 960, 960, 963, 1000, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1280x960"), 108280, 1280, 1376, 1488, 1800, 0, 960, 960, 963, 1000, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX },
{ MODEPREFIX("1280x1024"), 108280, 1280, 1328, 1440, 1688, 0, 1024, 1024, 1027, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1280x1024"), 108280, 1280, 1328, 1440, 1688, 0, 1024, 1024, 1027, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX },
{ MODEPREFIX("1360x768"), 85500, 1360, 1392, 1712, 1744, 0, 768, 783, 791, 807, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, { MODEPREFIX("1360x768"), 85500, 1360, 1392, 1712, 1744, 0, 768, 783, 791, 807, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX },
@ -159,6 +171,7 @@ static DisplayModeRec ViaPanelModes[] = {
#define VIA_RES_1280X720 19 #define VIA_RES_1280X720 19
#define VIA_RES_1920X1080 20 #define VIA_RES_1920X1080 20
#define VIA_RES_1366X768 22 #define VIA_RES_1366X768 22
#define VIA_RES_1200X900 23
#define VIA_RES_INVALID 0xFF #define VIA_RES_INVALID 0xFF
/* /*
@ -190,6 +203,7 @@ static struct {
{VIA_RES_856X480, VIA_PANEL_INVALID, 856, 480}, {VIA_RES_856X480, VIA_PANEL_INVALID, 856, 480},
{VIA_RES_1024X576, VIA_PANEL_INVALID, 1024, 576}, {VIA_RES_1024X576, VIA_PANEL_INVALID, 1024, 576},
{VIA_RES_800X480, VIA_PANEL8X4, 800, 480}, {VIA_RES_800X480, VIA_PANEL8X4, 800, 480},
{VIA_RES_1200X900, VIA_PANEL12X9, 1200, 900},
{VIA_RES_INVALID, VIA_PANEL_INVALID, 0, 0} {VIA_RES_INVALID, VIA_PANEL_INVALID, 0, 0}
}; };

View File

@ -45,16 +45,20 @@ static ViaPanelModeRec ViaPanelNativeModes[] = {
{1280, 768}, {1280, 768},
{1280, 1024}, {1280, 1024},
{1400, 1050}, {1400, 1050},
{1600, 1200}, {1600, 1200}, /* 0x6 Resolution 1440x900 */
{1280, 800}, {1280, 800}, /* 0x7 Resolution 1280x800 (Samsung NC20) */
{800, 480}, {800, 480}, /* 0x8 For Quanta 800x480 */
{1366, 768}, {1024, 600}, /* 0x9 Resolution 1024x600 (for HP 2133) */
{1360, 768}, {1366, 768}, /* 0xA Resolution 1366x768 */
{1920, 1080}, {1920, 1080},
{1920, 1200}, {1920, 1200},
{1024, 600}, {1280, 1024}, /* 0xD Need to be fixed to 1920x1200 */
{1440, 900}, {1440, 900}, /* 0xE Need to be fixed to 640x240 */
{1280, 720} {1280, 720}, /* 0xF 480x640 */
{1200, 900}, /* 0x10 For Panasonic 1280x768 18bit Dual-Channel Panel */
{1360, 768}, /* 0x11 Resolution 1360X768 */
{1024, 768}, /* 0x12 Resolution 1024x768 */
{800, 480} /* 0x13 General 8x4 panel use this setting */
}; };
static int static int
@ -63,6 +67,7 @@ ViaPanelLookUpModeIndex(int width, int height)
int i, index = VIA_PANEL_INVALID; int i, index = VIA_PANEL_INVALID;
int length = sizeof(ViaPanelNativeModes) / sizeof(ViaPanelModeRec); int length = sizeof(ViaPanelNativeModes) / sizeof(ViaPanelModeRec);
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
if (ViaPanelNativeModes[i].Width == width if (ViaPanelNativeModes[i].Width == width
&& ViaPanelNativeModes[i].Height == height) { && ViaPanelNativeModes[i].Height == height) {
@ -283,10 +288,13 @@ ViaPanelPreInit(ScrnInfoPtr pScrn)
*/ */
if (ret) { if (ret) {
panel->NativeModeIndex = ViaPanelLookUpModeIndex(width, height); panel->NativeModeIndex = ViaPanelLookUpModeIndex(width, height);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelLookUpModeIndex, Width %d, Height %d, NativeModeIndex%d\n", width, height, panel->NativeModeIndex));
if (panel->NativeModeIndex != VIA_PANEL_INVALID) { if (panel->NativeModeIndex != VIA_PANEL_INVALID) {
panel->NativeMode->Width = width; panel->NativeMode->Width = width;
panel->NativeMode->Height = height; panel->NativeMode->Height = height;
} }
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to get panel size from EDID. Return code: %d\n", ret);
} }
} }
@ -378,6 +386,7 @@ ViaPanelGetSizeFromEDID(ScrnInfoPtr pScrn, xf86MonPtr pMon,
Bool Bool
ViaPanelGetSizeFromDDCv1(ScrnInfoPtr pScrn, int *width, int *height) ViaPanelGetSizeFromDDCv1(ScrnInfoPtr pScrn, int *width, int *height)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
xf86MonPtr pMon; xf86MonPtr pMon;

View File

@ -31,6 +31,9 @@
#include "shadowfb.h" #include "shadowfb.h"
#include "servermd.h" #include "servermd.h"
/* RandR support */
#include "xf86RandR12.h"
static void static void
VIARefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) VIARefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
@ -59,6 +62,85 @@ VIARefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
} }
} }
void
VIARefreshArea_UD(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
VIAPtr pVia = VIAPTR(pScrn);
int width, height, Bpp, FBPitch;
unsigned char *src, *dst;
int i;
Bpp = pScrn->bitsPerPixel >> 3;
FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel);
while (num--) {
width = pbox->x2 - pbox->x1;
height = pbox->y2 - pbox->y1;
dst = pVia->FBBase + ((pScrn->virtualY - 1 - pbox->y1) * FBPitch) + ((pScrn->virtualX - 1 - pbox->x1) * Bpp);
src = pVia->ShadowPtr + (pbox->y1 * pVia->ShadowPitch) +
(pbox->x1 * Bpp);
switch(pScrn->bitsPerPixel) {
case 8:
while (height--) {
for(i=0; i<width; i++) {
*(dst-i)=*(src+i);
}
dst -= FBPitch;
src += pVia->ShadowPitch;
}
break;
case 16:
while (height--) {
/* TODO Faster method - need test
for(i=0; i<width*2; i=i+2) {
*(CARD16 *)(dst-i)=*(CARD16 *)(src+i);
}
*/
for(i=0; i<width; i++) {
*(CARD16 *)(dst-i*2)=*(CARD16 *)(src+i*2);
}
dst -= FBPitch;
src += pVia->ShadowPitch;
}
break;
case 24:
while (height--) {
/* TODO Faster method - need test
for(i=0; i<width*3; i=i+3) {
*(CARD16 *)(dst-i)=*(CARD16 *)(src+i);
*(dst-i+2)=*(src+i+2);
}
*/
for(i=0; i<width*3; i=i+3) {
*(dst-i)=*(src+i);
*(dst-i+1)=*(src+i+1);
*(dst-i+2)=*(src+i+2);
}
dst -= FBPitch;
src += pVia->ShadowPitch;
}
break;
case 32:
while (height--) {
/* TODO Faster method - need test
for(i=0; i<width*4; i=i+4) {
*(CARD32 *)(dst-i)=*(CARD32 *)(src+i);
}
*/
for(i=0; i<width; i++) {
*(CARD32 *)(dst-i*4)=*(CARD32 *)(src+i*4);
}
dst -= FBPitch;
src += pVia->ShadowPitch;
}
break;
}
pbox++;
}
}
static void static void
VIAPointerMoved(int index, int x, int y) VIAPointerMoved(int index, int x, int y)
{ {
@ -66,12 +148,15 @@ VIAPointerMoved(int index, int x, int y)
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
int newX, newY; int newX, newY;
if (pVia->rotate == 1) { if (pVia->rotate == RR_Rotate_90) {
newX = pScrn->pScreen->height - y - 1; newX = pScrn->pScreen->height - y - 1;
newY = x; newY = x;
} else { } else if (pVia->rotate == RR_Rotate_270) {
newX = y; newX = y;
newY = pScrn->pScreen->width - x - 1; newY = pScrn->pScreen->width - x - 1;
} else {
newX = pScrn->pScreen->width - x - 1;
newY = pScrn->pScreen->height - y - 1;
} }
(*pVia->PointerMoved) (index, newX, newY); (*pVia->PointerMoved) (index, newX, newY);
@ -81,12 +166,29 @@ static void
VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
int count, width, height, y1, y2, dstPitch, srcPitch; int count, width, height, y1, y2, dstPitch, srcPitch, tmpRot;
CARD8 *dstPtr, *srcPtr, *src; CARD8 *dstPtr, *srcPtr, *src;
CARD32 *dst; CARD32 *dst;
if (pVia->rotate == RR_Rotate_0)
{
VIARefreshArea(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_180) {
VIARefreshArea_UD(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_90) {
tmpRot=1;
} else {
tmpRot=-1;
}
dstPitch = pScrn->displayWidth; dstPitch = pScrn->displayWidth;
srcPitch = -pVia->rotate * pVia->ShadowPitch; srcPitch = -tmpRot*pVia->ShadowPitch;
while (num--) { while (num--) {
width = pbox->x2 - pbox->x1; width = pbox->x2 - pbox->x1;
@ -94,7 +196,7 @@ VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
y2 = (pbox->y2 + 3) & ~3; y2 = (pbox->y2 + 3) & ~3;
height = (y2 - y1) >> 2; /* in dwords */ height = (y2 - y1) >> 2; /* in dwords */
if (pVia->rotate == 1) { if (pVia->rotate == RR_Rotate_90) {
dstPtr = (pVia->FBBase dstPtr = (pVia->FBBase
+ (pbox->x1 * dstPitch) + pScrn->virtualX - y2); + (pbox->x1 * dstPitch) + pScrn->virtualX - y2);
srcPtr = pVia->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1; srcPtr = pVia->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
@ -116,7 +218,7 @@ VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
src += srcPitch * 4; src += srcPitch * 4;
} }
srcPtr += pVia->rotate; srcPtr += tmpRot;
dstPtr += dstPitch; dstPtr += dstPitch;
} }
@ -128,12 +230,29 @@ static void
VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
int count, width, height, y1, y2, dstPitch, srcPitch; int count, width, height, y1, y2, dstPitch, srcPitch, tmpRot;
CARD16 *dstPtr, *srcPtr, *src; CARD16 *dstPtr, *srcPtr, *src;
CARD32 *dst; CARD32 *dst;
if (pVia->rotate == RR_Rotate_0)
{
VIARefreshArea(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_180) {
VIARefreshArea_UD(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_90) {
tmpRot=1;
} else {
tmpRot=-1;
}
dstPitch = pScrn->displayWidth; dstPitch = pScrn->displayWidth;
srcPitch = -pVia->rotate * pVia->ShadowPitch >> 1; srcPitch = -tmpRot*pVia->ShadowPitch >> 1;
while (num--) { while (num--) {
width = pbox->x2 - pbox->x1; width = pbox->x2 - pbox->x1;
@ -141,7 +260,7 @@ VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
y2 = (pbox->y2 + 1) & ~1; y2 = (pbox->y2 + 1) & ~1;
height = (y2 - y1) >> 1; /* in dwords */ height = (y2 - y1) >> 1; /* in dwords */
if (pVia->rotate == 1) { if (pVia->rotate == RR_Rotate_90) {
dstPtr = ((CARD16*) pVia->FBBase dstPtr = ((CARD16*) pVia->FBBase
+ (pbox->x1 * dstPitch) + pScrn->virtualX - y2); + (pbox->x1 * dstPitch) + pScrn->virtualX - y2);
srcPtr = ((CARD16*) pVia->ShadowPtr srcPtr = ((CARD16*) pVia->ShadowPtr
@ -163,7 +282,7 @@ VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
src += srcPitch * 2; src += srcPitch * 2;
} }
srcPtr += pVia->rotate; srcPtr += tmpRot;
dstPtr += dstPitch; dstPtr += dstPitch;
} }
@ -177,12 +296,30 @@ void
VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
int count, width, height, y1, y2, dstPitch, srcPitch; int count, width, height, y1, y2, dstPitch, srcPitch, tmpRot;
CARD8 *dstPtr, *srcPtr, *src; CARD8 *dstPtr, *srcPtr, *src;
CARD32 *dst; CARD32 *dst;
if (pVia->rotate == RR_Rotate_0)
{
VIARefreshArea(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_180) {
VIARefreshArea_UD(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_90) {
tmpRot=1;
} else {
tmpRot=-1;
}
dstPitch = BitmapBytePad(pScrn->displayWidth * 24); dstPitch = BitmapBytePad(pScrn->displayWidth * 24);
srcPitch = -pVia->rotate * pVia->ShadowPitch; srcPitch = -tmpRot * pVia->ShadowPitch;
while (num--) { while (num--) {
width = pbox->x2 - pbox->x1; width = pbox->x2 - pbox->x1;
@ -190,7 +327,7 @@ VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
y2 = (pbox->y2 + 3) & ~3; y2 = (pbox->y2 + 3) & ~3;
height = (y2 - y1) >> 2; /* blocks of 3 dwords */ height = (y2 - y1) >> 2; /* blocks of 3 dwords */
if (pVia->rotate == 1) { if (pVia->rotate == RR_Rotate_90) {
dstPtr = (pVia->FBBase dstPtr = (pVia->FBBase
+ (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3)); + (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3));
srcPtr = pVia->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3); srcPtr = pVia->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3);
@ -217,7 +354,7 @@ VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
src += srcPitch * 4; src += srcPitch * 4;
} }
srcPtr += pVia->rotate * 3; srcPtr += tmpRot * 3;
dstPtr += dstPitch; dstPtr += dstPitch;
} }
@ -230,17 +367,33 @@ static void
VIARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox) VIARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
int count, width, height, dstPitch, srcPitch; int count, width, height, dstPitch, srcPitch, tmpRot;
CARD32 *dstPtr, *srcPtr, *src, *dst; CARD32 *dstPtr, *srcPtr, *src, *dst;
if (pVia->rotate == RR_Rotate_0)
{
VIARefreshArea(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_180) {
VIARefreshArea_UD(pScrn, num, pbox);
return;
}
if (pVia->rotate == RR_Rotate_90) {
tmpRot=1;
} else {
tmpRot=-1;
}
dstPitch = pScrn->displayWidth; dstPitch = pScrn->displayWidth;
srcPitch = -pVia->rotate * pVia->ShadowPitch >> 2; srcPitch = -tmpRot * pVia->ShadowPitch >> 2;
while (num--) { while (num--) {
width = pbox->x2 - pbox->x1; width = pbox->x2 - pbox->x1;
height = pbox->y2 - pbox->y1; height = pbox->y2 - pbox->y1;
if (pVia->rotate == 1) { if (pVia->rotate == RR_Rotate_90) {
dstPtr = ((CARD32*) pVia->FBBase dstPtr = ((CARD32*) pVia->FBBase
+ (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2); + (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2);
srcPtr = ((CARD32*) pVia->ShadowPtr srcPtr = ((CARD32*) pVia->ShadowPtr
@ -262,7 +415,7 @@ VIARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
src += srcPitch; src += srcPitch;
} }
srcPtr += pVia->rotate; srcPtr += tmpRot;
dstPtr += dstPitch; dstPtr += dstPitch;
} }
@ -276,7 +429,7 @@ ViaShadowFBInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
RefreshAreaFuncPtr refreshArea = VIARefreshArea; RefreshAreaFuncPtr refreshArea = VIARefreshArea;
if (pVia->rotate) { if ((pVia->rotate)||(pVia->RandRRotation==TRUE)) {
if (!pVia->PointerMoved) { if (!pVia->PointerMoved) {
pVia->PointerMoved = pScrn->PointerMoved; pVia->PointerMoved = pScrn->PointerMoved;
pScrn->PointerMoved = VIAPointerMoved; pScrn->PointerMoved = VIAPointerMoved;

View File

@ -46,6 +46,7 @@
#include "via_id.h" #include "via_id.h"
#include <math.h> #include <math.h>
#include <unistd.h>
/* /*
* Warning: this file contains revision checks which are CLE266-specific. * Warning: this file contains revision checks which are CLE266-specific.
@ -282,6 +283,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn)
HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE;
break; break;
case VIA_VX800: case VIA_VX800:
case VIA_VX855:
HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE;
HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = VID_HWDIFF_TRUE;
HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE; HWDiff->dwSupportTwoColorKey = VID_HWDIFF_TRUE;
@ -784,6 +786,7 @@ viaCalculateVideoColor(VIAPtr pVia, int hue, int saturation,
case PCI_CHIP_VT3324: case PCI_CHIP_VT3324:
case PCI_CHIP_VT3327: case PCI_CHIP_VT3327:
case PCI_CHIP_VT3353: case PCI_CHIP_VT3353:
case PCI_CHIP_VT3409:
model = 0; model = 0;
break; break;
case PCI_CHIP_CLE3122: case PCI_CHIP_CLE3122:
@ -922,6 +925,7 @@ viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness,
case PCI_CHIP_VT3324: case PCI_CHIP_VT3324:
case PCI_CHIP_VT3364: case PCI_CHIP_VT3364:
case PCI_CHIP_VT3353: case PCI_CHIP_VT3353:
case PCI_CHIP_VT3409:
case PCI_CHIP_CLE3122: case PCI_CHIP_CLE3122:
VIDOutD(V1_ColorSpaceReg_2, col2); VIDOutD(V1_ColorSpaceReg_2, col2);
VIDOutD(V1_ColorSpaceReg_1, col1); VIDOutD(V1_ColorSpaceReg_1, col1);
@ -951,6 +955,7 @@ ViaInitVideoStatusFlag(VIAPtr pVia)
case PCI_CHIP_VT3324: case PCI_CHIP_VT3324:
case PCI_CHIP_VT3364: case PCI_CHIP_VT3364:
case PCI_CHIP_VT3353: case PCI_CHIP_VT3353:
case PCI_CHIP_VT3409:
return (VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE return (VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE
| VIDEO_ACTIVE | VIDEO_SHOW); | VIDEO_ACTIVE | VIDEO_SHOW);
case PCI_CHIP_CLE3122: case PCI_CHIP_CLE3122:
@ -990,6 +995,8 @@ ViaSetVidCtl(VIAPtr pVia, unsigned int videoFlag)
case PCI_CHIP_VT3364: case PCI_CHIP_VT3364:
case PCI_CHIP_VT3353: case PCI_CHIP_VT3353:
return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336; return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336;
case PCI_CHIP_VT3409:
return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3409;
case PCI_CHIP_CLE3122: case PCI_CHIP_CLE3122:
if (CLE266_REV_IS_CX(pVia->ChipRev)) if (CLE266_REV_IS_CX(pVia->ChipRev))
return V3_ENABLE | V3_EXPIRE_NUM_F; return V3_ENABLE | V3_EXPIRE_NUM_F;
@ -1269,23 +1276,27 @@ SetFIFO_V1(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold)
static void static void
SetFIFO_V3(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold) SetFIFO_V3(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold)
{ {
if ((pVia->ChipId == PCI_CHIP_VT3314) switch (pVia->ChipId) {
|| (pVia->ChipId == PCI_CHIP_VT3324) case PCI_CHIP_VT3314:
|| (pVia->ChipId == PCI_CHIP_VT3327 case PCI_CHIP_VT3324:
|| (pVia->ChipId == PCI_CHIP_VT3353))) { case PCI_CHIP_VT3327:
case PCI_CHIP_VT3353:
case PCI_CHIP_VT3409:
SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL,
(VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK)
| ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8));
SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL,
(VIDInD(ALPHA_V3_PREFIFO_CONTROL) (VIDInD(ALPHA_V3_PREFIFO_CONTROL)
& ~V3_FIFO_MASK_3314) | (prethreshold & 0xff)); & ~V3_FIFO_MASK_3314) | (prethreshold & 0xff));
} else { break;
default :
SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL,
(VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK)
| ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8));
SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL,
(VIDInD(ALPHA_V3_PREFIFO_CONTROL) & ~V3_FIFO_MASK) (VIDInD(ALPHA_V3_PREFIFO_CONTROL) & ~V3_FIFO_MASK)
| (prethreshold & 0x7f)); | (prethreshold & 0x7f));
break;
} }
} }
@ -1335,6 +1346,7 @@ SetFIFO_V3_64or32or32(VIAPtr pVia)
case PCI_CHIP_VT3324: case PCI_CHIP_VT3324:
case PCI_CHIP_VT3364: case PCI_CHIP_VT3364:
case PCI_CHIP_VT3353: case PCI_CHIP_VT3353:
case PCI_CHIP_VT3409:
SetFIFO_V3(pVia, 225, 200, 250); SetFIFO_V3(pVia, 225, 200, 250);
break; break;
case PCI_CHIP_VT3204: case PCI_CHIP_VT3204:
@ -1367,6 +1379,7 @@ SetFIFO_V3_64or32or16(VIAPtr pVia)
case PCI_CHIP_VT3324: case PCI_CHIP_VT3324:
case PCI_CHIP_VT3364: case PCI_CHIP_VT3364:
case PCI_CHIP_VT3353: case PCI_CHIP_VT3353:
case PCI_CHIP_VT3409:
SetFIFO_V3(pVia, 225, 200, 250); SetFIFO_V3(pVia, 225, 200, 250);
break; break;
case PCI_CHIP_VT3204: case PCI_CHIP_VT3204:
@ -1640,9 +1653,9 @@ SetVideoWindow(ScrnInfoPtr pScrn, unsigned long videoFlag,
*/ */
if (videoFlag & VIDEO_1_INUSE) { if (videoFlag & VIDEO_1_INUSE) {
if (pBIOSInfo->SetDVI && pBIOSInfo->scaleY) { if (pBIOSInfo->SetDVI && pBIOSInfo->scaleY) {
top = (pUpdate->DstTop * pBIOSInfo->panelY top = (pUpdate->DstTop * pBIOSInfo->Panel->NativeMode->Height
/ pScrn->currentMode->VDisplay); / pScrn->currentMode->VDisplay);
bottom = (pUpdate->DstBottom * pBIOSInfo->panelY bottom = (pUpdate->DstBottom * pBIOSInfo->Panel->NativeMode->Height
/ pScrn->currentMode->VDisplay); / pScrn->currentMode->VDisplay);
} }
} }
@ -2011,7 +2024,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag,
if (pVia->VideoEngine == VIDEO_ENGINE_CME) { if (pVia->VideoEngine == VIDEO_ENGINE_CME) {
VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL1,0); VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL1,0);
VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL3,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL3,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1));
if (pVia->Chipset == VIA_VX800) { if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) {
VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL2,0); VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL2,0);
VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1));
} }

View File

@ -112,7 +112,6 @@ static Bool
ViaVbeSetActiveDevices(ScrnInfoPtr pScrn, int mode, int refresh) ViaVbeSetActiveDevices(ScrnInfoPtr pScrn, int mode, int refresh)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
vbeInfoPtr pVbe = pVia->pVbe; vbeInfoPtr pVbe = pVia->pVbe;
ViaVbeInitInt10(pVbe); ViaVbeInitInt10(pVbe);
@ -140,7 +139,6 @@ static Bool
ViaVbeSetPanelMode(ScrnInfoPtr pScrn, Bool expand) ViaVbeSetPanelMode(ScrnInfoPtr pScrn, Bool expand)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
vbeInfoPtr pVbe = pVia->pVbe; vbeInfoPtr pVbe = pVia->pVbe;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVbeSetPanelMode\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVbeSetPanelMode\n"));
@ -162,7 +160,6 @@ static Bool
ViaVbeSetRefresh(ScrnInfoPtr pScrn, int maxRefresh) ViaVbeSetRefresh(ScrnInfoPtr pScrn, int maxRefresh)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVbeSetRefresh\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVbeSetRefresh\n"));
vbeInfoPtr pVbe = pVia->pVbe; vbeInfoPtr pVbe = pVia->pVbe;
@ -351,8 +348,7 @@ ViaVbeModePreInit(ScrnInfoPtr pScrn)
{ {
VIAPtr pVia = VIAPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn);
VbeInfoBlock *vbe; VbeInfoBlock *vbe;
VbeModeInfoBlock *vbeMode;
DisplayModePtr pMode;
int i; int i;
memset(&(pVia->vbeMode), 0, sizeof(ViaVbeModeInfo)); memset(&(pVia->vbeMode), 0, sizeof(ViaVbeModeInfo));

View File

@ -32,7 +32,11 @@
#include "xf86.h" #include "xf86.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h" #include "xf86Resources.h"
#endif
#include "compiler.h" #include "compiler.h"
#include "xf86PciInfo.h" #include "xf86PciInfo.h"
#include "xf86Pci.h" #include "xf86Pci.h"
@ -277,6 +281,7 @@ DecideOverlaySupport(ScrnInfoPtr pScrn)
pVia->ChipId != PCI_CHIP_VT3314 && pVia->ChipId != PCI_CHIP_VT3314 &&
pVia->ChipId != PCI_CHIP_VT3327 && pVia->ChipId != PCI_CHIP_VT3327 &&
pVia->ChipId != PCI_CHIP_VT3336 && pVia->ChipId != PCI_CHIP_VT3336 &&
pVia->ChipId != PCI_CHIP_VT3409 &&
pVia->ChipId != PCI_CHIP_VT3364 && pVia->ChipId != PCI_CHIP_VT3364 &&
pVia->ChipId != PCI_CHIP_VT3324 && pVia->ChipId != PCI_CHIP_VT3324 &&
pVia->ChipId != PCI_CHIP_VT3353) { pVia->ChipId != PCI_CHIP_VT3353) {
@ -574,6 +579,7 @@ viaInitVideo(ScreenPtr pScreen)
(pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_P4M900) ||
(pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_CX700) ||
(pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX800) ||
(pVia->Chipset == VIA_VX855) ||
(pVia->Chipset == VIA_P4M890)); (pVia->Chipset == VIA_P4M890));
if ((pVia->drmVerMajor < 2) || if ((pVia->drmVerMajor < 2) ||
((pVia->drmVerMajor == 2) && (pVia->drmVerMinor < 9))) ((pVia->drmVerMajor == 2) && (pVia->drmVerMinor < 9)))
@ -592,7 +598,8 @@ viaInitVideo(ScreenPtr pScreen)
(pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) || (pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) ||
(pVia->Chipset == VIA_VM800) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_VM800) || (pVia->Chipset == VIA_K8M890) ||
(pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) ||
(pVia->Chipset == VIA_P4M890) || (pVia->Chipset == VIA_VX800)) { (pVia->Chipset == VIA_P4M890) || (pVia->Chipset == VIA_VX800) ||
(pVia->Chipset == VIA_VX855)) {
num_new = viaSetupAdaptors(pScreen, &newAdaptors); num_new = viaSetupAdaptors(pScreen, &newAdaptors);
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
} else { } else {
@ -667,7 +674,7 @@ viaVideoFillPixmap(ScrnInfoPtr pScrn,
{ {
int i; int i;
ErrorF("pitch %lu, depth %d, x %d, y %d, w %d h %d, color 0x%08lx\n", ErrorF("pitch %lu, depth %d, x %d, y %d, w %d, h %d, color 0x%08lx\n",
pitch, depth, x, y, w, h, color); pitch, depth, x, y, w, h, color);
depth = (depth + 7) >> 3; depth = (depth + 7) >> 3;
@ -1260,6 +1267,20 @@ viaDmaBlitImage(VIAPtr pVia,
#endif #endif
/*
* The source rectangle of the video is defined by (src_x, src_y, src_w, src_h).
* The dest rectangle of the video is defined by (drw_x, drw_y, drw_w, drw_h).
* id is a fourcc code for the format of the video.
* buf is the pointer to the source data in system memory.
* width and height are the w/h of the source data.
* If "sync" is TRUE, then we must be finished with *buf at the point of return
* (which we always are).
* clipBoxes is the clipping region in screen space.
* data is a pointer to our port private.
* pDraw is a Drawable, which might not be the screen in the case of
* compositing. It's a new argument to the function in the 1.1 server.
*/
static int static int
viaPutImage(ScrnInfoPtr pScrn, viaPutImage(ScrnInfoPtr pScrn,
short src_x, short src_y, short src_x, short src_y,
@ -1313,7 +1334,7 @@ viaPutImage(ScrnInfoPtr pScrn,
/* Copy image data from system memory to video memory /* Copy image data from system memory to video memory
* TODO: use DRM's DMA feature to accelerate data copy * TODO: use DRM's DMA feature to accelerate data copy
*/ */
if (FOURCC_XVMC != id) { if (id != FOURCC_XVMC) {
dstPitch = pVia->swov.SWDevice.dwPitch; dstPitch = pVia->swov.SWDevice.dwPitch;
if (pVia->useDmaBlit) { if (pVia->useDmaBlit) {

View File

@ -32,6 +32,40 @@
#include "via_vt162x.h" #include "via_vt162x.h"
#include "via_id.h" #include "via_id.h"
static void
ViaSetTVClockSource(ScrnInfoPtr pScrn)
{
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaSetTVClockSource\n"));
VIAPtr pVia = VIAPTR(pScrn);
VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo;
vgaHWPtr hwp = VGAHWPTR(pScrn);
/* External TV: */
switch(pVia->Chipset) {
case VIA_CX700:
case VIA_VX800:
if (pBIOSInfo->FirstCRTC->IsActive) {
if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP1)
ViaCrtcMask(hwp, 0x6C, 0xB0, 0xF0);
else if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP0)
ViaCrtcMask(hwp, 0x6C, 0x90, 0xF0);
} else {
/* IGA2 */
if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP1)
ViaCrtcMask(hwp, 0x6C, 0x0B, 0x0F);
else if(pBIOSInfo->TVDIPort == VIA_DI_PORT_DVP0)
ViaCrtcMask(hwp, 0x6C, 0x09, 0x0F);
}
break;
default:
if (pBIOSInfo->FirstCRTC->IsActive)
ViaCrtcMask(hwp, 0x6C, 0x21, 0x21);
else
ViaCrtcMask(hwp, 0x6C, 0xA1, 0xA1);
break;
}
}
static void static void
VT162xPrintRegs(ScrnInfoPtr pScrn) VT162xPrintRegs(ScrnInfoPtr pScrn)
@ -650,11 +684,30 @@ VT1622ModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode)
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2B, Table.RGB[4]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2B, Table.RGB[4]);
if (Table.RGB[5]) if (Table.RGB[5])
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2C, Table.RGB[5]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2C, Table.RGB[5]);
if (pBIOSInfo->TVEncoder == VIA_VT1625) {
if (pBIOSInfo->TVType < TVTYPE_480P) {
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x12);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x23, 0x7E);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A, 0x85);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4B, 0x0A);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4E, 0x00);
} else {
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x12);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4A, 0x85);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4B, 0x0A);
}
}
} else if (pBIOSInfo->TVOutput == TVOUTPUT_YCBCR) { } else if (pBIOSInfo->TVOutput == TVOUTPUT_YCBCR) {
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x03); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x03);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.YCbCr[0]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.YCbCr[0]);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.YCbCr[1]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.YCbCr[1]);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x67, Table.YCbCr[2]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x67, Table.YCbCr[2]);
if (pBIOSInfo->TVEncoder == VIA_VT1625) {
if (pBIOSInfo->TVType < TVTYPE_480P) {
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x23, 0x7E);
xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x4E, 0x00);
}
}
} }
/* Configure flicker filter. */ /* Configure flicker filter. */
@ -721,8 +774,7 @@ VT1622ModeCrtc(ScrnInfoPtr pScrn, DisplayModePtr mode)
} }
pBIOSInfo->ClockExternal = TRUE; pBIOSInfo->ClockExternal = TRUE;
ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); ViaCrtcMask(hwp, 0x6A, 0x40, 0x40);
ViaCrtcMask(hwp, 0x6C, 0x01, 0x01); ViaSetTVClockSource(pScrn);
ViaSeqMask(hwp, 0x1E, 0xF0, 0xF0); /* enable DI0/DVP0 */
} }

View File

@ -755,19 +755,19 @@ static DisplayModeRec VT1625Modes[] = {
{ MODEPREFIX("1024x768Over"), ... , MODESUFFIXPAL }, { MODEPREFIX("1024x768Over"), ... , MODESUFFIXPAL },
{ MODEPREFIX("720x576Over"), ... , MODESUFFIXPAL },*/ { MODEPREFIX("720x576Over"), ... , MODESUFFIXPAL },*/
/* clock HR SH1 SH2 HFL VR SV1 SV2 VFL*/ /* clock HR SH1 SH2 HFL VR SV1 SV2 VFL*/
{ MODEPREFIX("640x480"), 30000, 640, 680, 808, 1000, 0, 480, 520, 523, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("640x480"), 30000, 640, 688, 744, 784, 0, 480, 488, 495, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL },
{ MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("800x600"), 34500, 800, 816, 880, 920, 0, 600, 604, 620, 750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIXPAL },
{ MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL }, { MODEPREFIX("1024x768"), 57000, 1024, 1040, 1112, 1200, 0, 768, 829, 840, 950, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXPAL },
{ MODEPREFIX("720x576"), 34500, 720, 766, 800, 1000, 0, 576, 576, 579, 690, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x576"), 34500, 720, 760, 800, 1000, 0, 576, 577, 580, 690, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL },
{ MODEPREFIX("720x576Over"), 27000, 720, 768, 800, 864, 0, 576, 577, 579, 625, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL }, { MODEPREFIX("720x576Over"), 27000, 720, 768, 800, 864, 0, 576, 577, 579, 625, 0, V_NHSYNC | V_PVSYNC, MODESUFFIXPAL },
{ MODEPREFIX("1280x720"), 74250, 1280, 1320, 1376, 1650, 0, 720, 722, 728, 750, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX720P }, { MODEPREFIX("1280x720"), 74250, 1280, 1320, 1376, 1650, 0, 720, 722, 728, 750, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX720P },
{ MODEPREFIX("1920x1080"), 74250, 1920, 1960, 2016, 2200, 0, 1080, 1082, 1088, 1125, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX1080I }, { MODEPREFIX("1920x1080"), 74250, 1920, 1960, 2064, 2200, 0, 1080, 1083, 1087, 1125, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX1080I },
{ MODEPREFIX("640x480"), 24696, 640, 656, 744, 784, 0, 480, 482, 483, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("640x480"), 24696, 640, 656, 744, 784, 0, 480, 482, 483, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC },
{ MODEPREFIX("720x480Under"), 34000, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Under"), 34000, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC },
{ MODEPREFIX("720x480Fit"), 28980, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Fit"), 28980, 720, 728, 776, 840, 0, 480, 484, 499, 575, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC },
{ MODEPREFIX("720x480Over"), 27025, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC }, { MODEPREFIX("720x480Over"), 27025, 720, 752, 792, 800, 0, 480, 482, 485, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIXNTSC },
{ MODEPREFIX("720x480Under"), 28224, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P }, { MODEPREFIX("720x480Under"), 28224, 720, 728, 744, 784, 0, 480, 490, 496, 600, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P },
{ MODEPREFIX("720x480Fit"), 28980, 720, 728, 776, 840, 0, 480, 484, 499, 575, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P }, { MODEPREFIX("720x480Fit"), 28980, 720, 728, 776, 840, 0, 480, 484, 499, 575, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX480P },
@ -828,13 +828,13 @@ VT1625Table[] = {
}, },
{ "720x480Over", 720, 480, TVTYPE_NTSC, 0, 0, { "720x480Over", 720, 480, TVTYPE_NTSC, 0, 0,
/* 00 0F */ /* 00 0F */
{ 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x33, 0x1C, 0x06, 0x7B, 0x15, 0x50, 0x57, 0, 0x9E, { 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x02, 0x10, 0x00, 0x7B, 0x15, 0x50, 0x57, 0, 0xB7,
0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xD6, 0x7B, 0xF0, 0x21, 0x00, 0x50, 0x43, 0x80, 0, 0x10, 0, 0x80, 0xAD, 0x21, 0x64, 0x34, 0xD6, 0x7B, 0xF0, 0x21, 0x00, 0x50, 0x00, 0x80, 0, 0x10,
0x1C, 0x08, 0xDC, 0x77, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0x1C, 0x08, 0xE5, 0x77, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* 4A 4F 50 59 */ /* 4A 4F 50 59 */
{ 0xC5, 0x0F, 0, 0x01, 0x10, 0x4A, 0x59, 0xCF, 0x23, 0x0C, 0x22, 0x59, 0xCF, 0x7F, 0x23, 0x91, { 0xC5, 0x0F, 0, 0x01, 0x10, 0x4A, 0x1F, 0xD2, 0x23, 0x0C, 0x22, 0x59, 0xC0, 0x7E, 0x23, 0x8C,
/* 5A 5F 60 64 */ /* 5A 5F 60 64 */
0xD2, 0xE1, 0x7D, 0x06, 0, 0, 0x80, 0x28, 0xFF, 0x59, 0x03 }, 0xD0, 0xF6, 0x7C, 0x06, 0, 0x34, 0x80, 0x28, 0xFF, 0x1F, 0x03 },
/* RBG 65,66,67,27,2b,2c */ /* RBG 65,66,67,27,2b,2c */
{ 0x55, 0x37, 0x5C, 0, 0, 0 }, { 0x55, 0x37, 0x5C, 0, 0, 0 },
/* Y-Cb-Cr 65,66,67 */ /* Y-Cb-Cr 65,66,67 */
@ -876,8 +876,8 @@ VT1625Table[] = {
}, },
{ "720x480Over", 720, 480, TVTYPE_480P, 0, 0, { "720x480Over", 720, 480, TVTYPE_480P, 0, 0,
/* 00 0F */ /* 00 0F */
{ 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x33, 0x20, 0xFF, 0x7B, 0, 0x50, 0x57, 0, 0x9E, { 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x01, 0x20, 0, 0x7B, 0, 0x50, 0x57, 0, 0x9E,
0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x43, 0x80, 0, 0x01, 0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x00, 0x80, 0, 0x01,
0x2F, 0x08, 0xDC, 0x7E, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0x2F, 0x08, 0xDC, 0x7E, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* 4A 4F 50 59 */ /* 4A 4F 50 59 */
{ 0xC5, 0x0F, 0, 0x01, 0, 0x4A, 0x59, 0xCF, 0x23, 0x0C, 0x22, 0x59, 0xCF, 0x7F, 0x23, 0x91, { 0xC5, 0x0F, 0, 0x01, 0, 0x4A, 0x59, 0xCF, 0x23, 0x0C, 0x22, 0x59, 0xCF, 0x7F, 0x23, 0x91,
@ -909,15 +909,15 @@ VT1625Table[] = {
0x0, 0x0, 0x0, 0x0,
}, },
{ "1920x1080", 1920, 540, TVTYPE_1080I, 0, 0, { "1920x1080", 1920, 1080, TVTYPE_1080I, 0, 0,
/* 00 0F */ /* 00 0F */
{ 0x83, 0, 0x10, 0x4A, 0x86, 0x39, 0, 0x8B, 0x3D, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, { 0x83, 0, 0x10, 0x4A, 0x86, 0x32, 0, 0x8B, 0x3D, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E,
0x00, 0x80, 0x4A, 0x08, 0x37, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x44, 0x80, 0x00, 0x03, 0x00, 0x80, 0x4A, 0x08, 0x37, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x04, 0x80, 0x00, 0x03,
0x25, 0x00, 0x00, 0x7E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0x25, 0x00, 0x00, 0x7E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* 4A 4F 50 59 */ /* 4A 4F 50 59 */
{ 0xC5, 0x0F, 0, 0x01, 0, 0x00, 0x97, 0x7F, 0x78, 0x64, 0x14, 0x97, 0x7f, 0x59, 0x78, 0xb0, { 0xC5, 0x0F, 0, 0x01, 0, 0x00, 0x97, 0x7F, 0x78, 0x64, 0x14, 0x97, 0x7f, 0x59, 0x78, 0xb0,
/* 5A 5F 60 64 */ /* 5A 5F 60 64 */
0x1a, 0xec, 0xfa, 0x08, 0x00, 0x00, 0x80, 0x20, 0xFF, 0x97, 0x28 }, 0x1a, 0xdc, 0x5d, 0x08, 0x00, 0x00, 0x80, 0x28, 0xFF, 0x97, 0x28 },
/* RBG 65,66,67,27,2b,2c */ /* RBG 65,66,67,27,2b,2c */
{ 0x55, 0x39, 0x66, 0, 0, 0 }, { 0x55, 0x39, 0x66, 0, 0, 0 },
/* Y-Cb-Cr 65,66,67 */ /* Y-Cb-Cr 65,66,67 */
@ -945,8 +945,8 @@ VT1625Table[] = {
{ "720x576", 720, 576, TVTYPE_PAL, 0, 0, { "720x576", 720, 576, TVTYPE_PAL, 0, 0,
/* 00 0F */ /* 00 0F */
{ 0x03, 0x00, 0x10, 0x1f, 0x03, 0x00, 0x00, 0xc9, 0x4c, 0x11, 0x7c, 0x00, 0x56, 0x57, 0x07, 0xbf, { 0x03, 0x00, 0x10, 0x1f, 0x03, 0x00, 0x00, 0xc9, 0x4c, 0x10, 0x7c, 0x00, 0x56, 0x57, 0x07, 0xbf,
0x00, 0x80, 0x09, 0x08, 0x17, 0x24, 0xcb, 0x8a, 0x09, 0x2a, 0x06, 0x50, 0x01, 0x80, 0x00, 0x10, 0x00, 0x80, 0x09, 0x08, 0x17, 0x24, 0xcb, 0x8a, 0x09, 0x2a, 0x06, 0x50, 0x00, 0x80, 0x00, 0x10,
0x14, 0x0c, 0x32, 0x7e, 0x00, 0x5f, 0x34, 0x8c, 0x4f, 0x5e, 0x15, 0xa2, 0x22, 0x80, 0xd3, 0x10 0x14, 0x0c, 0x32, 0x7e, 0x00, 0x5f, 0x34, 0x8c, 0x4f, 0x5e, 0x15, 0xa2, 0x22, 0x80, 0xd3, 0x10
}, },
/* 4A 4F 50 59 */ /* 4A 4F 50 59 */

View File

@ -27,7 +27,11 @@
#include "xf86.h" #include "xf86.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h" #include "xf86Resources.h"
#endif
#include "compiler.h" #include "compiler.h"
#include "xf86PciInfo.h" #include "xf86PciInfo.h"
#include "xf86Pci.h" #include "xf86Pci.h"
@ -322,6 +326,7 @@ ViaInitXVMC(ScreenPtr pScreen)
if ((pVia->Chipset == VIA_KM400) || if ((pVia->Chipset == VIA_KM400) ||
(pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_CX700) ||
(pVia->Chipset == VIA_VX800) || (pVia->Chipset == VIA_VX800) ||
(pVia->Chipset == VIA_VX855) ||
(pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_K8M890) ||
(pVia->Chipset == VIA_P4M900)) { (pVia->Chipset == VIA_P4M900)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,