Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108217
b: refs/heads/master
c: e3cf695
h: refs/heads/master
i:
  108215: 08f0bf2
v: v3
  • Loading branch information
Bjorn Helgaas authored and Dave Airlie committed Aug 12, 2008
1 parent 9559a91 commit e76b57e
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 135 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55814b74c95a73dae6795e167294e6edc733aae9
refs/heads/master: e3cf69511a2c5369c58f6fd6a065de152c3d4b22
10 changes: 5 additions & 5 deletions trunk/drivers/char/agp/ali-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ static int ali_configure(void)

nlvm_addr+= agp_bridge->gart_bus_addr;
nlvm_addr|=(agp_bridge->gart_bus_addr>>12);
printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr);
dev_info(&agp_bridge->dev->dev, "nlvm top &base = %8x\n",
nlvm_addr);
}
#endif

Expand Down Expand Up @@ -315,8 +316,8 @@ static int __devinit agp_ali_probe(struct pci_dev *pdev,
goto found;
}

printk(KERN_ERR PFX "Unsupported ALi chipset (device id: %04x)\n",
pdev->device);
dev_err(&pdev->dev, "unsupported ALi chipset [%04x/%04x])\n",
pdev->vendor, pdev->device);
return -ENODEV;


Expand Down Expand Up @@ -361,8 +362,7 @@ static int __devinit agp_ali_probe(struct pci_dev *pdev,
bridge->driver = &ali_generic_bridge;
}

printk(KERN_INFO PFX "Detected ALi %s chipset\n",
devs[j].chipset_name);
dev_info(&pdev->dev, "ALi %s chipset\n", devs[j].chipset_name);

/* Fill in the mode register */
pci_read_config_dword(pdev,
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/char/agp/amd-k7-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
return -ENODEV;

j = ent - agp_amdk7_pci_table;
printk(KERN_INFO PFX "Detected AMD %s chipset\n",
amd_agp_device_ids[j].chipset_name);
dev_info(&pdev->dev, "AMD %s chipset\n",
amd_agp_device_ids[j].chipset_name);

bridge = agp_alloc_bridge();
if (!bridge)
Expand All @@ -442,7 +442,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
while (!cap_ptr) {
gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard);
if (!gfxcard) {
printk (KERN_INFO PFX "Couldn't find an AGP VGA controller.\n");
dev_info(&pdev->dev, "no AGP VGA controller\n");
return -ENODEV;
}
cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP);
Expand All @@ -453,7 +453,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
(if necessary at all). */
if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) {
agp_bridge->flags |= AGP_ERRATA_1X;
printk (KERN_INFO PFX "AMD 751 chipset with NVidia GeForce detected. Forcing to 1X due to errata.\n");
dev_info(&pdev->dev, "AMD 751 chipset with NVidia GeForce; forcing 1X due to errata\n");
}
pci_dev_put(gfxcard);
}
Expand All @@ -469,7 +469,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
agp_bridge->flags = AGP_ERRATA_FASTWRITES;
agp_bridge->flags |= AGP_ERRATA_SBA;
agp_bridge->flags |= AGP_ERRATA_1X;
printk (KERN_INFO PFX "AMD 761 chipset with errata detected - disabling AGP fast writes & SBA and forcing to 1X.\n");
dev_info(&pdev->dev, "AMD 761 chipset with errata; disabling AGP fast writes & SBA and forcing to 1X\n");
}
}

Expand Down
36 changes: 18 additions & 18 deletions trunk/drivers/char/agp/amd64-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,13 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
* so let double check that order, and lets trust the AMD NB settings
*/
if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) {
printk(KERN_INFO "Aperture size %u MB is not right, using settings from NB\n",
32 << order);
dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n",
32 << order);
order = nb_order;
}

printk(KERN_INFO PFX "Aperture from AGP @ %Lx size %u MB\n", aper, 32 << order);
dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n",
aper, 32 << order);
if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order))
return -1;

