Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88fa08f6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
  agp: fix SIS 5591/5592 wrong PCI id
  intel/agp: rewrite GTT on resume
  agp: use dev_printk when possible
  amd64-agp: run fallback when no bridges found, not when driver registration fails
  intel_agp: official name for GM45 chipset
parents 1ea29508 91397585
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -148,6 +148,9 @@ struct agp_bridge_data {
	char minor_version;
	char minor_version;
	struct list_head list;
	struct list_head list;
	u32 apbase_config;
	u32 apbase_config;
	/* list of agp_memory mapped to the aperture */
	struct list_head mapped_list;
	spinlock_t mapped_lock;
};
};


#define KB(x)	((x) * 1024)
#define KB(x)	((x) * 1024)
+5 −5
Original line number Original line Diff line number Diff line
@@ -110,7 +110,8 @@ static int ali_configure(void)


		nlvm_addr+= agp_bridge->gart_bus_addr;
		nlvm_addr+= agp_bridge->gart_bus_addr;
		nlvm_addr|=(agp_bridge->gart_bus_addr>>12);
		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
#endif


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


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




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


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


	/* Fill in the mode register */
	/* Fill in the mode register */
	pci_read_config_dword(pdev,
	pci_read_config_dword(pdev,
+5 −5
Original line number Original line Diff line number Diff line
@@ -419,7 +419,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
		return -ENODEV;
		return -ENODEV;


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


	bridge = agp_alloc_bridge();
	bridge = agp_alloc_bridge();
@@ -442,7 +442,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
		while (!cap_ptr) {
		while (!cap_ptr) {
			gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard);
			gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard);
			if (!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;
				return -ENODEV;
			}
			}
			cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP);
			cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP);
@@ -453,7 +453,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
		   (if necessary at all). */
		   (if necessary at all). */
		if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) {
		if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) {
			agp_bridge->flags |= AGP_ERRATA_1X;
			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);
		pci_dev_put(gfxcard);
	}
	}
@@ -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_FASTWRITES;
			agp_bridge->flags |= AGP_ERRATA_SBA;
			agp_bridge->flags |= AGP_ERRATA_SBA;
			agp_bridge->flags |= AGP_ERRATA_1X;
			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");
		}
		}
	}
	}


+31 −20
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@


static struct resource *aperture_resource;
static struct resource *aperture_resource;
static int __initdata agp_try_unsupported = 1;
static int __initdata agp_try_unsupported = 1;
static int agp_bridges_found;


static void amd64_tlbflush(struct agp_memory *temp)
static void amd64_tlbflush(struct agp_memory *temp)
{
{
@@ -293,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
	 * so let double check that order, and lets trust the AMD NB settings
	 */
	 */
	if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) {
	if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) {
		printk(KERN_INFO "Aperture size %u MB is not right, using settings from NB\n",
		dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n",
			 32 << order);
			 32 << order);
		order = nb_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))
	if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order))
		return -1;
		return -1;


@@ -319,10 +321,10 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
	for (i = 0; i < num_k8_northbridges; i++) {
	for (i = 0; i < num_k8_northbridges; i++) {
		struct pci_dev *dev = k8_northbridges[i];
		struct pci_dev *dev = k8_northbridges[i];
		if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
		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__
#ifdef __x86_64__
			/* should port this to i386 */
			/* 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
#endif
			return -1;
			return -1;
		}
		}
@@ -345,14 +347,14 @@ static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data
	default:   revstring="??"; break;
	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.
	 * Work around errata.
	 * Chips before B2 stepping incorrectly reporting v3.5
	 * Chips before B2 stepping incorrectly reporting v3.5
	 */
	 */
	if (pdev->revision < 0x13) {
	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->major_version = 3;
		bridge->minor_version = 0;
		bridge->minor_version = 0;
	}
	}
@@ -375,11 +377,11 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
	struct pci_dev *dev1;
	struct pci_dev *dev1;
	int i;
	int i;
	unsigned size = amd64_fetch_size();
	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));
	dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0));
	if (dev1 == NULL) {
	if (dev1 == NULL) {
		printk(KERN_INFO PFX "Detected a ULi chipset, "
		dev_info(&pdev->dev, "can't find ULi secondary device\n");
			"but could not fine the secondary device.\n");
		return -ENODEV;
		return -ENODEV;
	}
	}


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


	if (i == ARRAY_SIZE(uli_sizes)) {
	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;
		return -ENODEV;
	}
	}


@@ -433,13 +435,11 @@ static int nforce3_agp_init(struct pci_dev *pdev)
	int i;
	int i;
	unsigned size = amd64_fetch_size();
	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));
	dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0));
	if (dev1 == NULL) {
	if (dev1 == NULL) {
		printk(KERN_INFO PFX "agpgart: Detected an NVIDIA "
		dev_info(&pdev->dev, "can't find Nforce3 secondary device\n");
			"nForce3 chipset, but could not find "
			"the secondary device.\n");
		return -ENODEV;
		return -ENODEV;
	}
	}


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


	if (i == ARRAY_SIZE(nforce3_sizes)) {
	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;
		return -ENODEV;
	}
	}


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


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


@@ -489,6 +489,7 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
{
{
	struct agp_bridge_data *bridge;
	struct agp_bridge_data *bridge;
	u8 cap_ptr;
	u8 cap_ptr;
	int err;


	cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
	cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
	if (!cap_ptr)
	if (!cap_ptr)
@@ -504,7 +505,8 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
	    pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
	    pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
		amd8151_init(pdev, bridge);
		amd8151_init(pdev, bridge);
	} else {
	} 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;
	bridge->driver = &amd_8151_driver;
@@ -536,7 +538,12 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
	}
	}


	pci_set_drvdata(pdev, bridge);
	pci_set_drvdata(pdev, bridge);
	return agp_add_bridge(bridge);
	err = agp_add_bridge(bridge);
	if (err < 0)
		return err;

	agp_bridges_found++;
	return 0;
}
}


static void __devexit agp_amd64_remove(struct pci_dev *pdev)
static void __devexit agp_amd64_remove(struct pci_dev *pdev)
@@ -713,7 +720,11 @@ int __init agp_amd64_init(void)


	if (agp_off)
	if (agp_off)
		return -EINVAL;
		return -EINVAL;
	if (pci_register_driver(&agp_amd64_pci_driver) < 0) {
	err = pci_register_driver(&agp_amd64_pci_driver);
	if (err < 0)
		return err;

	if (agp_bridges_found == 0) {
		struct pci_dev *dev;
		struct pci_dev *dev;
		if (!agp_try_unsupported && !agp_try_unsupported_boot) {
		if (!agp_try_unsupported && !agp_try_unsupported_boot) {
			printk(KERN_INFO PFX "No supported AGP bridge found.\n");
			printk(KERN_INFO PFX "No supported AGP bridge found.\n");
+3 −4
Original line number Original line Diff line number Diff line
@@ -486,8 +486,8 @@ static int __devinit agp_ati_probe(struct pci_dev *pdev,
			goto found;
			goto found;
	}
	}


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


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


	bridge->driver = &ati_generic_bridge;
	bridge->driver = &ati_generic_bridge;


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


	/* Fill in the mode register */
	/* Fill in the mode register */
	pci_read_config_dword(pdev,
	pci_read_config_dword(pdev,
Loading