Bug 11652 - patch updates for the mga driver
Summary: patch updates for the mga driver
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/mga (show other bugs)
Version: 7.2 (2007.02)
Hardware: Other Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-07-18 09:02 UTC by benoit
Modified: 2008-04-16 18:02 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch #1 (20.53 KB, patch)
2007-07-18 09:03 UTC, benoit
no flags Details | Splinter Review
patch #2 (8.82 KB, patch)
2007-07-18 09:04 UTC, benoit
no flags Details | Splinter Review
patch #3 (1.34 KB, patch)
2007-07-18 09:04 UTC, benoit
no flags Details | Splinter Review
patch #4 (1.34 KB, text/x-diff)
2007-07-18 09:06 UTC, benoit
no flags Details

Description benoit 2007-07-18 09:02:41 UTC
A set of patches to add support for new cards. Originally submitted to the xorg mailing list around feb 2007.
Comment 1 benoit 2007-07-18 09:03:52 UTC
Created attachment 10787 [details] [review]
patch #1
Comment 2 benoit 2007-07-18 09:04:09 UTC
Created attachment 10788 [details] [review]
patch #2
Comment 3 benoit 2007-07-18 09:04:49 UTC
Created attachment 10789 [details] [review]
patch #3
Comment 4 benoit 2007-07-18 09:06:26 UTC
Created attachment 10790 [details]
patch #4
Comment 5 Stefan Dirsch 2007-07-19 06:40:53 UTC
JFYI, patches #3/#4 are exactly the same.
Comment 6 Alex Deucher 2007-07-25 10:00:18 UTC
It looks like a lot of this is already included in mga driver.  Can you check the latest git version and verify that it includes all the necessary fixes and if not, submit a patch against git master?

http://gitweb.freedesktop.org/?p=xorg/driver/xf86-video-mga.git;a=summary
Comment 7 Stefan Dirsch 2007-11-04 12:50:43 UTC
Ben, could you verify this?
Comment 8 Adam Jackson 2007-12-12 14:44:20 UTC
Most of patch 1 is already merged.  Some bits aren't.

The change to MGAdoDDC appears to turn off DDC on G200SE.  This seems intensely foolish, unless G200SE really doesn't have an I2C bus.  Pretty sure it does though.  I have no intention of merging this without explanation.

The change to MGAPreInit to disallow modes larger than 1600x1200 for G200SE-A will simply fail preinit completely, rather than just filtering away modes that big.  Also, it's broken:

+    if ((pScrn->modes->VDisplay > 1600) && 
+        (pScrn->modes->HDisplay > 1200) &&
+        (pMga->is_G200SE_A)) {
+        return FALSE;
+    }

That's rejecting taller than 1600 and wider than 1200; pretty sure you meant to do taller than 1200 _or_ wider than 1600.  I've added a check for this in MGAValidMode().

The changes to mga.h add a #define MAX_BW that's never used.  Why?
Comment 9 Adam Jackson 2007-12-13 13:28:30 UTC
The MAX_BW thing in the first patch is apparently a bandwidth limitation that's used in the second patch to reject large video modes.  But, again, doing this outside of MGAValidMode, which means X will just fail to start instead of merely rejecting the bad modes.

Then there's this gem:

+    MGA_NOT_HAL(
+        if (pMga->is_G200SE) {
+            CARD8 value = 0x14;
+            if (pMga->is_G200SE_A) {
+                if (INREG(0x1E24) == 0x1) {
+                    value = 0x03;
+                }
+            }
+            OUTREG8(0x1FDE, 0x06);
+            OUTREG8(0x1FDF, value);
+        }
+    );

Based on the usage of 0x1E24 elsewhere, I'm going to assume this is setting up memory type or timing parameters, but comments would be helpful.

Also:

     if (pMga->is_G200SE) {
 	VRTemp = pScrn->videoRam;
 	FBTemp = pMga->FbMapSize;
-	pScrn->videoRam = 4096;
+	pScrn->videoRam = 8192;
 	pMga->FbMapSize = pScrn->videoRam * 1024;
     }

Pretty sure the card I've got isn't 8M.  Shame we can't tell this some more accurate way...
Comment 10 benoit 2007-12-24 05:33:42 UTC
The modes greater than 1600x1200 are indeed blocked, but in the local current version i have i have also added maxHeight field to have xf86ValdiateMode to remove unwanted resolution for this card so it should never need to exit at the 1600x1200 check. 

MAX_BW is indeed used as a bandwidth limitation check to make sure the card doesn't try to set up for a resolution it can't handle.

The 0x1E24 check is to verify which pilot card is being used. And is used mainly to setup the hipri value of the card for use in a non hal enabled configuration as well as for when we check the max bandwidth for the latest board version of pilot.

The memory value hack is done for the HAL to setup it up in the screeninit function.

As to DDC when the patch was submitted it wasn't functional. Support for it will be added through the HAL at some point.

Comment 11 Adam Jackson 2008-01-19 12:55:26 UTC
(In reply to comment #10)
> The modes greater than 1600x1200 are indeed blocked, but in the local current
> version i have i have also added maxHeight field to have xf86ValdiateMode to
> remove unwanted resolution for this card so it should never need to exit at the
> 1600x1200 check.

This "local current version", is it in CVS or something?  I would really like to see a change history for Matrox' version of mga(4) so I can be sure we've merged everything over that we should have.

> MAX_BW is indeed used as a bandwidth limitation check to make sure the card
> doesn't try to set up for a resolution it can't handle.

I've committed a version of this that uses the same mode bandwidth computation as the other drivers.

> The 0x1E24 check is to verify which pilot card is being used. And is used
> mainly to setup the hipri value of the card for use in a non hal enabled
> configuration as well as for when we check the max bandwidth for the latest
> board version of pilot.

Applied.

> The memory value hack is done for the HAL to setup it up in the screeninit
> function.

Applied.

> As to DDC when the patch was submitted it wasn't functional. Support for it
> will be added through the HAL at some point.

Applied, although nngh.  I2C is not magic, I don't know why you'd bother to hide it in the HAL.
Comment 12 Adam Jackson 2008-03-31 08:12:06 UTC
This is probably as fixed as it's going to get in git.

(In reply to comment #11)
> (In reply to comment #10)
> > The modes greater than 1600x1200 are indeed blocked, but in the local current
> > version i have i have also added maxHeight field to have xf86ValdiateMode to
> > remove unwanted resolution for this card so it should never need to exit at the
> > 1600x1200 check.
> 
> This "local current version", is it in CVS or something?  I would really like
> to see a change history for Matrox' version of mga(4) so I can be sure we've
> merged everything over that we should have.

This would still be really nice to have.  But I suspect I can just hack something up with successive git imports of the matrox release tarballs.
 
> > As to DDC when the patch was submitted it wasn't functional. Support for it
> > will be added through the HAL at some point.
> 
> Applied, although nngh.  I2C is not magic, I don't know why you'd bother to
> hide it in the HAL.

DDC is still broken for this chip, and hiding it in HAL is utterly incomprehensible.  The HAL library has completely outlived its usefulness now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.