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

Commit 43813f39 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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.
  ...
parents a552f0af 0b7af262
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -107,7 +107,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 *, struct page *, int);
	void (*cache_flush)(void);
	int (*create_gatt_table)(struct agp_bridge_data *);
	int (*free_gatt_table)(struct agp_bridge_data *);
@@ -115,9 +115,9 @@ struct agp_bridge_driver {
	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 *);
@@ -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);
@@ -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);
+14 −14
Original line number Diff line number Diff line
@@ -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) {
@@ -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);
}


@@ -346,7 +346,7 @@ found:
			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";
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
+17 −6
Original line number Diff line number Diff line
@@ -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;

@@ -297,9 +302,10 @@ static int ati_insert_memory(struct agp_memory * mem,
		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. */
						       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;
}
@@ -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;
}
Loading