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] x86_64: Enable VIA AGP driver on x86-64 for VIA P4 chipsets
  [AGPGART] x86_64: Fix wrong PCI ID for ALI M1695 AGP bridge
  [AGPGART] ATI RS350 support.
  [AGPGART] Lots of CodingStyle/whitespace cleanups.
  • Loading branch information
Linus Torvalds committed Mar 25, 2006
2 parents c36cd16 + 9d1f6b2 commit 2e9abdd
Show file tree
Hide file tree
Showing 19 changed files with 103 additions and 106 deletions.
4 changes: 2 additions & 2 deletions drivers/char/agp/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ config AGP_SWORKS
tristate "Serverworks LE/HE chipset support"
depends on AGP && X86_32
help
Say Y here to support the Serverworks AGP card. See
Say Y here to support the Serverworks AGP card. See
<http://www.serverworks.com/> for product descriptions and images.

config AGP_VIA
tristate "VIA chipset support"
depends on AGP && X86_32
depends on AGP
help
This option gives you AGP support for the GLX component of
X on VIA MVP3/Apollo Pro chipsets.
Expand Down
11 changes: 5 additions & 6 deletions drivers/char/agp/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
Expand Down Expand Up @@ -53,7 +53,7 @@ enum aper_size_type {
struct gatt_mask {
unsigned long mask;
u32 type;
/* totally device specific, for integrated chipsets that
/* totally device specific, for integrated chipsets that
* might have different types of memory masks. For other
* devices this will probably be ignored */
};
Expand Down Expand Up @@ -104,8 +104,7 @@ struct agp_bridge_driver {
void (*agp_enable)(struct agp_bridge_data *, u32);
void (*cleanup)(void);
void (*tlb_flush)(struct agp_memory *);
unsigned long (*mask_memory)(struct agp_bridge_data *,
unsigned long, int);
unsigned long (*mask_memory)(struct agp_bridge_data *, unsigned long, int);
void (*cache_flush)(void);
int (*create_gatt_table)(struct agp_bridge_data *);
int (*free_gatt_table)(struct agp_bridge_data *);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/ali-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge)

if (!addr)
return NULL;

pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
Expand Down
14 changes: 8 additions & 6 deletions drivers/char/agp/alpha-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ static struct page *alpha_core_agp_vm_nopage(struct vm_area_struct *vma,
dma_addr = address - vma->vm_start + agp->aperture.bus_base;
pa = agp->ops->translate(agp, dma_addr);

if (pa == (unsigned long)-EINVAL) return NULL; /* no translation */

if (pa == (unsigned long)-EINVAL)
return NULL; /* no translation */

/*
* Get the page, inc the use count, and return it
*/
Expand Down Expand Up @@ -89,7 +90,7 @@ static void alpha_core_agp_enable(struct agp_bridge_data *bridge, u32 mode)
agp_device_command(agp->mode.lw, 0);
}

static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,
static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,
int type)
{
alpha_agp_info *agp = agp_bridge->dev_private_data;
Expand All @@ -98,7 +99,8 @@ static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,

temp = agp_bridge->current_size;
num_entries = A_SIZE_FIX(temp)->num_entries;
if ((pg_start + mem->page_count) > num_entries) return -EINVAL;
if ((pg_start + mem->page_count) > num_entries)
return -EINVAL;

status = agp->ops->bind(agp, pg_start, mem);
mb();
Expand All @@ -107,7 +109,7 @@ static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,
return status;
}

static int alpha_core_agp_remove_memory(struct agp_memory *mem, off_t pg_start,
static int alpha_core_agp_remove_memory(struct agp_memory *mem, off_t pg_start,
int type)
{
alpha_agp_info *agp = agp_bridge->dev_private_data;
Expand All @@ -125,7 +127,7 @@ struct agp_bridge_driver alpha_core_agp_driver = {
.size_type = FIXED_APER_SIZE,
.cant_use_aperture = 1,
.masks = NULL,

.fetch_size = alpha_core_agp_fetch_size,
.configure = alpha_core_agp_configure,
.agp_enable = alpha_core_agp_enable,
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/amd64-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] =
{256, 65536, 6, 0x00000700 }, /* 1 1 1 0 0 0 */
{128, 32768, 5, 0x00000720 }, /* 1 1 1 1 0 0 */
{64, 16384, 4, 0x00000730 }, /* 1 1 1 1 1 0 */
{32, 8192, 3, 0x00000738 } /* 1 1 1 1 1 1 */
{32, 8192, 3, 0x00000738 } /* 1 1 1 1 1 1 */
};

static int amd_8151_configure(void)
Expand Down
10 changes: 7 additions & 3 deletions drivers/char/agp/ati-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int ati_create_page_map(ati_page_map *page_map)
/*CACHE_FLUSH();*/
global_cache_flush();

for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) {
for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) {
writel(agp_bridge->scratch_page, page_map->remapped+i);
readl(page_map->remapped+i); /* PCI Posting. */
}
Expand All @@ -99,7 +99,7 @@ static void ati_free_gatt_pages(void)
ati_page_map *entry;

