summaryrefslogtreecommitdiff
path: root/src/mga_dacG.c
AgeCommit message (Collapse)Author
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 3 -Wmissing-prototypes warningsAlan 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-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-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-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>
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>
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>
2012-06-06mga: port to new compat API.Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-25Move PCI vendor/device id defines into mga.h instead of using xf86PciInfo.hAlan Coopersmith
Silences deprecation warnings from xf86PciInfo.h in current Xorg servers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-20Delete support for MGA's proprietary HAL: unifdef USEMGAHAL.Jamey Sharp
This patch produced with: for f in `git grep -Fwl USEMGAHAL`; do unifdef -B -UUSEMGAHAL $f | sponge $f done Adam Jackson wrote: Hey, so, remember back in the dark ages when dualhead was this insanely wild differentiating feature? Matrox thought it was so special, in fact, that they hid most of the implementation of it (and a bunch of other stuff) in a binary-only blob called the HALlib. As you'd expect it was pretty much a cut-and-paste of the relevant Windows code, and then some open glue to keep it working; clientlx.c is that glue. I guess the theory was that if you don't tell people which registers to duplicate to implement a second pipe in their own hardware, they won't figure it out? A pretty eyeroll-worthy idea even at the time, and definitely not something we should be condoning anymore. Kill it with fire, but while you're at it, untangle the hideous mess of MGA_HAL() macros too. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Adam Jackson <ajax@redhat.com>
2010-12-17added support for G200ER.Yannick Heneault
2010-02-11Added support for G200EHYannick Heneault
2009-11-10Removed DDC1 support for G200eW.Yannick Heneault
2009-08-19updated G200eW PLL programming sequence.Yannick Heneault
2009-03-31Fixed G200SE PLL selection routine of m,n,p.Yannick Heneault
2009-03-11Fixed bad access issues and ddc1 implementation for IP core.Yannick Heneault
Fixed a bug in PLL programming sequence for G200eW/G200eV where a register IO offset was used instead of a memory offset. Removed clock selection toggling in PLL programming sequence for G200eW. Fixed ddc1 protocol to support correct I/O lines according to chip attribute. Fixed a bug in CRTC2 programming seqence where a register IO offset was used instead of a memory offset.
2009-01-21Updated PLL algorithm for G200eW.Yannick Heneault
Changed the m,n,p selection for G200eW and programming sequence.
2008-11-20Fixed PLL m,n,p selection for G200eW to respect byte granularity.Yannick Heneault
Renamed G200 eW Winbond ID string to Nuvoton. Added EV suffix to G200 Maxim. Blocked double scan mode for G200 eW. Fixed memory bandwidth limitation for G200eW to 318.77 Mhz. Added a workaround (blit 1x1 with rop=xor) to fix the black screen problem for G200eW.
2008-06-30Bug #16545: Add G200WB support.Yannick Henault
2008-06-23Death to RCS tags.Adam Jackson
2008-06-23Bug #15836: Fix DDC on G200SE.Yannick Henault
2008-06-09G200EV: Enable support for G200EVIan Romanick
2008-05-30I2C: Second (and final) round of clean-upsIan Romanick
2008-05-30I2C: First round of clean-upsIan Romanick
2008-05-30cfb8_32: Gut a remnants of support for 24-bit with 8-bit overlayIan Romanick
2007-08-31Use XSERVER_LIBPCIACCESS to detect pci-rework.Ian Romanick
2007-08-22Merge PCI-rework support and "classic" PCI interface support into one treeIan Romanick
First pass at merging both trees. So far, this has only been tested on the PCI-rework build on a PCI G450.
2007-08-20Merge branch 'master' of ↵Ian Romanick
git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
2007-03-28Fix various timing bugs on the G200SE.Adam Jackson
2006-12-11Merge branch 'master' of ↵Ian Romanick
git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
2006-12-11Merge branch 'master' of ↵Ian Romanick
git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework Conflicts: src/mga_macros.h
2006-12-10Replaced some more magic values with register names.Tilman Sauerbeck
2006-11-26Removed a duplicated register definition.Tilman Sauerbeck
2006-11-26Replaced more magic values with register names.Tilman Sauerbeck
2006-10-27Convert tests of pMga->Chipset to tests of single bit flags.Ian Romanick
Several places in the driver contain if-statements that test Chipset against several different values to determine what functionality to use. Some of these tests, HALCHIPSETS in particular, test as many as 6 different values. This bloats the code size unnecessarilly. Instead we cache the results of some of those tests in single bit flags stored in pMga. These changes are similar to some changes in the pci-rework branch.
2006-10-26Fix bug #8666. git-bisect for the win!Ian Romanick
Since && takes precedence over ||, put parenthesis around the || block to make all the operations associate in the intended manner.
2006-07-26Current state of MGA driver modified to work with the xserverIan Romanick
pci-rework branch.
2006-07-10Add includes of <unistd.h> & <stdlib.h> to replace previously xf86wrapped ↵Alan Coopersmith
prototypes Fixes these warnings: make.out:"mga_dacG.c", line 195: warning: implicit function declaration: abs make.out:"mga_dacG.c", line 1117: warning: implicit function declaration: usleepmake.out:"mga_driver.c", line 692: warning: implicit function declaration: usleep
2006-04-07Unlibcwrap. Bump server version requirement. Bump to 1.4.0.mga-1_4_0Adam Jackson
2006-04-02Bug #6328: Add support for Matrox G200SE chips. (Matrox)Adam Jackson
2005-07-25PInS data on later cards (G200 and later) contains information about theIan Romanick
physical bus used for the card. This allows accurate detection of PCI cards that use a PCI-to-PCI bridge with an AGP chip. Correctly disable DRI on PCI cards used with pre-3.2 DRM. Previously the test was performed based on PCI ID (see above for why this is wrong) and was done *before* the DRM version was known. Bug #3759: <https://bugs.freedesktop.org/show_bug.cgi?id=3759> Correctly determine the PLL reference frequency from the PInS data. Previously the wrong bit was tested. Blame the dumb programmer that used cut-and-paste (that would be me).
2005-07-11Prep for modular builds by adding guarded #include "config.h" everywhere.XORG-6_8_99_16XORG-6_8_99_15Adam Jackson
2005-07-01Re-write the PInS processing codeIan Romanick
This patch dumps all of the old BIOS processing code from the MGA DDX. The new code, located in mga_bios.c, is modeled after the code in matroxfb_misc.c (though no actual code was copied). Basically, the BIOS is processed in one place, with "device independent" values stored in a data structure. This data is then used, without extra switch-statments, throughout the driver. In addition, this patch adds support for processing the BIOS on PowerPC systems. On PPC cards, the magic offset values (that give the location of the PInS data) is not in the BIOS. Instead the driver has to search the BIOS for the PInS structure signature. The patch does this and correctly handles byte-ordering (and data alignement) issues. This code has been tested on an AGP G400 on x86 and a PCI G450 on PowerPC. NOTE: The file mga_bios.h is also removed. The "documentation" in that file was moved to the file mga_PInS.txt. This file documents, as much as possible, the layout of the various PInS datastructure versions. The information in that file is 100% based on the old mga_bios.h and the code in matroxfb_misc.c. No additional information from Matrox documentation is included in that file. This just puts the information that was already known in one place. Xorg Bug: 3553
2004-07-31Change several LoaderSymbol calls introduced by the bug #400 patch toAdam Jackson
*Weak() resolver functions.