<p>Trusting the spec worries me; could this break anybody?</p>
<p>Is there any reason to use the not-so-magic numbers instead of the named constants?</p>
<p>Sending from a mobile, pardon my terseness. ~ C.</p>
<div class="gmail_quote">On Nov 6, 2011 7:03 AM, "Tormod Volden" <<a href="mailto:lists.tormod@gmail.com">lists.tormod@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Tormod Volden <<a href="mailto:debian.tormod@gmail.com">debian.tormod@gmail.com</a>><br>
<br>
Some cards report that they support only 4x, in which case they<br>
should support 2x and 1x as well, according to the AGP spec.<br>
<br>
Otherwise a requested 1x or 2x rate will result in 0 being set:<br>
<br>
agpgart-via 0000:00:00.0: putting AGP V2 device into 0x mode<br>
<br>
For instance ProSavage KN133 [5333:8d02] only reports 4x.<br>
<br>
Signed-off-by: Tormod Volden <<a href="mailto:debian.tormod@gmail.com">debian.tormod@gmail.com</a>><br>
---<br>
drivers/char/agp/generic.c | 18 ++++++++++++++++++<br>
1 files changed, 18 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c<br>
index b072648..c5d04e5 100644<br>
--- a/drivers/char/agp/generic.c<br>
+++ b/drivers/char/agp/generic.c<br>
@@ -526,6 +526,24 @@ static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_<br>
break;<br>
}<br>
<br>
+ /* Some graphic cards report they only support 4x, however the AGP 2.0 spec<br>
+ * (section 4.1.1) says components must support the lower speeds as well.<br>
+ */<br>
+ switch (*vga_agpstat & 7) {<br>
+ case 4:<br>
+ *vga_agpstat |= (AGPSTAT2_2X | AGPSTAT2_1X);<br>
+ printk(KERN_INFO PFX "Graphics card claims to only support x4 rate. "<br>
+ "Fixing up support for x2 & x1\n");<br>
+ break;<br>
+ case 2:<br>
+ *vga_agpstat |= AGPSTAT2_1X;<br>
+ printk(KERN_INFO PFX "Graphics card claims to only support x2 rate. "<br>
+ "Fixing up support for x1\n");<br>
+ break;<br>
+ default:<br>
+ break;<br>
+ }<br>
+<br>
/* Check the speed bits make sense. Only one should be set. */<br>
tmp = *requested_mode & 7;<br>
switch (tmp) {<br>
--<br>
1.7.5.4<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div>