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>
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>
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>
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>
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>
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>
`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>
Fixes misaligned address crash when EXA is enabled on Solaris SPARC
(Oracle Bug id 22993744)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
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>
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>
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>
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>
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 ;-)
- 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>
- 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>