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

Commit 51e6ed23 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart

* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart:
  [AGPGART] Add new IDs to VIA AGP.
  [AGPGART] Remove pointless assignment.
  [AGPGART] Remove pointless typedef in ati-agp
  [AGPGART] Prevent (unlikely) memory leak in amd_create_gatt_pages()
  [AGPGART] intel_agp: restore graphics device's pci space early in resume
parents 597049cc 43ed41f6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -101,6 +101,11 @@ static int amd_create_gatt_pages(int nr_tables)
	for (i = 0; i < nr_tables; i++) {
		entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL);
		if (entry == NULL) {
			while (i > 0) {
				kfree(tables[i-1]);
				i--;
			}
			kfree(tables);
			retval = -ENOMEM;
			break;
		}
+1 −1
Original line number Diff line number Diff line
@@ -655,7 +655,7 @@ static struct pci_device_id agp_amd64_pci_table[] = {
	.class          = (PCI_CLASS_BRIDGE_HOST << 8),
	.class_mask     = ~0,
	.vendor         = PCI_VENDOR_ID_VIA,
	.device         = PCI_DEVICE_ID_VIA_K8M890CE,
	.device         = PCI_DEVICE_ID_VIA_VT3336,
	.subvendor      = PCI_ANY_ID,
	.subdevice      = PCI_ANY_ID,
	},
+18 −18
Original line number Diff line number Diff line
@@ -41,18 +41,18 @@ static struct gatt_mask ati_generic_masks[] =
};


typedef struct _ati_page_map {
struct ati_page_map {
	unsigned long *real;
	unsigned long __iomem *remapped;
} ati_page_map;
};

static struct _ati_generic_private {
	volatile u8 __iomem *registers;
	ati_page_map **gatt_pages;
	struct ati_page_map **gatt_pages;
	int num_tables;
} ati_generic_private;

static int ati_create_page_map(ati_page_map *page_map)
static int ati_create_page_map(struct ati_page_map *page_map)
{
	int i, err = 0;

@@ -82,7 +82,7 @@ static int ati_create_page_map(ati_page_map *page_map)
}


static void ati_free_page_map(ati_page_map *page_map)
static void ati_free_page_map(struct ati_page_map *page_map)
{
	unmap_page_from_agp(virt_to_page(page_map->real));
	iounmap(page_map->remapped);
@@ -94,8 +94,8 @@ static void ati_free_page_map(ati_page_map *page_map)
static void ati_free_gatt_pages(void)
{
	int i;
	ati_page_map **tables;
	ati_page_map *entry;
	struct ati_page_map **tables;
	struct ati_page_map *entry;

	tables = ati_generic_private.gatt_pages;
	for (i = 0; i < ati_generic_private.num_tables; i++) {
@@ -112,30 +112,30 @@ static void ati_free_gatt_pages(void)

static int ati_create_gatt_pages(int nr_tables)
{
	ati_page_map **tables;
	ati_page_map *entry;
	struct ati_page_map **tables;
	struct ati_page_map *entry;
	int retval = 0;
	int i;

	tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL);
	tables = kzalloc((nr_tables + 1) * sizeof(struct ati_page_map *),GFP_KERNEL);
	if (tables == NULL)
		return -ENOMEM;

	for (i = 0; i < nr_tables; i++) {
		entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL);
		entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL);
		if (entry == NULL) {
			while (i > 0) {
				kfree(tables[i-1]);
				i--;
			}
			kfree(tables);
			tables = NULL;
			retval = -ENOMEM;
			break;
		}
		tables[i] = entry;
		retval = ati_create_page_map(entry);
		if (retval != 0) break;
		if (retval != 0)
			break;
	}
	ati_generic_private.num_tables = nr_tables;
	ati_generic_private.gatt_pages = tables;
@@ -340,7 +340,7 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start,
static int ati_create_gatt_table(struct agp_bridge_data *bridge)
{
	struct aper_size_info_lvl2 *value;
	ati_page_map page_dir;
	struct ati_page_map page_dir;
	unsigned long addr;
	int retval;
	u32 temp;
@@ -400,7 +400,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)

static int ati_free_gatt_table(struct agp_bridge_data *bridge)
{
	ati_page_map page_dir;
	struct ati_page_map page_dir;

	page_dir.real = (unsigned long *)agp_bridge->gatt_table_real;
	page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table;
+9 −0
Original line number Diff line number Diff line
@@ -1955,6 +1955,15 @@ static int agp_intel_resume(struct pci_dev *pdev)

	pci_restore_state(pdev);

	/* We should restore our graphics device's config space,
	 * as host bridge (00:00) resumes before graphics device (02:00),
	 * then our access to its pci space can work right.
	 */
	if (intel_i810_private.i810_dev)
		pci_restore_state(intel_i810_private.i810_dev);
	if (intel_i830_private.i830_dev)
		pci_restore_state(intel_i830_private.i830_dev);

	if (bridge->driver == &intel_generic_driver)
		intel_configure();
	else if (bridge->driver == &intel_850_driver)
+19 −2
Original line number Diff line number Diff line
@@ -380,9 +380,23 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata =
	/* P4M800CE */
	{
		.device_id	= PCI_DEVICE_ID_VIA_P4M800CE,
		.chipset_name	= "P4M800CE",
		.chipset_name	= "VT3314",
	},
	/* CX700 */
	{
		.device_id  = PCI_DEVICE_ID_VIA_CX700,
		.chipset_name   = "CX700",
	},
	/* VT3336 */
	{
		.device_id  = PCI_DEVICE_ID_VIA_VT3336,
		.chipset_name   = "VT3336",
	},
	/* P4M890 */
	{
		.device_id  = PCI_DEVICE_ID_VIA_P4M890,
		.chipset_name   = "P4M890",
	},

	{ }, /* dummy final entry, always present */
};

@@ -524,6 +538,9 @@ static const struct pci_device_id agp_via_pci_table[] = {
	ID(PCI_DEVICE_ID_VIA_83_87XX_1),
	ID(PCI_DEVICE_ID_VIA_3296_0),
	ID(PCI_DEVICE_ID_VIA_P4M800CE),
	ID(PCI_DEVICE_ID_VIA_CX700),
	ID(PCI_DEVICE_ID_VIA_VT3336),
	ID(PCI_DEVICE_ID_VIA_P4M890),
	{ }
};

Loading