diff options
author | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2010-01-04 22:25:05 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-06 22:15:50 -0500 |
commit | e6be8d9d17bd44061116f601fe2609b3ace7aa69 (patch) | |
tree | 85b8acc2fd4734724b9d5202016743461e02ee07 | |
parent | 29ebdf925c2c45f6531a953c6c5c8e4d3b4ac2dc (diff) |
drm: remove address mask param for drm_pci_alloc()
drm_pci_alloc() has input of address mask for setting pci dma
mask on the device, which should be properly setup by drm driver.
And leave it as a param for drm_pci_alloc() would cause confusion
or mistake would corrupt the correct dma mask setting, as seen on
intel hw which set wrong dma mask for hw status page. So remove
it from drm_pci_alloc() function.
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/ati_pcigart.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_bufs.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_pci.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | include/drm/drmP.h | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c index 628eae3e9b83..a1fce68e3bbe 100644 --- a/drivers/gpu/drm/ati_pcigart.c +++ b/drivers/gpu/drm/ati_pcigart.c | |||
@@ -39,8 +39,7 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev, | |||
39 | struct drm_ati_pcigart_info *gart_info) | 39 | struct drm_ati_pcigart_info *gart_info) |
40 | { | 40 | { |
41 | gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size, | 41 | gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size, |
42 | PAGE_SIZE, | 42 | PAGE_SIZE); |
43 | gart_info->table_mask); | ||
44 | if (gart_info->table_handle == NULL) | 43 | if (gart_info->table_handle == NULL) |
45 | return -ENOMEM; | 44 | return -ENOMEM; |
46 | 45 | ||
@@ -112,6 +111,13 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga | |||
112 | if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { | 111 | if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { |
113 | DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n"); | 112 | DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n"); |
114 | 113 | ||
114 | if (pci_set_dma_mask(dev->pdev, gart_info->table_mask)) { | ||
115 | DRM_ERROR("fail to set dma mask to 0x%Lx\n", | ||
116 | gart_info->table_mask); | ||
117 | ret = 1; | ||
118 | goto done; | ||
119 | } | ||
120 | |||
115 | ret = drm_ati_alloc_pcigart_table(dev, gart_info); | 121 | ret = drm_ati_alloc_pcigart_table(dev, gart_info); |
116 | if (ret) { | 122 | if (ret) { |
117 | DRM_ERROR("cannot allocate PCI GART page!\n"); | 123 | DRM_ERROR("cannot allocate PCI GART page!\n"); |
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 3d09e304f6f4..8417cc4c43f1 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c | |||
@@ -326,7 +326,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset, | |||
326 | * As we're limiting the address to 2^32-1 (or less), | 326 | * As we're limiting the address to 2^32-1 (or less), |
327 | * casting it down to 32 bits is no problem, but we | 327 | * casting it down to 32 bits is no problem, but we |
328 | * need to point to a 64bit variable first. */ | 328 | * need to point to a 64bit variable first. */ |
329 | dmah = drm_pci_alloc(dev, map->size, map->size, 0xffffffffUL); | 329 | dmah = drm_pci_alloc(dev, map->size, map->size); |
330 | if (!dmah) { | 330 | if (!dmah) { |
331 | kfree(map); | 331 | kfree(map); |
332 | return -ENOMEM; | 332 | return -ENOMEM; |
@@ -885,7 +885,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request) | |||
885 | 885 | ||
886 | while (entry->buf_count < count) { | 886 | while (entry->buf_count < count) { |
887 | 887 | ||
888 | dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000, 0xfffffffful); | 888 | dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000); |
889 | 889 | ||
890 | if (!dmah) { | 890 | if (!dmah) { |
891 | /* Set count correctly so we free the proper amount. */ | 891 | /* Set count correctly so we free the proper amount. */ |
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 577094fb1995..e68ebf92fa2a 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c | |||
@@ -47,8 +47,7 @@ | |||
47 | /** | 47 | /** |
48 | * \brief Allocate a PCI consistent memory block, for DMA. | 48 | * \brief Allocate a PCI consistent memory block, for DMA. |
49 | */ | 49 | */ |
50 | drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align, | 50 | drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align) |
51 | dma_addr_t maxaddr) | ||
52 | { | 51 | { |
53 | drm_dma_handle_t *dmah; | 52 | drm_dma_handle_t *dmah; |
54 | #if 1 | 53 | #if 1 |
@@ -63,11 +62,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali | |||
63 | if (align > size) | 62 | if (align > size) |
64 | return NULL; | 63 | return NULL; |
65 | 64 | ||
66 | if (pci_set_dma_mask(dev->pdev, maxaddr) != 0) { | ||
67 | DRM_ERROR("Setting pci dma mask failed\n"); | ||
68 | return NULL; | ||
69 | } | ||
70 | |||
71 | dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL); | 65 | dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL); |
72 | if (!dmah) | 66 | if (!dmah) |
73 | return NULL; | 67 | return NULL; |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 701bfeac7f57..02607ed61399 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -123,7 +123,7 @@ static int i915_init_phys_hws(struct drm_device *dev) | |||
123 | drm_i915_private_t *dev_priv = dev->dev_private; | 123 | drm_i915_private_t *dev_priv = dev->dev_private; |
124 | /* Program Hardware Status Page */ | 124 | /* Program Hardware Status Page */ |
125 | dev_priv->status_page_dmah = | 125 | dev_priv->status_page_dmah = |
126 | drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); | 126 | drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE); |
127 | 127 | ||
128 | if (!dev_priv->status_page_dmah) { | 128 | if (!dev_priv->status_page_dmah) { |
129 | DRM_ERROR("Can not allocate hardware status page\n"); | 129 | DRM_ERROR("Can not allocate hardware status page\n"); |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 917b8377ae28..c7f0cbec4e84 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -4708,7 +4708,7 @@ int i915_gem_init_phys_object(struct drm_device *dev, | |||
4708 | 4708 | ||
4709 | phys_obj->id = id; | 4709 | phys_obj->id = id; |
4710 | 4710 | ||
4711 | phys_obj->handle = drm_pci_alloc(dev, size, 0, 0xffffffff); | 4711 | phys_obj->handle = drm_pci_alloc(dev, size, 0); |
4712 | if (!phys_obj->handle) { | 4712 | if (!phys_obj->handle) { |
4713 | ret = -ENOMEM; | 4713 | ret = -ENOMEM; |
4714 | goto kfree_obj; | 4714 | goto kfree_obj; |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 71dafb69cfeb..ffac157fb5b2 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1408,7 +1408,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev, | |||
1408 | struct drm_ati_pcigart_info * gart_info); | 1408 | struct drm_ati_pcigart_info * gart_info); |
1409 | 1409 | ||
1410 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, | 1410 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, |
1411 | size_t align, dma_addr_t maxaddr); | 1411 | size_t align); |
1412 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1412 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1413 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1413 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1414 | 1414 | ||