<p>Thanks for writing it!</p>
<p>Reviewed-by: Corbin Simpson <<a href="mailto:MostAwesomeDude@gmail.com">MostAwesomeDude@gmail.com</a>></p>
<p>Sending from a mobile, pardon my terseness. ~ C.</p>
<div class="gmail_quote">On Nov 6, 2011 10:39 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">
On Sun, Nov 6, 2011 at 4:37 PM, Corbin Simpson<br>
<<a href="mailto:mostawesomedude@gmail.com">mostawesomedude@gmail.com</a>> wrote:<br>
> Trusting the spec worries me; could this break anybody?<br>
<br>
It will allow the user to override possibly safer default settings. If<br>
a user has specified, say, 2x in his xorg.conf and this was not<br>
honored because the card only reported 4x, this patch would finally<br>
give him the 2x he is asking for. If 2x turns out to not work, he will<br>
suddenly have problems. But the solution would be to fix his<br>
xorg.conf. Up till now he might be thinking 2x works fine, while he<br>
was actually getting another rate.<br>
<br>
Generally, the default rate is defined by the DDX and the patch does<br>
not change these policies. However, with the patch we may actually<br>
apply the default value, instead of an undefined "0x" (i.e. the case<br>
when the DDX sets 1x or 2x by default, but the card says only 4x). The<br>
spec (I have checked section 6.1.10) does not say anything about<br>
writing a zero rate, and I don't know what the silicon does. I don't<br>
know of any way to read out the resulting speed. Is there any simple<br>
agp benchmarking tools?<br>
<br>
Of course, it would be good if more people who currently see "0x" in<br>
dmesg would try this patch.<br>
<br>
Note that Dave Jones did the same for bridges in<br>
28af24bb8470c7d0573b703a2955548b73a6c066 to get rid of "0x" cases.<br>
<br>
><br>
> Is there any reason to use the not-so-magic numbers instead of the named<br>
> constants?<br>
<br>
I followed the style of the surrounding code. I can follow up with a<br>
patch using named constants everywhere if that would be desired.<br>
<br>
Thanks for looking at it!<br>
Tormod<br>
<br>
<br>
><br>
> Sending from a mobile, pardon my terseness. ~ C.<br>
><br>
> On Nov 6, 2011 7:03 AM, "Tormod Volden" <<a href="mailto:lists.tormod@gmail.com">lists.tormod@gmail.com</a>> wrote:<br>
>><br>
>> 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<br>
>> *bridge_agpstat, u32 *vga_<br>
>> break;<br>
>> }<br>
>><br>
>> + /* Some graphic cards report they only support 4x, however the AGP<br>
>> 2.0 spec<br>
>> + * (section 4.1.1) says components must support the lower speeds<br>
>> 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<br>
>> 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<br>
>> 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>
><br>
</blockquote></div>