diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2017-02-18 17:22:08 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2017-02-18 17:22:08 +0000 |
commit | 8bb9f1ee646a94ecb372984046812d63d1557782 (patch) | |
tree | 96084275029b6afd90c0ca9e5f0c712ac11dc40b /driver/xf86-video-mga | |
parent | 5b47d2b04e18ed374f7f1f6881e584e06aecca0e (diff) |
Update to xf86-video-mga 1.6.5
Diffstat (limited to 'driver/xf86-video-mga')
-rw-r--r-- | driver/xf86-video-mga/ChangeLog | 104 | ||||
-rw-r--r-- | driver/xf86-video-mga/compile | 2 | ||||
-rw-r--r-- | driver/xf86-video-mga/config.h.in | 3 | ||||
-rw-r--r-- | driver/xf86-video-mga/configure | 35 | ||||
-rw-r--r-- | driver/xf86-video-mga/configure.ac | 9 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/compat-api.h | 5 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga.h | 10 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga_dac3026.c | 6 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga_dacG.c | 184 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga_driver.c | 68 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga_exa.c | 36 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga_merge.c | 4 | ||||
-rw-r--r-- | driver/xf86-video-mga/src/mga_storm.c | 1 |
13 files changed, 384 insertions, 83 deletions
diff --git a/driver/xf86-video-mga/ChangeLog b/driver/xf86-video-mga/ChangeLog index f4f7ff5a4..31def7952 100644 --- a/driver/xf86-video-mga/ChangeLog +++ b/driver/xf86-video-mga/ChangeLog @@ -1,3 +1,107 @@ +commit 979e0e73eb3424b6a97746e29c8b4a5b7e86196e +Author: Matt Turner <mattst88@gmail.com> +Date: Tue Jan 17 14:40:48 2017 -0800 + + xf86-video-mga 1.6.5 + + Signed-off-by: Matt Turner <mattst88@gmail.com> + +commit fc5d7acc23fcec9d87ca26fadf466fcf107671c0 +Author: Mathieu Larouche <mathieu.larouche@matrox.com> +Date: Wed Jul 20 09:18:49 2016 -0400 + + xf86-video-mga: Add support for the new G200e chipset -- V2 + + - Added PLL algorithm for a new rev of G200e + - Removed the bandwidth limitation for the new G200e + + Fixes : https://bugs.freedesktop.org/show_bug.cgi?id=92540 + + Change from V1 : + - Make sure we don't cause issue on previous chips. (Dave Airlie review) + + Signed-off-by: Mathieu Larouche <mathieu.larouche@matrox.com> + Signed-off-by: Dave Airlie <airlied@redhat.com> + +commit 12781f2e3deb7f6d86fde53134384996a6004894 +Author: Mathieu Larouche <mathieu.larouche@matrox.com> +Date: Fri Jun 17 10:52:42 2016 -0400 + + xf86-video-mga: Add support for a new G200eW3 chipset + + - Added support for the new deviceID for G200eW3 + - Added PLL algorithm for the G200eW3 + - Added some initialization code for G200eW3 + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92541 + + Signed-off-by: Mathieu Larouche <mathieu.larouche@matrox.com> + Signed-off-by: Dave Airlie <airlied@redhat.com> + +commit df094bfffe4ef097bfd9a569f2d2e35649c1a3c7 +Author: Adam Jackson <ajax@redhat.com> +Date: Tue Jul 19 10:03:56 2016 -0400 + + Adapt Block/WakeupHandler signature for ABI 23 + + Signed-off-by: Adam Jackson <ajax@redhat.com> + +commit 72a8b5ef0bcb08d4cde7b329a13a59db35342f58 +Author: Thomas Klausner <wiz@NetBSD.org> +Date: Mon Feb 23 13:26:14 2015 +0100 + + Use correct type in function call. + + Fixes + passing argument 2 of 'pci_device_cfg_read_u32' from incompatible pointer type + pciaccess.h:153:5: note: expected '__uint32_t *' but argument is of type 'CARD32 *' + + Signed-off-by: Thomas Klausner <wiz@NetBSD.org> + Reviewed-by: Connor Behan <connor.behan@gmail.com> + +commit f1e6c73be073c8816319104b2fde329bc286f5ec +Author: Connor Behan <connor.behan@gmail.com> +Date: Mon Aug 24 13:48:29 2015 -0400 + + Composite fixup + + A driver like this that tries to composite a lot will definitely need to + avoid crashing for solid pictures. + + Signed-off-by: Connor Behan <connor.behan@gmail.com> + +commit e6770f7cc11800ab6cc2e88790f357189de7ce32 +Author: Connor Behan <connor.behan@gmail.com> +Date: Mon Aug 24 11:48:16 2015 -0400 + + Remove DownloadFromScreen + + This hook was broken and did the same thing as a software fallback. + + Signed-off-by: Connor Behan <connor.behan@gmail.com> + +commit 04432b9c1db255e8e3d39a924f8803f83c407acc +Author: Adam Jackson <ajax@redhat.com> +Date: Tue May 5 11:05:44 2015 -0400 + + Enable write-combining on the framebuffer BAR + + Signed-off-by: Adam Jackson <ajax@redhat.com> + +commit da1223394ac9b6f3974b0b2570cbf46a2425fc11 +Author: Matthew Rezny <matthew@reztek.cz> +Date: Sun Jun 21 19:50:43 2015 +0200 + + MGA DDX: make it possible to find EXA support + + Newer versions of the xserver stricter requirements on header order + which caused the configure tests for EXA support to erroneously fail. + Since XAA was already removed from an earlier version of xserver, the + configure failure meant no acceleration was possible. Patch configure + tests similar to r128. + + Reviewed-by: Adam Jackson <ajax@redhat.com> + commit 8ed77eb7920f375e9490a31f907eccb02fb123cd Author: Matt Turner <mattst88@gmail.com> Date: Thu Feb 19 13:39:18 2015 -0800 diff --git a/driver/xf86-video-mga/compile b/driver/xf86-video-mga/compile index 531136b06..a85b723c7 100644 --- a/driver/xf86-video-mga/compile +++ b/driver/xf86-video-mga/compile @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify diff --git a/driver/xf86-video-mga/config.h.in b/driver/xf86-video-mga/config.h.in index df570d5b3..3313eaf31 100644 --- a/driver/xf86-video-mga/config.h.in +++ b/driver/xf86-video-mga/config.h.in @@ -5,6 +5,9 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the <exa.h> header file. */ +#undef HAVE_EXA_H + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H diff --git a/driver/xf86-video-mga/configure b/driver/xf86-video-mga/configure index a51c78d49..eee34ee28 100644 --- a/driver/xf86-video-mga/configure +++ b/driver/xf86-video-mga/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xf86-video-mga 1.6.4. +# Generated by GNU Autoconf 2.69 for xf86-video-mga 1.6.5. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xf86-video-mga' PACKAGE_TARNAME='xf86-video-mga' -PACKAGE_VERSION='1.6.4' -PACKAGE_STRING='xf86-video-mga 1.6.4' +PACKAGE_VERSION='1.6.5' +PACKAGE_STRING='xf86-video-mga 1.6.5' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -1368,7 +1368,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-mga 1.6.4 to adapt to many kinds of systems. +\`configure' configures xf86-video-mga 1.6.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-mga 1.6.4:";; + short | recursive ) echo "Configuration of xf86-video-mga 1.6.5:";; esac cat <<\_ACEOF @@ -1572,7 +1572,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-mga configure 1.6.4 +xf86-video-mga configure 1.6.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1987,7 +1987,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-mga $as_me 1.6.4, which was +It was created by xf86-video-mga $as_me 1.6.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -10461,7 +10461,7 @@ fi # Define the identity of the package. PACKAGE='xf86-video-mga' - VERSION='1.6.4' + VERSION='1.6.5' cat >>confdefs.h <<_ACEOF @@ -18385,11 +18385,6 @@ fi done - if test "x$XAA" = xyes; then - -$as_echo "#define USE_XAA 1" >>confdefs.h - - fi CFLAGS=$save_CFLAGS CPPFLAGS=$save_CPPFLAGS fi @@ -18420,14 +18415,20 @@ $as_echo "yes" >&6; } SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" - ac_fn_c_check_header_compile "$LINENO" "exa.h" "ac_cv_header_exa_h" "#include \"xorg-server.h\" + for ac_header in exa.h +do : + ac_fn_c_check_header_compile "$LINENO" "exa.h" "ac_cv_header_exa_h" "#include \"xorg-server.h\" " if test "x$ac_cv_header_exa_h" = xyes; then : - have_exa_h="yes" + cat >>confdefs.h <<_ACEOF +#define HAVE_EXA_H 1 +_ACEOF + have_exa_h="yes" else have_exa_h="no" fi +done CPPFLAGS="$SAVE_CPPFLAGS" else @@ -19044,7 +19045,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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-mga $as_me 1.6.4, which was +This file was extended by xf86-video-mga $as_me 1.6.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19110,7 +19111,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-mga config.status 1.6.4 +xf86-video-mga config.status 1.6.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/driver/xf86-video-mga/configure.ac b/driver/xf86-video-mga/configure.ac index 22959e18e..3bef1f229 100644 --- a/driver/xf86-video-mga/configure.ac +++ b/driver/xf86-video-mga/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-mga], - [1.6.4], + [1.6.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-mga]) AC_CONFIG_SRCDIR([Makefile.am]) @@ -138,9 +138,6 @@ if test "x$XAA" != xno; then CFLAGS=$XORG_CFLAGS CPPFLAGS="$XORG_CFLAGS" AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no) - if test "x$XAA" = xyes; then - AC_DEFINE(USE_XAA, 1, [Build support for xaa]) - fi CFLAGS=$save_CFLAGS CPPFLAGS=$save_CPPFLAGS fi @@ -158,9 +155,9 @@ if test "x$EXA" = xyes; then SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" - AC_CHECK_HEADER(exa.h, + AC_CHECK_HEADERS(exa.h, [have_exa_h="yes"], [have_exa_h="no"], - [#include "xorg-server.h"]) + [#include "xorg-server.h"]) CPPFLAGS="$SAVE_CPPFLAGS" else AC_MSG_RESULT(no) diff --git a/driver/xf86-video-mga/src/compat-api.h b/driver/xf86-video-mga/src/compat-api.h index 6bc946fd6..89976e41c 100644 --- a/driver/xf86-video-mga/src/compat-api.h +++ b/driver/xf86-video-mga/src/compat-api.h @@ -75,8 +75,13 @@ #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv +#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout +#define BLOCKHANDLER_ARGS arg, pTimeout +#else #define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask +#endif #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen #define CLOSE_SCREEN_ARGS pScreen diff --git a/driver/xf86-video-mga/src/mga.h b/driver/xf86-video-mga/src/mga.h index e87932f4e..04f6bfdbe 100644 --- a/driver/xf86-video-mga/src/mga.h +++ b/driver/xf86-video-mga/src/mga.h @@ -146,6 +146,12 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*); #define PCI_CHIP_MGAG400 0x0525 #define PCI_CHIP_MGAG550 0x2527 +#ifndef PCI_CHIP_MGAG200_EW3_PCI +#define PCI_CHIP_MGAG200_EW3_PCI 0x0536 +#endif + + + /* * Read/write to the DAC via MMIO */ @@ -209,9 +215,9 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*); typedef struct { unsigned char ExtVga[6]; unsigned char DacClk[6]; - unsigned char ExtVga_Index24; + unsigned char ExtVga_MgaReq; unsigned char Dac_Index90; - unsigned char * DacRegs; + unsigned char * DacRegs; unsigned long crtc2[0x58]; unsigned char dac2[0x21]; CARD32 Option; diff --git a/driver/xf86-video-mga/src/mga_dac3026.c b/driver/xf86-video-mga/src/mga_dac3026.c index 97c2c7aeb..bf4e668b2 100644 --- a/driver/xf86-video-mga/src/mga_dac3026.c +++ b/driver/xf86-video-mga/src/mga_dac3026.c @@ -852,8 +852,12 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, mgaReg->DacRegs[i] = inTi3026(MGADACregs[i]); #ifdef XSERVER_LIBPCIACCESS - pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option, + { + uint32_t Option; + pci_device_cfg_read_u32(pMga->PciInfo, & Option, PCI_OPTION_REG); + mgaReg->Option = Option; + } #else mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG); #endif diff --git a/driver/xf86-video-mga/src/mga_dacG.c b/driver/xf86-video-mga/src/mga_dacG.c index f30748804..73d0d9d00 100644 --- a/driver/xf86-video-mga/src/mga_dacG.c +++ b/driver/xf86-video-mga/src/mga_dacG.c @@ -51,6 +51,75 @@ static Bool MGAGInit(ScrnInfoPtr, DisplayModePtr); static void MGAGLoadPalette(ScrnInfoPtr, int, int*, LOCO*, VisualPtr); static Bool MGAG_i2cInit(ScrnInfoPtr pScrn); +#define P_ARRAY_SIZE 9 + +void +MGAG200E4ComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) +{ + unsigned int ulComputedFo; + unsigned int ulFDelta; + unsigned int ulFPermitedDelta; + unsigned int ulFTmpDelta; + unsigned int ulVCOMax, ulVCOMin; + unsigned int ulTestP; + unsigned int ulTestM; + unsigned int ulTestN; + unsigned int ulFoInternal; + unsigned int ulPLLFreqRef; + unsigned int pulPValues[P_ARRAY_SIZE] = {16, 14, 12, 10, 8, 6, 4, 2, 1}; + unsigned int i; + unsigned int ulVCO; + unsigned int ulFVV; + + ulVCOMax = 1600000; + ulVCOMin = 800000; + ulPLLFreqRef = 25000; + + if(lFo < 25000) + lFo = 25000; + + ulFoInternal = lFo * 2; + + ulFDelta = 0xFFFFFFFF; + /* Permited delta is 0.5% as VESA Specification */ + ulFPermitedDelta = ulFoInternal * 5 / 1000; + + for (i = 0 ; i < P_ARRAY_SIZE ; i++) + { + ulTestP = pulPValues[i]; + + if ((ulFoInternal * ulTestP) > ulVCOMax) continue; + if ((ulFoInternal * ulTestP) < ulVCOMin) continue; + + for (ulTestN = 50; ulTestN <= 256; ulTestN++) { + for (ulTestM = 1; ulTestM <= 32; ulTestM++) { + ulComputedFo = (ulPLLFreqRef * ulTestN) / (ulTestM * ulTestP); + if (ulComputedFo > ulFoInternal) + ulFTmpDelta = ulComputedFo - ulFoInternal; + else + ulFTmpDelta = ulFoInternal - ulComputedFo; + + if (ulFTmpDelta < ulFDelta) { + ulFDelta = ulFTmpDelta; + *M = ulTestM - 1; + *N = ulTestN - 1; + *P = ulTestP - 1; + } + } + } + } + + ulVCO = ulPLLFreqRef * ((*N)+1) / ((*M)+1); + ulFVV = (ulVCO - 800000) / 50000; + + if (ulFVV > 15) + ulFVV = 15; + + *P |= (ulFVV << 4); + + *M |= 0x80; +} + static void MGAG200SEComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) { @@ -207,6 +276,74 @@ MGAG200WBComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) #endif } +void +MGAG200EW3ComputePLLParam(ScrnInfoPtr pScrn ,long lFo, int *M, int *N, int *P) +{ + unsigned int ulComputedFo; + unsigned int ulFDelta; + unsigned int ulFPermitedDelta; + unsigned int ulFTmpDelta; + unsigned int ulVCOMax, ulVCOMin; + unsigned int ulTestP1; + unsigned int ulTestP2; + unsigned int ulTestM; + unsigned int ulTestN; + unsigned int ulPLLFreqRef; + unsigned int ulTestP1Start; + unsigned int ulTestP1End; + unsigned int ulTestP2Start; + unsigned int ulTestP2End; + unsigned int ulTestMStart; + unsigned int ulTestMEnd; + unsigned int ulTestNStart; + unsigned int ulTestNEnd; + + ulVCOMax = 800000; + ulVCOMin = 400000; + ulPLLFreqRef = 25000; + ulTestP1Start = 1; + ulTestP1End = 8; + ulTestP2Start = 1; + ulTestP2End = 8; + ulTestMStart = 1; + ulTestMEnd = 26; + ulTestNStart = 32; + ulTestNEnd = 2048; + + ulFDelta = 0xFFFFFFFF; + /* Permited delta is 0.5% as VESA Specification */ + ulFPermitedDelta = lFo * 5 / 1000; + + /* Then we need to minimize the M while staying within 0.5% */ + for (ulTestP1 = ulTestP1Start; ulTestP1 < ulTestP1End; ulTestP1++) { + for (ulTestP2 = ulTestP2Start; ulTestP2 < ulTestP2End; ulTestP2++) { + if (ulTestP1 < ulTestP2) continue; + if ((lFo * ulTestP1 * ulTestP2) > ulVCOMax) continue; + if ((lFo * ulTestP1 * ulTestP2) < ulVCOMin) continue; + + for (ulTestM = ulTestMStart; ulTestM < ulTestMEnd; ulTestM++) { + for (ulTestN = ulTestNStart; ulTestN < ulTestNEnd; ulTestN++) { + ulComputedFo = (ulPLLFreqRef * ulTestN) / (ulTestM * ulTestP1 * ulTestP2); + if (ulComputedFo > lFo) + ulFTmpDelta = ulComputedFo - lFo; + else + ulFTmpDelta = lFo - ulComputedFo; + + if (ulFTmpDelta < ulFDelta) { + ulFDelta = ulFTmpDelta; + *M = (CARD8)((ulTestN & 0x100) >> 1) | + (CARD8)(ulTestM); + *N = (CARD8)(ulTestN & 0xFF); + *P = (CARD8)((ulTestN & 0x600) >> 3) | + (CARD8)(ulTestP2 << 3) | + (CARD8)ulTestP1; + } + } + } + } + } +} + static void MGAG200EHComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) { @@ -890,7 +1027,11 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out ) } if (pMga->is_G200SE) { - MGAG200SEComputePLLParam(pScrn, f_out, &m, &n, &p); + if (pMga->reg_1e24 >= 0x04) { + MGAG200E4ComputePLLParam(pScrn, f_out, &m, &n, &p); + } else { + MGAG200SEComputePLLParam(pScrn, f_out, &m, &n, &p); + } pReg->DacRegs[ MGA1064_PIX_PLLC_M ] = m; pReg->DacRegs[ MGA1064_PIX_PLLC_N ] = n; @@ -902,7 +1043,14 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out ) pReg->PllN = n; pReg->PllP = p; } else if (pMga->is_G200WB) { - MGAG200WBComputePLLParam(pScrn, f_out, &m, &n, &p); + if (pMga->Chipset == PCI_CHIP_MGAG200_EW3_PCI) + { + MGAG200EW3ComputePLLParam(pScrn, f_out, &m, &n, &p); + } + else + { + MGAG200WBComputePLLParam(pScrn, f_out, &m, &n, &p); + } pReg->PllM = m; pReg->PllN = n; @@ -1092,6 +1240,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) break; case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: pReg->DacRegs[MGA1064_VREF_CTL] = 0x07; pReg->Option = 0x41049120; pReg->Option2 = 0x0000b000; @@ -1232,7 +1381,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) if (pMga->is_G200WB){ pReg->ExtVga[1] |= 0x88; } - pReg->ExtVga_Index24 = 0x05; + pReg->ExtVga_MgaReq = 0x05; pVga->CRTC[0] = ht - 4; pVga->CRTC[1] = hd; @@ -1481,7 +1630,12 @@ MGA_NOT_HAL( { outMGAdac(0x90, mgaReg->Dac_Index90); } - + if (pMga->is_G200SE && (pMga->reg_1e24 >= 0x04)) { + outMGAdac( 0x1a, 0x09); + usleep(500); + outMGAdac( 0x1a, 0x01); + } + if (!MGAISGx50(pMga)) { /* restore pci_option register */ #ifdef XSERVER_LIBPCIACCESS @@ -1528,7 +1682,15 @@ MGA_NOT_HAL( if (pMga->is_G200ER) { OUTREG8(MGAREG_CRTCEXT_INDEX, 0x24); - OUTREG8(MGAREG_CRTCEXT_DATA, mgaReg->ExtVga_Index24); + OUTREG8(MGAREG_CRTCEXT_DATA, mgaReg->ExtVga_MgaReq); + } + + if (pMga->is_G200WB) { + if(pMga->Chipset == PCI_CHIP_MGAG200_EW3_PCI) + { + OUTREG8(MGAREG_CRTCEXT_INDEX, 0x34); + OUTREG8(MGAREG_CRTCEXT_DATA, mgaReg->ExtVga_MgaReq); + } } /* This handles restoring the generic VGA registers. */ @@ -1717,8 +1879,16 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, if (pMga->is_G200ER) { OUTREG8(MGAREG_CRTCEXT_INDEX, 0x24); - mgaReg->ExtVga_Index24 = INREG8(MGAREG_CRTCEXT_DATA); - } + mgaReg->ExtVga_MgaReq = INREG8(MGAREG_CRTCEXT_DATA); + } + if (pMga->is_G200WB) + { + if(pMga->Chipset == PCI_CHIP_MGAG200_EW3_PCI) + { + OUTREG8(MGAREG_CRTCEXT_INDEX, 0x34); + mgaReg->ExtVga_MgaReq = INREG8(MGAREG_CRTCEXT_DATA); + } + } #ifdef DEBUG ErrorF("Saved values:\nDAC:"); diff --git a/driver/xf86-video-mga/src/mga_driver.c b/driver/xf86-video-mga/src/mga_driver.c index d1b2d8533..7b46561b3 100644 --- a/driver/xf86-video-mga/src/mga_driver.c +++ b/driver/xf86-video-mga/src/mga_driver.c @@ -87,7 +87,7 @@ #include "mga_macros.h" #include "mga_maven.h" -#ifdef HAVE_XAA_H +#ifdef USE_XAA #include "xaa.h" #endif @@ -315,7 +315,7 @@ static const struct mga_device_attributes attribs[] = { }, /* G200SE A PCI */ - [10] = { 0, 1, 0, 0, 1, 0, 0, 1, new_BARs, + [10] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs, (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION), { { 50000, 230000 }, /* System VCO frequencies */ @@ -331,7 +331,7 @@ static const struct mga_device_attributes attribs[] = { }, /* G200SE B PCI */ - [11] = { 0, 1, 0, 0, 1, 0, 0, 1, new_BARs, + [11] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs, (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION), { { 50000, 114000 }, /* System VCO frequencies */ @@ -408,6 +408,22 @@ static const struct mga_device_attributes attribs[] = { }, 16384, 0x4000, /* Memory probe size & offset values */ + }, + + /* G200WB */ + [16] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs, + (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION), + { + { 50000, 230000 }, /* System VCO frequencies */ + { 50000, 203400 }, /* Pixel VCO frequencies */ + { 0, 0 }, /* Video VCO frequencies */ + 45000, /* Memory clock */ + 27050, /* PLL reference frequency */ + 0, /* Supports fast bitblt? */ + MGA_HOST_PCI /* Host interface */ + }, + + 16384, 0x4000, /* Memory probe size & offset values */ } }; @@ -438,7 +454,9 @@ static const struct pci_id_match mga_device_match[] = { MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EH_PCI, 14 ), - MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_ER_PCI, 15 ), + MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_ER_PCI, 15 ), + + MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EW3_PCI, 16 ), { 0, 0, 0 }, }; @@ -459,6 +477,7 @@ static SymTabRec MGAChipsets[] = { { PCI_CHIP_MGAG200_EV_PCI, "mgag200 EV Maxim" }, { PCI_CHIP_MGAG200_ER_PCI, "mgag200 ER SH7757" }, { PCI_CHIP_MGAG200_WINBOND_PCI, "mgag200 eW Nuvoton" }, + { PCI_CHIP_MGAG200_EW3_PCI, "mgag200 eW3 Nuvoton" }, { PCI_CHIP_MGAG200_EH_PCI, "mgag200eH" }, { PCI_CHIP_MGAG400, "mgag400" }, { PCI_CHIP_MGAG550, "mgag550" }, @@ -484,6 +503,8 @@ static PciChipsets MGAPciChipsets[] = { RES_SHARED_VGA }, { PCI_CHIP_MGAG200_WINBOND_PCI, PCI_CHIP_MGAG200_WINBOND_PCI, RES_SHARED_VGA }, + { PCI_CHIP_MGAG200_EW3_PCI, PCI_CHIP_MGAG200_EW3_PCI, + RES_SHARED_VGA }, { PCI_CHIP_MGAG200_EH_PCI, PCI_CHIP_MGAG200_EH_PCI, RES_SHARED_VGA }, { PCI_CHIP_MGAG400, PCI_CHIP_MGAG400, RES_SHARED_VGA }, @@ -923,6 +944,9 @@ MGAProbe(DriverPtr drv, int flags) attrib_no = 15; break; + case PCI_CHIP_MGAG200_EW3_PCI: + attrib_no = 16; + break; default: return FALSE; @@ -1541,7 +1565,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pMga->is_G200SE = (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI); pMga->is_G200EV = (pMga->Chipset == PCI_CHIP_MGAG200_EV_PCI); - pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI); + pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI) + || (pMga->Chipset == PCI_CHIP_MGAG200_EW3_PCI); pMga->is_G200EH = (pMga->Chipset == PCI_CHIP_MGAG200_EH_PCI); pMga->is_G200ER = (pMga->Chipset == PCI_CHIP_MGAG200_ER_PCI); @@ -1911,14 +1936,12 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) char *s = xf86GetOptValString(pMga->Options, OPTION_ACCELMETHOD); #endif pMga->NoAccel = FALSE; + pMga->Exa = FALSE; #ifdef USE_EXA - pMga->Exa = TRUE; - if (!xf86NameCmp(s, "XAA")) { - pMga->Exa = FALSE; + if (!xf86NameCmp(s, "EXA")) { + pMga->Exa = TRUE; from = X_CONFIG; } -#else - pMga->Exa = FALSE; #endif xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration\n", pMga->Exa ? "EXA" : "XAA"); @@ -2051,6 +2074,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGAG200_SE_A_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: @@ -2165,8 +2189,9 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGAG200_SE_A_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: - case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: pMga->SrcOrg = 0; pMga->DstOrg = 0; @@ -2349,6 +2374,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGAG200_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: @@ -2596,7 +2622,8 @@ MGAMapMem(ScrnInfoPtr pScrn) pciaddr_t fbsize = pMga->FbMapSize; err = pci_device_map_range(dev, fbaddr, fbsize, - PCI_DEV_MAP_FLAG_WRITABLE, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, (void **)&pMga->FbBase); if (err) { @@ -3827,7 +3854,7 @@ MGAValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 244) return MODE_BANDWIDTH; } else { - if (pMga->reg_1e24 >= 0x02) { + if (pMga->reg_1e24 == 0x02) { if (mode->HDisplay > 1920) return MODE_VIRTUAL_X; if (mode->VDisplay > 1200) @@ -3839,12 +3866,15 @@ MGAValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) } else if (pMga->is_G200WB){ if (mode->Flags & V_DBLSCAN) return MODE_NO_DBLESCAN; - if (pMga->KVM && mode->HDisplay > 1280) - return MODE_VIRTUAL_X; - if (pMga->KVM && mode->VDisplay > 1024) - return MODE_VIRTUAL_Y; - if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 318.77) - return MODE_BANDWIDTH; + if (pMga->Chipset != PCI_CHIP_MGAG200_EW3_PCI) + { + if (pMga->KVM && mode->HDisplay > 1280) + return MODE_VIRTUAL_X; + if (pMga->KVM && mode->VDisplay > 1024) + return MODE_VIRTUAL_Y; + if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 318.77) + return MODE_BANDWIDTH; + } } else if (pMga->is_G200EV && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 327)) { return MODE_BANDWIDTH; diff --git a/driver/xf86-video-mga/src/mga_exa.c b/driver/xf86-video-mga/src/mga_exa.c index 8bcc0c3ed..c4e4d9062 100644 --- a/driver/xf86-video-mga/src/mga_exa.c +++ b/driver/xf86-video-mga/src/mga_exa.c @@ -318,6 +318,11 @@ mgaGetTexFormat(PicturePtr pPict) static Bool mgaCheckSourceTexture(int tmu, PicturePtr pPict) { + if (!pPict->pDrawable) { + DEBUG_MSG(("Solid / gradient pictures not supported\n")); + return FALSE; + } + int w = pPict->pDrawable->width; int h = pPict->pDrawable->height; @@ -354,7 +359,7 @@ static Bool mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, PicturePtr pDstPict) { - MGAPtr pMga = xf86ScreenToScrn(pSrcPict->pDrawable->pScreen)->driverPrivate; + MGAPtr pMga = xf86ScreenToScrn(pDstPict->pDrawable->pScreen)->driverPrivate; if (op >= sizeof(mgaBlendOp) / sizeof(mgaBlendOp[0])) { DEBUG_MSG(("unsupported op %x\n", op)); @@ -521,6 +526,7 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, { PMGA(pDst); CARD32 fcol = 0xff000000, ds0 = 0, ds1 = 0, cmd, blendcntl; + if (!pSrc || !pSrcPict->pDrawable) return FALSE; mgaSetup(pMga, pDst, pDstPict, 2); OUTREG(MGAREG_DSTORG, exaGetPixmapOffset(pDst)); @@ -723,31 +729,6 @@ mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, return TRUE; } -static Bool -mgaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, - char *dst, int dst_pitch) -{ - PMGA(pSrc); - - char *src = (char *) exaGetPixmapFirstPixel(pSrc); - int src_pitch = exaGetPixmapPitch(pSrc); - - int cpp = (pSrc->drawable.bitsPerPixel + 7) / 8; - int bytes = w * cpp; - - src += y * src_pitch + x * cpp; - - QUIESCE_DMA(pSrc); - - while (h--) { - memcpy (dst, src, bytes); - src += src_pitch; - dst += dst_pitch; - } - - return TRUE; -} - static void mgaWaitMarker(ScreenPtr pScreen, int marker) { @@ -886,7 +867,6 @@ mgaExaInit(ScreenPtr pScreen) pExa->Copy = mgaCopy; pExa->DoneCopy = mgaNoopDone; -#if 0 if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550) { pExa->CheckComposite = mgaCheckComposite; @@ -896,8 +876,6 @@ mgaExaInit(ScreenPtr pScreen) } pExa->UploadToScreen = mgaUploadToScreen; - pExa->DownloadFromScreen = mgaDownloadFromScreen; -#endif #ifdef MGADRI if (pMga->directRenderingEnabled) diff --git a/driver/xf86-video-mga/src/mga_merge.c b/driver/xf86-video-mga/src/mga_merge.c index 6d7b71e41..a25730643 100644 --- a/driver/xf86-video-mga/src/mga_merge.c +++ b/driver/xf86-video-mga/src/mga_merge.c @@ -353,9 +353,10 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) case PCI_CHIP_MGAG200_SE_A_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: - case PCI_CHIP_MGAG200_ER_PCI: + case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: MGAGSetupFuncs(pScrn); @@ -505,6 +506,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) case PCI_CHIP_MGAG200_SE_A_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: diff --git a/driver/xf86-video-mga/src/mga_storm.c b/driver/xf86-video-mga/src/mga_storm.c index 84a4c8c20..4ef655b56 100644 --- a/driver/xf86-video-mga/src/mga_storm.c +++ b/driver/xf86-video-mga/src/mga_storm.c @@ -1148,6 +1148,7 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn ) case PCI_CHIP_MGAG200_SE_A_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: + case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: |