From 7b0e9d2e6b83b1748466240dcf22379840aa484a Mon Sep 17 00:00:00 2001 From: matthieu Date: Sat, 5 Jan 2019 10:30:12 +0000 Subject: [PATCH] Update to xf86-video-mga 2.0.0 Commited from a machine using a Matrox G550 card. --- driver/xf86-video-mga/ChangeLog | 280 ++++++++++++++++++++++++ driver/xf86-video-mga/Makefile.am | 2 +- driver/xf86-video-mga/Makefile.in | 4 +- driver/xf86-video-mga/README | 25 --- driver/xf86-video-mga/README.md | 18 ++ driver/xf86-video-mga/README_HALLIB | 209 ------------------ driver/xf86-video-mga/aclocal.m4 | 81 +++++-- driver/xf86-video-mga/configure | 102 ++++++--- driver/xf86-video-mga/configure.ac | 4 +- driver/xf86-video-mga/src/Makefile.am | 3 - driver/xf86-video-mga/src/Makefile.in | 27 +-- driver/xf86-video-mga/src/binding.h | 222 ------------------- driver/xf86-video-mga/src/client.h | 28 --- driver/xf86-video-mga/src/mga.h | 24 +- driver/xf86-video-mga/src/mga_arc.c | 2 + driver/xf86-video-mga/src/mga_bios.c | 1 - driver/xf86-video-mga/src/mga_dac3026.c | 8 +- driver/xf86-video-mga/src/mga_dacG.c | 93 +++++--- driver/xf86-video-mga/src/mga_dga.c | 8 +- driver/xf86-video-mga/src/mga_dri.c | 241 +------------------- driver/xf86-video-mga/src/mga_dripriv.h | 11 - driver/xf86-video-mga/src/mga_driver.c | 124 +++++++---- driver/xf86-video-mga/src/mga_exa.c | 20 +- driver/xf86-video-mga/src/mga_g450pll.c | 10 +- driver/xf86-video-mga/src/mga_halmod.c | 41 ---- driver/xf86-video-mga/src/mga_merge.c | 16 +- driver/xf86-video-mga/src/mga_storm.c | 32 +-- driver/xf86-video-mga/src/mga_video.c | 37 +++- 28 files changed, 689 insertions(+), 984 deletions(-) delete mode 100644 driver/xf86-video-mga/README create mode 100644 driver/xf86-video-mga/README.md delete mode 100644 driver/xf86-video-mga/README_HALLIB delete mode 100644 driver/xf86-video-mga/src/binding.h delete mode 100644 driver/xf86-video-mga/src/client.h delete mode 100644 driver/xf86-video-mga/src/mga_halmod.c diff --git a/driver/xf86-video-mga/ChangeLog b/driver/xf86-video-mga/ChangeLog index 31def7952..5e962bd9f 100644 --- a/driver/xf86-video-mga/ChangeLog +++ b/driver/xf86-video-mga/ChangeLog @@ -1,3 +1,283 @@ +commit 924c310dfecbfb916f0e81c03f1142a401bed056 +Author: Kevin Brace +Date: Fri Dec 7 16:43:46 2018 -0800 + + Version bumped to Version 2.0.0 + + Signed-off-by: Kevin Brace + +commit ada903eea2e138643faa721f37737ed885363bf7 +Author: Kevin Brace +Date: Fri Dec 7 16:21:44 2018 -0800 + + Version bumped to Version 1.6.901 + + Signed-off-by: Kevin Brace + +commit 54f0f0723d4291a23a2f1c10fcf33560f9a4340a +Author: Kevin Brace +Date: Thu Dec 6 20:49:31 2018 -0800 + + Remove last remnants of old Matrox HAL + + Apparently, commit 94bbeb132c7eda912d1b402a1a91ca7cbbf5e6a1 + missed removing a few more files related to old Matrox HAL. + + Signed-off-by: Kevin Brace + Reviewed-by: Alan Coopersmith + +commit b293b0956d518b2cc3833d0d2d846301fe35c0a0 +Author: Kevin Brace +Date: Thu Nov 29 10:41:23 2018 -0800 + + Version bumped to Version 1.6.900 + + Signed-off-by: Kevin Brace + +commit c5d295f06c83ba69811c17880e033cbd0fdb52b1 +Author: Henry Zhao +Date: Mon Nov 26 13:15:24 2018 -0800 + + Write 8 bits instead of 32 to MGAREG_CACHEFLUSH + + Fixes misaligned address crash when EXA is enabled on Solaris SPARC + (Oracle Bug id 22993744) + + Signed-off-by: Alan Coopersmith + +commit 11abbd45e0c93b672a7e8d5730560a6b351c7a9b +Author: Matthieu Herrb +Date: Mon Nov 26 21:12:05 2018 +0100 + + Use fabs() to compute absolute value of floating point number. + + Fixes a warning from clang and looks like it was a real bug. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + +commit 4ce40b932cdced590af1c32f6f491f63e9a247dd +Author: Kevin Brace +Date: Mon Nov 26 11:03:39 2018 -0800 + + Suppression of a compilation error when XAA is not in use + + Signed-off-by: Kevin Brace + +commit 4017c6e91f8938f1f1617e53e30ee1d3d10d490c +Author: Kevin Brace +Date: Mon Nov 26 11:02:30 2018 -0800 + + Convert most HAVE_XAA_H conditional compilation labels to USE_XAA + + Signed-off-by: Kevin Brace + +commit c5922dcc3ff26c9b1291e90ecedee35f97bc51c8 +Author: Kevin Brace +Date: Mon Nov 26 11:01:33 2018 -0800 + + Eliminate set but unused variables + + Signed-off-by: Kevin Brace + +commit 8db8f6b3f323a9d9cd934172c9f4d4a93a6b7394 +Author: Kevin Brace +Date: Mon Nov 26 11:00:32 2018 -0800 + + Eliminate unused variables + + Care had to be taken to properly handle XAA usage situation + + Signed-off-by: Kevin Brace + +commit 94c70f888b3e3b1e4c9f324f188279f276c9cbbd +Author: Alan Coopersmith +Date: Sun Nov 25 14:31:30 2018 -0800 + + Update configure.ac bug URL for gitlab migration + + Signed-off-by: Alan Coopersmith + +commit a939aa56b3af4418d0c026a3775fde7288b0cca7 +Author: Mikulas Patocka +Date: Tue Nov 20 08:41:14 2018 -0800 + + mga_drv: fix image corruption due to memcpy reordering + + The memcpy specification doesn't specify how the destination is written - + and on glibc 2.19 memcpy is doing some bytewise writes with the rep stosb + instruction. These bytewise writes confuse the hardware (because it + expects 32-bit writes) and result in image corruption. + + This patch replaces memcpy with explicit writes, so that the sequential + write order and 32-bit write size is guaranteed. We use the "volatile" + attribute to make sure that compiler optimizations won't cause write + reordering. When reading the memory, we use a structure with "packed" + attribute to avoid unaligned traps on RISC machines. + + Tested-by: Kevin Brace + Signed-off-by: Mikulas Patocka + +commit 0f4883f0b8ebfd105d5cee93841bc69f0f2b60b7 +Author: Alan Coopersmith +Date: Sun Nov 18 13:25:33 2018 -0800 + + Update README for gitlab migration + + Signed-off-by: Alan Coopersmith + +commit 34f37fe119f07e1e7b79964de08ac601a0753a7f +Author: Nicolas Kaiser +Date: Sun May 29 11:36:11 2011 +0200 + + fix typo in MGADRIMoveBuffersXAA() + + Fix typo in MGADRIMoveBuffersXAA(). + + Signed-off-by: Nicolas Kaiser + Reviewed-by: Cyril Brulebois + +commit 31544d805f99da54d5d3c658ccc137813dbde52b +Author: Mikulas Patocka +Date: Tue Feb 13 01:43:13 2018 +0100 + + mga_drv: use exa by default + + If the Xserver doesn't support XAA, we must turn EXA on by default - + otherwise we end up with no acceleration at all. + + Reviewed-by: Matt Turner + Signed-off-by: Mikulas Patocka + +commit 97c801e49251ffedf0eebd0563c737318433f114 +Author: Mikulas Patocka +Date: Tue Feb 13 01:42:41 2018 +0100 + + mga_drv: fix warning + + Fix warnings in the MGA driver. There's no functional change. + + Reviewed-by: Matt Turner + Signed-off-by: Mikulas Patocka + +commit 767c19e7142da1060586b1ff2b5e7253b6d6276b +Author: Mikulas Patocka +Date: Tue Feb 13 01:42:27 2018 +0100 + + mga_drv: fix structure definition + + Fix missing entry in structure definition. + + Reviewed-by: Matt Turner + Signed-off-by: Mikulas Patocka + +commit b9aab0dcb171ab936a8581d8287aac3a90652a09 +Author: Mikulas Patocka +Date: Tue Feb 13 01:42:08 2018 +0100 + + mga_drv: fix a typo + + Fix a typo that causes dynamic symbol lookup failure and xserver crash. + + Reviewed-by: Matt Turner + Signed-off-by: Mikulas Patocka + +commit 2998868964b2f3a56b6759fd8dc4462d812dbe1a +Author: Emil Velikov +Date: Mon Jul 17 11:05:57 2017 +0100 + + xf86-video-mga: remove the GlxSetVisualConfigs stub and friends + + The function was an empty since 2008 at least. Remove it alongside the + unused GLX visuals code. + + With this all the GL/GLX dependencies in the driver are gone. + + Cc: Mathieu Larouche + Cc: Dave Airlie + Signed-off-by: Emil Velikov + --- + There's a GLX reference in mga_ucode.h - a file which was seemingly + never used since day 1. I'm not going to bother with that, since I've + taken enough of a diversion already ;-) + +commit 42fabf69c33d0e803eb661cc06217611bc3c9048 +Author: Mathieu Larouche +Date: Tue Jun 13 13:43:45 2017 -0400 + + xf86-video-mga: Fix to always set HiPri for G200e4 V2 + + - Changed the HiPri value for G200e4 to always be 0. + - Added Bandwith limitation to block resolution above 1920x1200x60Hz + + - (V2): Pulled out ulMemoryBandwidth of condition so it's always initialized + as reviewed by : Stefan Dirsch + + Reviewed-by: Samer El-Haj-Mahmoud + +commit e55abc95c2b7f7cb8de73e1e21688fb5b5c08d5c +Author: Mathieu Larouche +Date: Tue Feb 7 11:12:14 2017 -0500 + + xf86-video-mga: Add support for a new G200eH3 device + + - Added support for the new deviceID for G200eH3 + - Added PLL algorithm for the G200eH3 + - Removed the bandwidth limitation for the G200eH3 + + Signed-off-by: Mathieu Larouche + Reviewed-by: Dave Airlie + +commit 2ccc50072ccb70411e5e32644e74ef7c6b33f628 +Author: Mihail Konev +Date: Thu Jan 26 14:00:22 2017 +1000 + + autogen: add default patch prefix + + Signed-off-by: Mihail Konev + +commit b9f57d1717fe9035d354b47e877ae110546d6f28 +Author: Emil Velikov +Date: Mon Mar 9 12:00:52 2015 +0000 + + autogen.sh: use quoted string variables + + Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent + fall-outs, when they contain space. + + Signed-off-by: Emil Velikov + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0b8e81d2a435e190e1a1b81e776423d255b4cb9a +Author: Peter Hutterer +Date: Tue Jan 24 10:32:07 2017 +1000 + + autogen.sh: use exec instead of waiting for configure to finish + + Syncs the invocation of configure with the one from the server. + + Signed-off-by: Peter Hutterer + Reviewed-by: Emil Velikov + +commit 7407e79cd62f7209a5fe0265882d0ee3d0007196 +Author: Colin Walters +Date: Wed Jan 4 17:37:06 2012 -0500 + + autogen.sh: Implement GNOME Build API + + http://people.gnome.org/~walters/docs/build-api.txt + + Signed-off-by: Adam Jackson + +commit 9ae2ad4ee9b0a9ad64fec0f88b68886d7b0b8663 +Author: Peter Hutterer +Date: Thu Jan 26 11:18:06 2017 +1000 + + configure: Drop AM_MAINTAINER_MODE + + Signed-off-by: Peter Hutterer + commit 979e0e73eb3424b6a97746e29c8b4a5b7e86196e Author: Matt Turner Date: Tue Jan 17 14:40:48 2017 -0800 diff --git a/driver/xf86-video-mga/Makefile.am b/driver/xf86-video-mga/Makefile.am index 75d689806..12762ac37 100644 --- a/driver/xf86-video-mga/Makefile.am +++ b/driver/xf86-video-mga/Makefile.am @@ -21,7 +21,7 @@ SUBDIRS = src man util MAINTAINERCLEANFILES = ChangeLog INSTALL -EXTRA_DIST = README_HALLIB mga_PInS.txt +EXTRA_DIST = mga_PInS.txt README.md .PHONY: ChangeLog INSTALL diff --git a/driver/xf86-video-mga/Makefile.in b/driver/xf86-video-mga/Makefile.in index 7117714ff..ceae85e0f 100644 --- a/driver/xf86-video-mga/Makefile.in +++ b/driver/xf86-video-mga/Makefile.in @@ -70,7 +70,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure COPYING ChangeLog INSTALL compile \ config.guess config.sub depcomp install-sh ltmain.sh missing @@ -308,7 +308,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src man util MAINTAINERCLEANFILES = ChangeLog INSTALL -EXTRA_DIST = README_HALLIB mga_PInS.txt +EXTRA_DIST = mga_PInS.txt README.md all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/driver/xf86-video-mga/README b/driver/xf86-video-mga/README deleted file mode 100644 index 37d6a3527..000000000 --- a/driver/xf86-video-mga/README +++ /dev/null @@ -1,25 +0,0 @@ -xf86-video-mga - Matrox video driver for the Xorg X server - -All questions regarding this software should be directed at the -Xorg mailing list: - - http://lists.freedesktop.org/mailman/listinfo/xorg - -Please submit bug reports to the Xorg bugzilla: - - https://bugs.freedesktop.org/enter_bug.cgi?product=xorg - -The master development code repository can be found at: - - git://anongit.freedesktop.org/git/xorg/driver/xf86-video-mga - - http://cgit.freedesktop.org/xorg/driver/xf86-video-mga - -For patch submission instructions, see: - - http://www.x.org/wiki/Development/Documentation/SubmittingPatches - -For more information on the git code manager, see: - - http://wiki.x.org/wiki/GitPage - diff --git a/driver/xf86-video-mga/README.md b/driver/xf86-video-mga/README.md new file mode 100644 index 000000000..7e3b63187 --- /dev/null +++ b/driver/xf86-video-mga/README.md @@ -0,0 +1,18 @@ +xf86-video-mga - Matrox video driver for the Xorg X server +---------------------------------------------------------- + +All questions regarding this software should be directed at the +Xorg mailing list: + + https://lists.x.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga + +Please submit bug reports and requests to merge patches there. + +For patch submission instructions, see: + + https://www.x.org/wiki/Development/Documentation/SubmittingPatches + diff --git a/driver/xf86-video-mga/README_HALLIB b/driver/xf86-video-mga/README_HALLIB deleted file mode 100644 index 432e42ecf..000000000 --- a/driver/xf86-video-mga/README_HALLIB +++ /dev/null @@ -1,209 +0,0 @@ -HAL Documentation - -This documentation provides preliminary explaination of the HAL library, a -more detailed version of this document is in the process of being written -and will be released with future driver builds. - ------------------------------------------------------------- -MGAOpenLibrary - -Description: Link Client functions with HAL Librery - -Input: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -LPBARDHANDLElpClient: Pointer to the client stucture - -ulClientSize: Size of the client structure - -Error: -return 0 on success - -------------------------------------------------------------- -MGAGetHardwareInfo - -Description: - -Fills MGAWINFO structure. - -struct { -ULONG UlCapsFirstOutput; -ULONG ulCapsSecondOutput; -ULONG ulVideoMemory; -} FAR *LPMGAHWINFO; - -#define MGAHWINFOCAPS_CRTC1_DIGITAL (1L << 1) -#define MGAHWINFOCAPS_CRTC1_TV (1L << 2) -#define MGAHWINFOCAPS_CRTC2_ANALOG (1L << 3) -#define MGAHWINFOCAPS_CRTC2_DIGITAL (1L << 4) -#define MGAHWINFOCAPS_CRTC2_TV (1L << 5) -#define MGAHWINFOCAPS_OUTPUT_VGA (1L << 6) -#define MGAHWINFOCAPS_CRTC2 (MGAHWINFOCAPS_CRTC2_ANALOG | MGAHWINFOCAPS_CRTC2_DIGITAL | MGAHWINFOCAPS_CRTC2_TV) -#define MGAHWINFOCAPS_OUTPUT_ANALOG (MGAHWINFOCAPS_CRTC1_ANALOG | MGAHWINFOCAPS_CRTC2_ANALOG) -#define MGAHWINFOCAPS_OUTPUT_DIGITAL (MGAHWINFOCAPS_CRTC1_DIGITAL | MGAHWINFOCAPS_CRTC2_DIGITAL) -#define MGAHWINFOCAPS_OUTPUT_TV (MGAHWINFOCAPS_CRTC1_TV | MGAHWINFOCAPS_CRTC2_TV) - -example: - -if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_TV ) -{ - ErrorF("TV detected\n"); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV detected\n "); -} -if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_DIGITAL) -{ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Digital Screen detected\n "); -} - -Inputs: - -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -LPMGAHWINFO pMgaHwInfo: Handle to the board structure containing all -the information about the specific Board. - -Error: -Returns 0 on success ------------------------------------------------------------- -MGAValidateMode - -Description: - -Validates the mode given by client. - -Here are the different options for pMgaModeInfo->flOutput: - -MGAMODEINFO_FORCE_PITCH -MGAMODEINFO_FORCE_DISPLAYORG -MGAMODEINFO_SECOND_CRTC -MGAMODEINFO_ANALOG1 -MGAMODEINFO_ANALOG2 -MGAMODEINFO_DIGITAL1 -MGAMODEINFO_DIGITAL2 -MGAMODEINFO_TV - -These options can be combined together to set different combinations. -Example: - -/*The second crtc outputs to a digital screen*/ -pMgaModeInfo->flOutput= MGAMODEINFO_DIGITAL2 | MGAMODEINFO_SECOND_CRTC -| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG; - -- or - - -/*The second crtc outputs to an analog screen*/ -pMgaModeInfo-> flOutput = MGAMODEINFO_ANALOG2| MGAMODEINFO_SECOND_CRTC -| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG; - -- or - - -/*The second crtc outputs to a tv*/ -pMga->pMgaModeInfo->flOutput = MGAMODEINFO_TV | MGAMODEINFO_SECOND_CRTC | MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG; - -Inputs: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -LPMGAMODEINFO pMgaModeInfo: Pointer to structure containing information about a specific display mode. (You need to fill the structure except the video parameters part which will be filled by the function). - -Error: -Returns 0 on success - -------------------------------------------------------------- -MGASetMode - -Description: - -Initializes the board. - -Here are the different options for pMgaModeInfo->flOutput: - -MGAMODEINFO_FORCE_PITCH -MGAMODEINFO_FORCE_DISPLAYORG -MGAMODEINFO_SECOND_CRTC -MGAMODEINFO_ANALOG1 -MGAMODEINFO_ANALOG2 -MGAMODEINFO_DIGITAL1 -MGAMODEINFO_DIGITAL2 -MGAMODEINFO_TV - -These options can be combined together to set different combinations. -Example: - -/*The second crtc outputs to a digital screen*/ -pMgaModeInfo->flOutput= MGAMODEINFO_DIGITAL2 | MGAMODEINFO_SECOND_CRTC -| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG; - -- or - - -/*The second crtc outputs to an analog screen*/ -pMgaModeInfo-> flOutput = MGAMODEINFO_ANALOG2| MGAMODEINFO_SECOND_CRTC -| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG; - -- or - - -/*The second crtc outputs to a tv*/ -pMga->pMgaModeInfo->flOutput = MGAMODEINFO_TV | MGAMODEINFO_SECOND_CRTC | MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG; - -Inputs: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -LPMGAMODEINFO pMgaModeInfo: Pointer to structure containing information about a specific display mode. (You need to fill the structure except the video parameters part which will be filled by the function). - -Error: -Returns 0 on success - ------------------------------------------------------------- - -MGASetVgaMode - -Description: - -Switchs the VGA mode - -Inputs: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -Error: -Returns 0 on success - ------------------------------------------------------------- - -MGARestoreVgaState - -Description: - -Restores the VGA State - -Inputs: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -Error: -Returns 0 on success - ------------------------------------------------------------- - -MGASaveVgaState - -Description: - -Saves the VGA state - -Inputs: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -Error: -Returns 0 on success - ------------------------------------------------------------- - -MGACloseLibrary - -Description: - -Closes the library - -Inputs: -LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board. - -Error: -Returns 0 on success diff --git a/driver/xf86-video-mga/aclocal.m4 b/driver/xf86-video-mga/aclocal.m4 index 075dc526f..7d21af36b 100644 --- a/driver/xf86-video-mga/aclocal.m4 +++ b/driver/xf86-video-mga/aclocal.m4 @@ -8806,6 +8806,23 @@ m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) 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. # # This file is free software; the Free Software Foundation @@ -9829,7 +9846,7 @@ AC_SUBST([am__untar]) dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl -dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. +dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), @@ -9866,7 +9883,7 @@ dnl DEALINGS IN THE SOFTWARE. # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.19.0]) +m4_define([vers_have], [1.19.2]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -9944,6 +9961,17 @@ AC_DEFUN([XORG_MANPAGE_SECTIONS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) +case $host_os in + solaris*) + # Solaris 2.0 - 11.3 use SysV man page section numbers, so we + # check for a man page file found in later versions that use + # traditional section numbers instead + AC_CHECK_FILE([/usr/share/man/man7/attributes.7], + [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true]) + ;; + *) SYSV_MAN_SECTIONS=false ;; +esac + if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi @@ -9959,9 +9987,9 @@ if test x$LIB_MAN_DIR = x ; then fi if test x$FILE_MAN_SUFFIX = x ; then - case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; + case $SYSV_MAN_SECTIONS in + true) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then @@ -9969,9 +9997,9 @@ if test x$FILE_MAN_DIR = x ; then fi if test x$MISC_MAN_SUFFIX = x ; then - case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; + case $SYSV_MAN_SECTIONS in + true) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then @@ -9979,9 +10007,9 @@ if test x$MISC_MAN_DIR = x ; then fi if test x$DRIVER_MAN_SUFFIX = x ; then - case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; + case $SYSV_MAN_SECTIONS in + true) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then @@ -9989,9 +10017,9 @@ if test x$DRIVER_MAN_DIR = x ; then fi if test x$ADMIN_MAN_SUFFIX = x ; then - case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; + case $SYSV_MAN_SECTIONS in + true) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then @@ -10252,13 +10280,24 @@ m4_ifval([$1], fi]) # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], - [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) + [# Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" + +EOF + AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], + [have_xmlto_text=yes], + [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) @@ -11654,8 +11693,9 @@ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ -echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ +touch \$(top_srcdir)/INSTALL; \ +echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc @@ -11716,10 +11756,11 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ # # AC_DEFUN([XORG_CHANGELOG], [ -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ -|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ -echo 'git directory not found: installing possibly empty changelog.' >&2)" +|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ +touch \$(top_srcdir)/ChangeLog; \ +echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG diff --git a/driver/xf86-video-mga/configure b/driver/xf86-video-mga/configure index eee34ee28..3ed2f15a1 100644 --- a/driver/xf86-video-mga/configure +++ b/driver/xf86-video-mga/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xf86-video-mga 1.6.5. +# Generated by GNU Autoconf 2.69 for xf86-video-mga 2.0.0. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -275,7 +275,7 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg +$0: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/issues $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do @@ -591,9 +591,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xf86-video-mga' PACKAGE_TARNAME='xf86-video-mga' -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_VERSION='2.0.0' +PACKAGE_STRING='xf86-video-mga 2.0.0' +PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/issues' PACKAGE_URL='' ac_unique_file="Makefile.am" @@ -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.5 to adapt to many kinds of systems. +\`configure' configures xf86-video-mga 2.0.0 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.5:";; + short | recursive ) echo "Configuration of xf86-video-mga 2.0.0:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -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.5 +xf86-video-mga configure 2.0.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1963,9 +1963,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------------------------------------------- ## -## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## -## ---------------------------------------------------------------------- ##" +( $as_echo "## ------------------------------------------------------------------------------- ## +## Report this to https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/issues ## +## ------------------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -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.5, which was +It was created by xf86-video-mga $as_me 2.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -9867,10 +9867,11 @@ _ACEOF -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ -|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ -echo 'git directory not found: installing possibly empty changelog.' >&2)" +|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ +touch \$(top_srcdir)/ChangeLog; \ +echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" @@ -9878,14 +9879,45 @@ echo 'git directory not found: installing possibly empty changelog.' >&2)" macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ -|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ -echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" +|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ +touch \$(top_srcdir)/INSTALL; \ +echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" +case $host_os in + solaris*) + # Solaris 2.0 - 11.3 use SysV man page section numbers, so we + # check for a man page file found in later versions that use + # traditional section numbers instead + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/man/man7/attributes.7" >&5 +$as_echo_n "checking for /usr/share/man/man7/attributes.7... " >&6; } +if ${ac_cv_file__usr_share_man_man7_attributes_7+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/usr/share/man/man7/attributes.7"; then + ac_cv_file__usr_share_man_man7_attributes_7=yes +else + ac_cv_file__usr_share_man_man7_attributes_7=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_man_man7_attributes_7" >&5 +$as_echo "$ac_cv_file__usr_share_man_man7_attributes_7" >&6; } +if test "x$ac_cv_file__usr_share_man_man7_attributes_7" = xyes; then : + SYSV_MAN_SECTIONS=false +else + SYSV_MAN_SECTIONS=true +fi + + ;; + *) SYSV_MAN_SECTIONS=false ;; +esac + if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi @@ -9901,9 +9933,9 @@ if test x$LIB_MAN_DIR = x ; then fi if test x$FILE_MAN_SUFFIX = x ; then - case $host_os in - solaris*) FILE_MAN_SUFFIX=4 ;; - *) FILE_MAN_SUFFIX=5 ;; + case $SYSV_MAN_SECTIONS in + true) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then @@ -9911,9 +9943,9 @@ if test x$FILE_MAN_DIR = x ; then fi if test x$MISC_MAN_SUFFIX = x ; then - case $host_os in - solaris*) MISC_MAN_SUFFIX=5 ;; - *) MISC_MAN_SUFFIX=7 ;; + case $SYSV_MAN_SECTIONS in + true) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then @@ -9921,9 +9953,9 @@ if test x$MISC_MAN_DIR = x ; then fi if test x$DRIVER_MAN_SUFFIX = x ; then - case $host_os in - solaris*) DRIVER_MAN_SUFFIX=7 ;; - *) DRIVER_MAN_SUFFIX=4 ;; + case $SYSV_MAN_SECTIONS in + true) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then @@ -9931,9 +9963,9 @@ if test x$DRIVER_MAN_DIR = x ; then fi if test x$ADMIN_MAN_SUFFIX = x ; then - case $host_os in - solaris*) ADMIN_MAN_SUFFIX=1m ;; - *) ADMIN_MAN_SUFFIX=8 ;; + case $SYSV_MAN_SECTIONS in + true) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then @@ -10461,7 +10493,7 @@ fi # Define the identity of the package. PACKAGE='xf86-video-mga' - VERSION='1.6.5' + VERSION='2.0.0' cat >>confdefs.h <<_ACEOF @@ -19045,7 +19077,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.5, which was +This file was extended by xf86-video-mga $as_me 2.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19105,13 +19137,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _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.5 +xf86-video-mga config.status 2.0.0 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 3bef1f229..686a6216c 100644 --- a/driver/xf86-video-mga/configure.ac +++ b/driver/xf86-video-mga/configure.ac @@ -23,8 +23,8 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-mga], - [1.6.5], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], + [2.0.0], + [https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/issues], [xf86-video-mga]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) diff --git a/driver/xf86-video-mga/src/Makefile.am b/driver/xf86-video-mga/src/Makefile.am index 20fbdf6ab..dc6d4f607 100644 --- a/driver/xf86-video-mga/src/Makefile.am +++ b/driver/xf86-video-mga/src/Makefile.am @@ -30,8 +30,6 @@ mga_drv_ladir = @moduledir@/drivers mga_drv_la_LIBADD = $(noinst_LTLIBRARIES) mga_drv_la_SOURCES = \ - binding.h \ - client.h \ mga_bios.c \ mga_common.h \ mga_dac3026.c \ @@ -41,7 +39,6 @@ mga_drv_la_SOURCES = \ mga_driver.c \ mga_g450pll.c \ mga.h \ - mga_halmod.c \ mga_hwcurs.c \ mga_macros.h \ mga_maven.h \ diff --git a/driver/xf86-video-mga/src/Makefile.in b/driver/xf86-video-mga/src/Makefile.in index 7e320e29b..7f0e3ae18 100644 --- a/driver/xf86-video-mga/src/Makefile.in +++ b/driver/xf86-video-mga/src/Makefile.in @@ -122,10 +122,9 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(mga_drv_ladir)" LTLIBRARIES = $(mga_drv_la_LTLIBRARIES) mga_drv_la_DEPENDENCIES = -am__mga_drv_la_SOURCES_DIST = binding.h client.h mga_bios.c \ - mga_common.h mga_dac3026.c mga_dacG.c mga_dga.c mga_dh.c \ - mga_driver.c mga_g450pll.c mga.h mga_halmod.c mga_hwcurs.c \ - mga_macros.h mga_maven.h mga_merge.c mga_merge.h \ +am__mga_drv_la_SOURCES_DIST = mga_bios.c mga_common.h mga_dac3026.c \ + mga_dacG.c mga_dga.c mga_dh.c mga_driver.c mga_g450pll.c mga.h \ + mga_hwcurs.c mga_macros.h mga_maven.h mga_merge.c mga_merge.h \ mgareg_flags.h mga_reg.h mga_sarea.h mga_shadow.c mga_ucode.h \ mga_vga.c mga_video.c mga_storm.c compat-api.h mga_dri.c \ mga_dri.h mga_dripriv.h mga_exa.c mga_arc.c @@ -134,9 +133,9 @@ am__mga_drv_la_SOURCES_DIST = binding.h client.h mga_bios.c \ @XAA_TRUE@am__objects_3 = mga_arc.lo am_mga_drv_la_OBJECTS = mga_bios.lo mga_dac3026.lo mga_dacG.lo \ mga_dga.lo mga_dh.lo mga_driver.lo mga_g450pll.lo \ - mga_halmod.lo mga_hwcurs.lo mga_merge.lo mga_shadow.lo \ - mga_vga.lo mga_video.lo mga_storm.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) + mga_hwcurs.lo mga_merge.lo mga_shadow.lo mga_vga.lo \ + mga_video.lo mga_storm.lo $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) mga_drv_la_OBJECTS = $(am_mga_drv_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -345,13 +344,12 @@ mga_drv_la_LTLIBRARIES = mga_drv.la mga_drv_la_LDFLAGS = -module -avoid-version mga_drv_ladir = @moduledir@/drivers mga_drv_la_LIBADD = $(noinst_LTLIBRARIES) -mga_drv_la_SOURCES = binding.h client.h mga_bios.c mga_common.h \ - mga_dac3026.c mga_dacG.c mga_dga.c mga_dh.c mga_driver.c \ - mga_g450pll.c mga.h mga_halmod.c mga_hwcurs.c mga_macros.h \ - mga_maven.h mga_merge.c mga_merge.h mgareg_flags.h mga_reg.h \ - mga_sarea.h mga_shadow.c mga_ucode.h mga_vga.c mga_video.c \ - mga_storm.c compat-api.h $(am__append_1) $(am__append_2) \ - $(am__append_3) +mga_drv_la_SOURCES = mga_bios.c mga_common.h mga_dac3026.c mga_dacG.c \ + mga_dga.c mga_dh.c mga_driver.c mga_g450pll.c mga.h \ + mga_hwcurs.c mga_macros.h mga_maven.h mga_merge.c mga_merge.h \ + mgareg_flags.h mga_reg.h mga_sarea.h mga_shadow.c mga_ucode.h \ + mga_vga.c mga_video.c mga_storm.c compat-api.h $(am__append_1) \ + $(am__append_2) $(am__append_3) all: all-am .SUFFIXES: @@ -439,7 +437,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_exa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_g450pll.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_halmod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_hwcurs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_merge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mga_shadow.Plo@am__quote@ diff --git a/driver/xf86-video-mga/src/binding.h b/driver/xf86-video-mga/src/binding.h deleted file mode 100644 index 616aed786..000000000 --- a/driver/xf86-video-mga/src/binding.h +++ /dev/null @@ -1,222 +0,0 @@ -/************************************************************************************** - - @doc MGA MGA_STRUCT - - @module MGA Structures | Structure of The MGA Layer - @normal Copyright © 1997, Matrox Graphics Inc. - - All Rights Reserved. - - @head3 MGA Structures | - @index struct | MGA_STRUCT - - @end - -***************************************************************************************/ - -#ifndef _BINDING -#define _BINDING - -#ifndef _INTERNALBINDING - -#define BINDING_NOERROR 0x00000000 -#define BINDING_ERROR 0x90000000 -#define FAR -#define DECL - -typedef void VOID; -typedef void FAR *LPVOID; -typedef void FAR *LPBOARDHANDLE; - -typedef long LONG; -typedef unsigned long ULONG; -typedef unsigned long FLONG; -typedef unsigned long FAR *LPULONG; - -typedef char CHAR; -typedef unsigned char UCHAR; -typedef unsigned char FAR*LPUCHAR; - -#endif /* _INTERNALBINDING */ - -/*************************************************************************************************** - MGAHWINFO STRUCTURE - *************************************************************************************************** - @struct MGAHWINFO | Public MGA Board Information - @field OUT ULONG | ulCapsFirstOutput | Capabilities of firts output - @flag Bit 0 | Analog output supported on primary CRTC - @flag Bit 1 | Digital output supported on primary CRTC - @flag Bit 2 | TV output supported on primary CRTC - @flag Bit 3 | Analog output supported on second CRTC - @flag Bit 4 | Digital output supported on second CRTC - @flag Bit 5 | TV output supported on second CRTC - @flag Bit 6 | VGA output supported - @field OUT ULONG | ulCapsSecondOutput | Capabilities of second output - @flag Bit 0 | Analog output supported on primary CRTC - @flag Bit 1 | Digital output supported on primary CRTC - @flag Bit 2 | TV output supported on primary CRTC - @flag Bit 3 | Analog output supported on second CRTC - @flag Bit 4 | Digital output supported on second CRTC - @flag Bit 5 | TV output supported on second CRTC - @flag Bit 6 | VGA output supported - @field OUT ULONG | ulVideoMemory | Total number of video memory in bytes - @end - **************************************************************************************************/ -typedef struct TAGMGAHWINFO { - ULONG ulCapsFirstOutput; - ULONG ulCapsSecondOutput; - ULONG ulVideoMemory; -} MGAHWINFO, FAR *LPMGAHWINFO; - -/*************************************************************************************************** - MGAMODEINFO STRUCTURE - *************************************************************************************************** - @struct MGAMODEINFO | Mode Information - @field IN FLONG | flOutput | Where we want to apply this parameters - @flag Bit 0 | Use second CRTC - @flag Bit 1 | Use primary analog output - @flag Bit 2 | Use secondary analog output - @flag Bit 3 | Use primary digital output - @flag Bit 4 | Use secondary digital output - @flag Bit 5 | Force a particular frame buffer pitch - @flag Bit 6 | Force a particular display origin - @flag Bit 7-31 | Reserved - @field IN ULONG | ulDispWidth | Display Width in pixels - @field IN ULONG | ulDispHeight | Display Height in pixels - @field IN ULONG | ulDeskWidth | Desktop Width in pixels - @field IN ULONG | ulDeskHeight | Desktop Height in pixels - @field IN OUT ULONG | ulFBPitch | Frame Buffer Pitch in pixel - @field IN ULONG | ulBpp | Bits Per Pixels and input format - @flag lower 16 bit | Bits per pixel - 8, 15, 16, 24 or 32 - @flag upper 16 bit | Input format - 0 RGB - 1 RGBA - 2 YcbCr 4:2:0 3 Planes - 3 YcbCr 4:2:0 4 Planes - 4 YcbCr 4:2:2-UYVY - 5 YcbCr 4:2:2-YUY2 - 6-10 none interleave mode - 6 NI RGBA - 7 NI YcbCr 4:2:0 3 Planes - 8 NI YcbCr 4:2:0 4 Planes - 9 NI YcbCr 4:2:2-UYVY - 10 NI YcbCr 4:2:2-YUY2 - @field IN ULONG | ulZoom | Zoom factor - @flag 1x (1), 2x (2) or 4x (4)| - @field IN OUT FLONG | flSignalMode | Signal Mode - @flag Bit 0 | Interlace (0 : Non-interlace / 1: Interlace) - @flag Bit 1 | Overscan (0 : No Overscan / 1 : Overscan) - @flag Bit 2 | Horizontal Sync Polarity (0 : Negative / 1 : Positive) - @flag Bit 3 | Vertical Sync Polarity (0 : Negative / 1 : Positive) - @flag Bit 4-7 | Standard TV output - 000 - PAL B G H - 001 - NTSC M - 010..111 - Reserved - @flag Bit 8-31 | Reserved for future use - @field IN OUT ULONG | ulRefreshRate | Vertical Refresh Rate in Hz - @field IN OUT ULONG | ulHorizRate | Horizontal Refresh Rate in KHz - @field IN OUT ULONG | ulPixClock | Pixel Clock in kHz - @field IN OUT ULONG | ulHFPorch | Horizontal front porch in pixels - @field IN OUT ULONG | ulHSync | Horizontal Sync in pixels - @field IN OUT ULONG | ulHBPorch | Horizontal back porch in pixels - @field IN OUT ULONG | ulVFPorch | Vertical front porch in lines - @field IN OUT ULONG | ulVSync | Vertical Sync in lines - @field IN OUT ULONG | ulVBPorch | Vertical back Porch in lines - @field IN OUT ULONG | ulDisplayOrg | Origin of the display Offset(pixels) - @field IN OUT ULONG | ulDstOrg | Origin of the drawing Offset in the frame (pixels) - @field IN OUT ULONG | ulPanXGran | Panning in X granularity in pixel - @field IN OUT ULONG | ulPanYGran | Panning in Y granularity in pixel - @field IN OUT ULONG | ulTVStandard | TV Standard - @field IN OUT ULONG | ulCableType | Cable Type - @end - **************************************************************************************************/ -typedef struct TAGMAGMODEINFO { - FLONG flOutput; /* Where we want to apply this parameters */ - ULONG ulDispWidth; /* Display Width in pixels */ - ULONG ulDispHeight; /* Display Height in pixels */ - ULONG ulDeskWidth; /* Desktop Width in pixels */ - ULONG ulDeskHeight; /* Desktop Height in pixels */ - ULONG ulFBPitch; /* Frame Buffer Pitch in pixel */ - ULONG ulBpp; /* Bits Per Pixels / input format */ - ULONG ulZoom; /* Zoom factor */ - FLONG flSignalMode; /* Signal Mode */ - ULONG ulRefreshRate; /* Vertical Refresh Rate in Hz */ - ULONG ulHorizRate; /* Horizontal Refresh Rate in KHz */ - ULONG ulPixClock; /* Pixel Clock in kHz */ - ULONG ulHFPorch; /* Horizontal front porch in pixels */ - ULONG ulHSync; /* Horizontal Sync in pixels */ - ULONG ulHBPorch; /* Horizontal back porch in pixels */ - ULONG ulVFPorch; /* Vertical front porch in lines */ - ULONG ulVSync; /* Vertical Sync in lines */ - ULONG ulVBPorch; /* Vertical back Porch in lines */ - ULONG ulDisplayOrg; /* Origin of the display Offset(bytes) */ - ULONG ulDstOrg; /* Origin of the drawing Offset in the frame (bytes) */ - ULONG ulPanXGran; /* Panning in X granularity in pixel */ - ULONG ulPanYGran; /* Panning in Y granularity in pixel */ - ULONG ulTVStandard; /* TV Standard */ - ULONG ulCableType; /* Cable Type */ -} MGAMODEINFO, FAR *LPMGAMODEINFO; - -#define MGAHWINFOCAPS_CRTC1_ANALOG 1L -#define MGAHWINFOCAPS_CRTC1_DIGITAL (1L << 1) -#define MGAHWINFOCAPS_CRTC1_TV (1L << 2) -#define MGAHWINFOCAPS_CRTC2_ANALOG (1L << 3) -#define MGAHWINFOCAPS_CRTC2_DIGITAL (1L << 4) -#define MGAHWINFOCAPS_CRTC2_TV (1L << 5) -#define MGAHWINFOCAPS_OUTPUT_VGA (1L << 6) -#define MGAHWINFOCAPS_CRTC2 (MGAHWINFOCAPS_CRTC2_ANALOG | MGAHWINFOCAPS_CRTC2_DIGITAL | MGAHWINFOCAPS_CRTC2_TV) -#define MGAHWINFOCAPS_OUTPUT_ANALOG (MGAHWINFOCAPS_CRTC1_ANALOG | MGAHWINFOCAPS_CRTC2_ANALOG) -#define MGAHWINFOCAPS_OUTPUT_DIGITAL (MGAHWINFOCAPS_CRTC1_DIGITAL | MGAHWINFOCAPS_CRTC2_DIGITAL) -#define MGAHWINFOCAPS_OUTPUT_TV (MGAHWINFOCAPS_CRTC1_TV | MGAHWINFOCAPS_CRTC2_TV) - -#define MGAMODEINFO_SECOND_CRTC 1L -#define MGAMODEINFO_ANALOG1 (1L << 1) -#define MGAMODEINFO_ANALOG2 (1L << 2) -#define MGAMODEINFO_DIGITAL1 (1L << 3) -#define MGAMODEINFO_DIGITAL2 (1L << 4) -#define MGAMODEINFO_FORCE_PITCH (1L << 5) -#define MGAMODEINFO_FORCE_DISPLAYORG (1L << 6) -#define MGAMODEINFO_TV (1L << 7) -#define MGAMODEINFO_TESTONLY 0x80000000 - -/* Cable Type */ -#define TV_YC_COMPOSITE 0 -#define TV_SCART_RGB 1 -#define TV_SCART_COMPOSITE 2 -#define TV_SCART_TYPE2 3 - -/* TV Standard */ - -#define TV_PAL 0 -#define TV_NTSC 1 - -#if defined(__cplusplus) - extern "C" { -#endif - -ULONG MGACloseLibrary(LPBOARDHANDLE pBoard); -ULONG MGAValidateMode(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo); -ULONG MGAValidateVideoParameters(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo); -ULONG MGASetMode(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo); -ULONG MGASetTVMode(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo); -ULONG MGASetVgaMode(LPBOARDHANDLE pBoard); -ULONG MGASaveVgaState(LPBOARDHANDLE pBoard); -ULONG MGARestoreVgaState(LPBOARDHANDLE pBoard); -ULONG MGAInitHardware(LPBOARDHANDLE pBoard); -ULONG MGAGetVideoParameters(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo, ULONG ulRefresh); -ULONG MGAGetHardwareInfo(LPBOARDHANDLE pBoard, LPMGAHWINFO pMgaHwInfo); -LPVOID MGAGetClientPointer(LPBOARDHANDLE pBoard); -ULONG MGAOpenLibrary(LPBOARDHANDLE pBoard, LPVOID lpClient, ULONG ulClientSize); -ULONG MGAGetBOARDHANDLESize(void); -ULONG MGASetTVStandard(LPBOARDHANDLE pBoard, ULONG ulTVStandard); -ULONG MGASetTVCableType(LPBOARDHANDLE pBoard, ULONG ulCableType); -ULONG HALSetDisplayStart(LPBOARDHANDLE pBoard, ULONG x, ULONG y, ULONG crtc); - -#if defined(__cplusplus) - } -#endif - -#endif /* _BINDING */ - - diff --git a/driver/xf86-video-mga/src/client.h b/driver/xf86-video-mga/src/client.h deleted file mode 100644 index 59aca5d35..000000000 --- a/driver/xf86-video-mga/src/client.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _CLIENT -#define _CLIENT - -#include "binding.h" - -#if defined(__cplusplus) - extern "C" { -#endif - -typedef void* LPBIOSREGS; -#define ASSERT_HANDLER(pBoard) - -typedef struct TAGCLIENTDATA -{ - ULONG ulFrameBufferBase; - ULONG ulRegisterBase; - pointer pMga; -} CLIENTDATA, *LPCLIENTDATA; - -#if defined(__cplusplus) - } -#endif - -#define ESC_CUSTOM_SET_FUNCTION_PTR 0x80000200 -#define ESC_CUSTOM_GET_FUNCTION_PTR 0x80000201 -#define ESC_CUSTOM_PATCH_HSL 0x80000202 - -#endif diff --git a/driver/xf86-video-mga/src/mga.h b/driver/xf86-video-mga/src/mga.h index 04f6bfdbe..1a7cb473a 100644 --- a/driver/xf86-video-mga/src/mga.h +++ b/driver/xf86-video-mga/src/mga.h @@ -41,11 +41,7 @@ #define _XF86DRI_SERVER_ #include "mga_dripriv.h" #include "dri.h" -#include "GL/glxint.h" -#include "dri.h" - -#include "GL/glxint.h" #include "mga_dri.h" #endif @@ -150,7 +146,9 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*); #define PCI_CHIP_MGAG200_EW3_PCI 0x0536 #endif - +#ifndef PCI_CHIP_MGAG200_EH3_PCI +#define PCI_CHIP_MGAG200_EH3_PCI 0x0538 +#endif /* * Read/write to the DAC via MMIO @@ -220,9 +218,9 @@ typedef struct { unsigned char * DacRegs; unsigned long crtc2[0x58]; unsigned char dac2[0x21]; - CARD32 Option; - CARD32 Option2; - CARD32 Option3; + uint32_t Option; + uint32_t Option2; + uint32_t Option3; long Clock; unsigned char Pan_Ctl; Bool PIXPLLCSaved; @@ -523,7 +521,7 @@ typedef struct { MessageType BiosFrom; #endif unsigned long FbAddress; - unsigned char * IOBase; + void * IOBase; unsigned char * FbBase; unsigned char * ILOADBase; unsigned char * FbStart; @@ -561,7 +559,7 @@ typedef struct { CARD32 MAccess; int FifoSize; int StyleLen; -#ifdef HAVE_XAA_H +#ifdef USE_XAA XAAInfoRecPtr AccelInfoRec; #endif xf86CursorInfoPtr CursorInfoRec; @@ -609,9 +607,6 @@ typedef struct { Bool directRenderingEnabled; DRIInfoPtr pDRIInfo; int drmFD; - int numVisualConfigs; - __GLXvisualConfig* pVisualConfigs; - MGAConfigPrivPtr pVisualConfigsPriv; MGADRIServerPrivatePtr DRIServerInfo; MGARegRec DRContextRegs; @@ -742,8 +737,9 @@ Bool mgaExaInit(ScreenPtr pScreen); Bool MGAHWCursorInit(ScreenPtr pScreen); - +#ifdef USE_XAA void MGAPolyArcThinSolid(DrawablePtr, GCPtr, int, xArc*); +#endif /* USE_XAA */ Bool MGADGAInit(ScreenPtr pScreen); diff --git a/driver/xf86-video-mga/src/mga_arc.c b/driver/xf86-video-mga/src/mga_arc.c index 61ade3b72..3c9dd42e6 100644 --- a/driver/xf86-video-mga/src/mga_arc.c +++ b/driver/xf86-video-mga/src/mga_arc.c @@ -59,6 +59,7 @@ in this Software without prior written authorization from The Open Group. OUTREG(MGAREG_YDSTLEN + MGAREG_EXEC, ((y) << 16) | 1); \ } +#ifdef USE_XAA static void MGAZeroArc( DrawablePtr pDraw, @@ -220,4 +221,5 @@ MGAPolyArcThinSolid ( miPolyArc(pDraw, pGC, 1, arc); } } +#endif /* USE_XAA */ diff --git a/driver/xf86-video-mga/src/mga_bios.c b/driver/xf86-video-mga/src/mga_bios.c index a391b2c4b..f4198d0fe 100644 --- a/driver/xf86-video-mga/src/mga_bios.c +++ b/driver/xf86-video-mga/src/mga_bios.c @@ -297,7 +297,6 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn ) #ifndef XSERVER_LIBPCIACCESS Bool pciBIOS = TRUE; #endif - int rlen; static const unsigned expected_length[] = { 0, 64, 64, 64, 128, 128 }; unsigned version; unsigned pins_len; diff --git a/driver/xf86-video-mga/src/mga_dac3026.c b/driver/xf86-video-mga/src/mga_dac3026.c index bf4e668b2..09fb548b2 100644 --- a/driver/xf86-video-mga/src/mga_dac3026.c +++ b/driver/xf86-video-mga/src/mga_dac3026.c @@ -694,8 +694,8 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode) MGA_NOT_HAL(MGATi3026SetMCLK(pScrn, MGAdac->MemoryClock)); #ifdef DEBUG - ErrorF("%6ld: %02X %02X %02X %02X %02X %02X %08lX\n", mode->Clock, - pReg->DacClk[0], pReg->DacClk[1], pReg->DacClk[2], pReg->DacClk[3], pReg->DacClk[4], pReg->DacClk[5], pReg->Option); + ErrorF("%6d: %02X %02X %02X %02X %02X %02X %08X\n", mode->Clock, + pReg->DacClk[0], pReg->DacClk[1], pReg->DacClk[2], pReg->DacClk[3], pReg->DacClk[4], pReg->DacClk[5], (unsigned)pReg->Option); for (i=0; iDacRegs[i]); for (i=0; i<6; i++) ErrorF(" %02X", pReg->ExtVga[i]); ErrorF("\n"); @@ -863,8 +863,8 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, #endif #ifdef DEBUG - ErrorF("read: %02X %02X %02X %02X %02X %02X %08lX\n", - mgaReg->DacClk[0], mgaReg->DacClk[1], mgaReg->DacClk[2], mgaReg->DacClk[3], mgaReg->DacClk[4], mgaReg->DacClk[5], mgaReg->Option); + ErrorF("read: %02X %02X %02X %02X %02X %02X %08X\n", + mgaReg->DacClk[0], mgaReg->DacClk[1], mgaReg->DacClk[2], mgaReg->DacClk[3], mgaReg->DacClk[4], mgaReg->DacClk[5], (unsigned)mgaReg->Option); for (i=0; iDacRegs[i]); for (i=0; i<6; i++) ErrorF(" %02X", mgaReg->ExtVga[i]); ErrorF("\n"); diff --git a/driver/xf86-video-mga/src/mga_dacG.c b/driver/xf86-video-mga/src/mga_dacG.c index 73d0d9d00..4e2459504 100644 --- a/driver/xf86-video-mga/src/mga_dacG.c +++ b/driver/xf86-video-mga/src/mga_dacG.c @@ -58,7 +58,6 @@ 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; @@ -81,8 +80,6 @@ MGAG200E4ComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) 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++) { @@ -125,7 +122,6 @@ MGAG200SEComputePLLParam(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; @@ -138,8 +134,6 @@ MGAG200SEComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) ulPLLFreqRef = 25000; 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 (ulTestP = 8; ulTestP > 0; ulTestP >>= 1) { @@ -170,7 +164,6 @@ MGAG200EVComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) { unsigned int ulComputedFo; unsigned int ulFDelta; - unsigned int ulFPermitedDelta; unsigned int ulFTmpDelta; unsigned int ulTestP; unsigned int ulTestM; @@ -184,8 +177,6 @@ MGAG200EVComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) ulPLLFreqRef = 50000; 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 (ulTestP = 16; ulTestP > 0; ulTestP--) { @@ -221,7 +212,6 @@ MGAG200WBComputePLLParam(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; @@ -244,8 +234,6 @@ MGAG200WBComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) ulTestMEnd = 16; 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 (ulTestP = ulTestPStart; ulTestP < 9; ulTestP++) { @@ -281,7 +269,6 @@ 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; @@ -311,8 +298,6 @@ MGAG200EW3ComputePLLParam(ScrnInfoPtr pScrn ,long lFo, int *M, int *N, int *P) 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++) { @@ -349,7 +334,6 @@ MGAG200EHComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) { unsigned int ulComputedFo; unsigned int ulFDelta; - unsigned int ulFPermitedDelta; unsigned int ulFTmpDelta; unsigned int ulTestP; unsigned int ulTestM; @@ -363,8 +347,6 @@ MGAG200EHComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) ulPLLFreqRef = 33333; 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 (ulTestP = 16; ulTestP > 0; ulTestP>>= 1) { @@ -393,6 +375,49 @@ MGAG200EHComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) } } +void +MGAG200EH3ComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P) +{ + unsigned int ulComputedFo; + unsigned int ulFDelta; + unsigned int ulFTmpDelta; + unsigned int ulTestP; + unsigned int ulTestM; + unsigned int ulTestN; + unsigned int ulVCOMax; + unsigned int ulVCOMin; + unsigned int ulPLLFreqRef; + + ulVCOMax = 3000000; + ulVCOMin = 1500000; + ulPLLFreqRef = 25000; + + ulTestP = 0; + + ulFDelta = 0xFFFFFFFF; + + /* Then we need to minimize the M while staying within 0.5% */ + for (ulTestM = 150; ulTestM >= 6; ulTestM--) { + if ((lFo * ulTestM) > ulVCOMax) continue; + if ((lFo * ulTestM) < ulVCOMin) continue; + + for (ulTestN = 120; ulTestN >= 60; ulTestN--) { + ulComputedFo = (ulPLLFreqRef * ulTestN) / ulTestM; + if (ulComputedFo > lFo) + ulFTmpDelta = ulComputedFo - lFo; + else + ulFTmpDelta = lFo - ulComputedFo; + + if (ulFTmpDelta < ulFDelta) { + ulFDelta = ulFTmpDelta; + *M = (CARD8)(ulTestM); + *N = (CARD8)(ulTestN); + *P = (CARD8)(ulTestP); + } + } + } +} + static void MGAG200EVPIXPLLSET(ScrnInfoPtr pScrn, MGARegPtr mgaReg) { @@ -781,12 +806,8 @@ MGAG200EHPIXPLLSET(ScrnInfoPtr pScrn, MGARegPtr mgaReg) { MGAPtr pMga = MGAPTR(pScrn); - unsigned long ulFallBackCounter, ulLoopCount, ulLockCheckIterations = 0, ulTempCount, ulVCount; + unsigned long ulLoopCount, ulLockCheckIterations = 0, ulTempCount, ulVCount; unsigned char ucTempByte, ucPixCtrl, ucPLLLocked = FALSE; - unsigned char ucM; - unsigned char ucN; - unsigned char ucP; - unsigned char ucS; while(ulLockCheckIterations <= 32 && ucPLLLocked == FALSE) { @@ -940,8 +961,8 @@ MGAGCalcClock ( ScrnInfoPtr pScrn, long f_out, /* * Pick the closest frequency. */ - if ( abs(calc_f - f_vco) < m_err ) { - m_err = abs(calc_f - f_vco); + if ( fabs(calc_f - f_vco) < m_err ) { + m_err = fabs(calc_f - f_vco); *best_m = m; *best_n = n; } @@ -1056,7 +1077,14 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out ) pReg->PllN = n; pReg->PllP = p; } else if (pMga->is_G200EH) { - MGAG200EHComputePLLParam(pScrn, f_out, &m, &n, &p); + if (pMga->Chipset == PCI_CHIP_MGAG200_EH3_PCI) + { + MGAG200EH3ComputePLLParam(pScrn, f_out, &m, &n, &p); + } + else + { + MGAG200EHComputePLLParam(pScrn, f_out, &m, &n, &p); + } pReg->PllM = m; pReg->PllN = n; @@ -1263,6 +1291,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) break; case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: pReg->DacRegs[MGA1064_MISC_CTL] = MGA1064_MISC_CTL_VGA8 | MGA1064_MISC_CTL_DAC_RAM_CS; @@ -1756,8 +1785,8 @@ MGA_NOT_HAL( ErrorF("0x%02X, ", mgaReg->DacRegs[i]); #endif } - ErrorF("\nOPTION = %08lX\n", mgaReg->Option); - ErrorF("OPTION2 = %08lX\n", mgaReg->Option2); + ErrorF("\nOPTION = %08X\n", (unsigned)mgaReg->Option); + ErrorF("OPTION2 = %08X\n", (unsigned)mgaReg->Option2); ErrorF("CRTCEXT:"); for (i=0; i<6; i++) ErrorF(" %02X", mgaReg->ExtVga[i]); ErrorF("\n"); @@ -1901,8 +1930,8 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, ErrorF("0x%02X, ", mgaReg->DacRegs[i]); #endif } - ErrorF("\nOPTION = %08lX\n:", mgaReg->Option); - ErrorF("OPTION2 = %08lX\nCRTCEXT:", mgaReg->Option2); + ErrorF("\nOPTION = %08X\n:", (unsigned)mgaReg->Option); + ErrorF("OPTION2 = %08X\nCRTCEXT:", (unsigned)mgaReg->Option2); for (i=0; i<6; i++) ErrorF(" %02X", mgaReg->ExtVga[i]); ErrorF("\n"); #endif @@ -2119,7 +2148,7 @@ MGAG_I2CPutBits(I2CBusPtr b, int clock, int data) static I2CBusPtr -mgag_create_i2c_bus(const char *name, unsigned bus_index, unsigned scrn_index) +mgag_create_i2c_bus(char *name, unsigned bus_index, unsigned scrn_index) { I2CBusPtr I2CPtr = xf86CreateI2CBusRec(); @@ -2129,7 +2158,7 @@ mgag_create_i2c_bus(const char *name, unsigned bus_index, unsigned scrn_index) I2CPtr->I2CPutBits = MGAG_I2CPutBits; I2CPtr->I2CGetBits = MGAG_I2CGetBits; I2CPtr->AcknTimeout = 5; - I2CPtr->DriverPrivate.ptr = & i2c_priv[bus_index]; + I2CPtr->DriverPrivate.ptr = (void *) &i2c_priv[bus_index]; if (!xf86I2CBusInit(I2CPtr)) { xf86DestroyI2CBusRec(I2CPtr, TRUE, TRUE); diff --git a/driver/xf86-video-mga/src/mga_dga.c b/driver/xf86-video-mga/src/mga_dga.c index ef0368893..66e6a0994 100644 --- a/driver/xf86-video-mga/src/mga_dga.c +++ b/driver/xf86-video-mga/src/mga_dga.c @@ -15,7 +15,7 @@ static Bool MGA_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, static Bool MGA_SetMode(ScrnInfoPtr, DGAModePtr); static int MGA_GetViewport(ScrnInfoPtr); static void MGA_SetViewport(ScrnInfoPtr, int, int, int); -#ifdef HAVE_XAA_H +#ifdef USE_XAA static void MGA_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void MGA_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); static void MGA_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, @@ -30,7 +30,7 @@ DGAFunctionRec MGA_DGAFuncs = { MGA_SetViewport, MGA_GetViewport, MGAStormSync, -#ifdef HAVE_XAA_H +#ifdef USE_XAA MGA_FillRect, MGA_BlitRect, MGA_BlitTransRect @@ -124,7 +124,7 @@ SECOND_PASS: mode->flags = DGA_CONCURRENT_ACCESS; if(pixmap) mode->flags |= DGA_PIXMAP_AVAILABLE; -#ifdef HAVE_XAA_H +#ifdef USE_XAA if(!pMga->NoAccel) { mode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT; if((Bpp != 3) && (pMga->Chipset != PCI_CHIP_MGA2064)) @@ -365,7 +365,7 @@ MGA_SetViewport( pMga->DGAViewportStatus = 0; /* MGAAdjustFrame loops until finished */ } -#ifdef HAVE_XAA_H +#ifdef USE_XAA static void MGA_FillRect ( ScrnInfoPtr pScrn, diff --git a/driver/xf86-video-mga/src/mga_dri.c b/driver/xf86-video-mga/src/mga_dri.c index b9570283b..6867d8ffc 100644 --- a/driver/xf86-video-mga/src/mga_dri.c +++ b/driver/xf86-video-mga/src/mga_dri.c @@ -48,15 +48,8 @@ #include "mga_drm.h" #define _XF86DRI_SERVER_ -#include "GL/glxtokens.h" #include "sarea.h" - - - - -#include "GL/glxtokens.h" - #include "mga_reg.h" #include "mga.h" #include "mga_macros.h" @@ -67,224 +60,6 @@ static char MGAKernelDriverName[] = "mga"; static char MGAClientDriverName[] = "mga"; -/* Initialize the visual configs that are supported by the hardware. - * These are combined with the visual configs that the indirect - * rendering core supports, and the intersection is exported to the - * client. - */ -static Bool MGAInitVisualConfigs( ScreenPtr pScreen ) -{ - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - MGAPtr pMga = MGAPTR(pScrn); - int numConfigs = 0; - __GLXvisualConfig *pConfigs = 0; - MGAConfigPrivPtr pMGAConfigs = 0; - MGAConfigPrivPtr *pMGAConfigPtrs = 0; - int i, db, depth, stencil, accum; - - switch ( pScrn->bitsPerPixel ) { - case 8: - case 24: - break; - - case 16: - numConfigs = 8; - - pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig), - numConfigs ); - if ( !pConfigs ) { - return FALSE; - } - - pMGAConfigs = (MGAConfigPrivPtr)calloc( sizeof(MGAConfigPrivRec), - numConfigs ); - if ( !pMGAConfigs ) { - free(pConfigs); - return FALSE; - } - - pMGAConfigPtrs = (MGAConfigPrivPtr*)calloc( sizeof(MGAConfigPrivPtr), - numConfigs ); - if ( !pMGAConfigPtrs ) { - free(pConfigs); - free(pMGAConfigs); - return FALSE; - } - - for ( i = 0 ; i < numConfigs ; i++ ) { - pMGAConfigPtrs[i] = &pMGAConfigs[i]; - } - - i = 0; - for ( accum = 0 ; accum <= 1 ; accum++ ) { - for ( stencil = 0 ; stencil <= 1 ; stencil++ ) { - for ( db = 1 ; db >= 0 ; db-- ) { - pConfigs[i].vid = -1; - pConfigs[i].class = -1; - pConfigs[i].rgba = TRUE; - pConfigs[i].redSize = 5; - pConfigs[i].greenSize = 6; - pConfigs[i].blueSize = 5; - pConfigs[i].alphaSize = 0; - pConfigs[i].redMask = 0x0000F800; - pConfigs[i].greenMask = 0x000007E0; - pConfigs[i].blueMask = 0x0000001F; - pConfigs[i].alphaMask = 0; - if ( accum ) { - pConfigs[i].accumRedSize = 16; - pConfigs[i].accumGreenSize = 16; - pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 0; - } else { - pConfigs[i].accumRedSize = 0; - pConfigs[i].accumGreenSize = 0; - pConfigs[i].accumBlueSize = 0; - pConfigs[i].accumAlphaSize = 0; - } - if ( db ) { - pConfigs[i].doubleBuffer = TRUE; - } else { - pConfigs[i].doubleBuffer = FALSE; - } - pConfigs[i].stereo = FALSE; - pConfigs[i].bufferSize = 16; - pConfigs[i].depthSize = 16; - if ( stencil ) { - pConfigs[i].stencilSize = 8; - } else { - pConfigs[i].stencilSize = 0; - } - pConfigs[i].auxBuffers = 0; - pConfigs[i].level = 0; - if ( accum || stencil ) { - pConfigs[i].visualRating = GLX_SLOW_CONFIG; - } else { - pConfigs[i].visualRating = GLX_NONE; - } - pConfigs[i].transparentPixel = GLX_NONE; - pConfigs[i].transparentRed = 0; - pConfigs[i].transparentGreen = 0; - pConfigs[i].transparentBlue = 0; - pConfigs[i].transparentAlpha = 0; - pConfigs[i].transparentIndex = 0; - i++; - } - } - } - if ( i != numConfigs ) { - xf86DrvMsg( pScrn->scrnIndex, X_ERROR, - "[drm] Incorrect initialization of visuals\n" ); - return FALSE; - } - break; - - case 32: - numConfigs = 8; - - pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig), - numConfigs ); - if ( !pConfigs ) { - return FALSE; - } - - pMGAConfigs = (MGAConfigPrivPtr)calloc( sizeof(MGAConfigPrivRec), - numConfigs ); - if ( !pMGAConfigs ) { - free(pConfigs); - return FALSE; - } - - pMGAConfigPtrs = (MGAConfigPrivPtr*)calloc( sizeof(MGAConfigPrivPtr), - numConfigs ); - if ( !pMGAConfigPtrs ) { - free(pConfigs); - free(pMGAConfigs); - return FALSE; - } - - for ( i = 0 ; i < numConfigs ; i++ ) { - pMGAConfigPtrs[i] = &pMGAConfigs[i]; - } - - i = 0; - for ( accum = 0 ; accum <= 1 ; accum++ ) { - for ( depth = 0 ; depth <= 1 ; depth++ ) { /* and stencil */ - for ( db = 1 ; db >= 0 ; db-- ) { - pConfigs[i].vid = -1; - pConfigs[i].class = -1; - pConfigs[i].rgba = TRUE; - pConfigs[i].redSize = 8; - pConfigs[i].greenSize = 8; - pConfigs[i].blueSize = 8; - pConfigs[i].alphaSize = 0; - pConfigs[i].redMask = 0x00FF0000; - pConfigs[i].greenMask = 0x0000FF00; - pConfigs[i].blueMask = 0x000000FF; - pConfigs[i].alphaMask = 0x0; - if ( accum ) { - pConfigs[i].accumRedSize = 16; - pConfigs[i].accumGreenSize = 16; - pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 0; - } else { - pConfigs[i].accumRedSize = 0; - pConfigs[i].accumGreenSize = 0; - pConfigs[i].accumBlueSize = 0; - pConfigs[i].accumAlphaSize = 0; - } - if ( db ) { - pConfigs[i].doubleBuffer = TRUE; - } else { - pConfigs[i].doubleBuffer = FALSE; - } - pConfigs[i].stereo = FALSE; - pConfigs[i].bufferSize = 24; - if ( depth ) { - pConfigs[i].depthSize = 24; - pConfigs[i].stencilSize = 8; - } - else { - pConfigs[i].depthSize = 0; - pConfigs[i].stencilSize = 0; - } - pConfigs[i].auxBuffers = 0; - pConfigs[i].level = 0; - if ( accum ) { - pConfigs[i].visualRating = GLX_SLOW_CONFIG; - } else { - pConfigs[i].visualRating = GLX_NONE; - } - pConfigs[i].transparentPixel = GLX_NONE; - pConfigs[i].transparentRed = 0; - pConfigs[i].transparentGreen = 0; - pConfigs[i].transparentBlue = 0; - pConfigs[i].transparentAlpha = 0; - pConfigs[i].transparentIndex = 0; - i++; - } - } - } - if ( i != numConfigs ) { - xf86DrvMsg( pScrn->scrnIndex, X_ERROR, - "[drm] Incorrect initialization of visuals\n" ); - return FALSE; - } - break; - - default: - /* Unexpected bits/pixels */ - break; - } - - pMga->numVisualConfigs = numConfigs; - pMga->pVisualConfigs = pConfigs; - pMga->pVisualConfigsPriv = pMGAConfigs; - - GlxSetVisualConfigs( numConfigs, pConfigs, (void **)pMGAConfigPtrs ); - - return TRUE; -} - static Bool MGACreateContext( ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore ) @@ -346,12 +121,13 @@ static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn ) void MGAGetQuiescence( ScrnInfoPtr pScrn ) { MGAPtr pMga = MGAPTR(pScrn); +#ifdef USE_XAA + MGAFBLayout *pLayout = &pMga->CurrentLayout; +#endif /* USE_XAA */ pMga->haveQuiescense = 1; if ( pMga->directRenderingEnabled ) { - MGAFBLayout *pLayout = &pMga->CurrentLayout; - MGAWaitForIdleDMA( pScrn ); /* FIXME what about EXA? */ @@ -958,7 +734,7 @@ static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg, pboxNew1 = 0; pptNew1 = 0; pboxNew2 = 0; - pboxNew2 = 0; + pptNew2 = 0; pptSrc = &ptOldOrg; dx = pParent->drawable.x - ptOldOrg.x; @@ -1095,10 +871,9 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) return FALSE; } - /* Check that the GLX, DRI, and DRM modules have been loaded by testing + /* Check that the DRI, and DRM modules have been loaded by testing * for canonical symbols in each module. */ - if ( !xf86LoaderCheckSymbol( "GlxSetVisualConfigs" ) ) return FALSE; if ( !xf86LoaderCheckSymbol( "drmAvailable" ) ) return FALSE; if ( !xf86LoaderCheckSymbol( "DRIQueryVersion" ) ) { xf86DrvMsg( pScreen->myNum, X_ERROR, @@ -1350,10 +1125,6 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) &scratch_ptr); } - if ( !MGAInitVisualConfigs( pScreen ) ) { - DRICloseScreen( pScreen ); - return FALSE; - } xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n" ); return TRUE; @@ -1495,6 +1266,4 @@ void MGADRICloseScreen( ScreenPtr pScreen ) } free(pMga->DRIServerInfo); pMga->DRIServerInfo = 0; - free(pMga->pVisualConfigs); - free(pMga->pVisualConfigsPriv); } diff --git a/driver/xf86-video-mga/src/mga_dripriv.h b/driver/xf86-video-mga/src/mga_dripriv.h index feca134c8..d494665a9 100644 --- a/driver/xf86-video-mga/src/mga_dripriv.h +++ b/driver/xf86-video-mga/src/mga_dripriv.h @@ -28,19 +28,8 @@ #ifndef __MGA_DRIPRIV_H__ #define __MGA_DRIPRIV_H__ -#include "GL/glxint.h" - #define MGA_MAX_DRAWABLES 256 -extern void GlxSetVisualConfigs( int nconfigs, - __GLXvisualConfig *configs, - void **configprivs ); - -typedef struct { - /* Nothing here yet */ - int dummy; -} MGAConfigPrivRec, *MGAConfigPrivPtr; - typedef struct { /* Nothing here yet */ int dummy; diff --git a/driver/xf86-video-mga/src/mga_driver.c b/driver/xf86-video-mga/src/mga_driver.c index 7b46561b3..94183dbdc 100644 --- a/driver/xf86-video-mga/src/mga_driver.c +++ b/driver/xf86-video-mga/src/mga_driver.c @@ -423,6 +423,21 @@ static const struct mga_device_attributes attribs[] = { MGA_HOST_PCI /* Host interface */ }, + 16384, 0x4000, /* Memory probe size & offset values */ + }, + + [17] = { 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 */ } }; @@ -458,6 +473,8 @@ static const struct pci_id_match mga_device_match[] = { MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EW3_PCI, 16 ), + MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EH3_PCI, 17 ), + { 0, 0, 0 }, }; #endif @@ -479,6 +496,7 @@ static SymTabRec MGAChipsets[] = { { PCI_CHIP_MGAG200_WINBOND_PCI, "mgag200 eW Nuvoton" }, { PCI_CHIP_MGAG200_EW3_PCI, "mgag200 eW3 Nuvoton" }, { PCI_CHIP_MGAG200_EH_PCI, "mgag200eH" }, + { PCI_CHIP_MGAG200_EH3_PCI, "mgag200eH3" }, { PCI_CHIP_MGAG400, "mgag400" }, { PCI_CHIP_MGAG550, "mgag550" }, {-1, NULL } @@ -507,6 +525,8 @@ static PciChipsets MGAPciChipsets[] = { RES_SHARED_VGA }, { PCI_CHIP_MGAG200_EH_PCI, PCI_CHIP_MGAG200_EH_PCI, RES_SHARED_VGA }, + { PCI_CHIP_MGAG200_EH3_PCI, PCI_CHIP_MGAG200_EH3_PCI, + RES_SHARED_VGA }, { PCI_CHIP_MGAG400, PCI_CHIP_MGAG400, RES_SHARED_VGA }, { PCI_CHIP_MGAG550, PCI_CHIP_MGAG550, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } @@ -680,7 +700,6 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev, intptr_t match_data) { ScrnInfoPtr pScrn = NULL; - EntityInfoPtr pEnt; MGAPtr pMga; if (pci_device_has_kernel_driver(dev)) { @@ -693,6 +712,7 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev, case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: xf86DrvMsg(0, X_ERROR, "mga: The PCI device 0x%x at %2.2d@%2.2d:%2.2d:%1.1d has a kernel module claiming it.\n", dev->device_id, dev->bus, dev->domain, dev->dev, dev->func); @@ -737,7 +757,6 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev, * For cards that can do dual head per entity, mark the entity * as sharable. */ - pEnt = xf86GetEntityInfo(entity_num); if (pMga->chip_attribs->dual_head_possible) { MGAEntPtr pMgaEnt = NULL; DevUnion *pPriv; @@ -948,6 +967,10 @@ MGAProbe(DriverPtr drv, int flags) attrib_no = 16; break; + case PCI_CHIP_MGAG200_EH3_PCI: + attrib_no = 17; + break; + default: return FALSE; } @@ -999,7 +1022,9 @@ MGASoftReset(ScrnInfoPtr pScrn) MGAPtr pMga = MGAPTR(pScrn); pMga->FbMapSize = 8192 * 1024; - MGAMapMem(pScrn); + if (!MGAMapMem(pScrn)) { + return; + } /* set soft reset bit */ OUTREG(MGAREG_Reset, 1); @@ -1120,7 +1145,9 @@ MGACountRam(ScrnInfoPtr pScrn) ProbeSize = 16384; ProbeSizeOffset = 0x10000; pMga->FbMapSize = ProbeSize * 1024; - MGAMapMem(pScrn); + if (!MGAMapMem(pScrn)) { + return 0; + } base = pMga->FbBase; } @@ -1135,7 +1162,7 @@ MGACountRam(ScrnInfoPtr pScrn) } if (pMga->is_G200WB) { - CARD32 Option, MaxMapSize; + uint32_t Option, MaxMapSize; #ifdef XSERVER_LIBPCIACCESS pci_device_cfg_read_u32(pMga->PciInfo, &Option, @@ -1160,7 +1187,9 @@ MGACountRam(ScrnInfoPtr pScrn) else { MGAUnmapMem(pScrn); pMga->FbMapSize = ProbeSize * 1024; - MGAMapMem(pScrn); + if (!MGAMapMem(pScrn)) { + return 0; + } base = pMga->FbBase; } } @@ -1567,7 +1596,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pMga->is_G200EV = (pMga->Chipset == PCI_CHIP_MGAG200_EV_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_G200EH = (pMga->Chipset == PCI_CHIP_MGAG200_EH_PCI) + || (pMga->Chipset == PCI_CHIP_MGAG200_EH3_PCI); pMga->is_G200ER = (pMga->Chipset == PCI_CHIP_MGAG200_ER_PCI); pMga->DualHeadEnabled = FALSE; @@ -1594,6 +1624,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: pMga->HWCursor = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HW cursor is not supported with video redirection on" @@ -1933,11 +1964,14 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) } else { int from = X_DEFAULT; #ifdef USE_EXA - char *s = xf86GetOptValString(pMga->Options, OPTION_ACCELMETHOD); + const char *s = xf86GetOptValString(pMga->Options, OPTION_ACCELMETHOD); #endif pMga->NoAccel = FALSE; pMga->Exa = FALSE; #ifdef USE_EXA +#ifndef USE_XAA + pMga->Exa = TRUE; +#endif if (!xf86NameCmp(s, "EXA")) { pMga->Exa = TRUE; from = X_CONFIG; @@ -2078,6 +2112,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: MGAGSetupFuncs(pScrn); @@ -2192,6 +2227,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGAG200_EW3_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: case PCI_CHIP_MGAG200_ER_PCI: pMga->SrcOrg = 0; pMga->DstOrg = 0; @@ -2376,7 +2412,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) 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_EH3_PCI: case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: @@ -2612,7 +2649,7 @@ MGAMapMem(ScrnInfoPtr pScrn) #ifdef XSERVER_LIBPCIACCESS struct pci_device *const dev = pMga->PciInfo; struct pci_mem_region *region; - int i, err; + int err; #endif @@ -2637,7 +2674,7 @@ MGAMapMem(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MAPPED Framebuffer %08llX %llx to %08llX.\n", (long long)fbaddr, (long long)fbsize, - (long long)pMga->FbBase); + (long long)(uintptr_t)pMga->FbBase); if(pMga->entityPrivate == NULL || pMga->entityPrivate->mappedIOUsage == 0) { region = &dev->regions[pMga->io_bar]; @@ -2773,7 +2810,7 @@ MGAUnmapMem(ScrnInfoPtr pScrn) pMga->entityPrivate->mappedIOBase = NULL; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UNMAPPING framebuffer 0x%08llX, 0x%llX.\n", (long long)pMga->FbBase, (long long)pMga->FbMapSize); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UNMAPPING framebuffer 0x%08llX, 0x%llX.\n", (long long)(uintptr_t)pMga->FbBase, (long long)pMga->FbMapSize); pci_device_unmap_range(dev, pMga->FbBase, pMga->FbMapSize); #else @@ -2941,19 +2978,27 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) ulMemoryBandwidth = (mode->Clock * ulBitsPerPixel) / 1000; - if (ulMemoryBandwidth > 3100) ucHiPriLvl = 0; - else if (ulMemoryBandwidth > 2600) ucHiPriLvl = 1; - else if (ulMemoryBandwidth > 1900) ucHiPriLvl = 2; - else if (ulMemoryBandwidth > 1160) ucHiPriLvl = 3; - else if (ulMemoryBandwidth > 440) ucHiPriLvl = 4; - else ucHiPriLvl = 5; + if (pMga->reg_1e24 >= 0x04) + { + ucHiPriLvl = 0; + } + else + { + + if (ulMemoryBandwidth > 3100) ucHiPriLvl = 0; + else if (ulMemoryBandwidth > 2600) ucHiPriLvl = 1; + else if (ulMemoryBandwidth > 1900) ucHiPriLvl = 2; + else if (ulMemoryBandwidth > 1160) ucHiPriLvl = 3; + else if (ulMemoryBandwidth > 440) ucHiPriLvl = 4; + else ucHiPriLvl = 5; + } OUTREG8(0x1FDE, 0x06); OUTREG8(0x1FDF, ucHiPriLvl); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock == %d\n", mode->Clock); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BitsPerPixel == %d\n", pScrn->bitsPerPixel); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MemoryBandwidth == %d\n", ulMemoryBandwidth); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock == %u\n", mode->Clock); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BitsPerPixel == %u\n", pScrn->bitsPerPixel); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MemoryBandwidth == %u\n", (unsigned)ulMemoryBandwidth); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HiPriLvl == %02X\n", ucHiPriLvl); } else @@ -3103,7 +3148,7 @@ MGACrtc2FillStrip(ScrnInfoPtr pScrn) (pScrn->bitsPerPixel >> 3) * pScrn->displayWidth * pScrn->virtualY); } else { xf86SetLastScrnFlag(pScrn->entityList[0], pScrn->scrnIndex); -#ifdef HAVE_XAA_H +#ifdef USE_XAA pMga->RestoreAccelState(pScrn); pMga->SetupForSolidFill(pScrn, 0, GXcopy, 0xFFFFFFFF); pMga->SubsequentSolidFillRect(pScrn, pScrn->virtualX, 0, @@ -3126,16 +3171,12 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL) vgaHWPtr hwp; MGAPtr pMga; MGARamdacPtr MGAdac; - int ret; VisualPtr visual; unsigned char *FBStart; int width, height, displayWidth; MGAEntPtr pMgaEnt = NULL; int f; - CARD32 VRTemp, FBTemp; -#ifdef MGADRI - MessageType driFrom = X_DEFAULT; -#endif + CARD32 VRTemp = 0, FBTemp = 0; DPMSSetProcPtr mga_dpms_set_proc = NULL; hwp = VGAHWPTR(pScrn); @@ -3317,20 +3358,16 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Not supported by hardware, not initializing the DRI\n"); pMga->directRenderingEnabled = FALSE; - driFrom = X_PROBED; } else if (!xf86ReturnOptValBool(pMga->Options, OPTION_DRI, TRUE)) { - driFrom = X_CONFIG; } else if ( pMga->NoAccel ) { xf86DrvMsg( pScrn->scrnIndex, X_ERROR, "Acceleration disabled, not initializing the DRI\n" ); pMga->directRenderingEnabled = FALSE; - driFrom = X_CONFIG; } else if ( pMga->TexturedVideo == TRUE ) { xf86DrvMsg( pScrn->scrnIndex, X_ERROR, "Textured video enabled, not initializing the DRI\n" ); pMga->directRenderingEnabled = FALSE; - driFrom = X_CONFIG; } else if (pMga->SecondCrtc == TRUE) { xf86DrvMsg( pScrn->scrnIndex, X_ERROR, @@ -3345,7 +3382,6 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL) "Need at least %d kB video memory at this resolution, bit depth\n", (3 * displayWidth * height * (pScrn->bitsPerPixel >> 3)) / 1024 ); pMga->directRenderingEnabled = FALSE; - driFrom = X_PROBED; } else { pMga->directRenderingEnabled = MGADRIScreenInit(pScreen); @@ -3712,7 +3748,7 @@ MGACloseScreen(CLOSE_SCREEN_ARGS_DECL) vgaHWPtr hwp = VGAHWPTR(pScrn); MGAPtr pMga = MGAPTR(pScrn); MGAEntPtr pMgaEnt = NULL; - CARD32 VRTemp, FBTemp; + CARD32 VRTemp = 0, FBTemp = 0; if (pMga->MergedFB) MGACloseScreenMerged(pScreen); @@ -3853,15 +3889,17 @@ MGAValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) return MODE_VIRTUAL_Y; if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 244) return MODE_BANDWIDTH; - } else { - if (pMga->reg_1e24 == 0x02) { - if (mode->HDisplay > 1920) - return MODE_VIRTUAL_X; - if (mode->VDisplay > 1200) - return MODE_VIRTUAL_Y; - if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 301) - return MODE_BANDWIDTH; - } + } else if (pMga->reg_1e24 == 0x02) { + if (mode->HDisplay > 1920) + return MODE_VIRTUAL_X; + if (mode->VDisplay > 1200) + return MODE_VIRTUAL_Y; + if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 301) + return MODE_BANDWIDTH; + } + else { + if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 550) + return MODE_BANDWIDTH; } } else if (pMga->is_G200WB){ if (mode->Flags & V_DBLSCAN) @@ -3878,7 +3916,7 @@ MGAValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) } else if (pMga->is_G200EV && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 327)) { return MODE_BANDWIDTH; - } else if (pMga->is_G200EH + } else if (pMga->is_G200EH && (pMga->Chipset != PCI_CHIP_MGAG200_EH3_PCI) && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 375)) { return MODE_BANDWIDTH; } else if (pMga->is_G200ER diff --git a/driver/xf86-video-mga/src/mga_exa.c b/driver/xf86-video-mga/src/mga_exa.c index c4e4d9062..03c5229e3 100644 --- a/driver/xf86-video-mga/src/mga_exa.c +++ b/driver/xf86-video-mga/src/mga_exa.c @@ -695,6 +695,14 @@ mgaComposite(PixmapPtr pDst, int srcx, int srcy, int maskx, int masky, OUTREG(MGAREG_YDSTLEN | MGAREG_EXEC, (dsty << 16) | (h & 0xffff)); } +struct unaligned_32 { + uint32_t val; +} __attribute__((packed)); + +struct unaligned_64 { + uint64_t val; +} __attribute__((packed)); + static Bool mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch) @@ -720,7 +728,15 @@ mgaUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, OUTREG(MGAREG_YDSTLEN | MGAREG_EXEC, (y << 16) | (h & 0xffff)); while (h--) { - memcpy (pMga->ILOADBase, src, bytes_padded); + int i = 0; + + if (sizeof(long) == 8) { + for (; i + 4 < bytes_padded; i += 8) + *(volatile uint64_t *)(pMga->ILOADBase + i) = ((struct unaligned_64 *)(src + i))->val; + } + + for (; i < bytes_padded; i += 4) + *(volatile uint32_t *)(pMga->ILOADBase + i) = ((struct unaligned_32 *)(src + i))->val; src += src_pitch; } @@ -737,7 +753,7 @@ mgaWaitMarker(ScreenPtr pScreen, int marker) WAITFIFO(1); - OUTREG(MGAREG_CACHEFLUSH, 0); + OUTREG8(MGAREG_CACHEFLUSH, 0); /* wait until the "drawing engine busy" bit is unset */ while (INREG (MGAREG_Status) & 0x10000); diff --git a/driver/xf86-video-mga/src/mga_g450pll.c b/driver/xf86-video-mga/src/mga_g450pll.c index 293178cf2..ae6e1a197 100644 --- a/driver/xf86-video-mga/src/mga_g450pll.c +++ b/driver/xf86-video-mga/src/mga_g450pll.c @@ -134,7 +134,7 @@ static CARD32 G450FindNextPLLParam(ScrnInfoPtr pScrn, CARD32 ulFout, *pulPLLMNP |= (CARD32)ucP; #ifdef DEBUG - ErrorF("FINS_S: VCO = %d, S = %02X, *pulPLLMNP = %08X\n", ulVCO, (ULONG)ucS, *pulPLLMNP); + ErrorF("FINS_S: VCO = %d, S = %02X, *pulPLLMNP = %08X\n", (unsigned)ulVCO, (unsigned)ucS, (unsigned)*pulPLLMNP); #endif } @@ -315,7 +315,7 @@ double MGAG450SetPLLFreq(ScrnInfoPtr pScrn, long f_out) MGAPtr pMga = MGAPTR(pScrn); #ifdef DEBUG - xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Restoring PLLClk = %d\n",f_out); + xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Restoring PLLClk = %ld\n", f_out); #endif G450FindFirstPLLParam(pScrn, f_out, &ulMNP); ulMNPTable[0] = ulMNP; @@ -489,7 +489,7 @@ MGAG450SavePLLFreq(ScrnInfoPtr pScrn) G450ApplyPFactor(pScrn, ucP, &freq); #ifdef DEBUG - xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Saved PLLClk = %d\n",freq); + xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Saved PLLClk = %u\n", (unsigned)freq); #endif return freq; } @@ -506,7 +506,7 @@ MGAG450PrintPLL(ScrnInfoPtr pScrn) ucP = (CARD8)(ulMNP & 0x03); G450ApplyPFactor(pScrn, ucP, &freq); - xf86DrvMsg(pScrn->scrnIndex,X_INFO,"MGAGClock = %d -- MNP = 0x%x\n", - freq,ulMNP); + xf86DrvMsg(pScrn->scrnIndex,X_INFO,"MGAGClock = %u -- MNP = 0x%x\n", + (unsigned)freq, (unsigned)ulMNP); } #endif diff --git a/driver/xf86-video-mga/src/mga_halmod.c b/driver/xf86-video-mga/src/mga_halmod.c deleted file mode 100644 index b562ba4f3..000000000 --- a/driver/xf86-video-mga/src/mga_halmod.c +++ /dev/null @@ -1,41 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "xf86Module.h" - -#ifdef XFree86LOADER - -#define HAL_MAJOR_VERSION 1 -#define HAL_MINOR_VERSION 0 -#define HAL_PATCHLEVEL 0 - -static MODULESETUPPROTO(halSetup); - -static XF86ModuleVersionInfo halVersRec = -{ - "mga_hal", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - HAL_MAJOR_VERSION, HAL_MINOR_VERSION, HAL_PATCHLEVEL, - ABI_CLASS_VIDEODRV, /* This is a video driver */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} -}; - -/* - * This is the module init data. - * Its name has to be the driver name followed by ModuleData. - */ -_X_EXPORT XF86ModuleData mga_halModuleData = { &halVersRec, halSetup, NULL }; - -static pointer -halSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - return (pointer)1; -} - -#endif /* XFree86LOADER */ diff --git a/driver/xf86-video-mga/src/mga_merge.c b/driver/xf86-video-mga/src/mga_merge.c index a25730643..64c85b438 100644 --- a/driver/xf86-video-mga/src/mga_merge.c +++ b/driver/xf86-video-mga/src/mga_merge.c @@ -18,12 +18,12 @@ #include "fbdevhw.h" static int -StrToRanges(range* r, char* s) { +StrToRanges(range* r, const char* s) { float num=0.0; int rangenum=0; Bool gotdash = FALSE; Bool nextdash = FALSE; - char* strnum=NULL; + const char* strnum=NULL; do { switch(*s) { case '0': case '1': case '2': case '3': case '4': case '5': @@ -117,7 +117,7 @@ CopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest, DisplayModePtr i, DisplayM } static DisplayModePtr -GetModeFromName(char* str, DisplayModePtr i) +GetModeFromName(const char* str, DisplayModePtr i) { DisplayModePtr c = i; if(!i) return NULL; @@ -130,9 +130,9 @@ GetModeFromName(char* str, DisplayModePtr i) /* takes a config file string of MetaModes and generates a MetaModeList */ static DisplayModePtr -GenerateModeList(ScrnInfoPtr pScrn, char* str, +GenerateModeList(ScrnInfoPtr pScrn, const char* str, DisplayModePtr i, DisplayModePtr j, MgaScrn2Rel srel) { - char* strmode = str; + const char* strmode = str; char modename[256]; Bool gotdash = FALSE; MgaScrn2Rel sr; @@ -165,7 +165,7 @@ GenerateModeList(ScrnInfoPtr pScrn, char* str, } else { mode1 = GetModeFromName(modename,i); if(!mode1) { - char* tmps = str; + const char* tmps = str; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Mode: \"%s\" is not a supported mode for monitor 1\n",modename); /* find if a monitor2 mode follows */ @@ -232,7 +232,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) MGAPtr pMga1; MessageType from; int i; - char* s; + const char* s; ClockRangePtr clockRanges; MgaScrn2Rel Monitor2Pos; @@ -357,6 +357,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: MGAGSetupFuncs(pScrn); @@ -510,6 +511,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: maxPitch = 4096; diff --git a/driver/xf86-video-mga/src/mga_storm.c b/driver/xf86-video-mga/src/mga_storm.c index 4ef655b56..08dfa2043 100644 --- a/driver/xf86-video-mga/src/mga_storm.c +++ b/driver/xf86-video-mga/src/mga_storm.c @@ -23,10 +23,6 @@ #include "miline.h" #include "servermd.h" -#ifdef MGADRI -#include "GL/glxtokens.h" -#endif - #include "mga.h" #include "mga_reg.h" #include "mga_macros.h" @@ -61,7 +57,7 @@ do { \ XAAMoveDWORDS((d),(s),(c)); \ } while (0) -#ifdef HAVE_XAA_H +#ifdef USE_XAA static void mgaSetupForSolidFill( ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask ); @@ -576,20 +572,29 @@ MGASubsequentCPUToScreenTexture ( Bool mgaAccelInit( ScreenPtr pScreen ) { -#ifdef HAVE_XAA_H +#ifdef USE_XAA XAAInfoRecPtr infoPtr; #endif ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); MGAPtr pMga = MGAPTR(pScrn); - int maxFastBlitMem, maxlines; +// int maxFastBlitMem, maxlines; +#ifdef USE_XAA + int maxFastBlitMem; +#endif /* USE_XAA */ + int maxlines; + +#if defined(USE_XAA) && defined(RENDER) Bool doRender = FALSE; +#endif /* defined(USE_XAA) && defined(RENDER) */ BoxRec AvailFBArea; +#ifdef USE_XAA int i; +#endif /* USE_XAA */ pMga->ScratchBuffer = malloc(((pScrn->displayWidth * pMga->CurrentLayout.bitsPerPixel) + 127) >> 3); if(!pMga->ScratchBuffer) return FALSE; -#ifdef HAVE_XAA_H +#ifdef USE_XAA pMga->AccelInfoRec = infoPtr = XAACreateInfoRec(); if(!infoPtr) return FALSE; #endif @@ -625,7 +630,7 @@ Bool mgaAccelInit( ScreenPtr pScreen ) pMga->AtypeNoBLK = MGAAtypeNoBLK; } -#ifdef HAVE_XAA_H +#ifdef USE_XAA /* fill out infoPtr here */ infoPtr->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS | @@ -932,7 +937,7 @@ Bool mgaAccelInit( ScreenPtr pScreen ) } -#ifdef HAVE_XAA_H +#ifdef USE_XAA for (i = 0; i < pScrn->numEntities; i++) { if (xf86IsEntityShared(pScrn->entityList[i])) { infoPtr->RestoreAccelState = mgaRestoreAccelState; @@ -971,7 +976,7 @@ Bool mgaAccelInit( ScreenPtr pScreen ) } -#ifdef HAVE_XAA_H +#ifdef USE_XAA /* Support for multiscreen */ static void mgaRestoreAccelState(ScrnInfoPtr pScrn) { @@ -1100,7 +1105,7 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn ) opmode &= ~0x30000; #endif -#ifdef HAVE_XAA_H +#ifdef USE_XAA pMga->SetupForSolidFill = mgaSetupForSolidFill; pMga->SubsequentSolidFillRect = mgaSubsequentSolidFillRect; pMga->RestoreAccelState = mgaRestoreAccelState; @@ -1152,6 +1157,7 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn ) case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: case PCI_CHIP_MGAG200_ER_PCI: + case PCI_CHIP_MGAG200_EH3_PCI: pMga->SrcOrg = 0; OUTREG(MGAREG_SRCORG, pMga->realSrcOrg); OUTREG(MGAREG_DSTORG, pMga->DstOrg); @@ -1178,7 +1184,7 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn ) } -#ifdef HAVE_XAA_H +#ifdef USE_XAA static void MGASetClippingRectangle( ScrnInfoPtr pScrn, diff --git a/driver/xf86-video-mga/src/mga_video.c b/driver/xf86-video-mga/src/mga_video.c index 535e32921..d703e48bb 100644 --- a/driver/xf86-video-mga/src/mga_video.c +++ b/driver/xf86-video-mga/src/mga_video.c @@ -565,8 +565,12 @@ MGAAllocateMemory( void **mem_struct, int size ){ +#if defined(USE_XAA) || defined(USE_EXA) MGAPtr pMga = MGAPTR(pScrn); +#endif /* defined(USE_XAA) || defined(USE_EXA) */ +#ifdef USE_XAA ScreenPtr pScreen = xf86ScrnToScreen(pScrn); +#endif /* USE_XAA */ int offset = 0; #ifdef USE_EXA @@ -644,7 +648,9 @@ MGAAllocateMemory( static void MGAFreeMemory(ScrnInfoPtr pScrn, void *mem_struct) { +#if defined(USE_XAA) || defined(USE_EXA) MGAPtr pMga = MGAPTR(pScrn); +#endif /* defined(USE_XAA) || defined(USE_EXA) */ #ifdef USE_EXA if (pMga->Exa) { @@ -1374,6 +1380,7 @@ static void CopyMungedScanline_AXP(CARD32 *fb_ptr, short src_w, } } +#if 0 static void CopyMungedScanline_AXP2(CARD32 *fb_ptr, short src_w, CARD32 *tsp, CARD32 *tpu, CARD32 *tpv) { @@ -1393,6 +1400,7 @@ static void CopyMungedScanline_AXP2(CARD32 *fb_ptr, short src_w, fb_ptr+=4; } } +#endif static void CopyMungedScanlineFilter_AXP(CARD32 *fb_ptr, short src_w, @@ -1466,6 +1474,7 @@ static void CopyMungedScanlineFilter_AXP(CARD32 *fb_ptr, short src_w, } } +#if 0 static void CopyMungedScanlineFilterDown_AXP(CARD32 *fb_ptr, short src_w, CARD32 *tsp1, CARD32 *tpu1, CARD32 *tpv1, CARD32 *tsp2, CARD32 *tpu2, CARD32 *tpv2, @@ -1504,6 +1513,7 @@ static void CopyMungedScanlineFilterDown_AXP(CARD32 *fb_ptr, short src_w, fb_ptr+=4; } } +#endif static void MGACopyScaledILOAD( ScrnInfoPtr pScrn, @@ -1520,7 +1530,12 @@ static void MGACopyScaledILOAD( CARD32 *fb_ptr; unsigned char *ubuf, *vbuf, *tbuf; CARD32 *pu, *pv; - int k,l, pl, dl, xds, yds; + int k,l; +#ifdef MGA2164_BLIT_DUP + int pl; +#endif /* MGA2164_BLIT_DUP */ + int dl; + int xds, yds; short box_h; short scr_pitch = ( pScrn->virtualX + 15) & ~15; @@ -1606,8 +1621,10 @@ static void MGACopyScaledILOAD( ubuf=vbuf+width*height/4; pu = (CARD32 *)(ubuf+(src_y/2)*(width/2)); pv = (CARD32 *)(vbuf+(src_y/2)*(width/2)); - - for(pl=-1,dl=0;dly1-drw_y))*src_h/drw_h; /* FIXME: check the math */ @@ -1764,7 +1781,9 @@ static void MGACopyScaledILOAD( default: break; } +#ifdef MGA2164_BLIT_DUP pl=l; +#endif /* MGA2164_BLIT_DUP */ } else { /* dup lines */ @@ -1801,7 +1820,10 @@ static void MGACopyILOAD( CARD32 *fb_ptr; CARD8 *ubuf, *vbuf; CARD32 *pu, *pv; - int k,l; +#ifdef CUSTOM_MEMCOPY + int k; +#endif /* CUSTOM_MEMCOPY */ + int l; short clip_x1, clip_x2, tmp_w; #ifdef DEBUG_MGA2164 @@ -1968,7 +1990,6 @@ MGAPutImageILOAD( MGAPortPrivPtr pPriv = pMga->portPrivate; INT32 x1, x2, y1, y2; int dstPitch = 0; - int bpp; BoxRec dstBox; int nbox; BoxPtr pbox; @@ -1984,9 +2005,7 @@ MGAPutImageILOAD( clipBoxes, width, height)) return Success; - bpp = pScrn->bitsPerPixel >> 3; - -#ifdef HAVE_XAA_H +#ifdef USE_XAA if( pMga->AccelInfoRec->NeedToSync && ((long)data != pPriv->lastPort) ) { MGAStormSync(pScrn); } @@ -2020,7 +2039,7 @@ MGAPutImageILOAD( pbox++; } -#ifdef HAVE_XAA_H +#ifdef USE_XAA pMga->AccelInfoRec->NeedToSync = TRUE; #endif pPriv->videoStatus = FREE_TIMER;