Expand All @@ -320,10 +321,10 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
for (i = 0; i < num_k8_northbridges; i++) {
struct pci_dev *dev = k8_northbridges[i];
if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
printk(KERN_ERR PFX "No usable aperture found.\n");
dev_err(&dev->dev, "no usable aperture found\n");
#ifdef __x86_64__
/* should port this to i386 */
printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
dev_err(&dev->dev, "consider rebooting with iommu=memaper=2 to get a good aperture\n");
#endif
return -1;
}
Expand All @@ -346,14 +347,14 @@ static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data
default: revstring="??"; break;
}

printk (KERN_INFO PFX "Detected AMD 8151 AGP Bridge rev %s\n", revstring);
dev_info(&pdev->dev, "AMD 8151 AGP Bridge rev %s\n", revstring);

/*
* Work around errata.
* Chips before B2 stepping incorrectly reporting v3.5
*/
if (pdev->revision < 0x13) {
printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n");
dev_info(&pdev->dev, "correcting AGP revision (reports 3.5, is really 3.0)\n");
bridge->major_version = 3;
bridge->minor_version = 0;
}
Expand All @@ -376,11 +377,11 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
struct pci_dev *dev1;
int i;
unsigned size = amd64_fetch_size();
printk(KERN_INFO "Setting up ULi AGP.\n");

dev_info(&pdev->dev, "setting up ULi AGP\n");
dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0));
if (dev1 == NULL) {
printk(KERN_INFO PFX "Detected a ULi chipset, "
"but could not fine the secondary device.\n");
dev_info(&pdev->dev, "can't find ULi secondary device\n");
return -ENODEV;
}

Expand All @@ -389,7 +390,7 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
break;

if (i == ARRAY_SIZE(uli_sizes)) {
printk(KERN_INFO PFX "No ULi size found for %d\n", size);
dev_info(&pdev->dev, "no ULi size found for %d\n", size);
return -ENODEV;
}

Expand Down Expand Up @@ -434,13 +435,11 @@ static int nforce3_agp_init(struct pci_dev *pdev)
int i;
unsigned size = amd64_fetch_size();

printk(KERN_INFO PFX "Setting up Nforce3 AGP.\n");
dev_info(&pdev->dev, "setting up Nforce3 AGP\n");

dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0));
if (dev1 == NULL) {
printk(KERN_INFO PFX "agpgart: Detected an NVIDIA "
"nForce3 chipset, but could not find "
"the secondary device.\n");
dev_info(&pdev->dev, "can't find Nforce3 secondary device\n");
return -ENODEV;
}

Expand All @@ -449,7 +448,7 @@ static int nforce3_agp_init(struct pci_dev *pdev)
break;

if (i == ARRAY_SIZE(nforce3_sizes)) {
printk(KERN_INFO PFX "No NForce3 size found for %d\n", size);
dev_info(&pdev->dev, "no NForce3 size found for %d\n", size);
return -ENODEV;
}

Expand All @@ -463,7 +462,7 @@ static int nforce3_agp_init(struct pci_dev *pdev)

/* if x86-64 aperture base is beyond 4G, exit here */
if ( (apbase & 0x7fff) >> (32 - 25) ) {
printk(KERN_INFO PFX "aperture base > 4G\n");
dev_info(&pdev->dev, "aperture base > 4G\n");
return -ENODEV;
}

Expand Down Expand Up @@ -506,7 +505,8 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
amd8151_init(pdev, bridge);
} else {
printk(KERN_INFO PFX "Detected AGP bridge %x\n", pdev->devfn);
dev_info(&pdev->dev, "AGP bridge [%04x/%04x]\n",
pdev->vendor, pdev->device);
}

bridge->driver = &amd_8151_driver;
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/char/agp/ati-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ static int __devinit agp_ati_probe(struct pci_dev *pdev,
goto found;
}

printk(KERN_ERR PFX
"Unsupported Ati chipset (device id: %04x)\n", pdev->device);
dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n",
pdev->vendor, pdev->device);
return -ENODEV;

