Commit fb5cd424 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] Improved AGPx8 handling.

If something fails, we should now explain what happened,
before we fall back to AGPx4 gracefully.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 2fbdf6e8
......@@ -458,29 +458,39 @@ static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
*mode |= AGPSTAT3_4X;
}
if (!((*cmd & AGPSTAT3_8X) && (*tmp & AGPSTAT3_8X) && (*mode & AGPSTAT3_8X)))
*cmd &= ~AGPSTAT3_8X;
else {
if (*mode & AGPSTAT3_8X) {
if (!(*cmd & AGPSTAT3_8X)) {
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
*cmd |= ~AGPSTAT3_4X;
printk ("%s requested AGPx8 but bridge not capable.\n", current->comm);
return;
}
if (!(*tmp & AGPSTAT3_8X)) {
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
*cmd |= ~AGPSTAT3_4X;
printk ("%s requested AGPx8 but device not capable.\n", current->comm);
return;
}
/* All set, bridge & device can do AGP x8*/
*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
return;
} else {
/*
* If we didn't specify AGPx8, we can only do x4.
* If the hardware can't do x4, we're up shit creek, and never
* should have got this far.
*/
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
if ((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X))
*cmd |= ~AGPSTAT3_4X;
else {
printk (KERN_INFO PFX "Badness. Don't know which AGP mode to set. "
"[cmd:%x tmp:%x fell back to:- cmd:%x tmp:%x]\n",
origcmd, origtmp, *cmd, *tmp);
return;
}
}
/* Clear out unwanted bits. */
if (*cmd & AGPSTAT3_8X)
*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
if (*cmd & AGPSTAT3_4X)
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
}
//FIXME: This doesn't smell right.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment