Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138973
b: refs/heads/master
c: eb1d919
h: refs/heads/master
i:
  138971: f109fec
v: v3
  • Loading branch information
Dave Airlie committed Mar 13, 2009
1 parent b70e94d commit 711e032
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 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: 6abf66018f7fe231720e50f9a47b142182388869
refs/heads/master: eb1d91954ededc00ddcfb51e2626f114ff351524
23 changes: 13 additions & 10 deletions trunk/drivers/gpu/drm/radeon/r600_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,25 @@ int r600_page_table_init(struct drm_device *dev)
{
drm_radeon_private_t *dev_priv = dev->dev_private;
struct drm_ati_pcigart_info *gart_info = &dev_priv->gart_info;
struct drm_local_map *map = &gart_info->mapping;
struct drm_sg_mem *entry = dev->sg;
int ret = 0;
int i, j;
int max_pages, pages;
u64 *pci_gart, page_base;
int pages;
u64 page_base;
dma_addr_t entry_addr;
int max_ati_pages, max_real_pages, gart_idx;

/* okay page table is available - lets rock */
max_ati_pages = (gart_info->table_size / sizeof(u64));
max_real_pages = max_ati_pages / (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE);

/* PTEs are 64-bits */
pci_gart = (u64 *)gart_info->addr;

max_pages = (gart_info->table_size / sizeof(u64));
pages = (entry->pages <= max_pages) ? entry->pages : max_pages;
pages = (entry->pages <= max_real_pages) ?
entry->pages : max_real_pages;

memset(pci_gart, 0, max_pages * sizeof(u64));
memset_io((void __iomem *)map->handle, 0, max_ati_pages * sizeof(u64));

gart_idx = 0;
for (i = 0; i < pages; i++) {
entry->busaddr[i] = pci_map_single(dev->pdev,
page_address(entry->
Expand All @@ -176,12 +178,13 @@ int r600_page_table_init(struct drm_device *dev)
page_base |= R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED;
page_base |= R600_PTE_READABLE | R600_PTE_WRITEABLE;

*pci_gart = page_base;
DRM_WRITE64(map, gart_idx * sizeof(u64), page_base);

gart_idx++;

if ((i % 128) == 0)
DRM_DEBUG("page entry %d: 0x%016llx\n",
i, (unsigned long long)page_base);
pci_gart++;
entry_addr += ATI_PCIGART_PAGE_SIZE;
}
}
Expand Down

0 comments on commit 711e032

Please sign in to comment.