Commit Graph

403 Commits

Author SHA1 Message Date
Alan Coopersmith
3f2000a09a mga_bios: remove unused get_u32 inline function
Clears warning from clang:

mga_bios.c:77:26: warning: unused function 'get_u32' [-Wunused-function]
static __inline__ CARD32 get_u32( const CARD8 * data )
                         ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
xlibre-xf86-video-mga-2.1.0.1
2024-11-16 22:09:35 +00:00
Alan Coopersmith
7012e41c65 Remove semicolons without statements
Clears 5 warnings from clang of the form:

mga_driver.c:1861:13: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
            ;
            ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
2024-11-16 22:09:35 +00:00
Alan Coopersmith
b460131050 PMGA & QUIESCE_DMA: Remove ; from end of macro definitions
Clears 12 warnings from clang of the form:

mga_exa.c:170:18: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
    PMGA(pPixmap);
                 ^
mga_exa.c:176:25: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
    QUIESCE_DMA(pPixmap);
                        ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
2024-11-16 22:09:35 +00:00
Alan Coopersmith
d55a8f77ab WAITFIFO: add do { ... } while (0) to avoid -Wextra-semi-stmt warnings
Clears 17 warnings from clang of the form:

mga_video.c:739:17: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
    WAITFIFO(15);
                ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
2024-11-16 22:09:35 +00:00
Alan Coopersmith
3b7e42e8b1 CHECK_DMA_QUIESCENT: add do ... while (0) to avoid -Wextra-semi-stmt warnings
Clears 8 warnings from clang of the form:

mga_storm.c:269:37: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
    CHECK_DMA_QUIESCENT(pMga, pScrn);
                                    ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
2024-11-16 22:09:35 +00:00
Alan Coopersmith
f227f3bec1 BOUND & REBOUND: add do ... while (0) to avoid -Wextra-semi-stmt warnings
Clears 22 warnings from clang of the form:

mga_merge.c:738:35: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
            REBOUND(f1.x0,f1.x1,x);
                                  ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
2024-11-16 22:09:35 +00:00
Alan Coopersmith
62f9d8de06 Remove MGA_NOT_HAL() macro left behind from HAL removal
When commit 94bbeb132c removed the HAL support, it removed the
MGA_HAL() macro to wrap code only used with HAL, but left behind
the equivalent MGA_NO_HAL() macro for the non-HAL code paths.
Since it just expanded to the code it contained, it did nothing
but upset clang and mess up the code formatting.

This fixes 6 clang warnings of the form:

mga_dacG.c:1670:2: warning: embedding a directive within macro arguments
 has undefined behavior [-Wembedded-directive]
#ifdef XSERVER_LIBPCIACCESS
 ^

and 23 clang warnings of the form:

mga_dacG.c:1351:3: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
        );      /* MGA_NOT_HAL */
         ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/14>
2024-11-16 13:21:06 -08:00
Alan Coopersmith
c228139d65 xf86-video-mga 2.1.0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xf86-video-mga-2.1.0
2024-10-12 12:54:20 -07:00
Alan Coopersmith
3279df42ed Fix 2 -Wcalloc-transposed-args warnings
From gcc 14.1:

mga_dri.c: In function ‘MGADRIScreenInit’:
mga_dri.c:757:40: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  757 |    pMGADRI = (MGADRIPtr)calloc( sizeof(MGADRIRec), 1 );
      |                                        ^~~~~~~~~
mga_dri.c:757:40: note: earlier argument should specify number of elements, later size of each element
mga_dri.c:767:22: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  767 |       calloc( sizeof(MGADRIServerPrivateRec), 1 );
      |                      ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/12>
2024-07-14 13:23:38 -07:00
Alan Coopersmith
66ee371516 Assume the Xserver provides xf86ModeBandwidth now
It was added by xorg/xserver@1768af38c7
which was included in the xserver 1.10 release, which is now less than
our minimum required, so we don't need to check for it and provide a
fallback any longer.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/11>
2024-05-14 18:17:54 -07:00
Alan Coopersmith
af09c0ca1f Raise minimum supported Xserver version to 1.18 (ABI_VIDEODRV_VERSION 20.0)
Already effectively required by use of XNFcallocarray() introduced in
xorg/xserver@b96dc999 - xserver-1.18.0, released in Nov. 2015.

