Skip to content

Commit

Permalink
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/airlied/drm-2.6

* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (24 commits)
  agp/intel: Make intel_i965_mask_memory use dma_addr_t for physical addresses
  agp: add user mapping support to ATI AGP bridge.
  drm/i915: enable GEM on PAE.
  drm/radeon: fix unused variables warning
  agp: switch AGP to use page array instead of unsigned long array
  agpgart: detected ALi M???? chipset with M1621
  drm/radeon: command stream checker for r3xx-r5xx hardware
  drm/radeon: Fully initialize LVDS info also when we can't get it from the ROM.
  radeon: Fix CP byte order on big endian architectures with KMS.
  agp/uninorth: Handle user memory types.
  drm/ttm: Add some powerpc cache flush code.
  radeon: Enable modesetting on non-x86.
  drm/radeon: Respect AGP cant_use_aperture flag.
  drm: EDID endianness fixes.
  drm/radeon: this VRAM vs aperture test is wrong, just remove it.
  drm/ttm: fix an error path to exit function correctly
  drm: Apply "Memory fragmentation from lost alignment blocks"
  ttm: Return -ERESTART when a signal interrupts bo eviction.
  drm: Remove memory debugging infrastructure.
  drm/i915: Clear fence register on tiling stride change.
  ...
  • Loading branch information
Linus Torvalds committed Jun 20, 2009
2 parents a552f0a + 0b7af26 commit 43813f3
Show file tree
Hide file tree
Showing 83 changed files with 1,391 additions and 1,300 deletions.
12 changes: 6 additions & 6 deletions drivers/char/agp/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ 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 *, struct page *, int);
void (*cache_flush)(void);
int (*create_gatt_table)(struct agp_bridge_data *);
int (*free_gatt_table)(struct agp_bridge_data *);
int (*insert_memory)(struct agp_memory *, off_t, int);
int (*remove_memory)(struct agp_memory *, off_t, int);
struct agp_memory *(*alloc_by_type) (size_t, int);
void (*free_by_type)(struct agp_memory *);
void *(*agp_alloc_page)(struct agp_bridge_data *);
struct page *(*agp_alloc_page)(struct agp_bridge_data *);
int (*agp_alloc_pages)(struct agp_bridge_data *, struct agp_memory *, size_t);
void (*agp_destroy_page)(void *, int flags);
void (*agp_destroy_page)(struct page *, int flags);
void (*agp_destroy_pages)(struct agp_memory *);
int (*agp_type_to_mask_type) (struct agp_bridge_data *, int);
void (*chipset_flush)(struct agp_bridge_data *);
Expand Down Expand Up @@ -278,10 +278,10 @@ int agp_generic_insert_memory(struct agp_memory *mem, off_t pg_start, int type);
int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type);
struct agp_memory *agp_generic_alloc_by_type(size_t page_count, int type);
void agp_generic_free_by_type(struct agp_memory *curr);
void *agp_generic_alloc_page(struct agp_bridge_data *bridge);
struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge);
int agp_generic_alloc_pages(struct agp_bridge_data *agp_bridge,
struct agp_memory *memory, size_t page_count);
void agp_generic_destroy_page(void *addr, int flags);
void agp_generic_destroy_page(struct page *page, int flags);
void agp_generic_destroy_pages(struct agp_memory *memory);
void agp_free_key(int key);
int agp_num_entries(void);
Expand All @@ -291,7 +291,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge);
void global_cache_flush(void);
void get_agp_version(struct agp_bridge_data *bridge);
unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge,
unsigned long addr, int type);
struct page *page, int type);
int agp_generic_type_to_mask_type(struct agp_bridge_data *bridge,
int type);
struct agp_bridge_data *agp_generic_find_bridge(struct pci_dev *pdev);
Expand Down
28 changes: 14 additions & 14 deletions drivers/char/agp/ali-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,37 +141,37 @@ static void m1541_cache_flush(void)
}
}

static void *m1541_alloc_page(struct agp_bridge_data *bridge)
static struct page *m1541_alloc_page(struct agp_bridge_data *bridge)
{
void *addr = agp_generic_alloc_page(agp_bridge);
struct page *page = agp_generic_alloc_page(agp_bridge);
u32 temp;

if (!addr)
if (!page)
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) |
virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN ));
return addr;
phys_to_gart(page_to_phys(page))) | ALI_CACHE_FLUSH_EN ));
return page;
}

