summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2006-08-11 19:16:50 +0000
committerjkim <jkim@FreeBSD.org>2006-08-11 19:16:50 +0000
commit11b5f41beac4542db8456ad35e02e9a1d89d2291 (patch)
tree51fcc229b845f37ddd4b57f3d627b2daca4bf523 /sys/pci
parent3a923dc02730b0a3c108dde04813059f81889161 (diff)
downloadFreeBSD-src-11b5f41beac4542db8456ad35e02e9a1d89d2291.zip
FreeBSD-src-11b5f41beac4542db8456ad35e02e9a1d89d2291.tar.gz
Explicitly set v3 mode only when it is requested. Don't bother otherwise.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/agp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/pci/agp.c b/sys/pci/agp.c
index b4ef386..92426ae 100644
--- a/sys/pci/agp.c
+++ b/sys/pci/agp.c
@@ -312,12 +312,14 @@ agp_v3_enable(device_t dev, device_t mdev, u_int32_t mode)
pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, 0, 4);
/* Construct the new mode word and tell the hardware */
+ command = 0;
command = AGP_MODE_SET_RQ(0, rq);
command = AGP_MODE_SET_ARQSZ(command, arqsz);
command = AGP_MODE_SET_CAL(command, cal);
command = AGP_MODE_SET_SBA(command, sba);
command = AGP_MODE_SET_FW(command, fw);
command = AGP_MODE_SET_RATE(command, rate);
+ command = AGP_MODE_SET_MODE_3(command, 1);
command = AGP_MODE_SET_AGP(command, 1);
pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, command, 4);
pci_write_config(mdev, agp_find_caps(mdev) + AGP_COMMAND, command, 4);
@@ -366,6 +368,7 @@ agp_v2_enable(device_t dev, device_t mdev, u_int32_t mode)
device_printf(dev, "Setting AGP v2 mode %d\n", rate);
/* Construct the new mode word and tell the hardware */
+ command = 0;
command = AGP_MODE_SET_RQ(0, rq);
command = AGP_MODE_SET_SBA(command, sba);
command = AGP_MODE_SET_FW(command, fw);
@@ -399,7 +402,9 @@ agp_generic_enable(device_t dev, u_int32_t mode)
* but should work fine for a classic single AGP slot system
* with AGP v3.
*/
- if (AGP_MODE_GET_MODE_3(tstatus) && AGP_MODE_GET_MODE_3(mstatus))
+ if (AGP_MODE_GET_MODE_3(mode) &&
+ AGP_MODE_GET_MODE_3(tstatus) &&
+ AGP_MODE_GET_MODE_3(mstatus))
return (agp_v3_enable(dev, mdev, mode));
else
return (agp_v2_enable(dev, mdev, mode));
OpenPOWER on IntegriCloud