On Tue, Mar 12, 2019 at 11:28:30AM +0100, Frederic Cambus wrote: > Hi tech@, > > Here is a diff to update openchrome to 0.6.182 in Xenocara. > > Tested on my VX900 system. > > Comments? OK?
Looks ok, but I can't test it, as I don't have via hardware anymore. One small nit: please remove $Id$ from the Makefile.am files (and regenerate the Makefile.in), and sed the diff upstreams. > > Index: driver/xf86-video-openchrome/Makefile.in > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/Makefile.in,v > retrieving revision 1.10 > diff -u -p -r1.10 Makefile.in > --- driver/xf86-video-openchrome/Makefile.in 9 Dec 2018 21:07:33 -0000 > 1.10 > +++ driver/xf86-video-openchrome/Makefile.in 11 Mar 2019 22:46:14 -0000 > @@ -73,7 +73,7 @@ subdir = . > DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ > $(srcdir)/Makefile.in $(srcdir)/config.h.in \ > $(top_srcdir)/configure COPYING ChangeLog NEWS config.guess \ > - config.sub install-sh ltmain.sh missing > + config.sub depcomp install-sh ltmain.sh missing > ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 > am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ > $(top_srcdir)/configure.ac > Index: driver/xf86-video-openchrome/aclocal.m4 > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/aclocal.m4,v > retrieving revision 1.9 > diff -u -p -r1.9 aclocal.m4 > --- driver/xf86-video-openchrome/aclocal.m4 9 Dec 2018 21:07:33 -0000 > 1.9 > +++ driver/xf86-video-openchrome/aclocal.m4 11 Mar 2019 22:46:14 -0000 > @@ -8606,32 +8606,63 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_L > m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) > m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) > > -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf > -*- > -# serial 1 (pkg-config-0.24) > -# > -# Copyright © 2004 Scott James Remnant <[email protected]>. > -# > -# This program is free software; you can redistribute it and/or modify > -# it under the terms of the GNU General Public License as published by > -# the Free Software Foundation; either version 2 of the License, or > -# (at your option) any later version. > -# > -# This program is distributed in the hope that it will be useful, but > -# WITHOUT ANY WARRANTY; without even the implied warranty of > -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > -# General Public License for more details. > -# > -# You should have received a copy of the GNU General Public License > -# along with this program; if not, write to the Free Software > -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > -# > -# As a special exception to the GNU General Public License, if you > -# distribute this file as part of a program that contains a > -# configuration script generated by Autoconf, you may include it under > -# the same distribution terms that you use for the rest of that program. > - > -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) > -# ---------------------------------- > +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- > +dnl serial 11 (pkg-config-0.29.1) > +dnl > +dnl Copyright © 2004 Scott James Remnant <[email protected]>. > +dnl Copyright © 2012-2015 Dan Nicholson <[email protected]> > +dnl > +dnl This program is free software; you can redistribute it and/or modify > +dnl it under the terms of the GNU General Public License as published by > +dnl the Free Software Foundation; either version 2 of the License, or > +dnl (at your option) any later version. > +dnl > +dnl This program is distributed in the hope that it will be useful, but > +dnl WITHOUT ANY WARRANTY; without even the implied warranty of > +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +dnl General Public License for more details. > +dnl > +dnl You should have received a copy of the GNU General Public License > +dnl along with this program; if not, write to the Free Software > +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA > +dnl 02111-1307, USA. > +dnl > +dnl As a special exception to the GNU General Public License, if you > +dnl distribute this file as part of a program that contains a > +dnl configuration script generated by Autoconf, you may include it under > +dnl the same distribution terms that you use for the rest of that > +dnl program. > + > +dnl PKG_PREREQ(MIN-VERSION) > +dnl ----------------------- > +dnl Since: 0.29 > +dnl > +dnl Verify that the version of the pkg-config macros are at least > +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's > +dnl installed version of pkg-config, this checks the developer's version > +dnl of pkg.m4 when generating configure. > +dnl > +dnl To ensure that this macro is defined, also add: > +dnl m4_ifndef([PKG_PREREQ], > +dnl [m4_fatal([must install pkg-config 0.29 or later before running > autoconf/autogen])]) > +dnl > +dnl See the "Since" comment for each macro you use to see what version > +dnl of the macros you require. > +m4_defun([PKG_PREREQ], > +[m4_define([PKG_MACROS_VERSION], [0.29.1]) > +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, > + [m4_fatal([pkg.m4 version $1 or higher is required but > ]PKG_MACROS_VERSION[ found])]) > +])dnl PKG_PREREQ > + > +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) > +dnl ---------------------------------- > +dnl Since: 0.16 > +dnl > +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to > +dnl first found in the path. Checks that the version of pkg-config found > +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is > +dnl used since that's the first version where most current features of > +dnl pkg-config existed. > AC_DEFUN([PKG_PROG_PKG_CONFIG], > [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) > > m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) > @@ -8653,18 +8684,19 @@ if test -n "$PKG_CONFIG"; then > PKG_CONFIG="" > fi > fi[]dnl > -])# PKG_PROG_PKG_CONFIG > +])dnl PKG_PROG_PKG_CONFIG > > -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) > -# > -# Check to see whether a particular set of modules exists. Similar > -# to PKG_CHECK_MODULES(), but does not set variables or print errors. > -# > -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) > -# only at the first occurence in configure.ac, so if the first place > -# it's called might be skipped (such as if it is within an "if", you > -# have to call PKG_CHECK_EXISTS manually > -# -------------------------------------------------------------- > +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) > +dnl ------------------------------------------------------------------- > +dnl Since: 0.18 > +dnl > +dnl Check to see whether a particular set of modules exists. Similar to > +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. > +dnl > +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) > +dnl only at the first occurence in configure.ac, so if the first place > +dnl it's called might be skipped (such as if it is within an "if", you > +dnl have to call PKG_CHECK_EXISTS manually > AC_DEFUN([PKG_CHECK_EXISTS], > [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl > if test -n "$PKG_CONFIG" && \ > @@ -8674,8 +8706,10 @@ m4_ifvaln([$3], [else > $3])dnl > fi]) > > -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) > -# --------------------------------------------- > +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) > +dnl --------------------------------------------- > +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting > +dnl pkg_failed based on the result. > m4_define([_PKG_CONFIG], > [if test -n "$$1"; then > pkg_cv_[]$1="$$1" > @@ -8687,10 +8721,11 @@ m4_define([_PKG_CONFIG], > else > pkg_failed=untried > fi[]dnl > -])# _PKG_CONFIG > +])dnl _PKG_CONFIG > > -# _PKG_SHORT_ERRORS_SUPPORTED > -# ----------------------------- > +dnl _PKG_SHORT_ERRORS_SUPPORTED > +dnl --------------------------- > +dnl Internal check to see if pkg-config supports short errors. > AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], > [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) > if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then > @@ -8698,19 +8733,17 @@ if $PKG_CONFIG --atleast-pkgconfig-versi > else > _pkg_short_errors_supported=no > fi[]dnl > -])# _PKG_SHORT_ERRORS_SUPPORTED > +])dnl _PKG_SHORT_ERRORS_SUPPORTED > > > -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], > -# [ACTION-IF-NOT-FOUND]) > -# > -# > -# Note that if there is a possibility the first call to > -# PKG_CHECK_MODULES might not happen, you should be sure to include an > -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac > -# > -# > -# -------------------------------------------------------------- > +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], > +dnl [ACTION-IF-NOT-FOUND]) > +dnl -------------------------------------------------------------- > +dnl Since: 0.4.0 > +dnl > +dnl Note that if there is a possibility the first call to > +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an > +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac > AC_DEFUN([PKG_CHECK_MODULES], > [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl > AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding > pkg-config])dnl > @@ -8764,16 +8797,40 @@ else > AC_MSG_RESULT([yes]) > $3 > fi[]dnl > -])# PKG_CHECK_MODULES > +])dnl PKG_CHECK_MODULES > > > -# PKG_INSTALLDIR(DIRECTORY) > -# ------------------------- > -# Substitutes the variable pkgconfigdir as the location where a module > -# should install pkg-config .pc files. By default the directory is > -# $libdir/pkgconfig, but the default can be changed by passing > -# DIRECTORY. The user can override through the --with-pkgconfigdir > -# parameter. > +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], > +dnl [ACTION-IF-NOT-FOUND]) > +dnl --------------------------------------------------------------------- > +dnl Since: 0.29 > +dnl > +dnl Checks for existence of MODULES and gathers its build flags with > +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags > +dnl and VARIABLE-PREFIX_LIBS from --libs. > +dnl > +dnl Note that if there is a possibility the first call to > +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to > +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your > +dnl configure.ac. > +AC_DEFUN([PKG_CHECK_MODULES_STATIC], > +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl > +_save_PKG_CONFIG=$PKG_CONFIG > +PKG_CONFIG="$PKG_CONFIG --static" > +PKG_CHECK_MODULES($@) > +PKG_CONFIG=$_save_PKG_CONFIG[]dnl > +])dnl PKG_CHECK_MODULES_STATIC > + > + > +dnl PKG_INSTALLDIR([DIRECTORY]) > +dnl ------------------------- > +dnl Since: 0.27 > +dnl > +dnl Substitutes the variable pkgconfigdir as the location where a module > +dnl should install pkg-config .pc files. By default the directory is > +dnl $libdir/pkgconfig, but the default can be changed by passing > +dnl DIRECTORY. The user can override through the --with-pkgconfigdir > +dnl parameter. > AC_DEFUN([PKG_INSTALLDIR], > [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) > m4_pushdef([pkg_description], > @@ -8784,16 +8841,18 @@ AC_ARG_WITH([pkgconfigdir], > AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) > m4_popdef([pkg_default]) > m4_popdef([pkg_description]) > -]) dnl PKG_INSTALLDIR > +])dnl PKG_INSTALLDIR > > > -# PKG_NOARCH_INSTALLDIR(DIRECTORY) > -# ------------------------- > -# Substitutes the variable noarch_pkgconfigdir as the location where a > -# module should install arch-independent pkg-config .pc files. By > -# default the directory is $datadir/pkgconfig, but the default can be > -# changed by passing DIRECTORY. The user can override through the > -# --with-noarch-pkgconfigdir parameter. > +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) > +dnl -------------------------------- > +dnl Since: 0.27 > +dnl > +dnl Substitutes the variable noarch_pkgconfigdir as the location where a > +dnl module should install arch-independent pkg-config .pc files. By > +dnl default the directory is $datadir/pkgconfig, but the default can be > +dnl changed by passing DIRECTORY. The user can override through the > +dnl --with-noarch-pkgconfigdir parameter. > AC_DEFUN([PKG_NOARCH_INSTALLDIR], > [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) > m4_pushdef([pkg_description], > @@ -8804,7 +8863,24 @@ AC_ARG_WITH([noarch-pkgconfigdir], > AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) > m4_popdef([pkg_default]) > m4_popdef([pkg_description]) > -]) dnl PKG_NOARCH_INSTALLDIR > +])dnl PKG_NOARCH_INSTALLDIR > + > + > +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, > +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) > +dnl ------------------------------------------- > +dnl Since: 0.28 > +dnl > +dnl Retrieves the value of the pkg-config variable for the given module. > +AC_DEFUN([PKG_CHECK_VAR], > +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl > +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl > + > +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) > +AS_VAR_COPY([$1], [pkg_cv_][$1]) > + > +AS_VAR_IF([$1], [""], [$5], [$4])dnl > +])dnl PKG_CHECK_VAR > > # Copyright (C) 2002-2012 Free Software Foundation, Inc. > # > Index: driver/xf86-video-openchrome/configure > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/configure,v > retrieving revision 1.14 > diff -u -p -r1.14 configure > --- driver/xf86-video-openchrome/configure 9 Dec 2018 21:07:33 -0000 > 1.14 > +++ driver/xf86-video-openchrome/configure 11 Mar 2019 22:46:15 -0000 > @@ -1,6 +1,6 @@ > #! /bin/sh > # Guess values for system-dependent variables and create Makefiles. > -# Generated by GNU Autoconf 2.69 for xf86-video-openchrome 0.6.176. > +# Generated by GNU Autoconf 2.69 for xf86-video-openchrome 0.6.182. > # > # Report bugs to > <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome>. > # > @@ -591,8 +591,8 @@ MAKEFLAGS= > # Identity of this package. > PACKAGE_NAME='xf86-video-openchrome' > PACKAGE_TARNAME='xf86-video-openchrome' > -PACKAGE_VERSION='0.6.176' > -PACKAGE_STRING='xf86-video-openchrome 0.6.176' > +PACKAGE_VERSION='0.6.182' > +PACKAGE_STRING='xf86-video-openchrome 0.6.182' > > PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome' > PACKAGE_URL='' > > @@ -1371,7 +1371,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.6.176 to adapt to many kinds > of systems. > +\`configure' configures xf86-video-openchrome 0.6.182 to adapt to many kinds > of systems. > > Usage: $0 [OPTION]... [VAR=VALUE]... > > @@ -1442,7 +1442,7 @@ fi > > if test -n "$ac_init_help"; then > case $ac_init_help in > - short | recursive ) echo "Configuration of xf86-video-openchrome > 0.6.176:";; > + short | recursive ) echo "Configuration of xf86-video-openchrome > 0.6.182:";; > esac > cat <<\_ACEOF > > @@ -1576,7 +1576,7 @@ fi > test -n "$ac_init_help" && exit $ac_status > if $ac_init_version; then > cat <<\_ACEOF > -xf86-video-openchrome configure 0.6.176 > +xf86-video-openchrome configure 0.6.182 > generated by GNU Autoconf 2.69 > > Copyright (C) 2012 Free Software Foundation, Inc. > @@ -1974,7 +1974,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.6.176, which was > +It was created by xf86-video-openchrome $as_me 0.6.182, which was > generated by GNU Autoconf 2.69. Invocation command line was > > $ $0 $@ > @@ -2819,7 +2819,7 @@ fi > > # Define the identity of the package. > PACKAGE='xf86-video-openchrome' > - VERSION='0.6.176' > + VERSION='0.6.182' > > > cat >>confdefs.h <<_ACEOF > @@ -13364,7 +13364,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri > # 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.6.176, which was > +This file was extended by xf86-video-openchrome $as_me 0.6.182, which was > generated by GNU Autoconf 2.69. Invocation command line was > > CONFIG_FILES = $CONFIG_FILES > @@ -13430,7 +13430,7 @@ _ACEOF > cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 > ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; > s/[\\""\`\$]/\\\\&/g'`" > ac_cs_version="\\ > -xf86-video-openchrome config.status 0.6.176 > +xf86-video-openchrome config.status 0.6.182 > configured by $0, generated by GNU Autoconf 2.69, > with options \\"\$ac_cs_config\\" > > Index: driver/xf86-video-openchrome/configure.ac > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/configure.ac,v > retrieving revision 1.11 > diff -u -p -r1.11 configure.ac > --- driver/xf86-video-openchrome/configure.ac 9 Dec 2018 21:07:33 -0000 > 1.11 > +++ driver/xf86-video-openchrome/configure.ac 11 Mar 2019 22:46:15 -0000 > @@ -23,7 +23,7 @@ > # Initialize Autoconf > AC_PREREQ(2.57) > AC_INIT([xf86-video-openchrome], > - [0.6.176], > + [0.6.182], > > [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome], > [xf86-video-openchrome]) > > Index: driver/xf86-video-openchrome/man/Makefile.am > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/man/Makefile.am,v > retrieving revision 1.5 > diff -u -p -r1.5 Makefile.am > --- driver/xf86-video-openchrome/man/Makefile.am 9 Dec 2018 21:07:33 > -0000 1.5 > +++ driver/xf86-video-openchrome/man/Makefile.am 11 Mar 2019 22:46:15 > -0000 > @@ -1,4 +1,4 @@ > -# $Id: Makefile.am,v 1.5 2018/12/09 21:07:33 fcambus Exp $ > +# $Id: Makefile.am,v 1.4 2005/10/18 00:01:55 alanc Exp $ > # > # Copyright 2005 Sun Microsystems, Inc. All rights reserved. > # > Index: driver/xf86-video-openchrome/man/Makefile.in > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/man/Makefile.in,v > retrieving revision 1.14 > diff -u -p -r1.14 Makefile.in > --- driver/xf86-video-openchrome/man/Makefile.in 9 Dec 2018 21:07:33 > -0000 1.14 > +++ driver/xf86-video-openchrome/man/Makefile.in 11 Mar 2019 22:46:15 > -0000 > @@ -14,7 +14,7 @@ > > @SET_MAKE@ > > -# $Id: Makefile.in,v 1.14 2018/12/09 21:07:33 fcambus Exp $ > +# $Id: Makefile.am,v 1.4 2005/10/18 00:01:55 alanc Exp $ > # > # Copyright 2005 Sun Microsystems, Inc. All rights reserved. > # > Index: driver/xf86-video-openchrome/src/via_display.c > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/src/via_display.c,v > retrieving revision 1.3 > diff -u -p -r1.3 via_display.c > --- driver/xf86-video-openchrome/src/via_display.c 9 Dec 2018 21:07:34 > -0000 1.3 > +++ driver/xf86-video-openchrome/src/via_display.c 11 Mar 2019 22:46:15 > -0000 > @@ -595,6 +595,7 @@ viaIGAInitCommon(ScrnInfoPtr pScrn) > vgaHWPtr hwp = VGAHWPTR(pScrn); > VIAPtr pVia = VIAPTR(pScrn); > VIADisplayPtr pVIADisplay = pVia->pVIADisplay; > + VIARegPtr Regs = &pVIADisplay->SavedReg; > CARD8 i; > #ifdef HAVE_DEBUG > CARD8 temp; > @@ -611,7 +612,7 @@ viaIGAInitCommon(ScrnInfoPtr pScrn) > temp = hwp->readMiscOut(hwp); > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Misc. Register: 0x%02X\n", temp)); > - hwp->writeMiscOut(hwp, temp | 0x22); > + hwp->writeMiscOut(hwp, temp | 0x23); > > temp = hwp->readEnable(hwp); > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > @@ -918,6 +919,25 @@ viaIGAInitCommon(ScrnInfoPtr pScrn) > * 11: Clock on/off according to each engine IDLE status */ > ViaSeqMask(hwp, 0x3F, 0xFF, 0xFF); > > + /* > + * Initialize frame buffer size and GTI for VX800, VX855, and > + * VX900 chipsets. This code is really necessary for standby > + * resume to work properly on VIA Embedded EPIA-M830 mainboard. > + */ > + if ((pVia->Chipset == VIA_VX800) || > + (pVia->Chipset == VIA_VX855) || > + (pVia->Chipset == VIA_VX900)) { > + hwp->writeSeq(hwp, 0x14, Regs->SR[0x14]); > + hwp->writeSeq(hwp, 0x68, Regs->SR[0x68]); > + hwp->writeSeq(hwp, 0x69, Regs->SR[0x69]); > + hwp->writeSeq(hwp, 0x6A, Regs->SR[0x6A]); > + hwp->writeSeq(hwp, 0x6B, Regs->SR[0x6B]); > + hwp->writeSeq(hwp, 0x6C, Regs->SR[0x6C]); > + hwp->writeSeq(hwp, 0x6D, Regs->SR[0x6D]); > + hwp->writeSeq(hwp, 0x6E, Regs->SR[0x6E]); > + hwp->writeSeq(hwp, 0x6F, Regs->SR[0x6F]); > + } > + > /* 3X5.36[7] - DPMS VSYNC Output > * 3X5.36[6] - DPMS HSYNC Output > * 3X5.36[5:4] - DPMS Control > @@ -939,11 +959,11 @@ viaIGAInitCommon(ScrnInfoPtr pScrn) > } > > /* 3X5.3B through 3X5.3F are scratch pad registers. */ > - ViaCrtcMask(hwp, 0x3B, pVIADisplay->originalCR3B, 0xFF); > - ViaCrtcMask(hwp, 0x3C, pVIADisplay->originalCR3C, 0xFF); > - ViaCrtcMask(hwp, 0x3D, pVIADisplay->originalCR3D, 0xFF); > - ViaCrtcMask(hwp, 0x3E, pVIADisplay->originalCR3E, 0xFF); > - ViaCrtcMask(hwp, 0x3F, pVIADisplay->originalCR3F, 0xFF); > + ViaCrtcMask(hwp, 0x3B, Regs->CR[0x3B], 0xFF); > + ViaCrtcMask(hwp, 0x3C, Regs->CR[0x3C], 0xFF); > + ViaCrtcMask(hwp, 0x3D, Regs->CR[0x3D], 0xFF); > + ViaCrtcMask(hwp, 0x3E, Regs->CR[0x3E], 0xFF); > + ViaCrtcMask(hwp, 0x3F, Regs->CR[0x3F], 0xFF); > > /* 3X5.47[5] - Peep at the PCI-bus > * 0: Disable > @@ -1869,252 +1889,9 @@ ViaDisablePrimaryFIFO(ScrnInfoPtr pScrn) > void > viaIGA1Save(ScrnInfoPtr pScrn) > { > - vgaHWPtr hwp = VGAHWPTR(pScrn); > - VIAPtr pVia = VIAPTR(pScrn); > - VIARegPtr Regs = &pVia->SavedReg; > - > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Entered viaIGA1Save.\n")); > > - vgaHWProtect(pScrn, TRUE); > - > - vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); > - > - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > - "Saving sequencer registers.\n")); > - > - /* Unlock extended registers. */ > - hwp->writeSeq(hwp, 0x10, 0x01); > - > - Regs->SR[0x14] = hwp->readSeq(hwp, 0x14); > - Regs->SR[0x15] = hwp->readSeq(hwp, 0x15); > - Regs->SR[0x16] = hwp->readSeq(hwp, 0x16); > - Regs->SR[0x17] = hwp->readSeq(hwp, 0x17); > - Regs->SR[0x18] = hwp->readSeq(hwp, 0x18); > - Regs->SR[0x19] = hwp->readSeq(hwp, 0x19); > - > - /* PCI Bus Control */ > - Regs->SR[0x1A] = hwp->readSeq(hwp, 0x1A); > - > - Regs->SR[0x1B] = hwp->readSeq(hwp, 0x1B); > - Regs->SR[0x1C] = hwp->readSeq(hwp, 0x1C); > - Regs->SR[0x1D] = hwp->readSeq(hwp, 0x1D); > - Regs->SR[0x1E] = hwp->readSeq(hwp, 0x1E); > - Regs->SR[0x1F] = hwp->readSeq(hwp, 0x1F); > - > - Regs->SR[0x20] = hwp->readSeq(hwp, 0x20); > - Regs->SR[0x21] = hwp->readSeq(hwp, 0x21); > - Regs->SR[0x22] = hwp->readSeq(hwp, 0x22); > - > - /* Registers 3C5.23 through 3C5.25 are not used by Chrome9. > - * Registers 3C5.27 through 3C5.29 are not used by Chrome9. */ > - switch (pVia->Chipset) { > - case VIA_CLE266: > - case VIA_KM400: > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - Regs->SR[0x23] = hwp->readSeq(hwp, 0x23); > - Regs->SR[0x24] = hwp->readSeq(hwp, 0x24); > - Regs->SR[0x25] = hwp->readSeq(hwp, 0x25); > - > - Regs->SR[0x27] = hwp->readSeq(hwp, 0x27); > - Regs->SR[0x28] = hwp->readSeq(hwp, 0x28); > - Regs->SR[0x29] = hwp->readSeq(hwp, 0x29); > - break; > - default: > - break; > - } > - > - Regs->SR[0x26] = hwp->readSeq(hwp, 0x26); > - > - Regs->SR[0x2A] = hwp->readSeq(hwp, 0x2A); > - Regs->SR[0x2B] = hwp->readSeq(hwp, 0x2B); > - Regs->SR[0x2D] = hwp->readSeq(hwp, 0x2D); > - Regs->SR[0x2E] = hwp->readSeq(hwp, 0x2E); > - > - /* Save PCI Configuration Memory Base Shadow 0 and 1. > - * These registers are available only in UniChrome, UniChrome Pro, > - * and UniChrome Pro II. */ > - switch (pVia->Chipset) { > - case VIA_CLE266: > - case VIA_KM400: > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - Regs->SR[0x2F] = hwp->readSeq(hwp, 0x2F); > - Regs->SR[0x30] = hwp->readSeq(hwp, 0x30); > - break; > - default: > - break; > - } > - > - /* Save PLL settings and several miscellaneous registers. > - * For UniChrome, register 3C5.44 through 3C5.4B are saved. > - * For UniChrome Pro and Chrome9, register 3C5.44 through 3C5.4C > - * are saved. */ > - Regs->SR[0x44] = hwp->readSeq(hwp, 0x44); > - Regs->SR[0x45] = hwp->readSeq(hwp, 0x45); > - Regs->SR[0x46] = hwp->readSeq(hwp, 0x46); > - Regs->SR[0x47] = hwp->readSeq(hwp, 0x47); > - Regs->SR[0x48] = hwp->readSeq(hwp, 0x48); > - Regs->SR[0x49] = hwp->readSeq(hwp, 0x49); > - Regs->SR[0x4A] = hwp->readSeq(hwp, 0x4A); > - Regs->SR[0x4B] = hwp->readSeq(hwp, 0x4B); > - > - switch (pVia->Chipset) { > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - Regs->SR[0x4C] = hwp->readSeq(hwp, 0x4C); > - > - /* Save register 3C5.4D. > - * According to CX700 / VX700 (UniChrome Pro II) Open Graphics > - * Programming Manual Part I: Graphics Core / 2D, > - * this register is called Dual Channel Memory Control. > - * According to VX800 / VX855 / VX900 (Chrome9 HC3 / HCM / HD) > - * Open Graphics Programming Manual Part I: Graphics Core / 2D, > - * this register is called Preemptive Arbiter Control. > - * It is likely that this register is also supported in UniChrome > Pro. */ > - Regs->SR[0x4D] = hwp->readSeq(hwp, 0x4D); > - > - Regs->SR[0x4E] = hwp->readSeq(hwp, 0x4E); > - Regs->SR[0x4F] = hwp->readSeq(hwp, 0x4F); > - break; > - default: > - break; > - } > - > - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > - "Finished saving sequencer registers.\n")); > - > - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > - "Saving IGA1 registers.\n")); > - > - /* UniChrome Pro or later */ > - switch (pVia->Chipset) { > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - /* Display Fetch Blocking Control */ > - Regs->CR[0x30] = hwp->readCrtc(hwp, 0x30); > - > - /* Half Line Position */ > - Regs->CR[0x31] = hwp->readCrtc(hwp, 0x31); > - break; > - default: > - break; > - } > - > - Regs->CR[0x32] = hwp->readCrtc(hwp, 0x32); > - Regs->CR[0x33] = hwp->readCrtc(hwp, 0x33); > - Regs->CR[0x35] = hwp->readCrtc(hwp, 0x35); > - Regs->CR[0x36] = hwp->readCrtc(hwp, 0x36); > - > - /* UniChrome Pro or later */ > - switch (pVia->Chipset) { > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - /* DAC Control Register */ > - Regs->CR[0x37] = hwp->readCrtc(hwp, 0x37); > - break; > - default: > - break; > - } > - > - Regs->CR[0x38] = hwp->readCrtc(hwp, 0x38); > - Regs->CR[0x39] = hwp->readCrtc(hwp, 0x39); > - Regs->CR[0x3A] = hwp->readCrtc(hwp, 0x3A); > - Regs->CR[0x3B] = hwp->readCrtc(hwp, 0x3B); > - Regs->CR[0x3C] = hwp->readCrtc(hwp, 0x3C); > - Regs->CR[0x3D] = hwp->readCrtc(hwp, 0x3D); > - Regs->CR[0x3E] = hwp->readCrtc(hwp, 0x3E); > - Regs->CR[0x3F] = hwp->readCrtc(hwp, 0x3F); > - > - Regs->CR[0x40] = hwp->readCrtc(hwp, 0x40); > - > - /* UniChrome Pro or later */ > - switch (pVia->Chipset) { > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - Regs->CR[0x43] = hwp->readCrtc(hwp, 0x43); > - Regs->CR[0x45] = hwp->readCrtc(hwp, 0x45); > - break; > - default: > - break; > - } > - > - Regs->CR[0x46] = hwp->readCrtc(hwp, 0x46); > - Regs->CR[0x47] = hwp->readCrtc(hwp, 0x47); > - > - /* Starting Address */ > - /* Start Address High */ > - Regs->CR[0x0C] = hwp->readCrtc(hwp, 0x0C); > - > - /* Start Address Low */ > - Regs->CR[0x0D] = hwp->readCrtc(hwp, 0x0D); > - > - /* UniChrome Pro or later */ > - switch (pVia->Chipset) { > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - /* Starting Address Overflow[28:24] */ > - Regs->CR[0x48] = hwp->readCrtc(hwp, 0x48); > - break; > - default: > - break; > - } > - > - /* Starting Address Overflow[23:16] */ > - Regs->CR[0x34] = hwp->readCrtc(hwp, 0x34); > - > - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > - "Finished saving IGA1 registers.\n")); > - > - vgaHWProtect(pScrn, FALSE); > - > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Exiting viaIGA1Save.\n")); > } > @@ -2124,7 +1901,8 @@ viaIGA1Restore(ScrnInfoPtr pScrn) > { > vgaHWPtr hwp = VGAHWPTR(pScrn); > VIAPtr pVia = VIAPTR(pScrn); > - VIARegPtr Regs = &pVia->SavedReg; > + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; > + VIARegPtr Regs = &pVIADisplay->SavedReg; > > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Entered viaIGA1Restore.\n")); > @@ -3145,131 +2923,9 @@ ViaSetSecondaryFIFO(ScrnInfoPtr pScrn, D > void > viaIGA2Save(ScrnInfoPtr pScrn) > { > - vgaHWPtr hwp = VGAHWPTR(pScrn); > - VIAPtr pVia = VIAPTR(pScrn); > - VIARegPtr Regs = &pVia->SavedReg; > - int i; > - > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Entered viaIGA2Save.\n")); > > - vgaHWProtect(pScrn, TRUE); > - > - vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); > - > - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > - "Saving IGA2 registers.\n")); > - > - /* Unlock extended registers. */ > - hwp->writeSeq(hwp, 0x10, 0x01); > - > - for (i = 0; i < (0x88 - 0x50 + 1); i++) { > - Regs->CR[i + 0x50] = hwp->readCrtc(hwp, i + 0x50); > - } > - > - for (i = 0; i < (0x92 - 0x8A + 1); i++) { > - Regs->CR[i + 0x8A] = hwp->readCrtc(hwp, i + 0x8A); > - } > - > - for (i = 0; i < (0xA3 - 0x94 + 1); i++) { > - Regs->CR[i + 0x94] = hwp->readCrtc(hwp, i + 0x94); > - } > - > - Regs->CR[0xA4] = hwp->readCrtc(hwp, 0xA4); > - > - for (i = 0; i < (0xAC - 0xA5 + 1); i++) { > - Regs->CR[i + 0xA5] = hwp->readCrtc(hwp, i + 0xA5); > - } > - > - /* Chrome 9 */ > - switch (pVia->Chipset) { > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - Regs->CR[0xAF] = hwp->readCrtc(hwp, 0xAF); > - break; > - default: > - break; > - } > - > - /* Chrome 9, Chrome 9 HC, and Chrome 9 HC3 */ > - switch (pVia->Chipset) { > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - for (i = 0; i < (0xCD - 0xB0 + 1); i++) { > - Regs->CR[i + 0xB0] = hwp->readCrtc(hwp, i + 0xB0); > - } > - > - break; > - default: > - break; > - } > - > - switch (pVia->Chipset) { > - > - /* UniChrome Pro and UniChrome Pro II */ > - case VIA_PM800: > - case VIA_K8M800: > - case VIA_P4M800PRO: > - case VIA_CX700: > - case VIA_P4M890: > - for (i = 0; i < (0xD7 - 0xD0 + 1); i++) { > - Regs->CR[i + 0xD0] = hwp->readCrtc(hwp, i + 0xD0); > - } > - > - break; > - > - /* Chrome 9 */ > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - for (i = 0; i < (0xEC - 0xD0 + 1); i++) { > - Regs->CR[i + 0xD0] = hwp->readCrtc(hwp, i + 0xD0); > - } > - > - break; > - default: > - break; > - } > - > - /* Chrome 9 */ > - switch (pVia->Chipset) { > - case VIA_K8M890: > - case VIA_P4M900: > - case VIA_VX800: > - case VIA_VX855: > - case VIA_VX900: > - for (i = 0; i < (0xF5 - 0xF0 + 1); i++) { > - Regs->CR[i + 0xF0] = hwp->readCrtc(hwp, i + 0xF0); > - } > - > - break; > - default: > - break; > - } > - > - /* Chrome 9 HCM and Chrome 9 HD */ > - if ((pVia->Chipset == VIA_VX855) || (pVia->Chipset == VIA_VX900)) { > - for (i = 0; i < (0xFC - 0xF6 + 1); i++) { > - Regs->CR[i + 0xF6] = hwp->readCrtc(hwp, i + 0xF6); > - } > - } > - > - /* Chrome 9 HD */ > - if (pVia->Chipset == VIA_VX900) { > - Regs->CR[0xFD] = hwp->readCrtc(hwp, 0xFD); > - } > - > - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > - "Finished saving IGA2 registers.\n")); > - > - vgaHWProtect(pScrn, FALSE); > - > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Exiting viaIGA2Save.\n")); > } > @@ -3279,7 +2935,8 @@ viaIGA2Restore(ScrnInfoPtr pScrn) > { > vgaHWPtr hwp = VGAHWPTR(pScrn); > VIAPtr pVia = VIAPTR(pScrn); > - VIARegPtr Regs = &pVia->SavedReg; > + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; > + VIARegPtr Regs = &pVIADisplay->SavedReg; > int i; > > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > Index: driver/xf86-video-openchrome/src/via_driver.h > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/src/via_driver.h,v > retrieving revision 1.12 > diff -u -p -r1.12 via_driver.h > --- driver/xf86-video-openchrome/src/via_driver.h 9 Dec 2018 21:07:34 > -0000 1.12 > +++ driver/xf86-video-openchrome/src/via_driver.h 11 Mar 2019 22:46:15 > -0000 > @@ -126,11 +126,6 @@ > > extern int gVIAEntityIndex; > > -typedef struct { > - CARD8 SR[256]; > - CARD8 CR[256]; > -} VIARegRec, *VIARegPtr; > - > /* > * variables that need to be shared among different screens. > */ > @@ -195,7 +190,6 @@ typedef struct _twodContext { > } ViaTwodContext; > > typedef struct _VIA { > - VIARegRec SavedReg; > int Bpp, Bpl; > > Bool KMS; > Index: driver/xf86-video-openchrome/src/via_fp.c > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/src/via_fp.c,v > retrieving revision 1.1 > diff -u -p -r1.1 via_fp.c > --- driver/xf86-video-openchrome/src/via_fp.c 9 Dec 2018 21:07:34 -0000 > 1.1 > +++ driver/xf86-video-openchrome/src/via_fp.c 11 Mar 2019 22:46:15 -0000 > @@ -706,13 +706,16 @@ viaFPGetFPInfoScratchPad(xf86OutputPtr o > { > ScrnInfoPtr pScrn = output->scrn; > vgaHWPtr hwp = VGAHWPTR(pScrn); > + VIAPtr pVia = VIAPTR(pScrn); > + VIADisplayPtr pVIADisplay = pVia->pVIADisplay; > VIAFPPtr pVIAFP = (VIAFPPtr) output->driver_private; > + VIARegPtr Regs = &pVIADisplay->SavedReg; > CARD8 index; > > DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, > "Entered %s.\n", __func__)); > > - index = hwp->readCrtc(hwp, 0x3F) & 0x0F; > + index = Regs->CR[0x3F] & 0x0F; > > pVIAFP->NativeModeIndex = index; > pVIAFP->NativeWidth = ViaPanelNativeModes[index].Width; > Index: driver/xf86-video-openchrome/src/via_ums.c > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/src/via_ums.c,v > retrieving revision 1.1 > diff -u -p -r1.1 via_ums.c > --- driver/xf86-video-openchrome/src/via_ums.c 9 Dec 2018 21:07:34 > -0000 1.1 > +++ driver/xf86-video-openchrome/src/via_ums.c 11 Mar 2019 22:46:15 > -0000 > @@ -1075,6 +1075,7 @@ umsCrtcInit(ScrnInfoPtr pScrn) > vgaHWPtr hwp = VGAHWPTR(pScrn); > VIAPtr pVia = VIAPTR(pScrn); > VIADisplayPtr pVIADisplay = pVia->pVIADisplay; > + VIARegPtr Regs = &pVIADisplay->SavedReg; > #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,8,0,0,0) > ClockRangePtr clockRanges; > #else > @@ -1082,13 +1083,149 @@ umsCrtcInit(ScrnInfoPtr pScrn) > #endif > int max_pitch, max_height; > xf86CrtcPtr iga1, iga2; > + uint32_t i; > > - /* 3X5.3B through 3X5.3F are scratch pad registers. */ > - pVIADisplay->originalCR3B = hwp->readCrtc(hwp, 0x3B); > - pVIADisplay->originalCR3C = hwp->readCrtc(hwp, 0x3C); > - pVIADisplay->originalCR3D = hwp->readCrtc(hwp, 0x3D); > - pVIADisplay->originalCR3E = hwp->readCrtc(hwp, 0x3E); > - pVIADisplay->originalCR3F = hwp->readCrtc(hwp, 0x3F); > + vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); > + > + /* Unlock extended registers. */ > + hwp->writeSeq(hwp, 0x10, 0x01); > + > + Regs->SR[0x14] = hwp->readSeq(hwp, 0x14); > + Regs->SR[0x15] = hwp->readSeq(hwp, 0x15); > + Regs->SR[0x16] = hwp->readSeq(hwp, 0x16); > + Regs->SR[0x17] = hwp->readSeq(hwp, 0x17); > + Regs->SR[0x18] = hwp->readSeq(hwp, 0x18); > + Regs->SR[0x19] = hwp->readSeq(hwp, 0x19); > + Regs->SR[0x1A] = hwp->readSeq(hwp, 0x1A); > + Regs->SR[0x1B] = hwp->readSeq(hwp, 0x1B); > + Regs->SR[0x1C] = hwp->readSeq(hwp, 0x1C); > + Regs->SR[0x1D] = hwp->readSeq(hwp, 0x1D); > + Regs->SR[0x1E] = hwp->readSeq(hwp, 0x1E); > + Regs->SR[0x1F] = hwp->readSeq(hwp, 0x1F); > + Regs->SR[0x20] = hwp->readSeq(hwp, 0x20); > + Regs->SR[0x21] = hwp->readSeq(hwp, 0x21); > + Regs->SR[0x22] = hwp->readSeq(hwp, 0x22); > + Regs->SR[0x23] = hwp->readSeq(hwp, 0x23); > + Regs->SR[0x24] = hwp->readSeq(hwp, 0x24); > + > + Regs->SR[0x27] = hwp->readSeq(hwp, 0x27); > + Regs->SR[0x28] = hwp->readSeq(hwp, 0x28); > + Regs->SR[0x29] = hwp->readSeq(hwp, 0x29); > + Regs->SR[0x2A] = hwp->readSeq(hwp, 0x2A); > + Regs->SR[0x2B] = hwp->readSeq(hwp, 0x2B); > + > + Regs->SR[0x2D] = hwp->readSeq(hwp, 0x2D); > + Regs->SR[0x2E] = hwp->readSeq(hwp, 0x2E); > + Regs->SR[0x2F] = hwp->readSeq(hwp, 0x2F); > + Regs->SR[0x30] = hwp->readSeq(hwp, 0x30); > + > + Regs->SR[0x44] = hwp->readSeq(hwp, 0x44); > + Regs->SR[0x45] = hwp->readSeq(hwp, 0x45); > + Regs->SR[0x46] = hwp->readSeq(hwp, 0x46); > + Regs->SR[0x47] = hwp->readSeq(hwp, 0x47); > + Regs->SR[0x48] = hwp->readSeq(hwp, 0x48); > + Regs->SR[0x49] = hwp->readSeq(hwp, 0x49); > + Regs->SR[0x4A] = hwp->readSeq(hwp, 0x4A); > + Regs->SR[0x4B] = hwp->readSeq(hwp, 0x4B); > + > + switch (pVia->Chipset) { > + case VIA_K8M800: > + case VIA_P4M800PRO: > + case VIA_PM800: > + case VIA_CX700: > + case VIA_P4M890: > + case VIA_K8M890: > + case VIA_P4M900: > + case VIA_VX800: > + case VIA_VX855: > + case VIA_VX900: > + Regs->SR[0x4C] = hwp->readSeq(hwp, 0x4C); > + Regs->SR[0x4D] = hwp->readSeq(hwp, 0x4D); > + Regs->SR[0x4E] = hwp->readSeq(hwp, 0x4E); > + Regs->SR[0x4F] = hwp->readSeq(hwp, 0x4F); > + break; > + default: > + break; > + } > + > + if ((pVia->Chipset == VIA_VX800) || > + (pVia->Chipset == VIA_VX855) || > + (pVia->Chipset == VIA_VX900)) { > + Regs->SR[0x14] = hwp->readSeq(hwp, 0x14); > + Regs->SR[0x68] = hwp->readSeq(hwp, 0x68); > + Regs->SR[0x69] = hwp->readSeq(hwp, 0x69); > + Regs->SR[0x6A] = hwp->readSeq(hwp, 0x6A); > + Regs->SR[0x6B] = hwp->readSeq(hwp, 0x6B); > + Regs->SR[0x6C] = hwp->readSeq(hwp, 0x6C); > + Regs->SR[0x6D] = hwp->readSeq(hwp, 0x6D); > + Regs->SR[0x6E] = hwp->readSeq(hwp, 0x6E); > + Regs->SR[0x6F] = hwp->readSeq(hwp, 0x6F); > + } > + > + Regs->CR[0x0C] = hwp->readCrtc(hwp, 0x0C); > + Regs->CR[0x0D] = hwp->readCrtc(hwp, 0x0D); > + > + Regs->CR[0x30] = hwp->readCrtc(hwp, 0x30); > + Regs->CR[0x31] = hwp->readCrtc(hwp, 0x31); > + Regs->CR[0x32] = hwp->readCrtc(hwp, 0x32); > + Regs->CR[0x33] = hwp->readCrtc(hwp, 0x33); > + Regs->CR[0x34] = hwp->readCrtc(hwp, 0x34); > + Regs->CR[0x35] = hwp->readCrtc(hwp, 0x35); > + Regs->CR[0x36] = hwp->readCrtc(hwp, 0x36); > + Regs->CR[0x37] = hwp->readCrtc(hwp, 0x37); > + Regs->CR[0x38] = hwp->readCrtc(hwp, 0x38); > + Regs->CR[0x39] = hwp->readCrtc(hwp, 0x39); > + Regs->CR[0x3A] = hwp->readCrtc(hwp, 0x3A); > + Regs->CR[0x3B] = hwp->readCrtc(hwp, 0x3B); > + Regs->CR[0x3C] = hwp->readCrtc(hwp, 0x3C); > + Regs->CR[0x3D] = hwp->readCrtc(hwp, 0x3D); > + Regs->CR[0x3E] = hwp->readCrtc(hwp, 0x3E); > + Regs->CR[0x3F] = hwp->readCrtc(hwp, 0x3F); > + Regs->CR[0x40] = hwp->readCrtc(hwp, 0x40); > + Regs->CR[0x43] = hwp->readCrtc(hwp, 0x43); > + Regs->CR[0x45] = hwp->readCrtc(hwp, 0x45); > + Regs->CR[0x46] = hwp->readCrtc(hwp, 0x46); > + Regs->CR[0x47] = hwp->readCrtc(hwp, 0x47); > + Regs->CR[0x48] = hwp->readCrtc(hwp, 0x48); > + > + for (i = 0; i < (0xA8 - 0x50 + 1); i++) { > + Regs->CR[i + 0x50] = hwp->readCrtc(hwp, i + 0x50); > + } > + > + switch (pVia->Chipset) { > + case VIA_CX700: > + case VIA_VX800: > + case VIA_VX855: > + case VIA_VX900: > + for (i = 0; i < (0xEF - 0xA9 + 1); i++) { > + Regs->CR[i + 0xA9] = hwp->readCrtc(hwp, i + 0xA9); > + } > + > + break; > + default: > + break; > + } > + > + if ((pVia->Chipset == VIA_VX800) || > + (pVia->Chipset == VIA_VX855) || > + (pVia->Chipset == VIA_VX900)) { > + for (i = 0; i < (0xF5 - 0xF0 + 1); i++) { > + Regs->CR[i + 0xF0] = hwp->readCrtc(hwp, i + 0xF0); > + } > + } > + > + if ((pVia->Chipset == VIA_VX855) || > + (pVia->Chipset == VIA_VX900)) { > + for (i = 0; i < (0xFC - 0xF6 + 1); i++) { > + Regs->CR[i + 0xF6] = hwp->readCrtc(hwp, i + 0xF6); > + } > + } > + > + if (pVia->Chipset == VIA_VX900) { > + for (i = 0; i < (0xFF - 0xF7 + 1); i++) { > + Regs->CR[i + 0xF7] = hwp->readCrtc(hwp, i + 0xF7); > + } > + } > > /* Read memory bandwidth from registers. */ > pVia->MemClk = hwp->readCrtc(hwp, 0x3D) >> 4; > Index: driver/xf86-video-openchrome/src/via_ums.h > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/src/via_ums.h,v > retrieving revision 1.1 > diff -u -p -r1.1 via_ums.h > --- driver/xf86-video-openchrome/src/via_ums.h 9 Dec 2018 21:07:34 > -0000 1.1 > +++ driver/xf86-video-openchrome/src/via_ums.h 11 Mar 2019 22:46:15 > -0000 > @@ -159,6 +159,11 @@ enum { > VIA_DPA_CLK_RANGE_150M, > }; > > +typedef struct { > + CARD8 SR[256]; > + CARD8 CR[256]; > +} VIARegRec, *VIARegPtr; > + > typedef struct ViaPanelMode { > int Width; > int Height; > @@ -223,9 +228,7 @@ typedef struct _VIADISPLAY { > /* OLPC XO-1.5 */ > Bool isOLPCXO15; > > - /* Shadow copy of CR3B through CR3F. */ > - CARD8 originalCR3B, originalCR3C, originalCR3D, > - originalCR3E, originalCR3F; > + VIARegRec SavedReg; > > xf86OutputPtr tv; > > Index: driver/xf86-video-openchrome/src/xvmc/xf86dristr.h > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-video-openchrome/src/xvmc/xf86dristr.h,v > retrieving revision 1.1 > diff -u -p -r1.1 xf86dristr.h > --- driver/xf86-video-openchrome/src/xvmc/xf86dristr.h 9 Dec 2018 > 21:07:34 -0000 1.1 > +++ driver/xf86-video-openchrome/src/xvmc/xf86dristr.h 11 Mar 2019 > 22:46:15 -0000 > @@ -59,7 +59,7 @@ typedef struct _XF86DRIQueryVersion > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIQueryVersion */ > - CARD16 length B16; > + CARD16 length; > } xXF86DRIQueryVersionReq; > > #define sz_xXF86DRIQueryVersionReq 4 > @@ -68,15 +68,15 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD16 majorVersion B16; /* major version of DRI protocol */ > - CARD16 minorVersion B16; /* minor version of DRI protocol */ > - CARD32 patchVersion B32; /* patch version of DRI protocol */ > - CARD32 pad3 B32; > - CARD32 pad4 B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD16 majorVersion; /* major version of DRI protocol */ > + CARD16 minorVersion; /* minor version of DRI protocol */ > + CARD32 patchVersion; /* patch version of DRI protocol */ > + CARD32 pad3; > + CARD32 pad4; > + CARD32 pad5; > + CARD32 pad6; > } xXF86DRIQueryVersionReply; > > #define sz_xXF86DRIQueryVersionReply 32 > @@ -85,8 +85,8 @@ typedef struct _XF86DRIQueryDirectRender > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* > X_DRIQueryDirectRenderingCapable */ > - CARD16 length B16; > - CARD32 screen B32; > + CARD16 length; > + CARD32 screen; > } xXF86DRIQueryDirectRenderingCapableReq; > > #define sz_xXF86DRIQueryDirectRenderingCapableReq 8 > @@ -95,17 +95,17 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > + CARD16 sequenceNumber; > + CARD32 length; > BOOL isCapable; > BOOL pad2; > BOOL pad3; > BOOL pad4; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > - CARD32 pad7 B32; > - CARD32 pad8 B32; > - CARD32 pad9 B32; > + CARD32 pad5; > + CARD32 pad6; > + CARD32 pad7; > + CARD32 pad8; > + CARD32 pad9; > } xXF86DRIQueryDirectRenderingCapableReply; > > #define sz_xXF86DRIQueryDirectRenderingCapableReply 32 > @@ -114,8 +114,8 @@ typedef struct _XF86DRIOpenConnection > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIOpenConnection */ > - CARD16 length B16; > - CARD32 screen B32; > + CARD16 length; > + CARD32 screen; > } xXF86DRIOpenConnectionReq; > > #define sz_xXF86DRIOpenConnectionReq 8 > @@ -124,14 +124,14 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 hSAREALow B32; > - CARD32 hSAREAHigh B32; > - CARD32 busIdStringLength B32; > - CARD32 pad6 B32; > - CARD32 pad7 B32; > - CARD32 pad8 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 hSAREALow; > + CARD32 hSAREAHigh; > + CARD32 busIdStringLength; > + CARD32 pad6; > + CARD32 pad7; > + CARD32 pad8; > } xXF86DRIOpenConnectionReply; > > #define sz_xXF86DRIOpenConnectionReply 32 > @@ -140,9 +140,9 @@ typedef struct _XF86DRIAuthConnection > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRICloseConnection */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 magic B32; > + CARD16 length; > + CARD32 screen; > + CARD32 magic; > } xXF86DRIAuthConnectionReq; > > #define sz_xXF86DRIAuthConnectionReq 12 > @@ -151,14 +151,14 @@ typedef struct > { > BYTE type; > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 authenticated B32; > - CARD32 pad2 B32; > - CARD32 pad3 B32; > - CARD32 pad4 B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 authenticated; > + CARD32 pad2; > + CARD32 pad3; > + CARD32 pad4; > + CARD32 pad5; > + CARD32 pad6; > } xXF86DRIAuthConnectionReply; > > #define zx_xXF86DRIAuthConnectionReply 32 > @@ -167,8 +167,8 @@ typedef struct _XF86DRICloseConnection > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRICloseConnection */ > - CARD16 length B16; > - CARD32 screen B32; > + CARD16 length; > + CARD32 screen; > } xXF86DRICloseConnectionReq; > > #define sz_xXF86DRICloseConnectionReq 8 > @@ -177,8 +177,8 @@ typedef struct _XF86DRIGetClientDriverNa > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always > X_DRIGetClientDriverName */ > - CARD16 length B16; > - CARD32 screen B32; > + CARD16 length; > + CARD32 screen; > } xXF86DRIGetClientDriverNameReq; > > #define sz_xXF86DRIGetClientDriverNameReq 8 > @@ -187,14 +187,14 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 ddxDriverMajorVersion B32; > - CARD32 ddxDriverMinorVersion B32; > - CARD32 ddxDriverPatchVersion B32; > - CARD32 clientDriverNameLength B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 ddxDriverMajorVersion; > + CARD32 ddxDriverMinorVersion; > + CARD32 ddxDriverPatchVersion; > + CARD32 clientDriverNameLength; > + CARD32 pad5; > + CARD32 pad6; > } xXF86DRIGetClientDriverNameReply; > > #define sz_xXF86DRIGetClientDriverNameReply 32 > @@ -203,10 +203,10 @@ typedef struct _XF86DRICreateContext > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRICreateContext */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 visual B32; > - CARD32 context B32; > + CARD16 length; > + CARD32 screen; > + CARD32 visual; > + CARD32 context; > } xXF86DRICreateContextReq; > > #define sz_xXF86DRICreateContextReq 16 > @@ -215,14 +215,14 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 hHWContext B32; > - CARD32 pad2 B32; > - CARD32 pad3 B32; > - CARD32 pad4 B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 hHWContext; > + CARD32 pad2; > + CARD32 pad3; > + CARD32 pad4; > + CARD32 pad5; > + CARD32 pad6; > } xXF86DRICreateContextReply; > > #define sz_xXF86DRICreateContextReply 32 > @@ -231,9 +231,9 @@ typedef struct _XF86DRIDestroyContext > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIDestroyContext */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 context B32; > + CARD16 length; > + CARD32 screen; > + CARD32 context; > } xXF86DRIDestroyContextReq; > > #define sz_xXF86DRIDestroyContextReq 12 > @@ -242,9 +242,9 @@ typedef struct _XF86DRICreateDrawable > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRICreateDrawable */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 drawable B32; > + CARD16 length; > + CARD32 screen; > + CARD32 drawable; > } xXF86DRICreateDrawableReq; > > #define sz_xXF86DRICreateDrawableReq 12 > @@ -253,14 +253,14 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 hHWDrawable B32; > - CARD32 pad2 B32; > - CARD32 pad3 B32; > - CARD32 pad4 B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 hHWDrawable; > + CARD32 pad2; > + CARD32 pad3; > + CARD32 pad4; > + CARD32 pad5; > + CARD32 pad6; > } xXF86DRICreateDrawableReply; > > #define sz_xXF86DRICreateDrawableReply 32 > @@ -269,9 +269,9 @@ typedef struct _XF86DRIDestroyDrawable > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIDestroyDrawable */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 drawable B32; > + CARD16 length; > + CARD32 screen; > + CARD32 drawable; > } xXF86DRIDestroyDrawableReq; > > #define sz_xXF86DRIDestroyDrawableReq 12 > @@ -280,9 +280,9 @@ typedef struct _XF86DRIGetDrawableInfo > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIGetDrawableInfo */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 drawable B32; > + CARD16 length; > + CARD32 screen; > + CARD32 drawable; > } xXF86DRIGetDrawableInfoReq; > > #define sz_xXF86DRIGetDrawableInfoReq 12 > @@ -291,18 +291,18 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 drawableTableIndex B32; > - CARD32 drawableTableStamp B32; > - INT16 drawableX B16; > - INT16 drawableY B16; > - INT16 drawableWidth B16; > - INT16 drawableHeight B16; > - CARD32 numClipRects B32; > - INT16 backX B16; > - INT16 backY B16; > - CARD32 numBackClipRects B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 drawableTableIndex; > + CARD32 drawableTableStamp; > + INT16 drawableX; > + INT16 drawableY; > + INT16 drawableWidth; > + INT16 drawableHeight; > + CARD32 numClipRects; > + INT16 backX; > + INT16 backY; > + CARD32 numBackClipRects; > } xXF86DRIGetDrawableInfoReply; > > #define sz_xXF86DRIGetDrawableInfoReply 36 > @@ -311,8 +311,8 @@ typedef struct _XF86DRIGetDeviceInfo > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIGetDeviceInfo */ > - CARD16 length B16; > - CARD32 screen B32; > + CARD16 length; > + CARD32 screen; > } xXF86DRIGetDeviceInfoReq; > > #define sz_xXF86DRIGetDeviceInfoReq 8 > @@ -321,14 +321,14 @@ typedef struct > { > BYTE type; /* X_Reply */ > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 hFrameBufferLow B32; > - CARD32 hFrameBufferHigh B32; > - CARD32 framebufferOrigin B32; > - CARD32 framebufferSize B32; > - CARD32 framebufferStride B32; > - CARD32 devPrivateSize B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 hFrameBufferLow; > + CARD32 hFrameBufferHigh; > + CARD32 framebufferOrigin; > + CARD32 framebufferSize; > + CARD32 framebufferStride; > + CARD32 devPrivateSize; > } xXF86DRIGetDeviceInfoReply; > > #define sz_xXF86DRIGetDeviceInfoReply 32 > @@ -337,9 +337,9 @@ typedef struct _XF86DRIOpenFullScreen > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRIOpenFullScreen */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 drawable B32; > + CARD16 length; > + CARD32 screen; > + CARD32 drawable; > } xXF86DRIOpenFullScreenReq; > > #define sz_xXF86DRIOpenFullScreenReq 12 > @@ -348,14 +348,14 @@ typedef struct > { > BYTE type; > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 isFullScreen B32; > - CARD32 pad2 B32; > - CARD32 pad3 B32; > - CARD32 pad4 B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 isFullScreen; > + CARD32 pad2; > + CARD32 pad3; > + CARD32 pad4; > + CARD32 pad5; > + CARD32 pad6; > } xXF86DRIOpenFullScreenReply; > > #define sz_xXF86DRIOpenFullScreenReply 32 > @@ -364,9 +364,9 @@ typedef struct _XF86DRICloseFullScreen > { > CARD8 reqType; /* always DRIReqCode */ > CARD8 driReqType; /* always X_DRICloseFullScreen */ > - CARD16 length B16; > - CARD32 screen B32; > - CARD32 drawable B32; > + CARD16 length; > + CARD32 screen; > + CARD32 drawable; > } xXF86DRICloseFullScreenReq; > > #define sz_xXF86DRICloseFullScreenReq 12 > @@ -375,14 +375,14 @@ typedef struct > { > BYTE type; > BOOL pad1; > - CARD16 sequenceNumber B16; > - CARD32 length B32; > - CARD32 pad2 B32; > - CARD32 pad3 B32; > - CARD32 pad4 B32; > - CARD32 pad5 B32; > - CARD32 pad6 B32; > - CARD32 pad7 B32; > + CARD16 sequenceNumber; > + CARD32 length; > + CARD32 pad2; > + CARD32 pad3; > + CARD32 pad4; > + CARD32 pad5; > + CARD32 pad6; > + CARD32 pad7; > } xXF86DRICloseFullScreenReply; > > #define sz_xXF86DRICloseFullScreenReply 32 -- Matthieu Herrb