static void ali_destroy_page(void * addr, int flags)
static void ali_destroy_page(struct page *page, int flags)
{
if (addr) {
if (page) {
if (flags & AGP_PAGE_DESTROY_UNMAP) {
global_cache_flush(); /* is this really needed? --hch */
agp_generic_destroy_page(addr, flags);
agp_generic_destroy_page(page, flags);
} else
agp_generic_destroy_page(addr, flags);
agp_generic_destroy_page(page, flags);
}
}

static void m1541_destroy_page(void * addr, int flags)
static void m1541_destroy_page(struct page *page, int flags)
{
u32 temp;

if (addr == NULL)
if (page == NULL)
return;

if (flags & AGP_PAGE_DESTROY_UNMAP) {
Expand All @@ -180,9 +180,9 @@ static void m1541_destroy_page(void * addr, int flags)
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) |
virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN));
phys_to_gart(page_to_phys(page))) | ALI_CACHE_FLUSH_EN));
}
agp_generic_destroy_page(addr, flags);
agp_generic_destroy_page(page, flags);
}


Expand Down Expand Up @@ -346,7 +346,7 @@ static int __devinit agp_ali_probe(struct pci_dev *pdev,
devs[j].chipset_name = "M1641";
break;
case 0x43:
devs[j].chipset_name = "M????";
devs[j].chipset_name = "M1621";
break;
case 0x47:
devs[j].chipset_name = "M1647";
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/agp/amd-k7-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr;
cur_gatt = GET_GATT(addr);
writel(agp_generic_mask_memory(agp_bridge,
mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr));
mem->pages[i], mem->type), cur_gatt+GET_GATT_OFF(addr));
readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */
}
amd_irongate_tlbflush(mem);
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 @@ -79,7 +79,7 @@ static int amd64_insert_memory(struct agp_memory *mem, off_t pg_start, int type)

for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
tmp = agp_bridge->driver->mask_memory(agp_bridge,
mem->memory[i], mask_type);
mem->pages[i], mask_type);

BUG_ON(tmp & 0xffffff0000000ffcULL);
pte = (tmp & 0x000000ff00000000ULL) >> 28;
Expand Down
23 changes: 17 additions & 6 deletions drivers/char/agp/ati-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,17 @@ static int ati_insert_memory(struct agp_memory * mem,
int i, j, num_entries;
unsigned long __iomem *cur_gatt;
unsigned long addr;
int mask_type;

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

if (type != 0 || mem->type != 0)
mask_type = agp_generic_type_to_mask_type(mem->bridge, type);
if (mask_type != 0 || type != mem->type)
return -EINVAL;

if (mem->page_count == 0)
return 0;

if ((pg_start + mem->page_count) > num_entries)
return -EINVAL;

Expand All @@ -296,10 +301,11 @@ static int ati_insert_memory(struct agp_memory * mem,
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr;
cur_gatt = GET_GATT(addr);
writel(agp_bridge->driver->mask_memory(agp_bridge,
mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr));
readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */
writel(agp_bridge->driver->mask_memory(agp_bridge,
mem->pages[i], mem->type),
cur_gatt+GET_GATT_OFF(addr));
}
readl(GET_GATT(agp_bridge->gart_bus_addr)); /* PCI posting */
agp_bridge->driver->tlb_flush(mem);
return 0;
}
Expand All @@ -310,17 +316,22 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start,
int i;
unsigned long __iomem *cur_gatt;
unsigned long addr;
int mask_type;

if (type != 0 || mem->type != 0)
mask_type = agp_generic_type_to_mask_type(mem->bridge, type);
if (mask_type != 0 || type != mem->type)
return -EINVAL;

if (mem->page_count == 0)
return 0;

for (i = pg_start; i < (mem->page_count + pg_start); i++) {
addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr;
cur_gatt = GET_GATT(addr);
writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr));
readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */
}

readl(GET_GATT(agp_bridge->gart_bus_addr)); /* PCI posting */
agp_bridge->driver->tlb_flush(mem);
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/agp/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
bridge->version = &agp_current_version;

if (bridge->driver->needs_scratch_page) {
void *addr = bridge->driver->agp_alloc_page(bridge);
struct page *page = bridge->driver->agp_alloc_page(bridge);

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

bridge->scratch_page_real = virt_to_gart(addr);
bridge->scratch_page_real = phys_to_gart(page_to_phys(page));
bridge->scratch_page =
bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0);
bridge->driver->mask_memory(bridge, page, 0);
}

size_value = bridge->driver->fetch_size();
Expand Down
5 changes: 3 additions & 2 deletions drivers/char/agp/efficeon-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ static const struct gatt_mask efficeon_generic_masks[] =
};

/* This function does the same thing as mask_memory() for this chipset... */
static inline unsigned long efficeon_mask_memory(unsigned long addr)
static inline unsigned long efficeon_mask_memory(struct page *page)
{
unsigned long addr = phys_to_gart(page_to_phys(page));
return addr | 0x00000001;
}

Expand Down Expand Up @@ -257,7 +258,7 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t
last_page = NULL;
for (i = 0; i < count; i++) {
int index = pg_start + i;
unsigned long insert = efficeon_mask_memory(mem->memory[i]);
unsigned long insert = efficeon_mask_memory(mem->pages[i]);

page = (unsigned int *) efficeon_private.l1_table[index >> 10];

Expand Down
Loading

0 comments on commit 43813f3

Please sign in to comment.