Allows dropping remnants of code for XAA and pre-pciaccess X servers

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/11>
2024-05-14 16:16:50 -07:00
Enrico Weigelt, metux IT consult
e7329f4634 use XNFcallocarray() instead of xnfcalloc macro
xnfcalloc is just an alias for XNFcallocarray() that doesn't seem to serve
any practical purpose, so it can go away once all drivers stopped using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/9>
2024-05-08 16:04:16 +02:00
Alan Coopersmith
0d0ae3fd54 Fix warning: declaration of ‘ulIndex’ shadows a previous local [-Wshadow]
mga_g450pll.c: In function ‘MGAG450SetPLLFreq’:
mga_g450pll.c:326:11: warning: declaration of ‘ulIndex’ shadows a previous local [-Wshadow]
  326 |       int ulIndex;
      |           ^~~~~~~
mga_g450pll.c:312:11: note: shadowed declaration is here
  312 |    CARD32 ulIndex;
      |           ^~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07 10:10:47 -08:00
Alan Coopersmith
3bc8e3b57e Fix 3 -Wmissing-prototypes warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07 10:02:57 -08:00
Alan Coopersmith
09df931ce6 Add X.Org's standard C warning flags to AM_CFLAGS
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07 10:00:19 -08:00
Alan Coopersmith
14e430cab9 Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOL
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008,
so it's time to rely on it.

Clears autoconf warnings:

configure.ac:45: warning: The macro 'AC_PROG_LIBTOOL' is obsolete.
configure.ac:45: You should run autoupdate.
aclocal.m4:3515: AC_PROG_LIBTOOL is expanded from...
configure.ac:45: the top level

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07 09:57:42 -08:00
Alan Coopersmith
58fae3137c gitlab CI: ensure libtool is installed in build container
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-01 13:30:46 -07:00
Alan Coopersmith
951fa4d49c Fix -Wold-style-declaration warnings
mga_dac3026.c:77:1: warning: ‘static’ is not at beginning of declaration
 [-Wold-style-declaration]
 const static unsigned char MGADACregs[] = {
 ^~~~~
mga_dac3026.c:103:1: warning: ‘static’ is not at beginning of declaration
 [-Wold-style-declaration]
 const static unsigned char MGADACbpp8[DACREGSIZE] = {
 ^~~~~
mga_dac3026.c:108:1: warning: ‘static’ is not at beginning of declaration
 [-Wold-style-declaration]
 const static unsigned char MGADACbpp16[DACREGSIZE] = {
 ^~~~~
mga_dac3026.c:124:1: warning: ‘static’ is not at beginning of declaration
 [-Wold-style-declaration]
 const static unsigned char MGADACbpp24[DACREGSIZE] = {
 ^~~~~
mga_dac3026.c:129:1: warning: ‘static’ is not at beginning of declaration
 [-Wold-style-declaration]
 const static unsigned char MGADACbpp32[DACREGSIZE] = {
 ^~~~~
mga_dacG.c: In function ‘MGAGInit’:
mga_dacG.c:1118:2: warning: ‘static’ is not at beginning of declaration
 [-Wold-style-declaration]
  const static unsigned char initDAC[] = {
  ^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-28 16:26:38 -07:00
Alan Coopersmith
32d6cc7971 Remove "All rights reserved" from Oracle copyright notices
Oracle no longer includes this term in our copyright & license notices.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-25 09:11:41 -08:00
Alan Coopersmith
e7fa8055ea gitlab CI: stop requiring Signed-off-by in commits
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-09 12:06:57 -08:00
Alan Coopersmith
37bf1be0fb xf86-video-mga 2.0.1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xf86-video-mga-2.0.1
2022-07-10 17:11:22 -07:00
Raphael Isemann
638653561d Fix uninitialized read in MGAEnableSecondOutPut
`MGAGRestore` allocated `ModeInfo` without initializing its memory and then
passes it into `MGAEnableSecondOutPut` via `MGAEnableSecondOutPut(pScrn, &ModeInfo);`.

`MGAEnableSecondOutPut` then reads the unitialized memory in the line
`if ( !(pModeInfo->flSignalMode & POS_HSYNC) )`.

This patch just zeroes the memory to prevent those branches to be randomly
taken.

Signed-off-by: Raphael Isemann <teemperor@gmail.com>
2022-04-13 13:12:29 +02:00
Alan Coopersmith
a6ab1e08ee gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 13:06:47 -08:00
Alan Coopersmith
1e4dbef654 Fix spelling/wording issues
Found by using:
    codespell --builtin clear,rare,usage,informal,code,names

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 13:05:35 -08:00
Alan Coopersmith
f74f050415 Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 12:57:58 -08:00
Fabrice Fontaine
f227f2f286 configure.ac: fix cross-compilation
AC_CHECK_FILE can't be used when cross-compiling

[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/x11r7/xdriver_xf86-video-mga/0001-misc-fixes.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-05-04 20:47:14 +02:00
Kevin Brace
924c310dfe Version bumped to Version 2.0.0
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
xf86-video-mga-2.0.0
2018-12-07 16:43:46 -08:00
Kevin Brace
ada903eea2 Version bumped to Version 1.6.901
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-12-07 16:21:44 -08:00
Kevin Brace
54f0f0723d Remove last remnants of old Matrox HAL
Apparently, commit 94bbeb132c
missed removing a few more files related to old Matrox HAL.

Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-12-07 16:21:32 -08:00
Kevin Brace
b293b0956d Version bumped to Version 1.6.900
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-29 10:41:23 -08:00
Henry Zhao
c5d295f06c 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 <alan.coopersmith@oracle.com>
2018-11-29 10:38:27 -08:00
Matthieu Herrb
11abbd45e0 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 <matthieu@herrb.eu>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-29 10:29:40 -08:00
Kevin Brace
4ce40b932c Suppression of a compilation error when XAA is not in use
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26 11:03:39 -08:00
Kevin Brace
4017c6e91f Convert most HAVE_XAA_H conditional compilation labels to USE_XAA
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26 11:02:30 -08:00
Kevin Brace
c5922dcc3f Eliminate set but unused variables
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26 11:01:33 -08:00
Kevin Brace
8db8f6b3f3 Eliminate unused variables
Care had to be taken to properly handle XAA usage situation

Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26 11:00:32 -08:00
Alan Coopersmith
94c70f888b Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-25 14:31:30 -08:00
Mikulas Patocka
a939aa56b3 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 <kevinbrace@gmx.com>
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
2018-11-21 13:51:54 -08:00
Alan Coopersmith
0f4883f0b8 Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-18 13:25:33 -08:00
Nicolas Kaiser
34f37fe119 fix typo in MGADRIMoveBuffersXAA()
Fix typo in MGADRIMoveBuffersXAA().

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2018-03-25 00:25:06 -07:00
Mikulas Patocka
31544d805f 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 <mattst88@gmail.com>
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
2018-02-20 09:36:47 -08:00
Mikulas Patocka
97c801e492 mga_drv: fix warning
Fix warnings in the MGA driver. There's no functional change.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
2018-02-20 09:36:45 -08:00
Mikulas Patocka
767c19e714 mga_drv: fix structure definition
Fix missing entry in structure definition.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
2018-02-20 09:36:44 -08:00
Mikulas Patocka
b9aab0dcb1 mga_drv: fix a typo
Fix a typo that causes dynamic symbol lookup failure and xserver crash.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
2018-02-20 09:36:35 -08:00
Emil Velikov
2998868964 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 <mathieu.larouche@matrox.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
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 ;-)
2017-07-17 13:56:35 +01:00
Mathieu Larouche
42fabf69c3 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 <sndirsch@suse.de>

Reviewed-by: Samer El-Haj-Mahmoud <smahmoud@lenovo.com>
2017-06-20 16:20:22 -04:00
Mathieu Larouche
e55abc95c2 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 <mathieu.larouche@matrox.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-02-14 11:23:18 -05:00
Mihail Konev
2ccc50072c autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:00:22 +10:00
Emil Velikov
b9f57d1717 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 <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 11:26:28 +10:00
Peter Hutterer
0b8e81d2a4 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 <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-26 11:25:40 +10:00