found:
Expand All @@ -500,8 +500,7 @@ static int __devinit agp_ati_probe(struct pci_dev *pdev,

bridge->driver = &ati_generic_bridge;

printk(KERN_INFO PFX "Detected Ati %s chipset\n",
devs[j].chipset_name);
dev_info(&pdev->dev, "Ati %s chipset\n", devs[j].chipset_name);

/* Fill in the mode register */
pci_read_config_dword(pdev,
Expand Down
26 changes: 15 additions & 11 deletions trunk/drivers/char/agp/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
void *addr = bridge->driver->agp_alloc_page(bridge);

if (!addr) {
printk(KERN_ERR PFX "unable to get memory for scratch page.\n");
dev_err(&bridge->dev->dev,
"can't get memory for scratch page\n");
return -ENOMEM;
}

Expand All @@ -155,21 +156,22 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)

size_value = bridge->driver->fetch_size();
if (size_value == 0) {
printk(KERN_ERR PFX "unable to determine aperture size.\n");
dev_err(&bridge->dev->dev, "can't determine aperture size\n");
rc = -EINVAL;
goto err_out;
}
if (bridge->driver->create_gatt_table(bridge)) {
printk(KERN_ERR PFX
"unable to get memory for graphics translation table.\n");
dev_err(&bridge->dev->dev,
"can't get memory for graphics translation table\n");
rc = -ENOMEM;
goto err_out;
}
got_gatt = 1;

bridge->key_list = vmalloc(PAGE_SIZE * 4);
if (bridge->key_list == NULL) {
printk(KERN_ERR PFX "error allocating memory for key lists.\n");
dev_err(&bridge->dev->dev,
"can't allocate memory for key lists\n");
rc = -ENOMEM;
goto err_out;
}
Expand All @@ -179,7 +181,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
memset(bridge->key_list, 0, PAGE_SIZE * 4);

if (bridge->driver->configure()) {
printk(KERN_ERR PFX "error configuring host chipset.\n");
dev_err(&bridge->dev->dev, "error configuring host chipset\n");
rc = -EINVAL;
goto err_out;
}
Expand Down Expand Up @@ -269,25 +271,27 @@ int agp_add_bridge(struct agp_bridge_data *bridge)

/* Grab reference on the chipset driver. */
if (!try_module_get(bridge->driver->owner)) {
printk (KERN_INFO PFX "Couldn't lock chipset driver.\n");
dev_info(&bridge->dev->dev, "can't lock chipset driver\n");
return -EINVAL;
}

error = agp_backend_initialize(bridge);
if (error) {
printk (KERN_INFO PFX "agp_backend_initialize() failed.\n");
dev_info(&bridge->dev->dev,
"agp_backend_initialize() failed\n");
goto err_out;
}

if (list_empty(&agp_bridges)) {
error = agp_frontend_initialize();
if (error) {
printk (KERN_INFO PFX "agp_frontend_initialize() failed.\n");
dev_info(&bridge->dev->dev,
"agp_frontend_initialize() failed\n");
goto frontend_err;
}

printk(KERN_INFO PFX "AGP aperture is %dM @ 0x%lx\n",
bridge->driver->fetch_size(), bridge->gart_bus_addr);
dev_info(&bridge->dev->dev, "AGP aperture is %dM @ 0x%lx\n",
bridge->driver->fetch_size(), bridge->gart_bus_addr);

}

Expand Down
13 changes: 5 additions & 8 deletions trunk/drivers/char/agp/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ void agp_device_command(u32 bridge_agpstat, bool agp_v3)
if (!agp)
continue;

printk(KERN_INFO PFX "Putting AGP V%d device at %s into %dx mode\n",
agp_v3 ? 3 : 2, pci_name(device), mode);
dev_info(&device->dev, "putting AGP V%d device into %dx mode\n",
agp_v3 ? 3 : 2, mode);
pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat);
}
}
Expand Down Expand Up @@ -800,10 +800,8 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)

get_agp_version(agp_bridge);

printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
agp_bridge->major_version,
agp_bridge->minor_version,
pci_name(agp_bridge->dev));
dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
agp_bridge->major_version, agp_bridge->minor_version);

pci_read_config_dword(agp_bridge->dev,
agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat);
Expand Down Expand Up @@ -832,8 +830,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
pci_write_config_dword(bridge->dev,
bridge->capndx+AGPCTRL, temp);

printk(KERN_INFO PFX "Device is in legacy mode,"
" falling back to 2.x\n");
dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n");
}
}

Expand Down
Loading

0 comments on commit e76b57e

Please sign in to comment.