Commit f938e97d authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

indentation fixes.

parent eeed0d9f
...@@ -14,12 +14,12 @@ static int agp_try_unsupported __initdata = 0; ...@@ -14,12 +14,12 @@ static int agp_try_unsupported __initdata = 0;
static struct aper_size_info_fixed intel_i810_sizes[] = static struct aper_size_info_fixed intel_i810_sizes[] =
{ {
{64, 16384, 4}, {64, 16384, 4},
/* The 32M mode still requires a 64k gatt */ /* The 32M mode still requires a 64k gatt */
{32, 8192, 4} {32, 8192, 4}
}; };
#define AGP_DCACHE_MEMORY 1 #define AGP_DCACHE_MEMORY 1
#define AGP_PHYS_MEMORY 2 #define AGP_PHYS_MEMORY 2
static struct gatt_mask intel_i810_masks[] = static struct gatt_mask intel_i810_masks[] =
{ {
...@@ -48,12 +48,12 @@ static int intel_i810_fetch_size(void) ...@@ -48,12 +48,12 @@ static int intel_i810_fetch_size(void)
} }
if ((smram_miscc & I810_GFX_MEM_WIN_SIZE) == I810_GFX_MEM_WIN_32M) { if ((smram_miscc & I810_GFX_MEM_WIN_SIZE) == I810_GFX_MEM_WIN_32M) {
agp_bridge.previous_size = agp_bridge.previous_size =
agp_bridge.current_size = (void *) (values + 1); agp_bridge.current_size = (void *) (values + 1);
agp_bridge.aperture_size_idx = 1; agp_bridge.aperture_size_idx = 1;
return values[1].size; return values[1].size;
} else { } else {
agp_bridge.previous_size = agp_bridge.previous_size =
agp_bridge.current_size = (void *) (values); agp_bridge.current_size = (void *) (values);
agp_bridge.aperture_size_idx = 0; agp_bridge.aperture_size_idx = 0;
return values[0].size; return values[0].size;
} }
...@@ -72,11 +72,10 @@ static int intel_i810_configure(void) ...@@ -72,11 +72,10 @@ static int intel_i810_configure(void)
pci_read_config_dword(intel_i810_private.i810_dev, I810_MMADDR, &temp); pci_read_config_dword(intel_i810_private.i810_dev, I810_MMADDR, &temp);
temp &= 0xfff80000; temp &= 0xfff80000;
intel_i810_private.registers = intel_i810_private.registers = (volatile u8 *) ioremap(temp, 128 * 4096);
(volatile u8 *) ioremap(temp, 128 * 4096);
if ((INREG32(intel_i810_private.registers, I810_DRAM_CTL) if ((INREG32(intel_i810_private.registers, I810_DRAM_CTL)
& I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) { & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) {
/* This will need to be dynamically assigned */ /* This will need to be dynamically assigned */
printk(KERN_INFO PFX "detected 4MB dedicated video ram.\n"); printk(KERN_INFO PFX "detected 4MB dedicated video ram.\n");
intel_i810_private.num_dcache_entries = 1024; intel_i810_private.num_dcache_entries = 1024;
...@@ -114,7 +113,7 @@ static void intel_i810_agp_enable(u32 mode) ...@@ -114,7 +113,7 @@ static void intel_i810_agp_enable(u32 mode)
} }
static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start, static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start,
int type) int type)
{ {
int i, j, num_entries; int i, j, num_entries;
void *temp; void *temp;
...@@ -132,12 +131,10 @@ static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start, ...@@ -132,12 +131,10 @@ static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start,
} }
if (type != 0 || mem->type != 0) { if (type != 0 || mem->type != 0) {
if ((type == AGP_DCACHE_MEMORY) && if ((type == AGP_DCACHE_MEMORY) && (mem->type == AGP_DCACHE_MEMORY)) {
(mem->type == AGP_DCACHE_MEMORY)) {
/* special insert */ /* special insert */
CACHE_FLUSH(); CACHE_FLUSH();
for (i = pg_start; for (i = pg_start; i < (pg_start + mem->page_count); i++) {
i < (pg_start + mem->page_count); i++) {
OUTREG32(intel_i810_private.registers, OUTREG32(intel_i810_private.registers,
I810_PTE_BASE + (i * 4), I810_PTE_BASE + (i * 4),
(i * 4096) | I810_PTE_LOCAL | (i * 4096) | I810_PTE_LOCAL |
...@@ -147,15 +144,13 @@ static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start, ...@@ -147,15 +144,13 @@ static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start,
agp_bridge.tlb_flush(mem); agp_bridge.tlb_flush(mem);
return 0; return 0;
} }
if((type == AGP_PHYS_MEMORY) && if((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY))
(mem->type == AGP_PHYS_MEMORY)) { goto insert;
goto insert;
}
return -EINVAL; return -EINVAL;
} }
insert: insert:
CACHE_FLUSH(); CACHE_FLUSH();
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
OUTREG32(intel_i810_private.registers, OUTREG32(intel_i810_private.registers,
I810_PTE_BASE + (j * 4), mem->memory[i]); I810_PTE_BASE + (j * 4), mem->memory[i]);
...@@ -167,7 +162,7 @@ static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start, ...@@ -167,7 +162,7 @@ static int intel_i810_insert_entries(agp_memory * mem, off_t pg_start,
} }
static int intel_i810_remove_entries(agp_memory * mem, off_t pg_start, static int intel_i810_remove_entries(agp_memory * mem, off_t pg_start,
int type) int type)
{ {
int i; int i;
...@@ -199,7 +194,7 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type) ...@@ -199,7 +194,7 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type)
new->page_count = pg_count; new->page_count = pg_count;
new->num_scratch_pages = 0; new->num_scratch_pages = 0;
vfree(new->memory); vfree(new->memory);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return new; return new;
} }
if(type == AGP_PHYS_MEMORY) { if(type == AGP_PHYS_MEMORY) {
...@@ -209,15 +204,14 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type) ...@@ -209,15 +204,14 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type)
* Xserver still writes to it through the agp * Xserver still writes to it through the agp
* aperture * aperture
*/ */
if (pg_count != 1) { if (pg_count != 1)
return NULL; return NULL;
}
new = agp_create_memory(1);
if (new == NULL) { new = agp_create_memory(1);
if (new == NULL)
return NULL; return NULL;
}
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
addr = agp_bridge.agp_alloc_page(); addr = agp_bridge.agp_alloc_page();
if (addr == NULL) { if (addr == NULL) {
...@@ -227,25 +221,23 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type) ...@@ -227,25 +221,23 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type)
} }
new->memory[0] = agp_bridge.mask_memory(virt_to_phys(addr), type); new->memory[0] = agp_bridge.mask_memory(virt_to_phys(addr), type);
new->page_count = 1; new->page_count = 1;
new->num_scratch_pages = 1; new->num_scratch_pages = 1;
new->type = AGP_PHYS_MEMORY; new->type = AGP_PHYS_MEMORY;
new->physical = virt_to_phys((void *) new->memory[0]); new->physical = virt_to_phys((void *) new->memory[0]);
return new; return new;
} }
return NULL; return NULL;
} }
static void intel_i810_free_by_type(agp_memory * curr) static void intel_i810_free_by_type(agp_memory * curr)
{ {
agp_free_key(curr->key); agp_free_key(curr->key);
if(curr->type == AGP_PHYS_MEMORY) { if(curr->type == AGP_PHYS_MEMORY) {
agp_bridge.agp_destroy_page( agp_bridge.agp_destroy_page(phys_to_virt(curr->memory[0]));
phys_to_virt(curr->memory[0]));
vfree(curr->memory); vfree(curr->memory);
} }
kfree(curr); kfree(curr);
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
} }
static unsigned long intel_i810_mask_memory(unsigned long addr, int type) static unsigned long intel_i810_mask_memory(unsigned long addr, int type)
...@@ -295,7 +287,7 @@ static struct aper_size_info_fixed intel_i830_sizes[] = ...@@ -295,7 +287,7 @@ static struct aper_size_info_fixed intel_i830_sizes[] =
}; };
static struct _intel_i830_private { static struct _intel_i830_private {
struct pci_dev *i830_dev; /* device one */ struct pci_dev *i830_dev; /* device one */
volatile u8 *registers; volatile u8 *registers;
int gtt_entries; int gtt_entries;
} intel_i830_private; } intel_i830_private;
...@@ -581,8 +573,7 @@ static int intel_fetch_size(void) ...@@ -581,8 +573,7 @@ static int intel_fetch_size(void)
for (i = 0; i < agp_bridge.num_aperture_sizes; i++) { for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
if (temp == values[i].size_value) { if (temp == values[i].size_value) {
agp_bridge.previous_size = agp_bridge.previous_size = agp_bridge.current_size = (void *) (values + i);
agp_bridge.current_size = (void *) (values + i);
agp_bridge.aperture_size_idx = i; agp_bridge.aperture_size_idx = i;
return values[i].size; return values[i].size;
} }
...@@ -627,11 +618,11 @@ static void intel_tlbflush(agp_memory * mem) ...@@ -627,11 +618,11 @@ static void intel_tlbflush(agp_memory * mem)
static void intel_8xx_tlbflush(agp_memory * mem) static void intel_8xx_tlbflush(agp_memory * mem)
{ {
u32 temp; u32 temp;
pci_read_config_dword(agp_bridge.dev, INTEL_AGPCTRL, &temp); pci_read_config_dword(agp_bridge.dev, INTEL_AGPCTRL, &temp);
pci_write_config_dword(agp_bridge.dev, INTEL_AGPCTRL, temp & ~(1 << 7)); pci_write_config_dword(agp_bridge.dev, INTEL_AGPCTRL, temp & ~(1 << 7));
pci_read_config_dword(agp_bridge.dev, INTEL_AGPCTRL, &temp); pci_read_config_dword(agp_bridge.dev, INTEL_AGPCTRL, &temp);
pci_write_config_dword(agp_bridge.dev, INTEL_AGPCTRL, temp | (1 << 7)); pci_write_config_dword(agp_bridge.dev, INTEL_AGPCTRL, temp | (1 << 7));
} }
...@@ -683,7 +674,7 @@ static int intel_configure(void) ...@@ -683,7 +674,7 @@ static int intel_configure(void)
/* paccfg/nbxcfg */ /* paccfg/nbxcfg */
pci_read_config_word(agp_bridge.dev, INTEL_NBXCFG, &temp2); pci_read_config_word(agp_bridge.dev, INTEL_NBXCFG, &temp2);
pci_write_config_word(agp_bridge.dev, INTEL_NBXCFG, pci_write_config_word(agp_bridge.dev, INTEL_NBXCFG,
(temp2 & ~(1 << 10)) | (1 << 9)); (temp2 & ~(1 << 10)) | (1 << 9));
/* clear any possible error conditions */ /* clear any possible error conditions */
pci_write_config_byte(agp_bridge.dev, INTEL_ERRSTS + 1, 7); pci_write_config_byte(agp_bridge.dev, INTEL_ERRSTS + 1, 7);
return 0; return 0;
...@@ -708,7 +699,7 @@ static int intel_815_configure(void) ...@@ -708,7 +699,7 @@ static int intel_815_configure(void)
/* attbase - aperture base */ /* attbase - aperture base */
/* the Intel 815 chipset spec. says that bits 29-31 in the /* the Intel 815 chipset spec. says that bits 29-31 in the
* ATTBASE register are reserved -> try not to write them */ * ATTBASE register are reserved -> try not to write them */
if (agp_bridge.gatt_bus_addr & INTEL_815_ATTBASE_MASK) if (agp_bridge.gatt_bus_addr & INTEL_815_ATTBASE_MASK)
panic("gatt bus addr too high"); panic("gatt bus addr too high");
pci_read_config_dword(agp_bridge.dev, INTEL_ATTBASE, &addr); pci_read_config_dword(agp_bridge.dev, INTEL_ATTBASE, &addr);
addr &= INTEL_815_ATTBASE_MASK; addr &= INTEL_815_ATTBASE_MASK;
...@@ -729,7 +720,7 @@ static int intel_815_configure(void) ...@@ -729,7 +720,7 @@ static int intel_815_configure(void)
static void intel_820_tlbflush(agp_memory * mem) static void intel_820_tlbflush(agp_memory * mem)
{ {
return; return;
} }
static void intel_820_cleanup(void) static void intel_820_cleanup(void)
...@@ -740,9 +731,9 @@ static void intel_820_cleanup(void) ...@@ -740,9 +731,9 @@ static void intel_820_cleanup(void)
previous_size = A_SIZE_8(agp_bridge.previous_size); previous_size = A_SIZE_8(agp_bridge.previous_size);
pci_read_config_byte(agp_bridge.dev, INTEL_I820_RDCR, &temp); pci_read_config_byte(agp_bridge.dev, INTEL_I820_RDCR, &temp);
pci_write_config_byte(agp_bridge.dev, INTEL_I820_RDCR, pci_write_config_byte(agp_bridge.dev, INTEL_I820_RDCR,
temp & ~(1 << 1)); temp & ~(1 << 1));
pci_write_config_byte(agp_bridge.dev, INTEL_APSIZE, pci_write_config_byte(agp_bridge.dev, INTEL_APSIZE,
previous_size->size_value); previous_size->size_value);
} }
...@@ -974,10 +965,10 @@ static struct aper_size_info_16 intel_generic_sizes[7] = ...@@ -974,10 +965,10 @@ static struct aper_size_info_16 intel_generic_sizes[7] =
static struct aper_size_info_8 intel_830mp_sizes[4] = static struct aper_size_info_8 intel_830mp_sizes[4] =
{ {
{256, 65536, 6, 0}, {256, 65536, 6, 0},
{128, 32768, 5, 32}, {128, 32768, 5, 32},
{64, 16384, 4, 48}, {64, 16384, 4, 48},
{32, 8192, 3, 56} {32, 8192, 3, 56}
}; };
static int __init intel_generic_setup (struct pci_dev *pdev) static int __init intel_generic_setup (struct pci_dev *pdev)
...@@ -1322,7 +1313,7 @@ static int __init agp_lookup_host_bridge (struct pci_dev *pdev) ...@@ -1322,7 +1313,7 @@ static int __init agp_lookup_host_bridge (struct pci_dev *pdev)
/* try init anyway, if user requests it */ /* try init anyway, if user requests it */
if (agp_try_unsupported) { if (agp_try_unsupported) {
printk(KERN_WARNING PFX "Trying generic Intel routines" printk(KERN_WARNING PFX "Trying generic Intel routines"
" for device id: %04x\n", pdev->device); " for device id: %04x\n", pdev->device);
agp_bridge.type = INTEL_GENERIC; agp_bridge.type = INTEL_GENERIC;
return intel_generic_setup(pdev); return intel_generic_setup(pdev);
} }
...@@ -1347,7 +1338,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev) ...@@ -1347,7 +1338,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev)
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1, NULL); i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG1, NULL);
if (i810_dev == NULL) { if (i810_dev == NULL) {
printk(KERN_ERR PFX "Detected an Intel i810," printk(KERN_ERR PFX "Detected an Intel i810,"
" but could not find the secondary device.\n"); " but could not find the secondary device.\n");
return -ENODEV; return -ENODEV;
} }
printk(KERN_INFO PFX "Detected an Intel i810 Chipset.\n"); printk(KERN_INFO PFX "Detected an Intel i810 Chipset.\n");
...@@ -1358,7 +1349,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev) ...@@ -1358,7 +1349,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev)
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, NULL); i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, NULL);
if (i810_dev == NULL) { if (i810_dev == NULL) {
printk(KERN_ERR PFX "Detected an Intel i810 DC100, but could not find the " printk(KERN_ERR PFX "Detected an Intel i810 DC100, but could not find the "
"secondary device.\n"); "secondary device.\n");
return -ENODEV; return -ENODEV;
} }
printk(KERN_INFO PFX "Detected an Intel i810 DC100 Chipset.\n"); printk(KERN_INFO PFX "Detected an Intel i810 DC100 Chipset.\n");
...@@ -1369,7 +1360,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev) ...@@ -1369,7 +1360,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev)
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810E_IG, NULL); i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810E_IG, NULL);
if (i810_dev == NULL) { if (i810_dev == NULL) {
printk(KERN_ERR PFX "Detected an Intel i810 E" printk(KERN_ERR PFX "Detected an Intel i810 E"
", but could not find the secondary device.\n"); ", but could not find the secondary device.\n");
return -ENODEV; return -ENODEV;
} }
printk(KERN_INFO PFX "Detected an Intel i810 E Chipset.\n"); printk(KERN_INFO PFX "Detected an Intel i810 E Chipset.\n");
...@@ -1377,11 +1368,11 @@ static int __init agp_find_supported_device(struct pci_dev *dev) ...@@ -1377,11 +1368,11 @@ static int __init agp_find_supported_device(struct pci_dev *dev)
return intel_i810_setup(i810_dev); return intel_i810_setup(i810_dev);
case PCI_DEVICE_ID_INTEL_82815_MC: case PCI_DEVICE_ID_INTEL_82815_MC:
/* The i815 can operate either as an i810 style /* The i815 can operate either as an i810 style
* integrated device, or as an AGP4X motherboard. * integrated device, or as an AGP4X motherboard.
* *
* This only addresses the first mode: * This only addresses the first mode:
*/ */
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_CGC, NULL); i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_CGC, NULL);
if (i810_dev == NULL) { if (i810_dev == NULL) {
printk(KERN_ERR PFX "agpgart: Detected an " printk(KERN_ERR PFX "agpgart: Detected an "
...@@ -1413,7 +1404,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev) ...@@ -1413,7 +1404,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev)
printk(KERN_INFO PFX "Detected an Intel 845G Chipset.\n"); printk(KERN_INFO PFX "Detected an Intel 845G Chipset.\n");
agp_bridge.type = INTEL_I810; agp_bridge.type = INTEL_I810;
return intel_i830_setup(i810_dev); return intel_i830_setup(i810_dev);
case PCI_DEVICE_ID_INTEL_82830_HB: case PCI_DEVICE_ID_INTEL_82830_HB:
i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82830_CGC, NULL); i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82830_CGC, NULL);
if(i810_dev && PCI_FUNC(i810_dev->devfn) != 0) if(i810_dev && PCI_FUNC(i810_dev->devfn) != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment