summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-05-14Assume the Xserver provides xf86ModeBandwidth nowAlan Coopersmith
It was added by xorg/xserver@1768af38c737f4c14d32f587b51a8ec3d3d6ed5f 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-14Raise minimum supported Xserver version to 1.18 (ABI_VIDEODRV_VERSION 20.0)Alan Coopersmith
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-08use XNFcallocarray() instead of xnfcalloc macroEnrico Weigelt, metux IT consult
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-01-07Fix warning: declaration of ‘ulIndex’ shadows a previous local [-Wshadow]Alan Coopersmith
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-07Fix 3 -Wmissing-prototypes warningsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-07Add X.Org's standard C warning flags to AM_CFLAGSAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-04-28Fix -Wold-style-declaration warningsAlan Coopersmith
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>
2022-04-13Fix uninitialized read in MGAEnableSecondOutPutRaphael Isemann
`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-01-22Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-12-07Remove last remnants of old Matrox HALKevin Brace
Apparently, commit 94bbeb132c7eda912d1b402a1a91ca7cbbf5e6a1 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-11-29Write 8 bits instead of 32 to MGAREG_CACHEFLUSHHenry Zhao
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-29Use fabs() to compute absolute value of floating point number.Matthieu Herrb
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-26Suppression of a compilation error when XAA is not in useKevin Brace
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26Convert most HAVE_XAA_H conditional compilation labels to USE_XAAKevin Brace
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26Eliminate set but unused variablesKevin Brace
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-26Eliminate unused variablesKevin Brace
Care had to be taken to properly handle XAA usage situation Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
2018-11-21mga_drv: fix image corruption due to memcpy reorderingMikulas Patocka
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-03-25fix typo in MGADRIMoveBuffersXAA()Nicolas Kaiser
Fix typo in MGADRIMoveBuffersXAA(). Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Cyril Brulebois <kibi@debian.org>
2018-02-20mga_drv: use exa by defaultMikulas Patocka
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-20mga_drv: fix warningMikulas Patocka
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-20mga_drv: fix structure definitionMikulas Patocka
Fix missing entry in structure definition. Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
2018-02-20mga_drv: fix a typoMikulas Patocka
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>
2017-07-17xf86-video-mga: remove the GlxSetVisualConfigs stub and friendsEmil Velikov
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-06-20xf86-video-mga: Fix to always set HiPri for G200e4 V2Mathieu Larouche
- 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-02-14xf86-video-mga: Add support for a new G200eH3 deviceMathieu Larouche
- 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>
2016-07-28xf86-video-mga: Add support for the new G200e chipset -- V2Mathieu Larouche
- Added PLL algorithm for a new rev of G200e - Removed the bandwidth limitation for the new G200e Fixes : https://bugs.freedesktop.org/show_bug.cgi?id=92540 Change from V1 : - Make sure we don't cause issue on previous chips. (Dave Airlie review) Signed-off-by: Mathieu Larouche <mathieu.larouche@matrox.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-07-28xf86-video-mga: Add support for a new G200eW3 chipsetMathieu Larouche
- Added support for the new deviceID for G200eW3 - Added PLL algorithm for the G200eW3 - Added some initialization code for G200eW3 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92541 Signed-off-by: Mathieu Larouche <mathieu.larouche@matrox.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-07-19Adapt Block/WakeupHandler signature for ABI 23Adam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-09-17Use correct type in function call.Thomas Klausner
Fixes passing argument 2 of 'pci_device_cfg_read_u32' from incompatible pointer type pciaccess.h:153:5: note: expected '__uint32_t *' but argument is of type 'CARD32 *' Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Connor Behan <connor.behan@gmail.com>
2015-08-24Composite fixupConnor Behan
A driver like this that tries to composite a lot will definitely need to avoid crashing for solid pictures. Signed-off-by: Connor Behan <connor.behan@gmail.com>
2015-08-24Remove DownloadFromScreenConnor Behan
This hook was broken and did the same thing as a software fallback. Signed-off-by: Connor Behan <connor.behan@gmail.com>
2015-07-01Enable write-combining on the framebuffer BARAdam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-07-29undef DISABLE_VGA_IOAdam Jackson
Dead conditional ever since m12n, must not be needed. Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-07-29dri: Stop (uselessly) initializing the ValidateTree hooksAdam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-03-14fix a type in previous lockup in the mga driver fixMikulas Patocka
Oh, I had a typo in that patch - so please commit this to fix it. Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-14xf86-video-mga: fix a lockup in the mga driverMikulas Patocka
I've had a Xserver lockup in the mga driver, examining it with gdb showed this obviously broken loop: count = INREG(MGAREG_VCOUNT) + 2; while(INREG(MGAREG_VCOUNT) < count); It reads the line counter and waits until the counter advances by two. The cause of the lockup is this - if the kernel reschedules the Xorg process and lets it run in such a moment when INREG(MGAREG_VCOUNT) returns the maximum (or maximum minus 1) line count, the loop never exits. Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-14xf86-video-mga: set the pan_ctl registerMikulas Patocka
On my Matrox G550 most videomodes in Xorg didn't work. I found out that it works if Xorg pixel clock is similar to the pixel clock set on framebuffer console. Further analysis showed that the Linux framebuffer driver sets the pan_ctl register (the register 0xa2) according to the pixel clock, the Xorg driver doesn't set it. I copied the code to set the pan_ctl register from the Linux kernel to the Xorg driver, and most videomodes in Xorg work. The pan_ctl register is required for both analog and digital output. The pan_ctl register is saved and restored, this is required so that we restore text-mode screen or Linux framebuffer correctly. Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-12-05mga: fix XAA runtimeDave Airlie
XAA->USE_XAA add USE_XAA. Tested-by: Avengence on #xorg-devel Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-19Remove mga_esc.c vestigal stubAlan Coopersmith
Previously contained MGA HAL code, was left an empty shell by the removal of USEMGAHAL in commit 94bbeb132c7eda. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-31mga: Use exaGetPixmapFirstPixel() instead of devPrivate.ptrTormod Volden
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
2013-10-25Disable HW cursor by default on G200 server chipsEgbert Eich
Disable HW cursor by default on G200 server chips as these chips a re often used with a remote graphics link which cannot display the HW cursor. This can be overridden by a config option. Most desktops today use ARGB cursors anyhow which are not supported by this driver anyhow. Thus the performance penalty should be irrelevant. Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-10-25Restructure code to make it more readableEgbert Eich
With the previous structure it wasn't immediately clear when SecondCrtc and HWCursor were set to which value. Make the code more readable. Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-10-25Fix dual head crash without XAATormod Volden
https://launchpad.net/bugs/1180986 Signed-off-by: Tormod Volden <debian.tormod@gmail.com> Reviewed-by: Robert Jacobs <robert.n.jacobs@gmail.com> Tested-by: Robert Jacobs <robert.n.jacobs@gmail.com>
2013-10-25Unbreak dual head (xinerama)Andy MacLean
This patch has been used in Debian, Ubuntu and Gentoo for years. https://bugs.freedesktop.org/show_bug.cgi?id=18472 https://launchpad.net/bugs/292214 https://bugs.gentoo.org/show_bug.cgi?id=265100 Signed-off-by: Andy MacLean <andy-ub1@themacleans.org.uk> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Robert Jacobs <robert.n.jacobs@gmail.com> Tested-by: Robert Jacobs <robert.n.jacobs@gmail.com>
2013-07-31Disable Linear Expansion on BEEgbert Eich
Linear Expansion doesn't work on BE as the bit order in a word is reversed. ScreenToScreenColorExpansion allows to adjust the bit order in a byte, still the bytes have the wrong order. Reviewed-by: <wharms@bfs.de> Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-01-12Restrict kernel driver matching to g200 server chipsJulien Cristau
Otherwise we might catch devices handled by matroxfb, not the mgag200 kms driver. Debian bug#697532 Reported-by: olafBuddenhagen@gmx.net Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
2012-09-28mga: bring dri1 back to life.Dave Airlie
we need to at least setup the memory manager bits so dri1 clients get a backbuffer. this at least gets gears working again without XAA. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-26mga: add stub storm functions if not using XAADave Airlie
If we aren't using XAA just add stub storm init/sync functions. This lets the driver load yay. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-25Remove mibstore.hAdam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-07-15mga: fix after XAA removalDave Airlie
Fix mga build after XAA removal. Signed-off-by: Dave Airlie <airlied@redhat.com>