Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161368
b: refs/heads/master
c: 56ec4c1
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 3, 2009
1 parent 71245c0 commit 6a4cccb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 176616814d700f19914d8509d9f65dec51a6ebf7
refs/heads/master: 56ec4c1e72865c6d99f643b6574e6e074c3e8823
23 changes: 13 additions & 10 deletions trunk/drivers/char/agp/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,20 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
}

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

if (bridge->driver->agp_map_page &&
bridge->driver->agp_map_page(phys_to_virt(page_to_phys(page)),
&bridge->scratch_page_dma)) {
dev_err(&bridge->dev->dev,
"unable to dma-map scratch page\n");
rc = -ENOMEM;
goto err_out_nounmap;
if (bridge->driver->agp_map_page) {
if (bridge->driver->agp_map_page(phys_to_virt(page_to_phys(page)),
&bridge->scratch_page_dma)) {
dev_err(&bridge->dev->dev,
"unable to dma-map scratch page\n");
rc = -ENOMEM;
goto err_out_nounmap;
}
} else {
bridge->scratch_page_dma = phys_to_gart(page_to_phys(page));
}

bridge->scratch_page = bridge->driver->mask_memory(bridge,
bridge->scratch_page_dma, 0);
}

size_value = bridge->driver->fetch_size();
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/char/agp/intel-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,13 +1138,9 @@ static int intel_i915_configure(void)
writel(agp_bridge->gatt_bus_addr|I810_PGETBL_ENABLED, intel_private.registers+I810_PGETBL_CTL);
readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */

#ifndef USE_PCI_DMA_API
agp_bridge->scratch_page_dma = agp_bridge->scratch_page;
#endif

if (agp_bridge->driver->needs_scratch_page) {
for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) {
writel(agp_bridge->scratch_page_dma, intel_private.gtt+i);
writel(agp_bridge->scratch_page, intel_private.gtt+i);
}
readl(intel_private.gtt+i-1); /* PCI Posting. */
}
Expand Down Expand Up @@ -1242,7 +1238,7 @@ static int intel_i915_remove_entries(struct agp_memory *mem, off_t pg_start,
}

for (i = pg_start; i < (mem->page_count + pg_start); i++)
writel(agp_bridge->scratch_page_dma, intel_private.gtt+i);
writel(agp_bridge->scratch_page, intel_private.gtt+i);

readl(intel_private.gtt+i-1);

Expand Down

0 comments on commit 6a4cccb

Please sign in to comment.