tables = ati_generic_private.gatt_pages;
for(i = 0; i < ati_generic_private.num_tables; i++) {
for (i = 0; i < ati_generic_private.num_tables; i++) {
entry = tables[i];
if (entry != NULL) {
if (entry->real != NULL)
Expand Down Expand Up @@ -387,7 +387,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
agp_bridge->gart_bus_addr = addr;

/* Calculate the agp offset */
for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1,
page_dir.remapped+GET_PAGE_DIR_OFF(addr));
readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
Expand Down Expand Up @@ -466,6 +466,10 @@ static struct agp_device_ids ati_agp_device_ids[] __devinitdata =
.device_id = PCI_DEVICE_ID_ATI_RS300_200,
.chipset_name = "IGP9100/M",
},
{
.device_id = PCI_DEVICE_ID_ATI_RS350_200,
.chipset_name = "IGP9100/M",
},
{ }, /* dummy final entry, always present */
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
struct agp_bridge_data *agp_alloc_bridge(void)
{
struct agp_bridge_data *bridge;

bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
if (!bridge)
return NULL;
Expand Down
16 changes: 8 additions & 8 deletions drivers/char/agp/efficeon-agp.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Transmeta's Efficeon AGPGART driver.
*
*
* Based upon a diff by Linus around November '02.
*
* Ported to the 2.6 kernel by Carlos Puchol <cpglinux@puchol.com>
Expand All @@ -9,7 +9,7 @@

/*
* NOTE-cpg-040217:
*
*
* - when compiled as a module, after loading the module,
* it will refuse to unload, indicating it is in use,
* when it is not.
Expand Down Expand Up @@ -45,7 +45,7 @@
* 8: Present
* 7:6: reserved, write as zero
* 5:0: GATT directory index: which 1st-level entry
*
*
* The Efficeon AGP spec requires pages to be WB-cacheable
* but to be explicitly CLFLUSH'd after any changes.
*/
Expand Down Expand Up @@ -125,7 +125,7 @@ static int efficeon_configure(void)
struct aper_size_info_lvl2 *current_size;

printk(KERN_DEBUG PFX "efficeon_configure()\n");

current_size = A_SIZE_LVL2(agp_bridge->current_size);

/* aperture size */
Expand Down Expand Up @@ -190,7 +190,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
const int present = EFFICEON_PRESENT;
const int clflush_chunk = ((cpuid_ebx(1) >> 8) & 0xff) << 3;
int num_entries, l1_pages;

num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries;

printk(KERN_DEBUG PFX "efficeon_create_gatt_table(%d)\n", num_entries);
Expand Down Expand Up @@ -257,12 +257,12 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t

if (!page)
continue;

page += (index & 0x3ff);
*page = insert;

/* clflush is slow, so don't clflush until we have to */
if ( last_page &&
if ( last_page &&
((unsigned long)page^(unsigned long)last_page) & clflush_mask )
asm volatile("clflush %0" : : "m" (*last_page));

Expand Down Expand Up @@ -373,7 +373,7 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev,
*/
r = &pdev->resource[0];
if (!r->start && r->end) {
if(pci_assign_resource(pdev, 0)) {
if (pci_assign_resource(pdev, 0)) {
printk(KERN_ERR PFX "could not assign resource 0\n");
return -ENODEV;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ static int agpioc_acquire_wrap(struct agp_file_private *priv)
if (agp_fe.current_controller != NULL)
return -EBUSY;

if(!agp_bridge)
if (!agp_bridge)
return -ENODEV;

if (atomic_read(&agp_bridge->agp_in_use))
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ EXPORT_SYMBOL_GPL(agp_num_entries);
/**
* agp_copy_info - copy bridge state information
*
* @info: agp_kern_info pointer. The caller should insure that this pointer is valid.
* @info: agp_kern_info pointer. The caller should insure that this pointer is valid.
*
* This function copies information about the agp bridge device and the state of
* the agp backend into an agp_kern_info pointer.
Expand Down
6 changes: 3 additions & 3 deletions drivers/char/agp/hp-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ static int __init hp_zx1_ioc_shared(void)
/*
* IOC already configured by sba_iommu module; just use
* its setup. We assume:
* - IOVA space is 1Gb in size
* - first 512Mb is IOMMU, second 512Mb is GART
* - IOVA space is 1Gb in size
* - first 512Mb is IOMMU, second 512Mb is GART
*/
hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG);
switch (hp->io_tlb_ps) {
Expand Down Expand Up @@ -115,7 +115,7 @@ static int __init hp_zx1_ioc_shared(void)

if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
/* Normal case when no AGP device in system */
hp->gatt = NULL;
hp->gatt = NULL;
hp->gatt_entries = 0;
printk(KERN_ERR PFX "No reserved IO PDIR entry found; "
"GART disabled\n");
Expand Down
16 changes: 8 additions & 8 deletions drivers/char/agp/i460-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,10 @@ static int i460_insert_memory_large_io_page (struct agp_memory *mem,
num_entries = A_SIZE_8(temp)->num_entries;

/* Figure out what pg_start means in terms of our large GART pages */
start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];
end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];
start_offset = pg_start % I460_KPAGES_PER_IOPAGE;
end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;
start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];
end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];
start_offset = pg_start % I460_KPAGES_PER_IOPAGE;
end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;

if (end > i460.lp_desc + num_entries) {
printk(KERN_ERR PFX "Looks like we're out of AGP memory\n");
Expand Down Expand Up @@ -458,10 +458,10 @@ static int i460_remove_memory_large_io_page (struct agp_memory *mem,
num_entries = A_SIZE_8(temp)->num_entries;

/* Figure out what pg_start means in terms of our large GART pages */
start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];
end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];
start_offset = pg_start % I460_KPAGES_PER_IOPAGE;
end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;
start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];
end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];
start_offset = pg_start % I460_KPAGES_PER_IOPAGE;
end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;

for (i = 0, lp = start; lp <= end; ++lp) {
for (idx = ((lp == start) ? start_offset : 0);
Expand Down
Loading

0 comments on commit 2e9abdd

Please sign in to comment.