diff options
-rw-r--r-- | drivers/gpu/drm/ati_pcigart.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c index 4d86a629a517..628eae3e9b83 100644 --- a/drivers/gpu/drm/ati_pcigart.c +++ b/drivers/gpu/drm/ati_pcigart.c | |||
@@ -99,7 +99,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga | |||
99 | struct drm_sg_mem *entry = dev->sg; | 99 | struct drm_sg_mem *entry = dev->sg; |
100 | void *address = NULL; | 100 | void *address = NULL; |
101 | unsigned long pages; | 101 | unsigned long pages; |
102 | u32 *pci_gart, page_base, gart_idx; | 102 | u32 *pci_gart = NULL, page_base, gart_idx; |
103 | dma_addr_t bus_address = 0; | 103 | dma_addr_t bus_address = 0; |
104 | int i, j, ret = 0; | 104 | int i, j, ret = 0; |
105 | int max_ati_pages, max_real_pages; | 105 | int max_ati_pages, max_real_pages; |
@@ -118,6 +118,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga | |||
118 | goto done; | 118 | goto done; |
119 | } | 119 | } |
120 | 120 | ||
121 | pci_gart = gart_info->table_handle->vaddr; | ||
121 | address = gart_info->table_handle->vaddr; | 122 | address = gart_info->table_handle->vaddr; |
122 | bus_address = gart_info->table_handle->busaddr; | 123 | bus_address = gart_info->table_handle->busaddr; |
123 | } else { | 124 | } else { |
@@ -128,7 +129,6 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga | |||
128 | (unsigned long)address); | 129 | (unsigned long)address); |
129 | } | 130 | } |
130 | 131 | ||
131 | pci_gart = (u32 *) address; | ||
132 | 132 | ||
133 | max_ati_pages = (gart_info->table_size / sizeof(u32)); | 133 | max_ati_pages = (gart_info->table_size / sizeof(u32)); |
134 | max_real_pages = max_ati_pages / (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); | 134 | max_real_pages = max_ati_pages / (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); |
@@ -138,8 +138,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga | |||
138 | if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { | 138 | if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { |
139 | memset(pci_gart, 0, max_ati_pages * sizeof(u32)); | 139 | memset(pci_gart, 0, max_ati_pages * sizeof(u32)); |
140 | } else { | 140 | } else { |
141 | for (gart_idx = 0; gart_idx < max_ati_pages; gart_idx++) | 141 | memset_io((void __iomem *)map->handle, 0, max_ati_pages * sizeof(u32)); |
142 | DRM_WRITE32(map, gart_idx * sizeof(u32), 0); | ||
143 | } | 142 | } |
144 | 143 | ||
145 | gart_idx = 0; | 144 | gart_idx = 0; |