xserver-xorg-video-mga: Changes to 'debian-unstable'
ChangeLog | 172 +++++++++++++++++++++++--
Makefile.am | 2
README | 20 ++
configure.ac | 11 +
debian/changelog | 5
man/mga.man | 2
src/mga_bios.c | 5
src/mga_dacG.c | 375 +++++++++++++++++++++++++++++++++++--------------------
src/mga_dh.c | 4
src/mga_driver.c | 325 ++++++++++++++++++++++++++---------------------
src/mga_exa.c | 5
src/mga_storm.c | 14 ++
12 files changed, 642 insertions(+), 298 deletions(-)
New commits:
commit dc2b188e517f77d7e57d652747bb1fd9cce9ce9d
Author: Brice Goglin <bgoglin@debian.org>
Date: Mon Apr 27 21:12:45 2009 +0200
Prepare changelog for upload
diff --git a/debian/changelog b/debian/changelog
index 407da31..5b79ba4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-xserver-xorg-video-mga (1:1.4.10.dfsg-1) UNRELEASED; urgency=low
+xserver-xorg-video-mga (1:1.4.10.dfsg-1) unstable; urgency=low
* New upstream release.
* xserver-xorg-video-mga now suggests firmware-linux since
a firmware may be needed during driver initialization.
- -- Brice Goglin <bgoglin@debian.org> Mon, 27 Apr 2009 21:12:07 +0200
+ -- Brice Goglin <bgoglin@debian.org> Mon, 27 Apr 2009 21:12:29 +0200
xserver-xorg-video-mga (1:1.4.9.dfsg-4) unstable; urgency=low
commit f50446f0a8f4e017f1038fc0be2c3219593269bb
Author: Brice Goglin <bgoglin@debian.org>
Date: Mon Apr 27 21:12:17 2009 +0200
New upstream release
diff --git a/ChangeLog b/ChangeLog
index cf96419..c78f10d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,155 @@
+commit 626af26098ab5d0823bf1d6c08157b4c89ec578a
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Apr 27 14:01:03 2009 -0400
+
+ mga 1.4.10
+
+commit d33b06038223b2b121be7e3f8c207de5f518b28c
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Apr 27 14:00:00 2009 -0400
+
+ Fix ChangeLog generation
+
+commit 06b6ead9a1b367e08ed6b3e75dfde0ee3b4a82b8
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Apr 27 13:37:42 2009 -0400
+
+ G200SE: Only force 16bpp on low-memory cards
+
+commit 8b84fe236a42336e87048317880cc437494655f1
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Apr 27 13:36:45 2009 -0400
+
+ Move device ID and memory sizing much earlier in setup
+
+commit 9a82c5db3f8332d10b31d68e5b86d3a6b136dc5e
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Apr 27 13:26:03 2009 -0400
+
+ Fix xf86ModeBandwidth check
+
+commit 58888aefd0bad7bfca231ec7a54865d9c26c8095
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Apr 27 13:19:42 2009 -0400
+
+ Remove a leftover from overlay support
+
+commit 19c44d537e982fcf0fe2dc9f3273ac6166302510
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Tue Apr 21 10:00:24 2009 -0400
+
+ Fixed bad vga access in memory count routine.
+
+commit 2388c4d512554258bce2b78c8f8aa1151b161c3e
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Tue Apr 21 09:51:34 2009 -0400
+
+ Force pitch of 1024 for G200SE Pilot1 when edid is used as modeline.
+
+commit 32bc0bcec815a363a47b9e7337d06370baf0c0d4
+Author: Stefan Dirsch <sndirsch@suse.de>
+Date: Thu Apr 16 15:34:12 2009 +0200
+
+ Prevent MergedFB setups from crashing.
+
+ Second time mga_read_and_process_bios() is called pMga->chip_attribs
+ is a NULL pointer for some reason. (#21022)
+
+commit 70681daa0392e5fa413f888d92a30ddacdcc9c8c
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Tue Mar 31 11:41:00 2009 -0400
+
+ Fixed G200SE PLL selection routine of m,n,p.
+
+commit c955c1fdabfe0449369d0ccf31ab7e6ef3d7bffe
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Mon Mar 30 13:38:39 2009 -0400
+
+ fixed memory count rountine for G200eW to detect up to 16Megs on X server without libpciaccess.
+
+commit 16a5e3a7e13c0a2c1091ad452250cbc231b8f427
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Thu Mar 26 10:58:06 2009 -0400
+
+ Modified memory count rountine for G200eW to detect up to 16Megs.
+
+commit 36ae47b82310d96f158694765105fc010911702f
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Wed Mar 11 16:31:43 2009 -0400
+
+ Fixed bad access issues and ddc1 implementation for IP core.
+ 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.
+
+commit 669acb55023bce505f4a912bed6f1e9f3efa2856
+Author: Thomas Jaeger <ThJaeger@gmail.com>
+Date: Fri Jan 30 16:18:34 2009 -0500
+
+ Fall back to software for unsupported repeat modes
+
+ [anholt: dropped unneded ->repeat check -- it's a misguided compat field for
+ drivers from before repeatType existed]
+
+commit 496342b09b7379bff95627ec357d4dd24123dc85
+Author: Chris Ball <cjb@laptop.org>
+Date: Fri Feb 27 10:54:17 2009 -0500
+
+ Revert "Build fix for EXA 3"
+
+ This reverts commit 4aac5618278d47a801bef40d3eede1c360c1ea28.
+ The EXA developers have backed out this ABI bump.
+
+ Signed-off-by: Chris Ball <cjb@laptop.org>
+
+commit 4aac5618278d47a801bef40d3eede1c360c1ea28
+Author: Chris Ball <cjb@laptop.org>
+Date: Tue Feb 24 12:48:54 2009 -0500
+
+ Build fix for EXA 3
+
+ EXA in xserver head now requires us to pass -DEXA_DRIVER_KNOWN_MAJOR=3.
+
+ Signed-off-by: Chris Ball <cjb@laptop.org>
+
+commit 0e9df5fe820d69387355c3ef857cde4cc72220b0
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Fri Jan 30 20:41:56 2009 -0800
+
+ Add README with pointers to mailing list, bugzilla & git repos
+
+commit aa64a0c7b31858802f953b787991ef9c22a94cc5
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Wed Jan 21 09:56:41 2009 -0500
+
+ Updated PLL algorithm for G200eW.
+ Changed the m,n,p selection for G200eW and programming sequence.
+
+commit 808d887d910636aaa64c42d6add896e9f9b1833a
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Fri Jan 9 16:30:43 2009 -0800
+
+ Remove xorgconfig & xorgcfg from See Also list in man page
+
+commit ba376973ae0d25557fdcd920e03474c0e6632e97
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Thu Nov 20 23:02:49 2008 -0500
+
+ Fixed PLL m,n,p selection for G200eW to respect byte granularity.
+ 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.
+
+commit 01e60b391f39f2ebcf2eeb3be2424a2e291ec8ca
+Author: Yannick Heneault <yheneaul@matrox.com>
+Date: Wed Oct 1 21:39:40 2008 -0400
+
+ fixed winbond/nuvoton min pll clock to correct value (18.75Mhz).
+
commit a0ebccaa10668bff6a51d9c027cd43e29a030e2b
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Jul 2 15:02:32 2008 -0400
@@ -192,7 +344,7 @@ Date: Wed Sep 5 18:06:57 2007 +0200
Bumped version to 1.4.7.
commit 6fde3fd6d34e7252ee16422b19896d71b1622039
-Merge: 4bfc1e1... 923176f...
+Merge: 4bfc1e1 923176f
Author: James Cloos <cloos@jhcloos.com>
Date: Mon Sep 3 06:07:32 2007 -0400
@@ -234,7 +386,7 @@ Date: Mon Aug 20 15:36:57 2007 -0700
Fix compile error introduced by merge.
commit 707d3adbc7d9ee918d6c70083f51ad851ce68852
-Merge: 741c50c... 489e007...
+Merge: 741c50c 489e007
Author: Ian Romanick <idr@us.ibm.com>
Date: Mon Aug 20 15:20:39 2007 -0700
@@ -386,7 +538,7 @@ Date: Mon Jan 15 11:42:07 2007 -0800
Pass the correct pointer to pci_device_cfg_write_bits.
commit d5b4dbe749e860e4349607c57467f8085dc28c33
-Merge: cb103a1... 876657e...
+Merge: cb103a1 876657e
Author: Ian Romanick <idr@us.ibm.com>
Date: Tue Jan 9 16:04:06 2007 -0800
@@ -420,7 +572,7 @@ Date: Tue Dec 26 00:28:55 2006 +0100
Bug #9448: Actually write the C2STARTADD0 register.
commit fd91b601ec4dd48cfb6ea5495b595fec6d932ab5
-Merge: f84b138... 0ce8f52...
+Merge: f84b138 0ce8f52
Author: Daniel Stone <daniel@fooishbar.org>
Date: Sun Dec 24 06:32:53 2006 +0200
@@ -452,14 +604,14 @@ Date: Sat Dec 16 01:44:49 2006 +0200
bump to 1.4.6
commit cb103a18067adb3256c0b791255ce8435ff57e06
-Merge: d0e0362... 4bcfca9...
+Merge: d0e0362 4bcfca9
Author: Ian Romanick <idr@us.ibm.com>
Date: Mon Dec 11 15:06:19 2006 -0800
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
commit d0e03622811fd94c830c0b5233ff505392c0d331
-Merge: 8fee907... 1dd6e69...
+Merge: 8fee907 1dd6e69
Author: Ian Romanick <idr@us.ibm.com>
Date: Mon Dec 11 15:06:03 2006 -0800
@@ -612,7 +764,7 @@ Date: Fri Oct 13 18:33:39 2006 -0400
Bump to 1.4.3
commit 8fee907cac7e5924630e3648bfb72ad9bd021ea8
-Merge: 7cecee1... 2fc0ebf...
+Merge: 7cecee1 2fc0ebf
Author: Ian Romanick <idr@us.ibm.com>
Date: Tue Oct 10 11:43:52 2006 -0700
@@ -645,7 +797,7 @@ Date: Wed Sep 20 20:51:36 2006 +0200
Added a FIXME on BLK support for GXcopy instead.
commit ecc155e27b6566196e56de241ae81266e03dc90e
-Merge: e7b36c6... 2e73c29...
+Merge: e7b36c6 2e73c29
Author: Tilman Sauerbeck <tilman@code-monkey.de>
Date: Wed Sep 20 20:43:55 2006 +0200
@@ -1004,7 +1156,7 @@ Date: Thu Aug 10 19:49:22 2006 +0200
by myself.
commit 7cecee186c889902bed9b7fa042f0bd3cc0297ef
-Merge: 160b1f7... bde5920...
+Merge: 160b1f7 bde5920
Author: Ian Romanick <idr@umwelt.(none)>
Date: Thu Aug 10 10:19:55 2006 -0700
@@ -1035,7 +1187,7 @@ Date: Tue Aug 8 16:59:15 2006 -0700
searching for it in MGAPreInit.
commit 068e3427cfdf3e3b5dc5c97872d5f52f47ff0d68
-Merge: 95e0722... 7170de8...
+Merge: 95e0722 7170de8
Author: Ian Romanick <idr@umwelt.(none)>
Date: Wed Jul 26 11:47:32 2006 -0700
diff --git a/debian/changelog b/debian/changelog
index 4eb4340..407da31 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
-xserver-xorg-video-mga (1:1.4.9.dfsg-5) UNRELEASED; urgency=low
+xserver-xorg-video-mga (1:1.4.10.dfsg-1) UNRELEASED; urgency=low
+ * New upstream release.
* xserver-xorg-video-mga now suggests firmware-linux since
a firmware may be needed during driver initialization.
- -- Brice Goglin <bgoglin@debian.org> Wed, 15 Apr 2009 18:41:24 +0200
+ -- Brice Goglin <bgoglin@debian.org> Mon, 27 Apr 2009 21:12:07 +0200
xserver-xorg-video-mga (1:1.4.9.dfsg-4) unstable; urgency=low
commit 626af26098ab5d0823bf1d6c08157b4c89ec578a
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 27 14:01:03 2009 -0400
mga 1.4.10
diff --git a/configure.ac b/configure.ac
index f0119dd..3a04b21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,9 +22,8 @@
AC_PREREQ(2.57)
-# When the version number is modified here, also modify it in src/mga.h.
AC_INIT([xf86-video-mga],
- 1.4.9,
+ 1.4.10,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-mga)
commit d33b06038223b2b121be7e3f8c207de5f518b28c
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 27 14:00:00 2009 -0400
Fix ChangeLog generation
diff --git a/Makefile.am b/Makefile.am
index 59e0db2..44f8234 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,6 @@ EXTRA_DIST = README_HALLIB mga_PInS.txt ChangeLog
.PHONY: ChangeLog
ChangeLog:
- (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+ (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
dist-hook: ChangeLog
commit 06b6ead9a1b367e08ed6b3e75dfde0ee3b4a82b8
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 27 13:37:42 2009 -0400
G200SE: Only force 16bpp on low-memory cards
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 6876f6c..e229984 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -2045,7 +2045,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->videoRam = MGACountRam(pScrn);
}
- if (pMga->is_G200SE)
+ if (pMga->is_G200SE && pScrn->videoRam < 2048)
pScrn->confScreen->defaultdepth = 16;
if (!xf86SetDepthBpp(pScrn, 0, 0, 0, flags24)) {
commit 8b84fe236a42336e87048317880cc437494655f1
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 27 13:36:45 2009 -0400
Move device ID and memory sizing much earlier in setup
diff --git a/src/mga_driver.c b/src/mga_driver.c
index fcb9127..6876f6c 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -1907,8 +1907,106 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
#endif
}
-
-
+ if (!(pMga->Options = xalloc(sizeof(MGAOptions))))
+ return FALSE;
+ memcpy(pMga->Options, MGAOptions, sizeof(MGAOptions));
+
+ /* ajv changes to reflect actual values. see sdk pp 3-2. */
+ /* these masks just get rid of the crap in the lower bits */
+
+ /* For the 2064 and older rev 1064, base0 is the MMIO and base1 is
+ * the framebuffer.
+ */
+
+ switch (pMga->chip_attribs->BARs) {
+ case old_BARs:
+ pMga->framebuffer_bar = 1;
+ pMga->io_bar = 0;
+ pMga->iload_bar = -1;
+ break;
+ case probe_BARs:
+ if (pMga->ChipRev < 3) {
+ pMga->framebuffer_bar = 1;
+ pMga->io_bar = 0;
+ pMga->iload_bar = 2;
+ break;
+ }
+ /* FALLTHROUGH */
+ case new_BARs:
+ pMga->framebuffer_bar = 0;
+ pMga->io_bar = 1;
+ pMga->iload_bar = 2;
+ break;
+ }
+
+#ifdef XSERVER_LIBPCIACCESS
+ pMga->FbAddress = pMga->PciInfo->regions[pMga->framebuffer_bar].base_addr;
+#else
+ pMga->FbAddress = pMga->PciInfo->memBase[pMga->framebuffer_bar] & 0xff800000;
+#endif
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lX\n",
+ (unsigned long)pMga->FbAddress);
+
+#ifdef XSERVER_LIBPCIACCESS
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO registers at 0x%lX\n",
+ (unsigned long) pMga->PciInfo->regions[pMga->io_bar].base_addr);
+#else
+ pMga->IOAddress = pMga->PciInfo->memBase[pMga->io_bar] & 0xffffc000;
+
+ xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
+ (unsigned long)pMga->IOAddress);
+#endif
+
+ if (pMga->iload_bar != -1) {
+#ifdef XSERVER_LIBPCIACCESS
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Pseudo-DMA transfer window at 0x%lX\n",
+ (unsigned long) pMga->PciInfo->regions[pMga->iload_bar].base_addr);
+#else
+ if (pMga->PciInfo->memBase[2] != 0) {
+ pMga->ILOADAddress = pMga->PciInfo->memBase[2] & 0xffffc000;
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Pseudo-DMA transfer window at 0x%lX\n",
+ (unsigned long)pMga->ILOADAddress);
+ }
+#endif
+ }
+
+#ifndef XSERVER_LIBPCIACCESS
+ /*
+ * Find the BIOS base. Get it from the PCI config if possible. Otherwise
+ * use the VGA default. Allow the config file to override this.
+ */
+
+ pMga->BiosFrom = X_NONE;
+ if (pMga->device->BiosBase != 0) {
+ /* XXX This isn't used */
+ pMga->BiosAddress = pMga->device->BiosBase;
+ pMga->BiosFrom = X_CONFIG;
+ } else {
+ /* details: rombase sdk pp 4-15 */
+ if (pMga->PciInfo->biosBase != 0) {
+ pMga->BiosAddress = pMga->PciInfo->biosBase & 0xffff0000;
+ pMga->BiosFrom = X_PROBED;
+ } else if (pMga->Primary) {
+ pMga->BiosAddress = 0xc0000;
+ pMga->BiosFrom = X_DEFAULT;
+ }
+ }
+ if (pMga->BiosAddress) {
+ xf86DrvMsg(pScrn->scrnIndex, pMga->BiosFrom, "BIOS at 0x%lX\n",
+ (unsigned long)pMga->BiosAddress);
+ }
+#endif
+
+ if (xf86RegisterResources(pMga->pEnt->index, NULL, ResExclusive)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "xf86RegisterResources() found resource conflicts\n");
+ MGAFreeRec(pScrn);
+ return FALSE;
+ }
+
/*
* The first thing we should figure out is the depth, bpp, etc.
* Our default depth is 8, so pass it to the helper function.
@@ -1921,6 +2019,32 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if (pMga->SecondCrtc)
flags24 = Support32bppFb;
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_FBDEV, FALSE)) {
+ pMga->FBDev = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Using framebuffer device\n");
+ /* check for linux framebuffer device */
+ if (!xf86LoadSubModule(pScrn, "fbdevhw"))
+ return FALSE;
+ xf86LoaderReqSymLists(fbdevHWSymbols, NULL);
+ if (!fbdevHWInit(pScrn, pMga->PciInfo, NULL))
+ return FALSE;
+ }
+
+ /*
+ * If the user has specified the amount of memory in the XF86Config
+ * file, we respect that setting.
+ */
+ from = X_PROBED;
+ if (pMga->device->videoRam != 0) {
+ pScrn->videoRam = pMga->device->videoRam;
+ from = X_CONFIG;
+ } else if (pMga->FBDev) {
+ pScrn->videoRam = fbdevHWGetVidmem(pScrn)/1024;
+ } else {
+ pScrn->videoRam = MGACountRam(pScrn);
+ }
+
if (pMga->is_G200SE)
pScrn->confScreen->defaultdepth = 16;
@@ -1971,9 +2095,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if (!(pMga->Options = xalloc(sizeof(MGAOptions))))
- return FALSE;
- memcpy(pMga->Options, MGAOptions, sizeof(MGAOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pMga->Options);
if (pMga->is_G200SE) {
@@ -2122,11 +2243,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
}
- if (xf86ReturnOptValBool(pMga->Options, OPTION_FBDEV, FALSE)) {
- pMga->FBDev = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using framebuffer device\n");
- }
if (xf86ReturnOptValBool(pMga->Options, OPTION_OVERCLOCK_MEM, FALSE)) {
pMga->OverclockMem = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Overclocking memory\n");
@@ -2170,12 +2286,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
} /* ISMGAGx50() */
}
if (pMga->FBDev) {
- /* check for linux framebuffer device */
- if (!xf86LoadSubModule(pScrn, "fbdevhw"))
- return FALSE;
- xf86LoaderReqSymLists(fbdevHWSymbols, NULL);
- if (!fbdevHWInit(pScrn, pMga->PciInfo, NULL))
- return FALSE;
pScrn->SwitchMode = fbdevHWSwitchModeWeak();
pScrn->AdjustFrame = fbdevHWAdjustFrameWeak();
pScrn->EnterVT = MGAEnterVTFBDev;
@@ -2233,105 +2343,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
break;
}
- /* ajv changes to reflect actual values. see sdk pp 3-2. */
- /* these masks just get rid of the crap in the lower bits */
-
- /* For the 2064 and older rev 1064, base0 is the MMIO and base1 is
- * the framebuffer.
- */
-
- switch (pMga->chip_attribs->BARs) {
- case old_BARs:
- pMga->framebuffer_bar = 1;
- pMga->io_bar = 0;
- pMga->iload_bar = -1;
- break;
- case probe_BARs:
- if (pMga->ChipRev < 3) {
- pMga->framebuffer_bar = 1;
- pMga->io_bar = 0;
- pMga->iload_bar = 2;
- break;
- }
- /* FALLTHROUGH */
- case new_BARs:
- pMga->framebuffer_bar = 0;
- pMga->io_bar = 1;
- pMga->iload_bar = 2;
- break;
- }
-
-
-#ifdef XSERVER_LIBPCIACCESS
- pMga->FbAddress = pMga->PciInfo->regions[pMga->framebuffer_bar].base_addr;
-#else
- pMga->FbAddress = pMga->PciInfo->memBase[pMga->framebuffer_bar] & 0xff800000;
-#endif
-
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lX\n",
- (unsigned long)pMga->FbAddress);
-
-#ifdef XSERVER_LIBPCIACCESS
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO registers at 0x%lX\n",
- (unsigned long) pMga->PciInfo->regions[pMga->io_bar].base_addr);
-#else
- pMga->IOAddress = pMga->PciInfo->memBase[pMga->io_bar] & 0xffffc000;
-
- xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
- (unsigned long)pMga->IOAddress);
-#endif
-
- if (pMga->iload_bar != -1) {
-#ifdef XSERVER_LIBPCIACCESS
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Pseudo-DMA transfer window at 0x%lX\n",
- (unsigned long) pMga->PciInfo->regions[pMga->iload_bar].base_addr);
-#else
- if (pMga->PciInfo->memBase[2] != 0) {
- pMga->ILOADAddress = pMga->PciInfo->memBase[2] & 0xffffc000;
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Pseudo-DMA transfer window at 0x%lX\n",
- (unsigned long)pMga->ILOADAddress);
- }
-#endif
- }
-
-
-#ifndef XSERVER_LIBPCIACCESS
- /*
- * Find the BIOS base. Get it from the PCI config if possible. Otherwise
- * use the VGA default. Allow the config file to override this.
- */
-
- pMga->BiosFrom = X_NONE;
- if (pMga->device->BiosBase != 0) {
- /* XXX This isn't used */
- pMga->BiosAddress = pMga->device->BiosBase;
- pMga->BiosFrom = X_CONFIG;
- } else {
- /* details: rombase sdk pp 4-15 */
- if (pMga->PciInfo->biosBase != 0) {
- pMga->BiosAddress = pMga->PciInfo->biosBase & 0xffff0000;
- pMga->BiosFrom = X_PROBED;
- } else if (pMga->Primary) {
- pMga->BiosAddress = 0xc0000;
- pMga->BiosFrom = X_DEFAULT;
- }
- }
- if (pMga->BiosAddress) {
- xf86DrvMsg(pScrn->scrnIndex, pMga->BiosFrom, "BIOS at 0x%lX\n",
- (unsigned long)pMga->BiosAddress);
- }
-#endif
-
-
- if (xf86RegisterResources(pMga->pEnt->index, NULL, ResExclusive)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "xf86RegisterResources() found resource conflicts\n");
- MGAFreeRec(pScrn);
- return FALSE;
- }
-
/*
* Read the BIOS data struct
*/
@@ -2379,20 +2390,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
if ( (!pMga->Primary && !pMga->FBDev) || xf86IsPc98() )
MGASoftReset(pScrn);
- /*
- * If the user has specified the amount of memory in the XF86Config
- * file, we respect that setting.
- */
- from = X_PROBED;
- if (pMga->device->videoRam != 0) {
- pScrn->videoRam = pMga->device->videoRam;
- from = X_CONFIG;
- } else if (pMga->FBDev) {
- pScrn->videoRam = fbdevHWGetVidmem(pScrn)/1024;
- } else {
- pScrn->videoRam = MGACountRam(pScrn);
- }
-
if (pScrn->videoRam == 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Unable to detect video RAM.\n");
commit 9a82c5db3f8332d10b31d68e5b86d3a6b136dc5e
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 27 13:26:03 2009 -0400
Fix xf86ModeBandwidth check
diff --git a/configure.ac b/configure.ac
index 923b434..f0119dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,10 +109,16 @@ CFLAGS="$XORG_CFLAGS"
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
+CFLAGS="$save_CFLAGS"
+
+save_CFLAGS="$CFLAGS"
+CFLAGS="$XORG_CFLAGS"
AC_CHECK_DECL(xf86ModeBandwidth,
[AC_DEFINE(HAVE_XF86MODEBANDWIDTH, 1, [Have xf86ModeBandwidth])],
[],
- [#include "xf86Modes.h"])
+ [#include <X11/extensions/randr.h>
+ #include "xorg-server.h"
+ #include "xf86Modes.h"])
CFLAGS="$save_CFLAGS"
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
commit 58888aefd0bad7bfca231ec7a54865d9c26c8095
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 27 13:19:42 2009 -0400
Remove a leftover from overlay support
diff --git a/src/mga_driver.c b/src/mga_driver.c
index e929311..fcb9127 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -492,7 +492,6 @@ static const OptionInfoRec MGAOptions[] = {
{ OPTION_SYNC_ON_GREEN, "SyncOnGreen", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHOWCACHE, "ShowCache", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_OVERLAY, "Overlay", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_MGA_SDRAM, "MGASDRAM", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE },
@@ -1916,17 +1915,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
* We support both 24bpp and 32bpp layouts, so indicate that.
*/
- /* Prefer 24bpp fb unless the Overlay option is set, or DRI is
- * supported.
- */
- flags24 = Support24bppFb | Support32bppFb | SupportConvert32to24;
- s = xf86TokenToOptName(MGAOptions, OPTION_OVERLAY);
-#ifndef XF86DRI
- if (!(xf86FindOption(pScrn->confScreen->options, s) ||
- xf86FindOption(pMga->device->options, s))) {
- flags24 |= PreferConvert32to24;
- }
-#endif
+ /* Prefer 32bpp */
+ flags24 = Support24bppFb | Support32bppFb | PreferConvert24to32;
if (pMga->SecondCrtc)
flags24 = Support32bppFb;
commit 19c44d537e982fcf0fe2dc9f3273ac6166302510
Author: Yannick Heneault <yheneaul@matrox.com>
Date: Tue Apr 21 10:00:24 2009 -0400
Fixed bad vga access in memory count routine.
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 7ed5c27..e929311 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -1346,7 +1346,7 @@ MGACountRam(ScrnInfoPtr pScrn)
base[Offset+0x100] = 0x55;
base[Offset+0x101] = 0xaa;
- OUTREG(MGAREG_CRTC_INDEX, 0);
+ OUTREG8(MGAREG_CRTC_INDEX, 0);
usleep(8);
TestMemoryLocA = base[Offset];
commit 2388c4d512554258bce2b78c8f8aa1151b161c3e
Author: Yannick Heneault <yheneaul@matrox.com>
Date: Tue Apr 21 09:51:34 2009 -0400
Force pitch of 1024 for G200SE Pilot1 when edid is used as modeline.
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 7c67405..7ed5c27 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -2638,9 +2638,13 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_MGAG100_PCI:
maxPitch = 2048;
break;
+ case PCI_CHIP_MGAG200_SE_A_PCI:
+ if (pScrn->videoRam < 2048){
+ maxPitch = 1024;
+ }
+ break;
case PCI_CHIP_MGAG200:
case PCI_CHIP_MGAG200_PCI:
- case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
case PCI_CHIP_MGAG200_WINBOND_PCI:
case PCI_CHIP_MGAG200_EV_PCI:
@@ -2664,6 +2668,10 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xfree(linePitches);
}
+ /* Some X compute displayWidth from inferred virtual without
+ checking pitch limit. */
+ if(pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI && pScrn->videoRam < 2048)
+ pScrn->displayWidth = 1024;
if (i < 1 && pMga->FBDev) {
fbdevHWUseBuildinMode(pScrn);
commit 32bc0bcec815a363a47b9e7337d06370baf0c0d4
Author: Stefan Dirsch <sndirsch@suse.de>
Date: Thu Apr 16 15:34:12 2009 +0200
Prevent MergedFB setups from crashing.
Second time mga_read_and_process_bios() is called pMga->chip_attribs
is a NULL pointer for some reason. (#21022)
diff --git a/src/mga_bios.c b/src/mga_bios.c
index b78890e..c015077 100644
--- a/src/mga_bios.c
+++ b/src/mga_bios.c
@@ -326,8 +326,9 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
* isn't found or can't be read we'll still have some reasonable values
* to use.
*/
- (void) memcpy(& pMga->bios, & pMga->chip_attribs->default_bios_values,
- sizeof(struct mga_bios_values));
+ if (pMga->chip_attribs)
+ (void) memcpy(& pMga->bios, & pMga->chip_attribs->default_bios_values,
+ sizeof(struct mga_bios_values));
/* If the BIOS address was probed, it was found from the PCI config space
commit 70681daa0392e5fa413f888d92a30ddacdcc9c8c
Author: Yannick Heneault <yheneaul@matrox.com>
Date: Tue Mar 31 11:41:00 2009 -0400
Fixed G200SE PLL selection routine of m,n,p.
diff --git a/src/mga_dacG.c b/src/mga_dacG.c
index 88a12cb..c98ae97 100644
--- a/src/mga_dacG.c
+++ b/src/mga_dacG.c
@@ -55,9 +55,8 @@ static void MGAGLoadPalette(ScrnInfoPtr, int, int*, LOCO*, VisualPtr);
static Bool MGAG_i2cInit(ScrnInfoPtr pScrn);
static void
-MGAG200IPComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
+MGAG200SEComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
{
- MGAPtr pMga = MGAPTR(pScrn);
unsigned int ulComputedFo;
unsigned int ulFDelta;
unsigned int ulFPermitedDelta;
@@ -67,43 +66,68 @@ MGAG200IPComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
unsigned int ulTestM;
unsigned int ulTestN;
unsigned int ulPLLFreqRef;
- unsigned int ulTestPStart;
- unsigned int ulTestNStart;
- unsigned int ulTestNEnd;
- unsigned int ulTestMStart;
- unsigned int ulTestMEnd;
- if (pMga->is_G200SE) {
- ulVCOMax = 320000;
- ulVCOMin = 160000;
- ulPLLFreqRef = 25000;
- ulTestPStart = 8;
- ulTestNStart = 17;
- ulTestNEnd = 32;
- ulTestMStart = 1;
- ulTestMEnd = 32;
- } else { /* pMga->is_G200EV */
- ulVCOMax = 550000;
- ulVCOMin = 150000;
- ulPLLFreqRef = 50000;
- ulTestPStart = 16;
- ulTestNStart = 1;
- ulTestNEnd = 256;
- ulTestMStart = 1;
- ulTestMEnd = 16;
+ ulVCOMax = 320000;
+ ulVCOMin = 160000;
+ 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) {
+ if ((lFo * ulTestP) > ulVCOMax) continue;
+ if ((lFo * ulTestP) < ulVCOMin) continue;
+
+ for (ulTestN = 17; ulTestN <= 256; ulTestN++) {
+ for (ulTestM = 1; ulTestM <= 32; ulTestM++) {
+ ulComputedFo = (ulPLLFreqRef * ulTestN) / (ulTestM * ulTestP);
+ if (ulComputedFo > lFo)
+ ulFTmpDelta = ulComputedFo - lFo;
+ else
+ ulFTmpDelta = lFo - ulComputedFo;
+
+ if (ulFTmpDelta < ulFDelta) {
+ ulFDelta = ulFTmpDelta;
+ *M = ulTestM - 1;
+ *N = ulTestN - 1;
+ *P = ulTestP - 1;
+ }
+ }
+ }
}
+}
+
+static void
+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;
+ unsigned int ulTestN;
+ unsigned int ulVCOMax;
+ unsigned int ulVCOMin;
+ unsigned int ulPLLFreqRef;
+
+ ulVCOMax = 550000;
+ ulVCOMin = 150000;
+ 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 = ulTestPStart; ulTestP > 0; ulTestP--) {
+ for (ulTestP = 16; ulTestP > 0; ulTestP--) {
if ((lFo * ulTestP) > ulVCOMax) continue;
if ((lFo * ulTestP) < ulVCOMin) continue;
- for (ulTestN = ulTestNStart; ulTestN <= ulTestNEnd; ulTestN++) {
- for (ulTestM = ulTestMStart; ulTestM <= ulTestMEnd; ulTestM++) {
+ for (ulTestN = 1; ulTestN <= 256; ulTestN++) {
+ for (ulTestM = 1; ulTestM <= 16; ulTestM++) {
ulComputedFo = (ulPLLFreqRef * ulTestN) / (ulTestM * ulTestP);
if (ulComputedFo > lFo)
ulFTmpDelta = ulComputedFo - lFo;
@@ -112,7 +136,7 @@ MGAG200IPComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *M, int *N, int *P)
if (ulFTmpDelta < ulFDelta) {
ulFDelta = ulFTmpDelta;
- *M = ulTestM - 1;
+ *M = (CARD8)(ulTestM - 1);
*N = (CARD8)(ulTestN - 1);
*P = (CARD8)(ulTestP - 1);
}
@@ -601,6 +625,7 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out )
/* Pixel clock values */
int m, n, p, s;
+ m = n = p = s = 0;
if(MGAISGx50(pMga)) {
pReg->Clock = f_out;
@@ -608,13 +633,13 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out )
}
if (pMga->is_G200SE) {
- MGAG200IPComputePLLParam(pScrn, f_out, &m, &n, &p);
+ MGAG200SEComputePLLParam(pScrn, f_out, &m, &n, &p);
pReg->DacRegs[ MGA1064_PIX_PLLC_M ] = m;
pReg->DacRegs[ MGA1064_PIX_PLLC_N ] = n;
pReg->DacRegs[ MGA1064_PIX_PLLC_P ] = p;
} else if (pMga->is_G200EV) {
- MGAG200IPComputePLLParam(pScrn, f_out, &m, &n, &p);
+ MGAG200EVComputePLLParam(pScrn, f_out, &m, &n, &p);
pReg->PllM = m;
pReg->PllN = n;
commit c955c1fdabfe0449369d0ccf31ab7e6ef3d7bffe
Author: Yannick Heneault <yheneaul@matrox.com>
Date: Mon Mar 30 13:38:39 2009 -0400
fixed memory count rountine for G200eW to detect up to 16Megs on X server without libpciaccess.
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 70bd280..7c67405 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -1293,8 +1293,7 @@ MGACountRam(ScrnInfoPtr pScrn)
Reply to: