diff --git a/driver/xf86-video-openchrome/ChangeLog b/driver/xf86-video-openchrome/ChangeLog index 7cddcb91f..5d493e6bc 100644 --- a/driver/xf86-video-openchrome/ChangeLog +++ b/driver/xf86-video-openchrome/ChangeLog @@ -1,3 +1,111 @@ +2009-09-26 Bartosz Kosiorek + + Save/restore ECK Clock Synthesizer + + * src/via_driver.c: (VIASave), (VIARestore): + * src/via_driver.h: + +2009-09-21 Bartosz Kosiorek + + Fixed bug with panel autodetection using + ViaPanelGetNativeModeFromScratchPad function + + * src/via_panel.c: + +2009-09-21 Bartosz Kosiorek + + Fixed problem with backlite (Ticket #308) + + * src/via_lvds.c: (ViaLVDSSoftwarePowerFirstSequence), + (ViaLVDSSoftwarePowerSecondSequence), + (ViaLVDSHardwarePowerFirstSequence), + (ViaLVDSHardwarePowerSecondSequence), (ViaLVDSPower): + +2009-09-15 Bartosz Kosiorek + + 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 + + Cursor support speedup + + * src/via_cursor.c: (viaHWCursorInit), (viaCursorStore), + (viaCursorRestore), (viaShowCursor), (viaHideCursor), + (viaSetCursorPosition), (viaLoadCursorImage), (viaLoadCursorARGB): + +2009-09-14 Bartosz Kosiorek + + 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 + + Fix bug with DFP Power Off (ticket #317) + + * src/via_mode.c: (ViaDFPPower): + +2009-08-20 Bartosz Kosiorek + + 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 + + Added support of the VIA OpenBook + + * src/via_id.c: + +2009-08-08 Bartosz Kosiorek + + 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 + + Forgot to remove an old Dot Clock entry from the table. + + * src/via_mode.h: + +2009-07-28 Jon Nettleton + + 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 * src/via_bios.h: diff --git a/driver/xf86-video-openchrome/Makefile.in b/driver/xf86-video-openchrome/Makefile.in index 03897e074..92b85b166 100644 --- a/driver/xf86-video-openchrome/Makefile.in +++ b/driver/xf86-video-openchrome/Makefile.in @@ -131,6 +131,8 @@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ +HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ +HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -163,6 +165,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ diff --git a/driver/xf86-video-openchrome/NEWS b/driver/xf86-video-openchrome/NEWS index eef34361a..bae9d2fe0 100644 --- a/driver/xf86-video-openchrome/NEWS +++ b/driver/xf86-video-openchrome/NEWS @@ -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) ------------------------------- * Enhancements and bug fixes: diff --git a/driver/xf86-video-openchrome/README b/driver/xf86-video-openchrome/README index 027df9798..c94e3034b 100644 --- a/driver/xf86-video-openchrome/README +++ b/driver/xf86-video-openchrome/README @@ -13,11 +13,13 @@ SUPPORTED CHIPSETS : - P4M890 (VT3327) - K8M890 (VT3336) - P4M900/VN896 (VT3364) +- VX800 (VT3353) +- VX855 (VT3409) 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. - TV-out support. - EXA acceleration. @@ -42,7 +44,7 @@ KNOWN BUGS/LIMITATIONS : * XvMC - The hardware MPEG4 acceleration that is present on some chipsets is not 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 for them first). @@ -55,10 +57,11 @@ KNOWN BUGS/LIMITATIONS : In other words, there is no dual screen support. * 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 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. diff --git a/driver/xf86-video-openchrome/config.h.in b/driver/xf86-video-openchrome/config.h.in index f58f4f6fc..4748d7668 100644 --- a/driver/xf86-video-openchrome/config.h.in +++ b/driver/xf86-video-openchrome/config.h.in @@ -47,6 +47,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* xextproto 7.1 available */ +#undef HAVE_XEXTPROTO_71 + /* Name of package */ #undef PACKAGE diff --git a/driver/xf86-video-openchrome/configure b/driver/xf86-video-openchrome/configure index 29a2a4d27..fc1e46c07 100755 --- a/driver/xf86-video-openchrome/configure +++ b/driver/xf86-video-openchrome/configure @@ -1,6 +1,6 @@ #! /bin/sh # 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 . # @@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xf86-video-openchrome' PACKAGE_TARNAME='xf86-video-openchrome' -PACKAGE_VERSION='0.2.903' -PACKAGE_STRING='xf86-video-openchrome 0.2.903' +PACKAGE_VERSION='0.2.904' +PACKAGE_STRING='xf86-video-openchrome 0.2.904' PACKAGE_BUGREPORT='http://www.openchrome.org/trac/report/1' ac_unique_file="Makefile.am" @@ -900,6 +900,10 @@ LIBTOOL PKG_CONFIG XORG_CFLAGS XORG_LIBS +XEXT_CFLAGS +XEXT_LIBS +HAVE_XEXTPROTO_71_TRUE +HAVE_XEXTPROTO_71_FALSE PCIACCESS_CFLAGS PCIACCESS_LIBS DRI_TRUE @@ -957,6 +961,8 @@ FFLAGS PKG_CONFIG XORG_CFLAGS XORG_LIBS +XEXT_CFLAGS +XEXT_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS 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. # This message is too long to be a string in the A/UX 3.1 sh. 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]... @@ -1586,7 +1592,7 @@ fi if test -n "$ac_init_help"; then 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 cat <<\_ACEOF @@ -1637,6 +1643,8 @@ Some influential environment variables: PKG_CONFIG path to pkg-config utility XORG_CFLAGS C compiler 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 C compiler flags for PCIACCESS, overriding pkg-config PCIACCESS_LIBS @@ -1712,7 +1720,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-openchrome configure 0.2.903 +xf86-video-openchrome configure 0.2.904 generated by GNU Autoconf 2.62 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 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 $ $0 $@ @@ -2380,7 +2388,7 @@ fi # Define the identity of the package. PACKAGE='xf86-video-openchrome' - VERSION='0.2.903' + VERSION='0.2.904' cat >>confdefs.h <<_ACEOF @@ -4439,7 +4447,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # 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 (eval $ac_compile) 2>&5 ac_status=$? @@ -7547,11 +7555,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 # The compiler can only warn and ignore the option if not recognized # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 # The compiler can only warn and ignore the option if not recognized # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 then # 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_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12861: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? 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 # The compiler can only warn and ignore the option if not recognized # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 then # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 # The compiler can only warn and ignore the option if not recognized # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 then # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 # The compiler can only warn and ignore the option if not recognized # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 # The compiler can only warn and ignore the option if not recognized # 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: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -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) ac_status=$? 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 then # The compiler can only warn and ignore the option if not recognized @@ -21299,6 +21307,91 @@ else $as_echo "yes" >&6; } : 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) # 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;} { (exit 1); exit 1; }; } 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 { { $as_echo "$as_me:$LINENO: error: conditional \"DRI\" was never defined. 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 # values after options handling. 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 CONFIG_FILES = $CONFIG_FILES @@ -22886,7 +22986,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/driver/xf86-video-openchrome/configure.ac b/driver/xf86-video-openchrome/configure.ac index 197bdba07..c94ab4cf8 100644 --- a/driver/xf86-video-openchrome/configure.ac +++ b/driver/xf86-video-openchrome/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-openchrome], - 0.2.903, + 0.2.904, [http://www.openchrome.org/trac/report/1], xf86-video-openchrome) @@ -71,6 +71,10 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Checks for pkg-config packages 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) # Checks for libraries. diff --git a/driver/xf86-video-openchrome/libxvmc/Makefile.in b/driver/xf86-video-openchrome/libxvmc/Makefile.in index bc55fed6b..4a09f0f2e 100644 --- a/driver/xf86-video-openchrome/libxvmc/Makefile.in +++ b/driver/xf86-video-openchrome/libxvmc/Makefile.in @@ -133,6 +133,8 @@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ +HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ +HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -165,6 +167,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ diff --git a/driver/xf86-video-openchrome/ltmain.sh b/driver/xf86-video-openchrome/ltmain.sh index 248cd4047..fccf69e28 100644 --- a/driver/xf86-video-openchrome/ltmain.sh +++ b/driver/xf86-video-openchrome/ltmain.sh @@ -2127,17 +2127,6 @@ EOF ;; esac 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" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" diff --git a/driver/xf86-video-openchrome/man/Makefile.am b/driver/xf86-video-openchrome/man/Makefile.am index 48ddda0b0..a5171ce71 100644 --- a/driver/xf86-video-openchrome/man/Makefile.am +++ b/driver/xf86-video-openchrome/man/Makefile.am @@ -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. # @@ -59,4 +59,4 @@ SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man sed $(MAN_SUBSTS) < $< > $@ @DRIVER_NAME@.man: - ln -s -f $(top_srcdir)/src/@DRIVER_NAME@.man . + ln -s -f $(top_srcdir)/man/@DRIVER_NAME@.man . diff --git a/driver/xf86-video-openchrome/man/Makefile.in b/driver/xf86-video-openchrome/man/Makefile.in index c62ed727f..ba81cc2b0 100644 --- a/driver/xf86-video-openchrome/man/Makefile.in +++ b/driver/xf86-video-openchrome/man/Makefile.in @@ -14,7 +14,7 @@ @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. # @@ -124,6 +124,8 @@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ +HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ +HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -156,6 +158,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ @@ -424,7 +428,7 @@ uninstall-am: uninstall-drivermanDATA uninstall-info-am sed $(MAN_SUBSTS) < $< > $@ @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. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/driver/xf86-video-openchrome/src/openchrome.man b/driver/xf86-video-openchrome/man/openchrome.man similarity index 94% rename from driver/xf86-video-openchrome/src/openchrome.man rename to driver/xf86-video-openchrome/man/openchrome.man index 1204ae3cf..fae904c6a 100644 --- a/driver/xf86-video-openchrome/src/openchrome.man +++ b/driver/xf86-video-openchrome/man/openchrome.man @@ -7,7 +7,7 @@ openchrome \- video driver for VIA Unichromes .SH SYNOPSIS .nf .B "Section \*qDevice\*q" -.BI " Identifier \*q" string \*q +.BI " Identifier \*q" devname \*q .B " Driver \*qopenchrome\*q" \ \ ... .B EndSection @@ -15,14 +15,14 @@ openchrome \- video driver for VIA Unichromes .SH DESCRIPTION .B openchrome -is an __xservername__ driver for VIA chipsets that have an integrated +is an __xservername__ driver for VIA chipsets that have an integrated Unichrome graphics engine. .PP The .B openchrome -driver supports the following chipsets: CLE266, KM400/KN400, CN400, CN700, -K8M800/K8N800, PM800/PN800, P4M800Pro, VN800, PM880, K8M890/K8N890, -CN896, VN896, and P4M900. +driver supports the following chipsets: CLE266, KM400/KN400/KM400A/P4M800, +CN400/PM800/PN800/PM880, K8M800, CN700/VM800/P4M800Pro, CX700, P4M890, K8M890, +P4M900/VN896/CN896, VX800 and VX855. The driver includes 2D acceleration and Xv video overlay extensions. Flat panel, TV, and VGA outputs are supported, depending on the hardware configuration. @@ -160,8 +160,8 @@ system. The sizes 640x480, 800x600, 1024x768, 1280x1024, and 1400x1050 are supported. .TP .BI "Option \*qRotate\*q \*q" string \*q -Rotates the display either clockwise ("CW") or counterclockwise ("CCW"). -Rotation is only supported unaccelerated. +Rotates the display either clockwise ("CW"), counterclockwise ("CCW") and +upside-down ("UD"). Rotation is only supported unaccelerated. .TP .BI "Option \*qShadowFB\*q \*q" boolean \*q 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 is selected via a jumper. .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 Specifies TV output format. The driver currently supports "NTSC" and "PAL" timings only. @@ -230,6 +234,6 @@ overscan). These modes are made available by the driver; modelines provided in __xconfigfile__ will be ignored. .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS Authors include: ... diff --git a/driver/xf86-video-openchrome/prepare-ChangeLogSVN.pl b/driver/xf86-video-openchrome/prepare-ChangeLogSVN.pl deleted file mode 100755 index d913dc344..000000000 --- a/driver/xf86-video-openchrome/prepare-ChangeLogSVN.pl +++ /dev/null @@ -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 , started 20 April 2000 -# Java support added by Maciej Stachowiak -# Adapted for subversion by Thomas Hellstrom -# 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 () - { - $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 ; - 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 = ; - 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: \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; - } diff --git a/driver/xf86-video-openchrome/src/Makefile.in b/driver/xf86-video-openchrome/src/Makefile.in index c3d5f5904..ea853d683 100644 --- a/driver/xf86-video-openchrome/src/Makefile.in +++ b/driver/xf86-video-openchrome/src/Makefile.in @@ -168,6 +168,8 @@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ +HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ +HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -200,6 +202,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ diff --git a/driver/xf86-video-openchrome/src/svnversion.h b/driver/xf86-video-openchrome/src/svnversion.h new file mode 100644 index 000000000..5a7f5acaa --- /dev/null +++ b/driver/xf86-video-openchrome/src/svnversion.h @@ -0,0 +1 @@ +#define BUILDCOMMENT "(openchrome 0.2.904 release)" diff --git a/driver/xf86-video-openchrome/src/via.h b/driver/xf86-video-openchrome/src/via.h index ee176503b..c961e1a51 100644 --- a/driver/xf86-video-openchrome/src/via.h +++ b/driver/xf86-video-openchrome/src/via.h @@ -327,6 +327,12 @@ #define VIDEO_FIFO_PRETHRESHOLD_VT3336 250 #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 * 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 diff --git a/driver/xf86-video-openchrome/src/via_accel.c b/driver/xf86-video-openchrome/src/via_accel.c index ce0a96396..b3c825de0 100644 --- a/driver/xf86-video-openchrome/src/via_accel.c +++ b/driver/xf86-video-openchrome/src/via_accel.c @@ -195,6 +195,7 @@ viaFlushPCI(ViaCommandBuffer * buf) */ switch (pVia->Chipset) { case VIA_VX800: + case VIA_VX855: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5)) && (loop++ < MAXLOOP)) ; @@ -471,7 +472,7 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn) VIASETREG(i, 0x0); } - if (pVia->Chipset == VIA_VX800) { + if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) { for (i = 0x44; i < 0x5c; i += 4) { VIASETREG(i, 0x0); } @@ -480,6 +481,7 @@ viaInitialize2DEngine(ScrnInfoPtr pScrn) /* Make the VIA_REG() macro magic work */ switch (pVia->Chipset) { case VIA_VX800: + case VIA_VX855: pVia->TwodRegs = via_2d_regs_m1; break; default: @@ -527,6 +529,7 @@ viaAccelSync(ScrnInfoPtr pScrn) switch (pVia->Chipset) { case VIA_VX800: + case VIA_VX855: while ((VIAGETREG(VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY_H5 | VIA_2D_ENG_BUSY_H5 | VIA_3D_ENG_BUSY_H5)) && (loop++ < MAXLOOP)) ; @@ -587,7 +590,7 @@ viaPitchHelper(VIAPtr pVia, unsigned dstPitch, unsigned srcPitch) unsigned val = (dstPitch >> 3) << 16 | (srcPitch >> 3); RING_VARS; - if (pVia->Chipset != VIA_VX800) { + if (pVia->Chipset != VIA_VX800 && pVia->Chipset != VIA_VX855) { val |= VIA_PITCH_ENABLE; } OUT_RING_H1(VIA_REG(pVia, PITCH), val); @@ -1289,17 +1292,23 @@ viaInitXAA(ScreenPtr pScreen) * test with x11perf -shmput500! */ - if (pVia->Chipset != VIA_K8M800 && - pVia->Chipset != VIA_K8M890 && - pVia->Chipset != VIA_P4M900 && - pVia->Chipset != VIA_VX800) - xaaptr->ImageWriteFlags |= NO_GXCOPY; + switch (pVia->Chipset) { + case VIA_K8M800: + case VIA_K8M890: + case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + break; + default: + xaaptr->ImageWriteFlags |= NO_GXCOPY; + break; + } xaaptr->SetupForImageWrite = viaSetupForImageWrite; xaaptr->SubsequentImageWriteRect = viaSubsequentImageWriteRect; xaaptr->ImageWriteBase = pVia->BltBase; - if (pVia->Chipset == VIA_VX800) + if (pVia->Chipset == VIA_VX800 || pVia->Chipset == VIA_VX855) xaaptr->ImageWriteRange = VIA_MMIO_BLTSIZE; else xaaptr->ImageWriteRange = (64 * 1024); @@ -2015,7 +2024,8 @@ viaExaUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst) dstPitch = 8; if (dstPitch * h > pVia->exaScratchSize * 1024) { 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; } @@ -2354,8 +2364,28 @@ viaInitAccel(ScreenPtr pScreen) VIAPtr pVia = VIAPTR(pScrn); BoxRec AvailFBArea; int maxY; + Bool ret; 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; if (((pVia->FBFreeEnd - pVia->FBFreeStart) >= VIA_VQ_SIZE) && pVia->VQEnable) { @@ -2425,6 +2455,10 @@ viaInitAccel(ScreenPtr pScreen) return TRUE; } + /* + * Finally, we set up the memory space available to the pixmap + * cache. + */ AvailFBArea.x1 = 0; AvailFBArea.y1 = 0; AvailFBArea.x2 = pScrn->displayWidth; @@ -2447,10 +2481,25 @@ viaInitAccel(ScreenPtr pScreen) if (maxY > 4 * pScrn->virtualY) maxY = 4 * pScrn->virtualY; + /* Non-rotate */ + AvailFBArea.y2 = maxY; 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); pVia->driSize = (pVia->FBFreeEnd - pVia->FBFreeStart - pVia->Bpl); diff --git a/driver/xf86-video-openchrome/src/via_bandwidth.c b/driver/xf86-video-openchrome/src/via_bandwidth.c index b0fd2400f..fd02a6620 100644 --- a/driver/xf86-video-openchrome/src/via_bandwidth.c +++ b/driver/xf86-video-openchrome/src/via_bandwidth.c @@ -244,6 +244,11 @@ ViaSetPrimaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) hwp->writeSeq(hwp, 0x18, 0x26); /* 152/4 = 38 */ hwp->writeSeq(hwp, 0x22, 0x10); /* 64/4 = 16 */ 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: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetPrimaryFIFO: " "Chipset %d not implemented\n", pVia->Chipset); @@ -412,6 +417,8 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, DisplayModePtr mode) else ViaCrtcMask(hwp, 0x94, 0x20, 0x7F); break; + case VIA_VX855: + break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ViaSetSecondaryFIFO: " "Chipset %d not implemented\n", pVia->Chipset); diff --git a/driver/xf86-video-openchrome/src/via_bios.h b/driver/xf86-video-openchrome/src/via_bios.h index 62fdf48eb..06809b992 100644 --- a/driver/xf86-video-openchrome/src/via_bios.h +++ b/driver/xf86-video-openchrome/src/via_bios.h @@ -42,6 +42,7 @@ #define VIA_PANEL10X6 13 #define VIA_PANEL14X9 14 #define VIA_PANEL1280X720 15 +#define VIA_PANEL12X9 16 #define VIA_PANEL_INVALID 255 #define TVTYPE_NONE 0x00 @@ -98,6 +99,13 @@ #define VIA_DI_12BIT 0x00 #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 { int Width ; int Height ; @@ -159,8 +167,6 @@ typedef struct _VIABIOSINFO { Bool SetDVI; /* LCD Simultaneous Expand Mode HWCursor Y Scale */ Bool scaleY; - int panelX; - int panelY; int resY; /* DFP */ @@ -187,6 +193,7 @@ typedef struct _VIABIOSINFO { int TVDeflicker; CARD8 TVRegs[0xFF]; int TVNumRegs; + int TVDIPort; /* TV Callbacks */ void (*TVSave) (ScrnInfoPtr pScrn); diff --git a/driver/xf86-video-openchrome/src/via_ch7xxx.c b/driver/xf86-video-openchrome/src/via_ch7xxx.c index 64e3e1f31..4407828dd 100644 --- a/driver/xf86-video-openchrome/src/via_ch7xxx.c +++ b/driver/xf86-video-openchrome/src/via_ch7xxx.c @@ -33,6 +33,7 @@ #include "via_vgahw.h" #include "via_ch7xxx.h" #include "via_id.h" +#include #ifdef HAVE_DEBUG /* diff --git a/driver/xf86-video-openchrome/src/via_crtc.c b/driver/xf86-video-openchrome/src/via_crtc.c index d0f19e5ce..4e2be975a 100644 --- a/driver/xf86-video-openchrome/src/via_crtc.c +++ b/driver/xf86-video-openchrome/src/via_crtc.c @@ -173,6 +173,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: break; default: ViaSeqMask(hwp, 0x16, 0x08, 0xBF); @@ -276,6 +277,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: break; default: /* some leftovers */ @@ -302,7 +304,8 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) 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); switch (pVia->ChipId) { @@ -310,6 +313,7 @@ ViaFirstCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: break; default: /* some leftovers */ @@ -429,6 +433,7 @@ ViaSecondCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: break; default: ViaSeqMask(hwp, 0x16, 0x08, 0xBF); @@ -512,6 +517,7 @@ ViaSecondCRTCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: break; default: /* some leftovers */ diff --git a/driver/xf86-video-openchrome/src/via_cursor.c b/driver/xf86-video-openchrome/src/via_cursor.c index 83ba655e2..9333a185f 100644 --- a/driver/xf86-video-openchrome/src/via_cursor.c +++ b/driver/xf86-video-openchrome/src/via_cursor.c @@ -76,7 +76,7 @@ viaHWCursorInit(ScreenPtr pScreen) pVia->CursorARGBSupported = TRUE; pVia->CursorMaxWidth = 64; pVia->CursorMaxHeight = 64; - pVia->CursorSize = pVia->CursorMaxWidth * (pVia->CursorMaxHeight + 1) * 4; + pVia->CursorSize = pVia->CursorMaxWidth * (pVia->CursorMaxHeight + 1) << 2; break; } @@ -97,6 +97,7 @@ viaHWCursorInit(ScreenPtr pScreen) case VIA_P4M890: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { pVia->CursorRegControl = VIA_REG_HI_CONTROL0; pVia->CursorRegBase = VIA_REG_HI_BASE0; @@ -164,6 +165,7 @@ viaHWCursorInit(ScreenPtr pScreen) case VIA_P4M890: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: if (pVia->pBIOSInfo->FirstCRTC->IsActive) { VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, 0x00FFFFFF); VIASETREG(VIA_REG_V327_HI_INVTCOLOR, 0x00FFFFFF); @@ -222,18 +224,19 @@ viaCursorStore(ScrnInfoPtr pScrn) case VIA_P4M890: case VIA_P4M900: case VIA_VX800: - if (pVia->pBIOSInfo->FirstCRTC->IsActive) { + case VIA_VX855: + if (pVia->pBIOSInfo->FirstCRTC->IsActive) { pVia->CursorPrimHiInvtColor = VIAGETREG(VIA_REG_PRIM_HI_INVTCOLOR); pVia->CursorV327HiInvtColor = VIAGETREG(VIA_REG_V327_HI_INVTCOLOR); - } - if (pVia->pBIOSInfo->SecondCRTC->IsActive) { + } + if (pVia->pBIOSInfo->SecondCRTC->IsActive) { /* TODO add saves here */ - } - pVia->CursorFifo = VIAGETREG(pVia->CursorRegFifo); - break; - default: - /* TODO add saves here */ - break; + } + pVia->CursorFifo = VIAGETREG(pVia->CursorRegFifo); + break; + default: + /* TODO add saves here */ + break; } } @@ -261,21 +264,22 @@ viaCursorRestore(ScrnInfoPtr pScrn) case VIA_P4M890: case VIA_P4M900: case VIA_VX800: - if (pVia->pBIOSInfo->FirstCRTC->IsActive) { + case VIA_VX855: + if (pVia->pBIOSInfo->FirstCRTC->IsActive) { VIASETREG(VIA_REG_PRIM_HI_INVTCOLOR, pVia->CursorPrimHiInvtColor); VIASETREG(VIA_REG_V327_HI_INVTCOLOR, pVia->CursorV327HiInvtColor); - } - if (pVia->pBIOSInfo->SecondCRTC->IsActive) { - /* TODO add real restores here */ + } + if (pVia->pBIOSInfo->SecondCRTC->IsActive) { + /* TODO add real restores here */ VIASETREG(VIA_REG_HI_INVTCOLOR, 0X00FFFFFF); VIASETREG(VIA_REG_ALPHA_PREFIFO, 0xE0000); - } - VIASETREG(pVia->CursorRegFifo, pVia->CursorFifo); - break; - default: - /* TODO add real restores here */ - VIASETREG(VIA_REG_ALPHA_PREFIFO, 0xE0000); - VIASETREG(pVia->CursorRegFifo, 0xE0F0000); + } + VIASETREG(pVia->CursorRegFifo, pVia->CursorFifo); + break; + default: + /* TODO add real restores here */ + VIASETREG(VIA_REG_ALPHA_PREFIFO, 0xE0000); + VIASETREG(pVia->CursorRegFifo, 0xE0F0000); } } @@ -287,22 +291,39 @@ void viaShowCursor(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - CARD32 temp; - CARD32 control = pVia->CursorRegControl; - temp = - (1 << 30) | - (1 << 29) | - (1 << 28) | - (1 << 26) | - (1 << 25) | - (1 << 2) | - (1 << 0); + 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 = + (1 << 30) | + (1 << 29) | + (1 << 28) | + (1 << 26) | + (1 << 25) | + (1 << 2) | + (1 << 0); + */ - if (pVia->CursorPipe) - temp |= (1 << 31); - - VIASETREG(control, temp); + /* Duoview */ + if (pVia->CursorPipe) + VIASETREG(VIA_REG_ALPHA_CONTROL, 0xF6000005); + else + VIASETREG(VIA_REG_ALPHA_CONTROL, 0x76000005); + } } void @@ -310,20 +331,33 @@ viaHideCursor(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); CARD32 temp; - CARD32 control = pVia->CursorRegControl; - temp = VIAGETREG(control); - VIASETREG(control, temp & 0xFFFFFFFE); + 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 & 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 viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) { VIAPtr pVia = VIAPTR(pScrn); - CARD32 temp; - CARD32 control = pVia->CursorRegControl; - CARD32 offset = pVia->CursorRegOffset; - CARD32 pos = pVia->CursorRegPos; unsigned xoff, yoff; if (x < 0) { @@ -340,13 +374,27 @@ viaSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) yoff = 0; } - temp = VIAGETREG(control); - VIASETREG(control, temp & 0xFFFFFFFE); + 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_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; + + default: + VIASETREG(VIA_REG_ALPHA_POS, ((x << 16) | (y & 0x07ff))); + VIASETREG(VIA_REG_ALPHA_OFFSET, ((xoff << 16) | (yoff & 0x07ff))); + } - VIASETREG(pos, ((x << 16) | (y & 0x07ff))); - VIASETREG(offset, ((xoff << 16) | (yoff & 0x07ff))); - - VIASETREG(control, temp); } static Bool @@ -379,36 +427,48 @@ static void viaLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *s) { VIAPtr pVia = VIAPTR(pScrn); - CARD32 control = pVia->CursorRegControl; CARD32 temp; CARD32 *dst; - CARD8 *src; CARD8 chunk; int i, j; - temp = VIAGETREG(control); - VIASETREG(control, temp & 0xFFFFFFFE); - pVia->CursorARGB = FALSE; dst = (CARD32*)(pVia->cursorMap); - src = (CARD8*)s; if (pVia->CursorARGBSupported) { #define ARGB_PER_CHUNK (8 * sizeof (chunk) / 2) for (i = 0; i < (pVia->CursorMaxWidth * pVia->CursorMaxHeight / ARGB_PER_CHUNK); i++) { - chunk = *s++; - for (j = 0; j < ARGB_PER_CHUNK; j++, chunk >>= 2) + chunk = *s++; + for (j = 0; j < ARGB_PER_CHUNK; j++, chunk >>= 2) *dst++ = mono_cursor_color[chunk & 3]; } pVia->CursorFG = mono_cursor_color[3]; pVia->CursorBG = mono_cursor_color[2]; - } else { - memcpy(dst, src, pVia->CursorSize); - } - - VIASETREG(control, temp); + } else { + 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; + + default: + temp = VIAGETREG(VIA_REG_ALPHA_CONTROL); + VIASETREG(VIA_REG_ALPHA_CONTROL, temp); + } } static void @@ -441,50 +501,51 @@ viaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) pVia->CursorFG = fg; pVia->CursorBG = bg; - VIASETREG(control, temp); + 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); + } } static void viaLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs) { VIAPtr pVia = VIAPTR(pScrn); - CARD32 control = pVia->CursorRegControl; int x, y, w, h; - CARD32 *image; - CARD32 *dst; - CARD32 *src; - CARD32 temp; - - temp = VIAGETREG(control); - VIASETREG(control, temp & 0xFFFFFFFE); + CARD32 *image = (CARD32*)pCurs->bits->argb; + CARD32 *dst = (CARD32*)pVia->cursorMap; pVia->CursorARGB = TRUE; - dst = (CARD32*)pVia->cursorMap; - image = pCurs->bits->argb; - w = pCurs->bits->width; - if (w > pVia->CursorMaxWidth) - w = pVia->CursorMaxWidth; - h = pCurs->bits->height; - if (h > pVia->CursorMaxHeight) - h = pVia->CursorMaxHeight; for (y = 0; y < h; y++) { - src = image; - image += pCurs->bits->width; - for (x = 0; x < w; x++) - *dst++ = *src++; + *dst++ = *image++; + /* pad to the right with transparent */ for (; x < pVia->CursorMaxHeight; x++) *dst++ = 0; } + /* pad below with transparent */ for (; y < pVia->CursorMaxHeight; y++) for (x = 0; x < pVia->CursorMaxWidth; x++) *dst++ = 0; - VIASETREG(control, temp); } diff --git a/driver/xf86-video-openchrome/src/via_display.c b/driver/xf86-video-openchrome/src/via_display.c index be26bebb8..0e833287f 100644 --- a/driver/xf86-video-openchrome/src/via_display.c +++ b/driver/xf86-video-openchrome/src/via_display.c @@ -111,6 +111,38 @@ ViaDisplayDisableCRT(ScrnInfoPtr pScrn) 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. */ @@ -143,3 +175,32 @@ ViaDisplaySetStreamOnDFP(ScrnInfoPtr pScrn, Bool primary) 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); +} + diff --git a/driver/xf86-video-openchrome/src/via_dri.c b/driver/xf86-video-openchrome/src/via_dri.c index 87b1933af..ee9a38a25 100644 --- a/driver/xf86-video-openchrome/src/via_dri.c +++ b/driver/xf86-video-openchrome/src/via_dri.c @@ -592,6 +592,7 @@ VIADRIScreenInit(ScreenPtr pScreen) case VIA_K8M890: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: pDRIInfo->clientDriverName = "swrast"; break; default: @@ -890,10 +891,17 @@ VIADRIKernelInit(ScreenPtr pScreen, VIAPtr pVia) drmInfo.sarea_priv_offset = sizeof(OPENCHROMEDRISAREARec); drmInfo.fb_offset = pVia->frameBufferHandle; drmInfo.mmio_offset = pVia->registerHandle; - if (pVia->IsPCI) + + if (pVia->IsPCI) { drmInfo.agpAddr = (CARD32) NULL; - else - drmInfo.agpAddr = (CARD32) pVia->agpAddr; + } else { + /*For AMD64*/ +#ifndef __x86_64__ + drmInfo.agpAddr = (CARD32)pVia->agpAddr; +#else + drmInfo.agpAddr = (CARD64)pVia->agpAddr; +#endif + } if ((drmCommandWrite(pVia->drmFD, DRM_VIA_MAP_INIT, &drmInfo, sizeof(drm_via_init_t))) < 0) diff --git a/driver/xf86-video-openchrome/src/via_driver.c b/driver/xf86-video-openchrome/src/via_driver.c index a3c276454..fa90f70dd 100644 --- a/driver/xf86-video-openchrome/src/via_driver.c +++ b/driver/xf86-video-openchrome/src/via_driver.c @@ -29,12 +29,15 @@ #include "config.h" #endif -#include "xf86RAC.h" #include "shadowfb.h" #include "globals.h" +#ifdef HAVE_XEXTPROTO_71 +#include +#else #define DPMS_SERVER #include +#endif #include "svnversion.h" @@ -42,12 +45,19 @@ #include "via_video.h" #include "via.h" +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 +#include "xf86RAC.h" +#endif + #ifdef OPENCHROMEDRI #include "dri.h" #endif #include "via_vgahw.h" #include "via_id.h" +/* RandR support */ +#include "xf86RandR12.h" + /* Prototypes. */ static void VIAIdentify(int flags); @@ -112,6 +122,10 @@ static void VIAUnmapMem(ScrnInfoPtr pScrn); static void VIALoadRgbLut(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); +/* RandR */ +static Bool VIADriverFunc(ScrnInfoPtr pScrnInfo, xorgDriverFuncOp op, pointer data); + + #ifdef XSERVER_LIBPCIACCESS #define VIA_DEVICE_MATCH(d,i) \ @@ -128,6 +142,7 @@ static const struct pci_id_match via_device_match[] = { VIA_DEVICE_MATCH (PCI_CHIP_VT3324, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3327, 0 ), VIA_DEVICE_MATCH (PCI_CHIP_VT3353, 0 ), + VIA_DEVICE_MATCH (PCI_CHIP_VT3409, 0 ), { 0, 0, 0 }, }; @@ -158,28 +173,30 @@ static SymTabRec VIAChipsets[] = { {VIA_KM400, "KM400/KN400"}, {VIA_K8M800, "K8M800/K8N800"}, {VIA_PM800, "PM800/PM880/CN400"}, - {VIA_VM800, "P4M800Pro/VN800/CN700"}, + {VIA_VM800, "VM800/P4M800Pro/VN800/CN700"}, {VIA_K8M890, "K8M890/K8N890"}, {VIA_P4M900, "P4M900/VN896/CN896"}, {VIA_CX700, "CX700/VX700"}, {VIA_P4M890, "P4M890"}, {VIA_VX800, "VX800"}, + {VIA_VX855, "VX855"}, {-1, NULL } }; /* Mapping a PCI device ID to a chipset family identifier. */ static PciChipsets VIAPciChipsets[] = { - {VIA_CLE266, PCI_CHIP_CLE3122, RES_SHARED_VGA}, - {VIA_KM400, PCI_CHIP_VT3205, RES_SHARED_VGA}, - {VIA_K8M800, PCI_CHIP_VT3204, RES_SHARED_VGA}, - {VIA_PM800, PCI_CHIP_VT3259, RES_SHARED_VGA}, - {VIA_VM800, PCI_CHIP_VT3314, RES_SHARED_VGA}, - {VIA_K8M890, PCI_CHIP_VT3336, RES_SHARED_VGA}, - {VIA_P4M900, PCI_CHIP_VT3364, RES_SHARED_VGA}, - {VIA_CX700, PCI_CHIP_VT3324, RES_SHARED_VGA}, - {VIA_P4M890, PCI_CHIP_VT3327, RES_SHARED_VGA}, - {VIA_VX800, PCI_CHIP_VT3353, RES_SHARED_VGA}, - {-1, -1, RES_UNDEFINED} + {VIA_CLE266, PCI_CHIP_CLE3122, VIA_RES_SHARED}, + {VIA_KM400, PCI_CHIP_VT3205, VIA_RES_SHARED}, + {VIA_K8M800, PCI_CHIP_VT3204, VIA_RES_SHARED}, + {VIA_PM800, PCI_CHIP_VT3259, VIA_RES_SHARED}, + {VIA_VM800, PCI_CHIP_VT3314, VIA_RES_SHARED}, + {VIA_K8M890, PCI_CHIP_VT3336, VIA_RES_SHARED}, + {VIA_P4M900, PCI_CHIP_VT3364, VIA_RES_SHARED}, + {VIA_CX700, PCI_CHIP_VT3324, VIA_RES_SHARED}, + {VIA_P4M890, PCI_CHIP_VT3327, VIA_RES_SHARED}, + {VIA_VX800, PCI_CHIP_VT3353, VIA_RES_SHARED}, + {VIA_VX855, PCI_CHIP_VT3409, VIA_RES_SHARED}, + {-1, -1, VIA_RES_UNDEF} }; int gVIAEntityIndex = -1; @@ -208,6 +225,7 @@ typedef enum OPTION_TVDOTCRAWL, OPTION_TVTYPE, OPTION_TVOUTPUT, + OPTION_TVDIPORT, OPTION_DISABLEVQ, OPTION_DISABLEIRQ, OPTION_TVDEFLICKER, @@ -217,7 +235,8 @@ typedef enum OPTION_VBE_SAVERESTORE, OPTION_MAX_DRIMEM, OPTION_AGPMEM, - OPTION_DISABLE_XV_BW_CHECK + OPTION_DISABLE_XV_BW_CHECK, + OPTION_MODE_SWITCH_METHOD } VIAOpts; @@ -246,6 +265,7 @@ static OptionInfoRec VIAOptions[] = { {OPTION_TVDEFLICKER, "TVDeflicker", OPTV_INTEGER, {0}, FALSE}, {OPTION_TVTYPE, "TVType", OPTV_ANYSTR, {0}, FALSE}, {OPTION_TVOUTPUT, "TVOutput", OPTV_ANYSTR, {0}, FALSE}, + {OPTION_TVDIPORT, "TVPort", OPTV_ANYSTR, {0}, FALSE}, {OPTION_DISABLEVQ, "DisableVQ", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DISABLEIRQ, "DisableIRQ", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_AGP_DMA, "EnableAGPDMA", OPTV_BOOLEAN, {0}, FALSE}, @@ -253,190 +273,14 @@ static OptionInfoRec VIAOptions[] = { {OPTION_XV_DMA, "NoXVDMA", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_VBE_SAVERESTORE, "VbeSaveRestore", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DISABLE_XV_BW_CHECK, "DisableXvBWCheck", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_MODE_SWITCH_METHOD, "ModeSwitchMethod", OPTV_ANYSTR, {0}, FALSE}, {OPTION_MAX_DRIMEM, "MaxDRIMem", OPTV_INTEGER, {0}, FALSE}, {OPTION_AGPMEM, "AGPMem", OPTV_INTEGER, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; -static const char *vgaHWSymbols[] = { - "vgaHWGetHWRec", - "vgaHWSetMmioFuncs", - "vgaHWSetStdFuncs", - "vgaHWGetIOBase", - "vgaHWSave", - "vgaHWProtect", - "vgaHWRestore", - "vgaHWMapMem", - "vgaHWUnmapMem", - "vgaHWInit", - "vgaHWSaveScreen", - "vgaHWLock", - "vgaHWUnlock", - "vgaHWFreeHWRec", - "vgaHWGetIndex", /* Through VGAHWPTR() */ - NULL -}; - -static const char *ramdacSymbols[] = { - "xf86InitCursor", - "xf86CreateCursorInfoRec", - "xf86DestroyCursorInfoRec", - NULL -}; - -static const char *vbeSymbols[] = { - "vbeDoEDID", - "VBEDPMSSet", - "VBEExtendedInit", - "vbeFree", - "VBEGetVBEInfo", - "VBEGetVBEMode", - "VBEGetModePool", - "VBEInit", - "VBEPrintModes", - "VBESaveRestore", - "VBESetDisplayStart", - "VBESetGetLogicalScanlineLength", - "VBESetLogicalScanline", - "VBESetModeNames", - "VBESetModeParameters", - "VBESetVBEMode", - "VBEValidateModes", - "xf86ExecX86int10", - "xf86Int10AllocPages", - "xf86Int10FreePages", - NULL -}; - -static const char *ddcSymbols[] = { - "xf86PrintEDID", - "xf86DoEDID_DDC2", - "xf86SetDDCproperties", - NULL -}; - -static const char *i2cSymbols[] = { - "xf86CreateI2CBusRec", - "xf86I2CBusInit", - "xf86CreateI2CDevRec", - "xf86I2CDevInit", - "xf86I2CWriteRead", - "xf86I2CProbeAddress", - "xf86DestroyI2CDevRec", - "xf86I2CReadByte", - "xf86I2CWriteByte", - NULL -}; - -static const char *xaaSymbols[] = { -#ifdef X_HAVE_XAAGETROP - "XAAGetCopyROP", - "XAAGetCopyROP_PM", - "XAAGetPatternROP", -#else - "XAACopyROP", - "XAACopyROP_PM", - "XAAPatternROP", -#endif - "XAACreateInfoRec", - "XAADestroyInfoRec", - "XAAInit", - "XAAFillSolidRects", - NULL -}; - -static const char *exaSymbols[] = { - "exaGetVersion", - "exaDriverInit", - "exaDriverFini", - "exaOffscreenAlloc", - "exaOffscreenFree", - "exaGetPixmapPitch", - "exaGetPixmapOffset", - "exaWaitSync", - "exaDriverAlloc", - NULL -}; - -static const char *shadowSymbols[] = { - "ShadowFBInit", - NULL -}; - -#ifdef USE_FB -static const char *fbSymbols[] = { - "fbScreenInit", - "fbPictureInit", - NULL -}; -#else -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb24_32ScreenInit", - "cfb32ScreenInit", - "cfb16BresS", - "cfb24BresS", - NULL -}; -#endif - #ifdef XFree86LOADER -#ifdef OPENCHROMEDRI -static const char *drmSymbols[] = { - "drmAddBufs", - "drmAddMap", - "drmAgpAcquire", - "drmAgpAlloc", - "drmAgpBase", - "drmAgpBind", - "drmAgpDeviceId", - "drmAgpEnable", - "drmAgpFree", - "drmAgpGetMode", - "drmAgpRelease", - "drmAgpVendorId", - "drmCtlInstHandler", - "drmCtlUninstHandler", - "drmCommandNone", - "drmCommandWrite", - "drmCommandWriteRead", - "drmFreeVersion", - "drmGetInterruptFromBusID", - "drmGetLibVersion", - "drmGetVersion", - "drmMap", - "drmMapBufs", - "drmUnmap", - "drmUnmapBufs", - "drmAgpUnbind", - "drmRmMap", - "drmCreateContext", - "drmAuthMagic", - "drmDestroyContext", - "drmSetContextFlags", - NULL -}; - -static const char *driSymbols[] = { - "DRICloseScreen", - "DRICreateInfoRec", - "DRIDestroyInfoRec", - "DRIFinishScreenInit", - "DRIGetSAREAPrivate", - "DRILock", - "DRIQueryVersion", - "DRIScreenInit", - "DRIUnlock", - "DRIOpenConnection", - "DRICloseConnection", - "GlxSetVisualConfigs", - NULL -}; -#endif - static MODULESETUPPROTO(VIASetup); static XF86ModuleVersionInfo VIAVersRec = { @@ -472,24 +316,6 @@ VIASetup(pointer module, pointer opts, int *errmaj, int *errmin) 0 #endif ); - LoaderRefSymLists(vgaHWSymbols, -#ifdef USE_FB - fbSymbols, -#else - cfbSymbols, -#endif - ramdacSymbols, - xaaSymbols, - exaSymbols, - shadowSymbols, - vbeSymbols, - i2cSymbols, - ddcSymbols, -#ifdef OPENCHROMEDRI - drmSymbols, - driSymbols, -#endif - NULL); return (pointer) 1; } else { @@ -826,7 +652,6 @@ VIAProbeDDC(ScrnInfoPtr pScrn, int index) vbeInfoPtr pVbe; if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); @@ -837,6 +662,7 @@ static Bool VIASetupDefaultOptions(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); + VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIASetupDefaultOptions\n")); @@ -866,27 +692,37 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) pVia->swov.maxHInterp = 600; pVia->useLegacyVBE = TRUE; - pVia->UseLegacyModeSwitch = TRUE; - + pVia->UseLegacyModeSwitch = FALSE; + pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP1; + switch (pVia->Chipset) { + case VIA_CLE266: + pVia->UseLegacyModeSwitch = TRUE; + pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP0; case VIA_KM400: /* IRQ is not broken on KM400A, but testing (pVia->ChipRev < 0x80) * is not enough to make sure we have an older, broken KM400. */ pVia->DRIIrqEnable = FALSE; + + /* The KM400 not working properly with new mode switch (See Ticket #301) */ + pVia->UseLegacyModeSwitch = TRUE; + pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP0; break; case VIA_K8M800: pVia->DRIIrqEnable = FALSE; + pVia->UseLegacyModeSwitch = TRUE; break; case VIA_PM800: pVia->VideoEngine = VIDEO_ENGINE_CME; + pVia->UseLegacyModeSwitch = TRUE; break; case VIA_VM800: + pVia->UseLegacyModeSwitch = TRUE; break; case VIA_K8M890: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->agpEnable = FALSE; pVia->dmaXV = FALSE; - pVia->UseLegacyModeSwitch = FALSE; break; case VIA_P4M900: pVia->VideoEngine = VIDEO_ENGINE_CME; @@ -894,24 +730,22 @@ VIASetupDefaultOptions(ScrnInfoPtr pScrn) pVia->useLegacyVBE = FALSE; /* FIXME: this needs to be tested */ pVia->dmaXV = FALSE; - pVia->UseLegacyModeSwitch = FALSE; + pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP0; break; case VIA_CX700: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->swov.maxWInterp = 1920; pVia->swov.maxHInterp = 1080; - pVia->UseLegacyModeSwitch = FALSE; break; case VIA_P4M890: pVia->VideoEngine = VIDEO_ENGINE_CME; pVia->dmaXV = FALSE; - pVia->UseLegacyModeSwitch = FALSE; break; case VIA_VX800: + case VIA_VX855: pVia->VideoEngine = VIDEO_ENGINE_CME; /* pVia->agpEnable = FALSE; pVia->dmaXV = FALSE;*/ - pVia->UseLegacyModeSwitch = FALSE; break; } @@ -931,7 +765,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) #ifndef USE_FB char *mod = NULL; - const char *reqSym = NULL; #endif vgaHWPtr hwp; int i, bMemSize = 0; @@ -952,7 +785,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; - xf86LoaderReqSymLists(vgaHWSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) return FALSE; @@ -973,11 +805,13 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pVia->IsSecondary = FALSE; pEnt = xf86GetEntityInfo(pScrn->entityList[0]); +#ifndef XSERVER_LIBPCIACCESS if (pEnt->resources) { xfree(pEnt); VIAFreeRec(pScrn); return FALSE; } +#endif pVia->EntityIndex = pEnt->index; @@ -1096,7 +930,9 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pScrn->rgbBits = 6; pVia->PciInfo = xf86GetPciInfoForEntity(pEnt->index); +#ifndef XSERVER_LIBPCIACCESS xf86RegisterResources(pEnt->index, NULL, ResNone); +#endif #if 0 xf86SetOperatingState(RES_SHARED_VGA, pEnt->index, ResUnusedOpr); @@ -1180,6 +1016,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) case VIA_P4M900: case VIA_CX700: case VIA_VX800: + case VIA_VX855: #ifdef XSERVER_LIBPCIACCESS pci_device_cfg_read_u8(vgaDevice, &videoRam, 0xA1); #else @@ -1230,6 +1067,69 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Setting amount of VideoRAM to %d kB\n", pScrn->videoRam); + if ((s = xf86GetOptValString(VIAOptions, OPTION_MODE_SWITCH_METHOD))) { + if (!xf86NameCmp(s, "legacy")) { + if (pVia->UseLegacyModeSwitch) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Already using \"legacy\" as ModeSwitchMethod, " + "did not force anything.\n"); + } + else { + pVia->UseLegacyModeSwitch = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Forced ModeSwitchMethod to \"legacy\".\n"); + } + } + else if (!xf86NameCmp(s, "new")) { + if (pVia->UseLegacyModeSwitch) { + pVia->UseLegacyModeSwitch = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Forced ModeSwitchMethod to \"new\".\n"); + } + else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Already using \"new\" as ModeSwitchMethod, " + "did not force anything.\n"); + } + } else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" + "value for Option \"ModeSwitchMethod\".\n", s); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Valid options are \"legacy\" or \"new\".\n"); + } + } + + /* When rotating, switch shadow framebuffer on and acceleration off. */ + if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATE))) { + if (!xf86NameCmp(s, "CW")) { + pVia->shadowFB = TRUE; + pVia->NoAccel = TRUE; + pVia->RandRRotation = TRUE; + pVia->rotate = RR_Rotate_270; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " + "clockwise -- acceleration is disabled.\n"); + } else if (!xf86NameCmp(s, "CCW")) { + pVia->shadowFB = TRUE; + pVia->NoAccel = TRUE; + pVia->RandRRotation = TRUE; + pVia->rotate = RR_Rotate_90; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " + "counterclockwise -- acceleration is disabled.\n"); + } else if (!xf86NameCmp(s, "UD")) { + pVia->shadowFB = TRUE; + pVia->NoAccel = TRUE; + pVia->RandRRotation = TRUE; + pVia->rotate = RR_Rotate_180; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " + "upside-down -- acceleration is disabled.\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" + "value for Option \"Rotate\".\n", s); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Valid options are \"CW\", \"CCW\" or \"UD\".\n"); + } + } + from = (xf86GetOptValBool(VIAOptions, OPTION_SHADOW_FB, &pVia->shadowFB) ? X_CONFIG : X_DEFAULT); xf86DrvMsg(pScrn->scrnIndex, from, "Shadow framebuffer is %s.\n", @@ -1247,27 +1147,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Hardware acceleration is %s.\n", !pVia->NoAccel ? "enabled" : "disabled"); - /* When rotating, switch shadow framebuffer on and acceleration off. */ - if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATE))) { - if (!xf86NameCmp(s, "CW")) { - pVia->shadowFB = TRUE; - pVia->NoAccel = TRUE; - pVia->rotate = 1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " - "clockwise -- acceleration is disabled.\n"); - } else if (!xf86NameCmp(s, "CCW")) { - pVia->shadowFB = TRUE; - pVia->NoAccel = TRUE; - pVia->rotate = -1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen " - "counterclockwise -- acceleration is disabled.\n"); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" - "value for Option \"Rotate\".\n", s); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Valid options are \"CW\" or \"CCW\".\n"); - } - } if (!pVia->NoAccel) { from = X_DEFAULT; if ((s = (char *)xf86GetOptValString(VIAOptions, OPTION_ACCELMETHOD))) { @@ -1535,6 +1414,30 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) "No default TV output signal type is set.\n"); } + /* TV DI Port */ + if ((s = xf86GetOptValString(VIAOptions, OPTION_TVDIPORT))) { + if (!xf86NameCmp(s, "DVP0")) { + pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP0; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "TV Output Port is DVP0.\n"); + } else if (!xf86NameCmp(s, "DVP1")) { + pBIOSInfo->TVDIPort = VIA_DI_PORT_DVP1; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "TV Output Port is DVP1.\n"); + } else if (!xf86NameCmp(s, "DFPHigh")) { + pBIOSInfo->TVDIPort = VIA_DI_PORT_DFPHIGH; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "TV Output Port is DFPHigh.\n"); + } else if (!xf86NameCmp(s, "DFPLow")) { + pBIOSInfo->TVDIPort = VIA_DI_PORT_DFPLOW; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "TV Output Port is DFPLow.\n"); + } + } else { + xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, + "No default TV output port is set.\n"); + } + VIAVidHWDiffInit(pScrn); /* maybe throw in some more sanity checks here */ @@ -1624,7 +1527,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) VIAFreeRec(pScrn); return FALSE; } else { - xf86LoaderReqSymLists(i2cSymbols, NULL); ViaI2CInit(pScrn); } @@ -1632,7 +1534,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) VIAFreeRec(pScrn); return FALSE; } else { - xf86LoaderReqSymLists(ddcSymbols, NULL); if (pVia->pI2CBus1) { pVia->DDC1 = xf86DoEDID_DDC2(pScrn->scrnIndex, pVia->pI2CBus1); @@ -1674,7 +1575,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) /* VBE doesn't properly initialise int10 itself. */ if (xf86LoadSubModule(pScrn, "int10") && xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); pVia->pVbe = VBEExtendedInit(NULL, pVia->EntityIndex, SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH); @@ -1773,22 +1673,18 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); #else /* Load bpp-specific modules. */ switch (pScrn->bitsPerPixel) { case 8: mod = "cfb"; - reqSym = "cfbScreenInit"; break; case 16: mod = "cfb16"; - reqSym = "cfb16ScreenInit"; break; case 32: mod = "cfb32"; - reqSym = "cfb32ScreenInit"; break; } @@ -1797,7 +1693,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } - xf86LoaderReqSymbols(reqSym, NULL); #endif if (!pVia->NoAccel) { @@ -1814,13 +1709,11 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) VIAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(exaSymbols, NULL); } if (!xf86LoadSubModule(pScrn, "xaa")) { VIAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); } if (pVia->hwcursor) { @@ -1828,7 +1721,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) VIAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); } if (pVia->shadowFB) { @@ -1836,7 +1728,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) VIAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); } VIAUnmapMem(pScrn); @@ -1926,8 +1817,16 @@ VIALeaveVT(int scrnIndex, int flags) viaAccelSync(pScrn); /* A soft reset helps to avoid a 3D hang on VT switch. */ - if (pVia->Chipset != VIA_K8M890 && pVia->Chipset != VIA_P4M900 && pVia->Chipset != VIA_VX800) - hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); + switch (pVia->Chipset) { + case VIA_K8M890: + case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + break; + default: + hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); + break; + } #ifdef OPENCHROMEDRI if (pVia->directRenderingEnabled) { @@ -2018,11 +1917,15 @@ VIASave(ScrnInfoPtr pScrn) vgaHWProtect(pScrn, TRUE); - if (xf86IsPrimaryPci(pVia->PciInfo)) + if (xf86IsPrimaryPci(pVia->PciInfo)) { vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); - else + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Primary Adapter! saving VGA_SR_ALL !!\n")); + } else { vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_MODE); - + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Non-Primary Adapter! saving VGA_SR_MODE only !!\n")); + } /* Unlock and save extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); @@ -2052,22 +1955,30 @@ VIASave(ScrnInfoPtr pScrn) Regs->SR2E = hwp->readSeq(hwp, 0x2E); + /*=* Save VCK, LCDCK and ECK *=*/ + /* Primary Display (VCK) (description for Chipset >= K8M800): */ Regs->SR44 = hwp->readSeq(hwp, 0x44); Regs->SR45 = hwp->readSeq(hwp, 0x45); Regs->SR46 = hwp->readSeq(hwp, 0x46); + + /* ECK Clock Synthesizer (description for Chipset >= K8M800): */ Regs->SR47 = hwp->readSeq(hwp, 0x47); + Regs->SR48 = hwp->readSeq(hwp, 0x48); + Regs->SR49 = hwp->readSeq(hwp, 0x49); switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: break; default: + /* Secondary Display (LCDCK): */ Regs->SR4A = hwp->readSeq(hwp, 0x4A); Regs->SR4B = hwp->readSeq(hwp, 0x4B); Regs->SR4C = hwp->readSeq(hwp, 0x4C); break; } - + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Non-Primary Adapter! saving VGA_SR_MODE only !!\n")); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Crtc...\n")); Regs->CR13 = hwp->readCrtc(hwp, 0x13); @@ -2103,8 +2014,13 @@ VIASave(ScrnInfoPtr pScrn) } /* Save TMDS status */ - if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800)) - Regs->CRD2 = hwp->readCrtc(hwp, 0xD2); + switch (pVia->Chipset) { + case VIA_CX700: + case VIA_VX800: + case VIA_VX855: + Regs->CRD2 = hwp->readCrtc(hwp, 0xD2); + break; + } vgaHWProtect(pScrn, FALSE); } @@ -2129,10 +2045,15 @@ VIARestore(ScrnInfoPtr pScrn) /* Unlock extended registers. */ hwp->writeSeq(hwp, 0x10, 0x01); + /*=* CR6A, CR6B, CR6C must be reset before restore + standard vga regs, or system will be hang. *=*/ + /*=* TODO Check is reset IGA2 channel before disable IGA2 channel + is neccesery or it may cause some line garbage. *=*/ hwp->writeCrtc(hwp, 0x6A, 0x00); hwp->writeCrtc(hwp, 0x6B, 0x00); hwp->writeCrtc(hwp, 0x6C, 0x00); - + + /* Gamma must disable before restore pallette */ ViaGammaDisable(pScrn); if (pBIOSInfo->TVI2CDev) @@ -2170,17 +2091,24 @@ VIARestore(ScrnInfoPtr pScrn) hwp->writeSeq(hwp, 0x2B, Regs->SR2B); hwp->writeSeq(hwp, 0x2E, Regs->SR2E); - + + /*=* restore VCK, LCDCK and ECK *=*/ + /* Primary Display (VCK): */ hwp->writeSeq(hwp, 0x44, Regs->SR44); hwp->writeSeq(hwp, 0x45, Regs->SR45); hwp->writeSeq(hwp, 0x46, Regs->SR46); + + /* ECK Clock Synthesizer: */ hwp->writeSeq(hwp, 0x47, Regs->SR47); + hwp->writeSeq(hwp, 0x48, Regs->SR48); + hwp->writeSeq(hwp, 0x49, Regs->SR49); switch (pVia->Chipset) { case VIA_CLE266: case VIA_KM400: break; default: + /* Secondary Display (LCDCK): */ hwp->writeSeq(hwp, 0x4A, Regs->SR4A); hwp->writeSeq(hwp, 0x4B, Regs->SR4B); hwp->writeSeq(hwp, 0x4C, Regs->SR4C); @@ -2191,11 +2119,19 @@ VIARestore(ScrnInfoPtr pScrn) ViaSeqMask(hwp, 0x40, 0x06, 0x06); ViaSeqMask(hwp, 0x40, 0x00, 0x06); + /* Integrated LVDS Mode Select */ hwp->writeCrtc(hwp, 0x13, Regs->CR13); + + /*=* Restore CRTC controller extended regs: *=*/ + /* Mode Control */ hwp->writeCrtc(hwp, 0x32, Regs->CR32); + /* HSYNCH Adjuster */ hwp->writeCrtc(hwp, 0x33, Regs->CR33); + /* Starting Address Overflow */ hwp->writeCrtc(hwp, 0x34, Regs->CR34); + /* Extended Overflow */ hwp->writeCrtc(hwp, 0x35, Regs->CR35); + /*Power Management 3 (Monitor Control) */ hwp->writeCrtc(hwp, 0x36, Regs->CR36); hwp->writeCrtc(hwp, 0x48, Regs->CR48); @@ -2206,11 +2142,12 @@ VIARestore(ScrnInfoPtr pScrn) hwp->writeCrtc(hwp, i + 0x50, Regs->CRTCRegs[i]); if (pVia->Chipset != VIA_CLE266 && pVia->Chipset != VIA_KM400) { - + /* Scaling Initial values */ hwp->writeCrtc(hwp, 0xA0, Regs->CRA0); hwp->writeCrtc(hwp, 0xA1, Regs->CRA1); hwp->writeCrtc(hwp, 0xA2, Regs->CRA2); + /* LVDS Channels Functions Selection */ hwp->writeCrtc(hwp, 0x97, Regs->CR97); hwp->writeCrtc(hwp, 0x99, Regs->CR99); hwp->writeCrtc(hwp, 0x9B, Regs->CR9B); @@ -2219,8 +2156,14 @@ VIARestore(ScrnInfoPtr pScrn) } /* Restore TMDS status */ - if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800)) - hwp->writeCrtc(hwp, 0xD2, Regs->CRD2); + switch (pVia->Chipset) { + case VIA_CX700: + case VIA_VX800: + case VIA_VX855: + /* LVDS Control Register */ + hwp->writeCrtc(hwp, 0xD2, Regs->CRD2); + break; + } if (pBIOSInfo->Panel->IsActive) ViaLCDPower(pScrn, TRUE); @@ -2245,6 +2188,7 @@ ViaMMIOEnable(ScrnInfoPtr pScrn) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: ViaSeqMask(hwp, 0x1A, 0x08, 0x08); break; default: @@ -2267,6 +2211,7 @@ ViaMMIODisable(ScrnInfoPtr pScrn) case VIA_CX700: case VIA_P4M900: case VIA_VX800: + case VIA_VX855: ViaSeqMask(hwp, 0x1A, 0x00, 0x08); break; default: @@ -2564,7 +2509,7 @@ VIALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, int i, index; int SR1A, SR1B, CR67, CR6A; - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIALoadPalette\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIALoadPalette: numColors: %d\n", numColors)); if (pScrn->bitsPerPixel != 8) { @@ -2768,6 +2713,11 @@ VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (pVia->shadowFB) ViaShadowFBInit(pScrn, pScreen); + + if (pVia->RandRRotation) + { + pScrn->DriverFunc = VIADriverFunc; + } if (!miCreateDefColormap(pScreen)) return FALSE; @@ -2872,14 +2822,14 @@ VIAInternalScreenInit(int scrnIndex, ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; VIAPtr pVia = VIAPTR(pScrn); - int width, height, displayWidth; + int width, height, displayWidth, shadowHeight; unsigned char *FBStart; xf86DrvMsg(scrnIndex, X_INFO, "VIAInternalScreenInit\n"); displayWidth = pScrn->displayWidth; - if (pVia->rotate) { + if ((pVia->rotate==RR_Rotate_90) || (pVia->rotate==RR_Rotate_270)) { height = pScrn->virtualX; width = pScrn->virtualY; } else { @@ -2887,9 +2837,14 @@ VIAInternalScreenInit(int scrnIndex, ScreenPtr pScreen) height = pScrn->virtualY; } + if (pVia->RandRRotation) + shadowHeight = max(width, height); + else + shadowHeight = height; + if (pVia->shadowFB) { pVia->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - pVia->ShadowPtr = xalloc(pVia->ShadowPitch * height); + pVia->ShadowPtr = xalloc(pVia->ShadowPitch * shadowHeight); displayWidth = pVia->ShadowPitch / (pScrn->bitsPerPixel >> 3); FBStart = pVia->ShadowPtr; } else { @@ -2918,6 +2873,7 @@ VIAInternalScreenInit(int scrnIndex, ScreenPtr pScreen) return FALSE; } #endif + return TRUE; } static Bool @@ -2956,13 +2912,19 @@ VIAWriteMode(ScrnInfoPtr pScrn, DisplayModePtr mode) * to detect when the display is using the secondary head. * TODO: This should be enabled for other chipsets as well. */ - if ((pVia->Chipset == VIA_P4M900 || pVia->Chipset == VIA_VX800) && pVia->pBIOSInfo->Panel->IsActive) { - /* - * Since we are using virtual, we need to adjust - * the offset to match the framebuffer alignment. - */ - if (pScrn->displayWidth != mode->CrtcHDisplay) - ViaSecondCRTCHorizontalOffset(pScrn); + if (pVia->pBIOSInfo->Panel->IsActive) { + switch (pVia->Chipset) { + case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + /* + * Since we are using virtual, we need to adjust + * the offset to match the framebuffer alignment. + */ + if (pScrn->displayWidth != mode->CrtcHDisplay) + ViaSecondCRTCHorizontalOffset(pScrn); + break; + } } } @@ -2996,9 +2958,16 @@ VIACloseScreen(int scrnIndex, ScreenPtr pScreen) viaAccelSync(pScrn); /* A soft reset avoids a 3D hang after X restart. */ - if (pVia->Chipset != VIA_K8M890 && pVia->Chipset != VIA_P4M900 && - pVia->Chipset != VIA_VX800) - hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); + switch (pVia->Chipset) { + case VIA_K8M890: + case VIA_P4M900: + case VIA_VX800: + case VIA_VX855: + break; + default : + hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); + break; + } if (!pVia->IsSecondary) { /* Turn off all video activities. */ @@ -3068,7 +3037,7 @@ VIAAdjustFrame(int scrnIndex, int x, int y, int flags) VIAPtr pVia = VIAPTR(pScrn); CARD32 Base; - DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAAdjustFrame\n")); + DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAAdjustFrame %dx%d\n", x, y)); if (pVia->pVbe) { ViaVbeAdjustFrame(scrnIndex, x, y, flags); @@ -3090,6 +3059,80 @@ VIAAdjustFrame(int scrnIndex, int x, int y, int flags) VIAVidAdjustFrame(pScrn, x, y); } + +static Bool +VIARandRGetInfo(ScrnInfoPtr pScrn, Rotation *rotations) +{ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIARandRGetInfo\n"); + + VIAPtr pVia = VIAPTR(pScrn); + + /* to report what ability we can support. */ + if(pVia->RandRRotation) + *rotations = RR_Rotate_0 | RR_Rotate_90 |RR_Rotate_180 | RR_Rotate_270; + else + *rotations = RR_Rotate_0; + + return TRUE; +} + +static Bool +VIARandRSetConfig(ScrnInfoPtr pScrn, xorgRRConfig *config) +{ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIARandRSetConfig\n"); + VIAPtr pVia = VIAPTR(pScrn); + + switch(config->rotation) { + case RR_Rotate_0: + pVia->rotate = RR_Rotate_0; + break; + + case RR_Rotate_90: + pVia->rotate = RR_Rotate_90; + break; + + case RR_Rotate_180: + pVia->rotate = RR_Rotate_180; + break; + + case RR_Rotate_270: + pVia->rotate = RR_Rotate_270; + break; + + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Unexpected rotation in VIARandRSetConfig\n"); + pVia->rotate = RR_Rotate_0; + return FALSE; + } + return TRUE; +} + +/* + * The driverFunc. xorgDriverFuncOp specifies the action driver should + * perform. If requested option is not supported function should return + * FALSE. pointer can be used to pass arguments to the function or + * to return data to the caller. + */ + +static Bool +VIADriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer data) +{ + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIADriverFunc Operation: %d\n", op)); + + switch(op) { + case RR_GET_INFO: + return VIARandRGetInfo(pScrn, (Rotation*)data); + case RR_SET_CONFIG: + return VIARandRSetConfig(pScrn, (xorgRRConfig*)data); + default: + return FALSE; + } + return FALSE; +} + + + static Bool VIASwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { diff --git a/driver/xf86-video-openchrome/src/via_driver.h b/driver/xf86-video-openchrome/src/via_driver.h index 3f5d88395..3b0282959 100644 --- a/driver/xf86-video-openchrome/src/via_driver.h +++ b/driver/xf86-video-openchrome/src/via_driver.h @@ -36,7 +36,11 @@ #include "vgaHW.h" #include "xf86.h" + +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" +#endif + #include "xf86Pci.h" #include "xf86PciInfo.h" #include "xf86_OSproc.h" @@ -100,11 +104,19 @@ #define DRIVER_NAME "openchrome" #define VERSION_MAJOR 0 #define VERSION_MINOR 2 -#define PATCHLEVEL 903 +#define PATCHLEVEL 904 #define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL) #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 { CARD8 SR08, SR0A, SR0F; @@ -114,7 +126,7 @@ typedef struct { CARD8 SR1F, SR20, SR21, SR22,SR23,SR24,SR25,SR26; CARD8 SR27, SR28, SR29, SR2A,SR2B,SR2C,SR2D,SR2E; 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; /* extended CRTC registers */ @@ -229,7 +241,7 @@ typedef struct _VIA { Bool hwcursor; Bool NoAccel; Bool shadowFB; - int rotate; + Rotation rotate; Bool vbeSR; int agpMem; @@ -295,6 +307,9 @@ typedef struct _VIA { char * dBounce; #endif + /* Rotation */ + Bool RandRRotation; + /* BIOS Info Ptr */ VIABIOSInfoPtr pBIOSInfo; struct ViaCardIdStruct* Id; diff --git a/driver/xf86-video-openchrome/src/via_drm.h b/driver/xf86-video-openchrome/src/via_drm.h deleted file mode 100644 index 9d85a1e84..000000000 --- a/driver/xf86-video-openchrome/src/via_drm.h +++ /dev/null @@ -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_ */ diff --git a/driver/xf86-video-openchrome/src/via_id.c b/driver/xf86-video-openchrome/src/via_id.c index 027094f35..c961ee162 100644 --- a/driver/xf86-video-openchrome/src/via_id.c +++ b/driver/xf86-video-openchrome/src/via_id.c @@ -92,6 +92,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"Shuttle FX21", VIA_K8M800, 0x1297, 0x3052, VIA_DEVICE_CRT}, {"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 PC-AE30J", VIA_K8M800, 0x13BD, 0x104B, VIA_DEVICE_CRT | VIA_DEVICE_LCD}, {"Giga-byte GA-K8VM800M", VIA_K8M800, 0x1458, 0xD000, VIA_DEVICE_CRT}, {"MSI K8M Neo-V", VIA_K8M800, 0x1462, 0x0320, VIA_DEVICE_CRT}, {"MSI K8MM-V", VIA_K8M800, 0x1462, 0x7142, VIA_DEVICE_CRT}, @@ -134,6 +135,7 @@ static struct ViaCardIdStruct ViaCardId[] = { /*** P4M800Pro, VN800, CN700 ***/ {"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}, {"ECS P4M800PRO-M", VIA_VM800, 0x1019, 0x2122, 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}, {"Biostar P4M80-M4 / P4VMA-M", VIA_VM800, 0x1565, 0x1202, 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 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}, @@ -185,6 +188,7 @@ static struct ViaCardIdStruct ViaCardId[] = { {"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 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}, {"Clevo M660SE", VIA_P4M900, 0x1558, 0x0664, 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 ***/ {"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}, {"Asustek P5V-VM ULTRA", VIA_P4M890, 0x1043, 0x81B5, VIA_DEVICE_CRT}, {"Asustek P5V-VM DH", VIA_P4M890, 0x1043, 0x81CE, VIA_DEVICE_CRT}, @@ -219,8 +224,13 @@ static struct ViaCardIdStruct ViaCardId[] = { /*** VX800 ***/ {"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}, {"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 */ {NULL, VIA_UNKNOWN, 0x0000, 0x0000, VIA_DEVICE_NONE} @@ -264,15 +274,15 @@ ViaCheckCardId(ScrnInfoPtr pScrn) if ((Id->Chip == pVia->Chipset) && (Id->Vendor == SUBVENDOR_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; return; } } xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Unknown Card-Ids (%4X|%4X|%4X); please report to openchrome-users@openchrome.org\n", - DEVICE_ID(pVia->PciInfo), SUBVENDOR_ID(pVia->PciInfo), SUBSYS_ID(pVia->PciInfo)); + "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), pScrn->chipset); pVia->Id = NULL; } diff --git a/driver/xf86-video-openchrome/src/via_id.h b/driver/xf86-video-openchrome/src/via_id.h index 168e8a92e..d941cf2e5 100644 --- a/driver/xf86-video-openchrome/src/via_id.h +++ b/driver/xf86-video-openchrome/src/via_id.h @@ -38,6 +38,7 @@ enum VIACHIPTAGS { VIA_CX700, VIA_P4M890, VIA_VX800, + VIA_VX855, VIA_LAST }; @@ -54,6 +55,7 @@ enum VIACHIPTAGS { #define PCI_CHIP_VT3324 0x3157 /* CX700 */ #define PCI_CHIP_VT3327 0x3343 /* P4M890 */ #define PCI_CHIP_VT3353 0x1122 /* VX800 */ +#define PCI_CHIP_VT3409 0x5122 /* VX855/VX875 */ /* There is some conflicting information about the two major revisions of * the CLE266, often labelled Ax and Cx. The dividing line seems to be diff --git a/driver/xf86-video-openchrome/src/via_lvds.c b/driver/xf86-video-openchrome/src/via_lvds.c index 9a783cc99..90c089ac7 100644 --- a/driver/xf86-video-openchrome/src/via_lvds.c +++ b/driver/xf86-video-openchrome/src/via_lvds.c @@ -35,10 +35,121 @@ #include "via_driver.h" #include "via_vgahw.h" #include "via_id.h" +#include + +/* + 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 -ViaLVDSPowerFirstSequence(ScrnInfoPtr pScrn, Bool on) +ViaLVDSHardwarePowerFirstSequence(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -59,7 +170,7 @@ ViaLVDSPowerFirstSequence(ScrnInfoPtr pScrn, Bool on) } static void -ViaLVDSPowerSecondSequence(ScrnInfoPtr pScrn, Bool on) +ViaLVDSHardwarePowerSecondSequence(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -83,15 +194,10 @@ static void ViaLVDSDFPPower(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); + VIAPtr pVia = VIAPTR(pScrn); - if (on) { - /* Turn DFP High/Low pad on. */ - 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); - - } + /* Switch DFP High/Low pads on or off for channels active at EnterVT(). */ + ViaSeqMask(hwp, 0x2A, on ? pVia->SavedReg.SR2A : 0, 0x0F); } static void @@ -114,9 +220,24 @@ ViaLVDSPowerChannel(ScrnInfoPtr pScrn, Bool on) void ViaLVDSPower(ScrnInfoPtr pScrn, Bool on) { - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSPower\n")); - ViaLVDSPowerFirstSequence(pScrn, on); - ViaLVDSPowerSecondSequence(pScrn, on); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaLVDSPower %d\n", on)); + VIAPtr pVia = VIAPTR(pScrn); + + /* + * 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); ViaLVDSPowerChannel(pScrn, on); } diff --git a/driver/xf86-video-openchrome/src/via_mode.c b/driver/xf86-video-openchrome/src/via_mode.c index 1d8c9566c..7b845623c 100644 --- a/driver/xf86-video-openchrome/src/via_mode.c +++ b/driver/xf86-video-openchrome/src/via_mode.c @@ -39,6 +39,7 @@ #include "via_driver.h" #include "via_vgahw.h" #include "via_id.h" +#include /* * Modetable nonsense. @@ -250,6 +251,10 @@ ViaTVSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) if (pBIOSInfo->TVModeCrtc) pBIOSInfo->TVModeCrtc(pScrn, mode); + + /* TV reset. */ + xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x00); + xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x1D, 0x80); } void @@ -299,7 +304,7 @@ ViaDFPDetect(ScrnInfoPtr pScrn) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDFPDetect\n")); VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; + xf86MonPtr monPtr = NULL; if (pVia->pI2CBus2) @@ -371,17 +376,20 @@ ViaOutputsDetect(ScrnInfoPtr pScrn) } } - if ((pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800)) { - - if (ViaDFPDetect(pScrn)) { - pBIOSInfo->DfpPresent = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "DFP is connected.\n"); - } else { - pBIOSInfo->DfpPresent = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "DFP is disconnected.\n"); - } + switch (pVia->Chipset) { + case VIA_CX700: + case VIA_VX800: + case VIA_VX855: + if (ViaDFPDetect(pScrn)) { + pBIOSInfo->DfpPresent = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "DFP is connected.\n"); + } else { + pBIOSInfo->DfpPresent = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "DFP is disconnected.\n"); + } + break; } } @@ -491,6 +499,8 @@ ViaOutputsSelect(ScrnInfoPtr pScrn) pBIOSInfo->CrtPresent = TRUE; pBIOSInfo->CrtActive = TRUE; } + if (pBIOSInfo->TVActive) + pBIOSInfo->FirstCRTC->IsActive = TRUE ; } if (!pVia->UseLegacyModeSwitch) { if (pBIOSInfo->CrtActive) @@ -499,8 +509,14 @@ ViaOutputsSelect(ScrnInfoPtr pScrn) pBIOSInfo->FirstCRTC->IsActive = TRUE ; if (pBIOSInfo->Panel->IsActive) { pVia->pBIOSInfo->SecondCRTC->IsActive = TRUE ; - if (pVia->Chipset == VIA_P4M900 || pVia->Chipset == VIA_CX700 || pVia->Chipset == VIA_VX800 ) - pVia->pBIOSInfo->Lvds->IsActive = TRUE ; + switch (pVia->Chipset) { + case VIA_P4M900: + case VIA_CX700: + case VIA_VX800: + case VIA_VX855: + pVia->pBIOSInfo->Lvds->IsActive = TRUE ; + break; + } } } @@ -536,13 +552,14 @@ VIAGetPanelSize(ScrnInfoPtr pScrn) int height = 0; Bool ret; - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSize\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetPanelSize (UseLegacyModeSwitch)\n")); ret = ViaPanelGetSizeFromDDCv1(pScrn, &width, &height); if (!ret) ret = ViaPanelGetSizeFromDDCv2(pScrn, &width); if (ret) { + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID returned resolution %d x %d \n", width, height)); switch (width) { case 640: pBIOSInfo->Panel->NativeModeIndex = VIA_PANEL6X4; @@ -571,6 +588,7 @@ VIAGetPanelSize(ScrnInfoPtr pScrn) } } else { 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) { /* VIA_PANEL6X4 == 0, but that value equals unset */ 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)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel does not support this" " resolution: %s\n", mode->name); @@ -681,8 +692,8 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) for (i = 0; ViaResolutionTable[i].Index != VIA_RES_INVALID; i++) { if (ViaResolutionTable[i].PanelIndex == pBIOSInfo->Panel->NativeModeIndex) { - pBIOSInfo->panelX = ViaResolutionTable[i].X; - pBIOSInfo->panelY = ViaResolutionTable[i].Y; + pBIOSInfo->Panel->NativeMode->Width = ViaResolutionTable[i].X; + pBIOSInfo->Panel->NativeMode->Height = ViaResolutionTable[i].Y; break; } } @@ -693,8 +704,8 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) return FALSE; } - if ((pBIOSInfo->panelX != mode->CrtcHDisplay) - || (pBIOSInfo->panelY != mode->CrtcVDisplay)) { + if ((pBIOSInfo->Panel->NativeMode->Width != mode->CrtcHDisplay) + || (pBIOSInfo->Panel->NativeMode->Height != mode->CrtcVDisplay)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelGetIndex: Non-native" " resolutions are broken.\n"); return FALSE; @@ -719,7 +730,7 @@ ViaPanelGetIndex(ScrnInfoPtr pScrn, DisplayModePtr mode) pBIOSInfo->PanelIndex = i; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaPanelGetIndex:" "index: %d (%dx%d)\n", pBIOSInfo->PanelIndex, - pBIOSInfo->panelX, pBIOSInfo->panelY)); + pBIOSInfo->Panel->NativeMode->Width, pBIOSInfo->Panel->NativeMode->Height)); return TRUE; } @@ -832,7 +843,7 @@ ViaGetMemoryBandwidth(ScrnInfoPtr 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) { case VIA_MEM_SDR66: @@ -873,7 +884,7 @@ ViaValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) if (pVia->pVbe) 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)); if (mode->Flags & V_INTERLACE) @@ -968,22 +979,47 @@ ViaSetUseExternalClock(vgaHWPtr hwp) * */ static void -ViaSetPrimaryDotclock(ScrnInfoPtr pScrn, CARD32 clock) +ViaSetDotclock(ScrnInfoPtr pScrn, CARD32 clock, int base, int probase) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); 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)) { - hwp->writeSeq(hwp, 0x46, clock >> 8); - hwp->writeSeq(hwp, 0x47, clock & 0xFF); + hwp->writeSeq(hwp, base, clock >> 8); + hwp->writeSeq(hwp, base+1, clock & 0xFF); } else { /* unichrome pro */ - hwp->writeSeq(hwp, 0x44, clock >> 16); - hwp->writeSeq(hwp, 0x45, (clock >> 8) & 0xFF); - hwp->writeSeq(hwp, 0x46, clock & 0xFF); + union pllparams pll; + int dtz, dr, dn, dm; + 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, 0x00, 0x02); @@ -996,24 +1032,23 @@ static void ViaSetSecondaryDotclock(ScrnInfoPtr pScrn, CARD32 clock) { vgaHWPtr hwp = VGAHWPTR(pScrn); - VIAPtr pVia = VIAPTR(pScrn); - DEBUG(xf86DrvMsg(hwp->pScrn->scrnIndex, X_INFO, - "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); - } + ViaSetDotclock(pScrn, clock, 0x44, 0x4A); ViaSeqMask(hwp, 0x40, 0x04, 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. */ @@ -1065,8 +1100,8 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaVgahwWrite(hwp, 0x300 + port, offset, 0x301 + port, data); } - if ((mode->CrtcHDisplay != pBIOSInfo->panelX) - || (mode->CrtcVDisplay != pBIOSInfo->panelY)) { + if ((mode->CrtcHDisplay != pBIOSInfo->Panel->NativeMode->Width) + || (mode->CrtcVDisplay != pBIOSInfo->Panel->NativeMode->Height)) { VIALCDModeEntryPtr Main; VIALCDMPatchEntryPtr Patch1, Patch2; int numPatch1, numPatch2; @@ -1162,7 +1197,7 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode) for (i = 0; i < numPatch2; i++, Patch2++) { if (Patch2->Mode == modeNum) { if (!pBIOSInfo->Center - && (mode->CrtcHDisplay == pBIOSInfo->panelX)) + && (mode->CrtcHDisplay == pBIOSInfo->Panel->NativeMode->Width)) pBIOSInfo->scaleY = FALSE; for (j = 0; j < Patch2->numEntry; j++) { @@ -1247,7 +1282,7 @@ VIASetLCDMode(ScrnInfoPtr pScrn, DisplayModePtr mode) static CARD32 ViaComputeDotClock(unsigned clock) { - double fvco, fout, fref, err, minErr; + double fout, fref, err, minErr; CARD32 dr, dn, dm, maxdm, maxdn; CARD32 factual, best; @@ -1281,15 +1316,16 @@ ViaComputeProDotClock(unsigned clock) { double fvco, fout, fref, err, minErr; CARD32 dr = 0, dn, dm, maxdm, maxdn; - CARD32 factual, bestClock; - + CARD32 factual; + union pllparams bestClock; + fref = 14.318e6; fout = (double)clock * 1.e3; factual = ~0; - maxdm = factual / 14318000U - 2; + maxdm = factual / 14318000U; minErr = 1.e10; - bestClock = 0U; + bestClock.packed = 0U; do { fvco = fout * (1 << dr); @@ -1300,30 +1336,31 @@ ViaComputeProDotClock(unsigned clock) } if (clock < 30000) - maxdn = 6; + maxdn = 8; else if (clock < 45000) - maxdn = 5; + maxdn = 7; else if (clock < 170000) - maxdn = 4; + maxdn = 6; else - maxdn = 3; + maxdn = 5; - for (dn = 0; dn < maxdn; ++dn) { - for (dm = 0; dm < maxdm; ++dm) { - factual = 14318000U * (dm + 2); - factual /= (dn + 2) << dr; + for (dn = 2; dn < maxdn; ++dn) { + for (dm = 2; dm < maxdm; ++dm) { + factual = 14318000U * dm; + factual /= dn << dr; if ((err = fabs((double)factual / fout - 1.)) < 0.005) { if (err < minErr) { minErr = err; - bestClock = ((dm & 0xff) << 16) | - (((1 << 7) | (dr << 2) | ((dm & 0x300) >> 8)) << 8) - | (dn & 0x7f); + bestClock.params.dtz = 1; + bestClock.params.dr = dr; + 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, "ViaComputeDotClock %d : %04x : %04x\n", - mode->Clock, best1, best2)); + mode->Clock, (unsigned int)best1, (unsigned int)best2)); + return best2; } else { for (i = 0; ViaDotClocks[i].DotClock; i++) if (ViaDotClocks[i].DotClock == mode->Clock) - return ViaDotClocks[i].UniChromePro; + return ViaDotClocks[i].UniChromePro.packed; return ViaComputeProDotClock(mode->Clock); } @@ -1370,7 +1408,7 @@ ViaModePrimaryLegacy(ScrnInfoPtr pScrn, DisplayModePtr mode) VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModePrimary\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModePrimaryLegacy\n")); DEBUG(ViaPrintMode(pScrn, mode)); /* Turn off Screen */ @@ -1449,7 +1487,7 @@ ViaModeSecondaryLegacy(ScrnInfoPtr pScrn, DisplayModePtr mode) VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModeSecondary\n")); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaModeSecondaryLegacy\n")); DEBUG(ViaPrintMode(pScrn, mode)); /* Turn off Screen */ @@ -1557,15 +1595,16 @@ ViaDFPPower(ScrnInfoPtr pScrn, Bool On) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaDFPPower: Off.\n"); #endif vgaHWPtr hwp = VGAHWPTR(pScrn); - VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; /* Display Channel Select */ ViaCrtcMask(hwp, 0xD2, 0x30, 0x30); - /* Power on TMDS */ - ViaCrtcMask(hwp, 0xD2, 0x00, 0x08); - + if (On) + /* Power on TMDS */ + 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->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); ViaSetPrimaryDotclock(pScrn, pBIOSInfo->Clock); @@ -1668,6 +1721,13 @@ ViaModeSet(ScrnInfoPtr pScrn, DisplayModePtr mode) ViaDisplaySetStreamOnDFP(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); } else { diff --git a/driver/xf86-video-openchrome/src/via_mode.h b/driver/xf86-video-openchrome/src/via_mode.h index 2d197f86a..826df7fce 100644 --- a/driver/xf86-video-openchrome/src/via_mode.h +++ b/driver/xf86-video-openchrome/src/via_mode.h @@ -35,7 +35,16 @@ #define VIA_BW_DDR400 498000000 /* > 1920x1080@60Hz@32bpp */ #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 * @@ -43,51 +52,52 @@ static struct ViaDotClock { int DotClock; CARD16 UniChrome; - CARD32 UniChromePro; + union pllparams UniChromePro; } ViaDotClocks[] = { - { 25200, 0x513C, 0xa79004 }, - { 25312, 0xC763, 0xc49005 }, - { 26591, 0x471A, 0xce9005 }, - { 31500, 0xC558, 0xae9003 }, - { 31704, 0x471F, 0xaf9002 }, - { 32663, 0xC449, 0x479000 }, - { 33750, 0x4721, 0x959002 }, - { 35500, 0x5877, 0x759001 }, - { 36000, 0x5879, 0x9f9002 }, - { 39822, 0xC459, 0x578c02 }, - { 40000, 0x515F, 0x848c04 }, - { 41164, 0x4417, 0x2c8c00 }, - { 46981, 0x5069, 0x678c02 }, - { 49500, 0xC353, 0xa48c04 }, - { 50000, 0xC354, 0x368c00 }, - { 56300, 0x4F76, 0x3d8c00 }, - { 57284, 0x4E70, 0x3e8c00 }, - { 64995, 0x0D3B, 0x6b8c01 }, - { 65000, 0x0D3B, 0x6b8c01 }, /* Slightly unstable on PM800 */ - { 65028, 0x866D, 0x6b8c01 }, - { 74480, 0x156E, 0x288800 }, - { 75000, 0x156E, 0x288800 }, - { 78800, 0x442C, 0x2a8800 }, - { 81135, 0x0622, 0x428801 }, - { 81613, 0x4539, 0x708803 }, - { 94500, 0x4542, 0x4d8801 }, - { 108000, 0x0B53, 0x778802 }, - { 108280, 0x4879, 0x778802 }, - { 122000, 0x0D6F, 0x428800 }, - { 122726, 0x073C, 0x878802 }, - { 135000, 0x0742, 0x6f8801 }, - { 148500, 0x0853, 0x518800 }, - { 155800, 0x0857, 0x558402 }, - { 157500, 0x422C, 0x2a8400 }, - { 161793, 0x4571, 0x6f8403 }, - { 162000, 0x0A71, 0x6f8403 }, - { 175500, 0x4231, 0x2f8400 }, - { 189000, 0x0542, 0x4d8401 }, - { 202500, 0x0763, 0x6F8402 }, - { 204800, 0x0764, 0x548401 }, - { 218300, 0x043D, 0x3b8400 }, - { 229500, 0x0660, 0x3e8400 }, /* Not tested on Pro */ - { 0, 0, 0 } + { 25200, 0x513C, /* 0xa79004 */ { 1, 4, 6, 169 } }, + { 25312, 0xC763, /* 0xc49005 */ { 1, 4, 7, 198 } }, + { 26591, 0x471A, /* 0xce9005 */ { 1, 4, 7, 208 } }, + { 31500, 0xC558, /* 0xae9003 */ { 1, 4, 5, 176 } }, + { 31704, 0x471F, /* 0xaf9002 */ { 1, 4, 4, 177 } }, + { 32663, 0xC449, /* 0x479000 */ { 1, 4, 2, 73 } }, + { 33750, 0x4721, /* 0x959002 */ { 1, 4, 4, 151 } }, + { 35500, 0x5877, /* 0x759001 */ { 1, 4, 3, 119 } }, + { 36000, 0x5879, /* 0x9f9002 */ { 1, 4, 4, 161 } }, + { 39822, 0xC459, /* 0x578c02 */ { 1, 3, 4, 89 } }, + { 40000, 0x515F, /* 0x848c04 */ { 1, 3, 6, 134 } }, + { 41164, 0x4417, /* 0x2c8c00 */ { 1, 3, 2, 46 } }, + { 46981, 0x5069, /* 0x678c02 */ { 1, 3, 4, 105 } }, + { 49500, 0xC353, /* 0xa48c04 */ { 3, 3, 5, 138 } }, + { 50000, 0xC354, /* 0x368c00 */ { 1, 3, 2, 56 } }, + { 56300, 0x4F76, /* 0x3d8c00 */ { 1, 3, 2, 63 } }, + { 57275, 0, /* 0x3e8c00 */ { 1, 3, 5, 157 } }, /* For XO 1.5 no need for a unichrome clock */ + { 57284, 0x4E70, /* 0x3e8c00 */ { 1, 3, 2, 64 } }, + { 64995, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, + { 65000, 0x0D3B, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, /* Slightly unstable on PM800 */ + { 65028, 0x866D, /* 0x6b8c01 */ { 1, 3, 3, 109 } }, + { 74480, 0x156E, /* 0x288800 */ { 1, 2, 2, 42 } }, + { 75000, 0x156E, /* 0x288800 */ { 1, 2, 2, 42 } }, + { 78800, 0x442C, /* 0x2a8800 */ { 1, 2, 2, 44 } }, + { 81135, 0x0622, /* 0x428801 */ { 1, 2, 3, 68 } }, + { 81613, 0x4539, /* 0x708803 */ { 1, 2, 5, 114 } }, + { 94500, 0x4542, /* 0x4d8801 */ { 1, 2, 3, 79 } }, + { 108000, 0x0B53, /* 0x778802 */ { 1, 2, 4, 121 } }, + { 108280, 0x4879, /* 0x778802 */ { 1, 2, 4, 121 } }, + { 122000, 0x0D6F, /* 0x428800 */ { 1, 2, 2, 68 } }, + { 122726, 0x073C, /* 0x878802 */ { 1, 2, 4, 137 } }, + { 135000, 0x0742, /* 0x6f8801 */ { 1, 2, 3, 113 } }, + { 148500, 0x0853, /* 0x518800 */ { 1, 2, 2, 83 } }, + { 155800, 0x0857, /* 0x558402 */ { 1, 1, 4, 87 } }, + { 157500, 0x422C, /* 0x2a8400 */ { 1, 1, 2, 44 } }, + { 161793, 0x4571, /* 0x6f8403 */ { 1, 1, 5, 113 } }, + { 162000, 0x0A71, /* 0x6f8403 */ { 1, 1, 5, 113 } }, + { 175500, 0x4231, /* 0x2f8400 */ { 1, 1, 2, 49 } }, + { 189000, 0x0542, /* 0x4d8401 */ { 1, 1, 3, 79 } }, + { 202500, 0x0763, /* 0x6F8402 */ { 1, 1, 4, 113 } }, + { 204800, 0x0764, /* 0x548401 */ { 1, 1, 3, 86 } }, + { 218300, 0x043D, /* 0x3b8400 */ { 1, 1, 2, 61 } }, + { 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("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("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("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 }, @@ -159,6 +171,7 @@ static DisplayModeRec ViaPanelModes[] = { #define VIA_RES_1280X720 19 #define VIA_RES_1920X1080 20 #define VIA_RES_1366X768 22 +#define VIA_RES_1200X900 23 #define VIA_RES_INVALID 0xFF /* @@ -190,6 +203,7 @@ static struct { {VIA_RES_856X480, VIA_PANEL_INVALID, 856, 480}, {VIA_RES_1024X576, VIA_PANEL_INVALID, 1024, 576}, {VIA_RES_800X480, VIA_PANEL8X4, 800, 480}, + {VIA_RES_1200X900, VIA_PANEL12X9, 1200, 900}, {VIA_RES_INVALID, VIA_PANEL_INVALID, 0, 0} }; diff --git a/driver/xf86-video-openchrome/src/via_panel.c b/driver/xf86-video-openchrome/src/via_panel.c index 34ecdeb2b..322cda170 100644 --- a/driver/xf86-video-openchrome/src/via_panel.c +++ b/driver/xf86-video-openchrome/src/via_panel.c @@ -45,16 +45,20 @@ static ViaPanelModeRec ViaPanelNativeModes[] = { {1280, 768}, {1280, 1024}, {1400, 1050}, - {1600, 1200}, - {1280, 800}, - {800, 480}, - {1366, 768}, - {1360, 768}, + {1600, 1200}, /* 0x6 Resolution 1440x900 */ + {1280, 800}, /* 0x7 Resolution 1280x800 (Samsung NC20) */ + {800, 480}, /* 0x8 For Quanta 800x480 */ + {1024, 600}, /* 0x9 Resolution 1024x600 (for HP 2133) */ + {1366, 768}, /* 0xA Resolution 1366x768 */ {1920, 1080}, {1920, 1200}, - {1024, 600}, - {1440, 900}, - {1280, 720} + {1280, 1024}, /* 0xD Need to be fixed to 1920x1200 */ + {1440, 900}, /* 0xE Need to be fixed to 640x240 */ + {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 @@ -63,6 +67,7 @@ ViaPanelLookUpModeIndex(int width, int height) int i, index = VIA_PANEL_INVALID; int length = sizeof(ViaPanelNativeModes) / sizeof(ViaPanelModeRec); + for (i = 0; i < length; i++) { if (ViaPanelNativeModes[i].Width == width && ViaPanelNativeModes[i].Height == height) { @@ -283,10 +288,13 @@ ViaPanelPreInit(ScrnInfoPtr pScrn) */ if (ret) { 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) { panel->NativeMode->Width = width; 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 ViaPanelGetSizeFromDDCv1(ScrnInfoPtr pScrn, int *width, int *height) + { VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr pMon; diff --git a/driver/xf86-video-openchrome/src/via_shadow.c b/driver/xf86-video-openchrome/src/via_shadow.c index 56ba22483..ca416c105 100644 --- a/driver/xf86-video-openchrome/src/via_shadow.c +++ b/driver/xf86-video-openchrome/src/via_shadow.c @@ -31,6 +31,9 @@ #include "shadowfb.h" #include "servermd.h" +/* RandR support */ +#include "xf86RandR12.h" + static void 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; iShadowPitch; + } + break; + case 16: + while (height--) { + /* TODO Faster method - need test + for(i=0; iShadowPitch; + } + break; + case 24: + while (height--) { + /* TODO Faster method - need test + for(i=0; iShadowPitch; + } + break; + case 32: + while (height--) { + /* TODO Faster method - need test + for(i=0; iShadowPitch; + } + break; + } + pbox++; + } +} + static void VIAPointerMoved(int index, int x, int y) { @@ -66,12 +148,15 @@ VIAPointerMoved(int index, int x, int y) VIAPtr pVia = VIAPTR(pScrn); int newX, newY; - if (pVia->rotate == 1) { + if (pVia->rotate == RR_Rotate_90) { newX = pScrn->pScreen->height - y - 1; newY = x; - } else { + } else if (pVia->rotate == RR_Rotate_270) { newX = y; newY = pScrn->pScreen->width - x - 1; + } else { + newX = pScrn->pScreen->width - x - 1; + newY = pScrn->pScreen->height - y - 1; } (*pVia->PointerMoved) (index, newX, newY); @@ -81,12 +166,29 @@ static void VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { 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; 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; - srcPitch = -pVia->rotate * pVia->ShadowPitch; + srcPitch = -tmpRot*pVia->ShadowPitch; while (num--) { width = pbox->x2 - pbox->x1; @@ -94,7 +196,7 @@ VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) y2 = (pbox->y2 + 3) & ~3; height = (y2 - y1) >> 2; /* in dwords */ - if (pVia->rotate == 1) { + if (pVia->rotate == RR_Rotate_90) { dstPtr = (pVia->FBBase + (pbox->x1 * dstPitch) + pScrn->virtualX - y2); srcPtr = pVia->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1; @@ -116,7 +218,7 @@ VIARefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) src += srcPitch * 4; } - srcPtr += pVia->rotate; + srcPtr += tmpRot; dstPtr += dstPitch; } @@ -128,12 +230,29 @@ static void VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { 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; 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; - srcPitch = -pVia->rotate * pVia->ShadowPitch >> 1; + srcPitch = -tmpRot*pVia->ShadowPitch >> 1; while (num--) { width = pbox->x2 - pbox->x1; @@ -141,7 +260,7 @@ VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) y2 = (pbox->y2 + 1) & ~1; height = (y2 - y1) >> 1; /* in dwords */ - if (pVia->rotate == 1) { + if (pVia->rotate == RR_Rotate_90) { dstPtr = ((CARD16*) pVia->FBBase + (pbox->x1 * dstPitch) + pScrn->virtualX - y2); srcPtr = ((CARD16*) pVia->ShadowPtr @@ -163,7 +282,7 @@ VIARefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) src += srcPitch * 2; } - srcPtr += pVia->rotate; + srcPtr += tmpRot; dstPtr += dstPitch; } @@ -177,12 +296,30 @@ void VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { 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; 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); - srcPitch = -pVia->rotate * pVia->ShadowPitch; + srcPitch = -tmpRot * pVia->ShadowPitch; while (num--) { width = pbox->x2 - pbox->x1; @@ -190,7 +327,7 @@ VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) y2 = (pbox->y2 + 3) & ~3; height = (y2 - y1) >> 2; /* blocks of 3 dwords */ - if (pVia->rotate == 1) { + if (pVia->rotate == RR_Rotate_90) { dstPtr = (pVia->FBBase + (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3)); srcPtr = pVia->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3); @@ -217,7 +354,7 @@ VIARefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) src += srcPitch * 4; } - srcPtr += pVia->rotate * 3; + srcPtr += tmpRot * 3; dstPtr += dstPitch; } @@ -230,17 +367,33 @@ static void VIARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { VIAPtr pVia = VIAPTR(pScrn); - int count, width, height, dstPitch, srcPitch; + int count, width, height, dstPitch, srcPitch, tmpRot; 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; - srcPitch = -pVia->rotate * pVia->ShadowPitch >> 2; + srcPitch = -tmpRot * pVia->ShadowPitch >> 2; while (num--) { width = pbox->x2 - pbox->x1; height = pbox->y2 - pbox->y1; - if (pVia->rotate == 1) { + if (pVia->rotate == RR_Rotate_90) { dstPtr = ((CARD32*) pVia->FBBase + (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2); srcPtr = ((CARD32*) pVia->ShadowPtr @@ -262,7 +415,7 @@ VIARefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox) src += srcPitch; } - srcPtr += pVia->rotate; + srcPtr += tmpRot; dstPtr += dstPitch; } @@ -276,7 +429,7 @@ ViaShadowFBInit(ScrnInfoPtr pScrn, ScreenPtr pScreen) VIAPtr pVia = VIAPTR(pScrn); RefreshAreaFuncPtr refreshArea = VIARefreshArea; - if (pVia->rotate) { + if ((pVia->rotate)||(pVia->RandRRotation==TRUE)) { if (!pVia->PointerMoved) { pVia->PointerMoved = pScrn->PointerMoved; pScrn->PointerMoved = VIAPointerMoved; diff --git a/driver/xf86-video-openchrome/src/via_swov.c b/driver/xf86-video-openchrome/src/via_swov.c index 52428f9ba..119bbba1c 100644 --- a/driver/xf86-video-openchrome/src/via_swov.c +++ b/driver/xf86-video-openchrome/src/via_swov.c @@ -46,6 +46,7 @@ #include "via_id.h" #include +#include /* * Warning: this file contains revision checks which are CLE266-specific. @@ -282,6 +283,7 @@ VIAVidHWDiffInit(ScrnInfoPtr pScrn) HWDiff->dwNeedV1Prefetch = VID_HWDIFF_FALSE; break; case VIA_VX800: + case VIA_VX855: HWDiff->dwThreeHQVBuffer = VID_HWDIFF_TRUE; HWDiff->dwHQVFetchByteUnit = 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_VT3327: case PCI_CHIP_VT3353: + case PCI_CHIP_VT3409: model = 0; break; case PCI_CHIP_CLE3122: @@ -922,6 +925,7 @@ viaSetColorSpace(VIAPtr pVia, int hue, int saturation, int brightness, case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: + case PCI_CHIP_VT3409: case PCI_CHIP_CLE3122: VIDOutD(V1_ColorSpaceReg_2, col2); VIDOutD(V1_ColorSpaceReg_1, col1); @@ -951,6 +955,7 @@ ViaInitVideoStatusFlag(VIAPtr pVia) case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: + case PCI_CHIP_VT3409: return (VIDEO_HQV_INUSE | SW_USE_HQV | VIDEO_1_INUSE | VIDEO_ACTIVE | VIDEO_SHOW); case PCI_CHIP_CLE3122: @@ -990,6 +995,8 @@ ViaSetVidCtl(VIAPtr pVia, unsigned int videoFlag) case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3336; + case PCI_CHIP_VT3409: + return V3_ENABLE | VIDEO_EXPIRE_NUM_VT3409; case PCI_CHIP_CLE3122: if (CLE266_REV_IS_CX(pVia->ChipRev)) return V3_ENABLE | V3_EXPIRE_NUM_F; @@ -1269,24 +1276,28 @@ SetFIFO_V1(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold) static void SetFIFO_V3(VIAPtr pVia, CARD8 depth, CARD8 prethreshold, CARD8 threshold) { - if ((pVia->ChipId == PCI_CHIP_VT3314) - || (pVia->ChipId == PCI_CHIP_VT3324) - || (pVia->ChipId == PCI_CHIP_VT3327 - || (pVia->ChipId == PCI_CHIP_VT3353))) { - SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, - (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) - | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); - SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, - (VIDInD(ALPHA_V3_PREFIFO_CONTROL) - & ~V3_FIFO_MASK_3314) | (prethreshold & 0xff)); - } else { - SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, - (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) - | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); - SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, - (VIDInD(ALPHA_V3_PREFIFO_CONTROL) & ~V3_FIFO_MASK) - | (prethreshold & 0x7f)); - } + switch (pVia->ChipId) { + case PCI_CHIP_VT3314: + case PCI_CHIP_VT3324: + case PCI_CHIP_VT3327: + case PCI_CHIP_VT3353: + case PCI_CHIP_VT3409: + SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, + (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) + | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); + SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, + (VIDInD(ALPHA_V3_PREFIFO_CONTROL) + & ~V3_FIFO_MASK_3314) | (prethreshold & 0xff)); + break; + default : + SaveVideoRegister(pVia, ALPHA_V3_FIFO_CONTROL, + (VIDInD(ALPHA_V3_FIFO_CONTROL) & ALPHA_FIFO_MASK) + | ((depth - 1) & 0xff) | ((threshold & 0xff) << 8)); + SaveVideoRegister(pVia, ALPHA_V3_PREFIFO_CONTROL, + (VIDInD(ALPHA_V3_PREFIFO_CONTROL) & ~V3_FIFO_MASK) + | (prethreshold & 0x7f)); + break; + } } static void @@ -1335,6 +1346,7 @@ SetFIFO_V3_64or32or32(VIAPtr pVia) case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: + case PCI_CHIP_VT3409: SetFIFO_V3(pVia, 225, 200, 250); break; case PCI_CHIP_VT3204: @@ -1367,6 +1379,7 @@ SetFIFO_V3_64or32or16(VIAPtr pVia) case PCI_CHIP_VT3324: case PCI_CHIP_VT3364: case PCI_CHIP_VT3353: + case PCI_CHIP_VT3409: SetFIFO_V3(pVia, 225, 200, 250); break; case PCI_CHIP_VT3204: @@ -1640,9 +1653,9 @@ SetVideoWindow(ScrnInfoPtr pScrn, unsigned long videoFlag, */ if (videoFlag & VIDEO_1_INUSE) { if (pBIOSInfo->SetDVI && pBIOSInfo->scaleY) { - top = (pUpdate->DstTop * pBIOSInfo->panelY + top = (pUpdate->DstTop * pBIOSInfo->Panel->NativeMode->Height / pScrn->currentMode->VDisplay); - bottom = (pUpdate->DstBottom * pBIOSInfo->panelY + bottom = (pUpdate->DstBottom * pBIOSInfo->Panel->NativeMode->Height / pScrn->currentMode->VDisplay); } } @@ -2011,7 +2024,7 @@ Upd_Video(ScrnInfoPtr pScrn, unsigned long videoFlag, if (pVia->VideoEngine == VIDEO_ENGINE_CME) { VIDOutD(HQV_SRC_DATA_OFFSET_CONTROL1,0); 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_CONTROL4,((pUpdate->SrcRight - 1 ) << 16) | (pUpdate->SrcBottom - 1)); } diff --git a/driver/xf86-video-openchrome/src/via_vbe.c b/driver/xf86-video-openchrome/src/via_vbe.c index c1dd63689..2e3998f6b 100644 --- a/driver/xf86-video-openchrome/src/via_vbe.c +++ b/driver/xf86-video-openchrome/src/via_vbe.c @@ -112,7 +112,6 @@ static Bool ViaVbeSetActiveDevices(ScrnInfoPtr pScrn, int mode, int refresh) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; vbeInfoPtr pVbe = pVia->pVbe; ViaVbeInitInt10(pVbe); @@ -140,7 +139,6 @@ static Bool ViaVbeSetPanelMode(ScrnInfoPtr pScrn, Bool expand) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; vbeInfoPtr pVbe = pVia->pVbe; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVbeSetPanelMode\n")); @@ -162,7 +160,6 @@ static Bool ViaVbeSetRefresh(ScrnInfoPtr pScrn, int maxRefresh) { VIAPtr pVia = VIAPTR(pScrn); - VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ViaVbeSetRefresh\n")); vbeInfoPtr pVbe = pVia->pVbe; @@ -351,8 +348,7 @@ ViaVbeModePreInit(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); VbeInfoBlock *vbe; - VbeModeInfoBlock *vbeMode; - DisplayModePtr pMode; + int i; memset(&(pVia->vbeMode), 0, sizeof(ViaVbeModeInfo)); diff --git a/driver/xf86-video-openchrome/src/via_video.c b/driver/xf86-video-openchrome/src/via_video.c index af632b473..c605f1165 100644 --- a/driver/xf86-video-openchrome/src/via_video.c +++ b/driver/xf86-video-openchrome/src/via_video.c @@ -32,7 +32,11 @@ #include "xf86.h" #include "xf86_OSproc.h" + +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" +#endif + #include "compiler.h" #include "xf86PciInfo.h" #include "xf86Pci.h" @@ -277,6 +281,7 @@ DecideOverlaySupport(ScrnInfoPtr pScrn) pVia->ChipId != PCI_CHIP_VT3314 && pVia->ChipId != PCI_CHIP_VT3327 && pVia->ChipId != PCI_CHIP_VT3336 && + pVia->ChipId != PCI_CHIP_VT3409 && pVia->ChipId != PCI_CHIP_VT3364 && pVia->ChipId != PCI_CHIP_VT3324 && pVia->ChipId != PCI_CHIP_VT3353) { @@ -574,6 +579,7 @@ viaInitVideo(ScreenPtr pScreen) (pVia->Chipset == VIA_P4M900) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || + (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_P4M890)); if ((pVia->drmVerMajor < 2) || ((pVia->drmVerMajor == 2) && (pVia->drmVerMinor < 9))) @@ -592,7 +598,8 @@ viaInitVideo(ScreenPtr pScreen) (pVia->Chipset == VIA_K8M800) || (pVia->Chipset == VIA_PM800) || (pVia->Chipset == VIA_VM800) || (pVia->Chipset == VIA_K8M890) || (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_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); } else { @@ -667,7 +674,7 @@ viaVideoFillPixmap(ScrnInfoPtr pScrn, { 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); depth = (depth + 7) >> 3; @@ -1260,6 +1267,20 @@ viaDmaBlitImage(VIAPtr pVia, #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 viaPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, @@ -1313,7 +1334,7 @@ viaPutImage(ScrnInfoPtr pScrn, /* Copy image data from system memory to video memory * TODO: use DRM's DMA feature to accelerate data copy */ - if (FOURCC_XVMC != id) { + if (id != FOURCC_XVMC) { dstPitch = pVia->swov.SWDevice.dwPitch; if (pVia->useDmaBlit) { diff --git a/driver/xf86-video-openchrome/src/via_vt162x.c b/driver/xf86-video-openchrome/src/via_vt162x.c index 511020514..aa64b336d 100644 --- a/driver/xf86-video-openchrome/src/via_vt162x.c +++ b/driver/xf86-video-openchrome/src/via_vt162x.c @@ -32,6 +32,40 @@ #include "via_vt162x.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 VT162xPrintRegs(ScrnInfoPtr pScrn) @@ -650,11 +684,30 @@ VT1622ModeI2C(ScrnInfoPtr pScrn, DisplayModePtr mode) xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x2B, Table.RGB[4]); if (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) { xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x02, 0x03); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x65, Table.YCbCr[0]); xf86I2CWriteByte(pBIOSInfo->TVI2CDev, 0x66, Table.YCbCr[1]); 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. */ @@ -721,8 +774,7 @@ VT1622ModeCrtc(ScrnInfoPtr pScrn, DisplayModePtr mode) } pBIOSInfo->ClockExternal = TRUE; ViaCrtcMask(hwp, 0x6A, 0x40, 0x40); - ViaCrtcMask(hwp, 0x6C, 0x01, 0x01); - ViaSeqMask(hwp, 0x1E, 0xF0, 0xF0); /* enable DI0/DVP0 */ + ViaSetTVClockSource(pScrn); } diff --git a/driver/xf86-video-openchrome/src/via_vt162x.h b/driver/xf86-video-openchrome/src/via_vt162x.h index ac5278f08..a1bc003b5 100644 --- a/driver/xf86-video-openchrome/src/via_vt162x.h +++ b/driver/xf86-video-openchrome/src/via_vt162x.h @@ -755,19 +755,19 @@ static DisplayModeRec VT1625Modes[] = { { MODEPREFIX("1024x768Over"), ... , MODESUFFIXPAL }, { MODEPREFIX("720x576Over"), ... , MODESUFFIXPAL },*/ /* 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("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("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("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("720x480Over"), 27025, 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, 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("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, /* 00 0F */ - { 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x33, 0x1C, 0x06, 0x7B, 0x15, 0x50, 0x57, 0, 0x9E, - 0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xD6, 0x7B, 0xF0, 0x21, 0x00, 0x50, 0x43, 0x80, 0, 0x10, - 0x1C, 0x08, 0xDC, 0x77, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0x03, 0, 0x10, 0x1F, 0x00, 0, 0, 0x02, 0x10, 0x00, 0x7B, 0x15, 0x50, 0x57, 0, 0xB7, + 0, 0x80, 0xAD, 0x21, 0x64, 0x34, 0xD6, 0x7B, 0xF0, 0x21, 0x00, 0x50, 0x00, 0x80, 0, 0x10, + 0x1C, 0x08, 0xE5, 0x77, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 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 */ - 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 */ { 0x55, 0x37, 0x5C, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ @@ -876,8 +876,8 @@ VT1625Table[] = { }, { "720x480Over", 720, 480, TVTYPE_480P, 0, 0, /* 00 0F */ - { 0x03, 0, 0x10, 0x40, 0x10, 0, 0, 0x33, 0x20, 0xFF, 0x7B, 0, 0x50, 0x57, 0, 0x9E, - 0, 0x80, 0x04, 0x08, 0x08, 0x10, 0xD6, 0x7B, 0xF0, 0x21, 0x02, 0x50, 0x43, 0x80, 0, 0x01, + { 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, 0x00, 0x80, 0, 0x01, 0x2F, 0x08, 0xDC, 0x7E, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x4A, 0x59, 0xCF, 0x23, 0x0C, 0x22, 0x59, 0xCF, 0x7F, 0x23, 0x91, @@ -909,15 +909,15 @@ VT1625Table[] = { 0x0, 0x0, }, - { "1920x1080", 1920, 540, TVTYPE_1080I, 0, 0, + { "1920x1080", 1920, 1080, TVTYPE_1080I, 0, 0, /* 00 0F */ - { 0x83, 0, 0x10, 0x4A, 0x86, 0x39, 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, + { 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, 0x04, 0x80, 0x00, 0x03, 0x25, 0x00, 0x00, 0x7E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* 4A 4F 50 59 */ { 0xC5, 0x0F, 0, 0x01, 0, 0x00, 0x97, 0x7F, 0x78, 0x64, 0x14, 0x97, 0x7f, 0x59, 0x78, 0xb0, /* 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 */ { 0x55, 0x39, 0x66, 0, 0, 0 }, /* Y-Cb-Cr 65,66,67 */ @@ -945,9 +945,9 @@ VT1625Table[] = { { "720x576", 720, 576, TVTYPE_PAL, 0, 0, /* 00 0F */ - { 0x03, 0x00, 0x10, 0x1f, 0x03, 0x00, 0x00, 0xc9, 0x4c, 0x11, 0x7c, 0x00, 0x56, 0x57, 0x07, 0xbf, - 0x00, 0x80, 0x09, 0x08, 0x17, 0x24, 0xcb, 0x8a, 0x09, 0x2a, 0x06, 0x50, 0x01, 0x80, 0x00, 0x10, - 0x14, 0x0c, 0x32, 0x7e, 0x00, 0x5f, 0x34, 0x8c, 0x4f, 0x5e, 0x15, 0xa2, 0x22, 0x80, 0xd3, 0x10 + { 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, 0x00, 0x80, 0x00, 0x10, + 0x14, 0x0c, 0x32, 0x7e, 0x00, 0x5f, 0x34, 0x8c, 0x4f, 0x5e, 0x15, 0xa2, 0x22, 0x80, 0xd3, 0x10 }, /* 4A 4F 50 59 */ { 0xc5, 0x0f, 0x00, 0x01, 0x00, 0x4b, 0xe7, 0xd2, 0x23, 0xb1, 0x22, 0x5f, 0x61, 0x7f, 0x23, 0x90, diff --git a/driver/xf86-video-openchrome/src/via_xvmc.c b/driver/xf86-video-openchrome/src/via_xvmc.c index 082e7ab75..120e251e4 100644 --- a/driver/xf86-video-openchrome/src/via_xvmc.c +++ b/driver/xf86-video-openchrome/src/via_xvmc.c @@ -27,7 +27,11 @@ #include "xf86.h" #include "xf86_OSproc.h" + +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" +#endif + #include "compiler.h" #include "xf86PciInfo.h" #include "xf86Pci.h" @@ -322,6 +326,7 @@ ViaInitXVMC(ScreenPtr pScreen) if ((pVia->Chipset == VIA_KM400) || (pVia->Chipset == VIA_CX700) || (pVia->Chipset == VIA_VX800) || + (pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_K8M890) || (pVia->Chipset == VIA_P4M900)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING,