Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138952
b: refs/heads/master
c: d30333b
h: refs/heads/master
v: v3
  • Loading branch information
David Miller authored and Dave Airlie committed Mar 13, 2009
1 parent ecb04e2 commit f37acbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 6abf6bb0ff90bb77f9429bd0d90fc841c358daf3
refs/heads/master: d30333bbabb4a2cfad1f1a45c48a4e4d0065c1f6
13 changes: 7 additions & 6 deletions trunk/drivers/gpu/drm/ati_pcigart.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
u32 *pci_gart, page_base, gart_idx;
dma_addr_t bus_address = 0;
int i, j, ret = 0;
int max_pages;
int max_ati_pages, max_real_pages;

if (!entry) {
DRM_ERROR("no scatter/gather memory!\n");
Expand Down Expand Up @@ -130,14 +130,15 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga

pci_gart = (u32 *) address;

max_pages = (gart_info->table_size / sizeof(u32));
pages = (entry->pages <= max_pages)
? entry->pages : max_pages;
max_ati_pages = (gart_info->table_size / sizeof(u32));
max_real_pages = max_ati_pages / (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE);
pages = (entry->pages <= max_real_pages)
? entry->pages : max_real_pages;

if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
memset(pci_gart, 0, max_pages * sizeof(u32));
memset(pci_gart, 0, max_ati_pages * sizeof(u32));
} else {
for (gart_idx = 0; gart_idx < max_pages; gart_idx++)
for (gart_idx = 0; gart_idx < max_ati_pages; gart_idx++)
DRM_WRITE32(map, gart_idx * sizeof(u32), 0);
}

Expand Down

0 comments on commit f37acbc

Please sign in to comment.