Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart:
  [AGPGART] sworks-agp: Switch to PCI ref counting APIs
  [AGPGART] Nvidia AGP: Use refcount aware PCI interfaces
  [AGPGART] Fix sparse warning in sgi-agp.c
  [AGPGART] Intel-agp adjustments
  [AGPGART] Move [un]map_page_into_agp into asm/agp.h
  [AGPGART] Add missing calls to global_flush_tlb() to ali-agp
  [AGPGART] prevent probe collision of sis-agp and amd64_agp
  • Loading branch information
Linus Torvalds committed May 5, 2007
2 parents cf8ba7a + 881ba59 commit 98b9617
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 158 deletions.
2 changes: 2 additions & 0 deletions drivers/char/agp/ali-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge)
void *addr = agp_generic_alloc_page(agp_bridge);
u32 temp;

global_flush_tlb();
if (!addr)
return NULL;

Expand All @@ -160,6 +161,7 @@ static void ali_destroy_page(void * addr)
if (addr) {
global_cache_flush(); /* is this really needed? --hch */
agp_generic_destroy_page(addr);
global_flush_tlb();
}
}

Expand Down
22 changes: 0 additions & 22 deletions drivers/char/agp/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,6 @@ int agp_memory_reserved;
*/
EXPORT_SYMBOL_GPL(agp_memory_reserved);

#if defined(CONFIG_X86)
int map_page_into_agp(struct page *page)
{
int i;
i = change_page_attr(page, 1, PAGE_KERNEL_NOCACHE);
/* Caller's responsibility to call global_flush_tlb() for
* performance reasons */
return i;
}
EXPORT_SYMBOL_GPL(map_page_into_agp);

int unmap_page_from_agp(struct page *page)
{
int i;
i = change_page_attr(page, 1, PAGE_KERNEL);
/* Caller's responsibility to call global_flush_tlb() for
* performance reasons */
return i;
}
EXPORT_SYMBOL_GPL(unmap_page_from_agp);
#endif

/*
* Generic routines for handling agp_memory structures -
* They use the basic page allocation routines to do the brunt of the work.
Expand Down
8 changes: 3 additions & 5 deletions drivers/char/agp/intel-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ static void *i8xx_alloc_pages(void)
return NULL;

if (change_page_attr(page, 4, PAGE_KERNEL_NOCACHE) < 0) {
change_page_attr(page, 4, PAGE_KERNEL);
global_flush_tlb();
__free_page(page);
__free_pages(page, 2);
return NULL;
}
global_flush_tlb();
Expand All @@ -209,7 +210,7 @@ static void i8xx_destroy_pages(void *addr)
global_flush_tlb();
put_page(page);
unlock_page(page);
free_pages((unsigned long)addr, 2);
__free_pages(page, 2);
atomic_dec(&agp_bridge->current_memory_agp);
}

Expand Down Expand Up @@ -315,9 +316,6 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type)
struct agp_memory *new;
void *addr;

if (pg_count != 1 && pg_count != 4)
return NULL;

switch (pg_count) {
case 1: addr = agp_bridge->driver->agp_alloc_page(agp_bridge);
global_flush_tlb();
Expand Down
9 changes: 6 additions & 3 deletions drivers/char/agp/nvidia-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ static int __devinit agp_nvidia_probe(struct pci_dev *pdev,
u8 cap_ptr;

nvidia_private.dev_1 =
pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 1));
pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 1));
nvidia_private.dev_2 =
pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
nvidia_private.dev_3 =
pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));
pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));

if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {
printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "
Expand Down Expand Up @@ -443,6 +443,9 @@ static int __init agp_nvidia_init(void)
static void __exit agp_nvidia_cleanup(void)
{
pci_unregister_driver(&agp_nvidia_pci_driver);
pci_dev_put(nvidia_private.dev_1);
pci_dev_put(nvidia_private.dev_2);
pci_dev_put(nvidia_private.dev_3);
}

module_init(agp_nvidia_init);
Expand Down
5 changes: 2 additions & 3 deletions drivers/char/agp/sgi-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ static void *sgi_tioca_alloc_page(struct agp_bridge_data *bridge)

nid = info->ca_closest_node;
page = alloc_pages_node(nid, GFP_KERNEL, 0);
if (page == NULL) {
return 0;
}
if (!page)
return NULL;

get_page(page);
SetPageLocked(page);
Expand Down
Loading

0 comments on commit 98b9617

Please sign in to comment.