|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 02/11] nouveau/radeon: Set coherent DMA mask
To: |
linux-kernel@xxxxxxxxxxxxxxx, thellstrom@xxxxxxxxxx, thomas@xxxxxxxxxxxx, airlied@xxxxxxxxxx, jglisse@xxxxxxxxxx, bskeggs@xxxxxxxxxx |
Subject: |
[Xen-devel] [PATCH 02/11] nouveau/radeon: Set coherent DMA mask |
From: |
Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Date: |
Tue, 1 Nov 2011 14:47:23 -0400 |
Cc: |
xen-devel@xxxxxxxxxxxxxxxxxxx, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Delivery-date: |
Tue, 01 Nov 2011 12:05:53 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<1320173252-2812-1-git-send-email-konrad.wilk@xxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<1320173252-2812-1-git-send-email-konrad.wilk@xxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
All the storage devices that use the dmapool set the coherent DMA
mask so they can properly use the dmapool. Since the TTM DMA pool
code is based on that and dma_alloc_coherent checks the
'coherent_dma_mask' and not 'dma_mask' we want to set it.
Reviewed-by: Jerome Glisse <jglisse@xxxxxxxxxx>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
drivers/gpu/drm/nouveau/nouveau_mem.c | 5 +++++
drivers/gpu/drm/radeon/radeon_device.c | 6 ++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c
b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 5ee14d2..8b39520 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -408,6 +408,11 @@ nouveau_mem_vram_init(struct drm_device *dev)
if (ret)
return ret;
+ ret = pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(dma_bits));
+ if (ret) {
+ /* Reset to default value. */
+ pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(32));
+ }
dev_priv->fb_phys = pci_resource_start(dev->pdev, 1);
ret = nouveau_ttm_global_init(dev_priv);
diff --git a/drivers/gpu/drm/radeon/radeon_device.c
b/drivers/gpu/drm/radeon/radeon_device.c
index 7cfaa7e..0c0a970 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -757,8 +757,14 @@ int radeon_device_init(struct radeon_device *rdev,
r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
if (r) {
rdev->need_dma32 = true;
+ dma_bits = 32;
printk(KERN_WARNING "radeon: No suitable DMA available.\n");
}
+ r = pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
+ if (r) {
+ pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(32));
+ printk(KERN_WARNING "radeon: No coherent DMA available.\n");
+ }
/* Registers mapping */
/* TODO: block userspace mapping of io register */
--
1.7.6.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH] TTM DMA pool v2.2 or [GIT PULL] (stable/ttm.dma_pool.v2.3) for 3.3, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 02/11] nouveau/radeon: Set coherent DMA mask,
Konrad Rzeszutek Wilk <=
- [Xen-devel] [PATCH 01/11] swiotlb: Expose swiotlb_nr_tlb function to modules, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 05/11] ttm: Get rid of temporary scaffolding, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 03/11] ttm/radeon/nouveau: Check the DMA address from TTM against known value., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 04/11] ttm: Wrap ttm_[put|get]_pages and extract GFP_* and caching states from 'struct ttm_tt', Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 10/11] nouveau/ttm/dma: Enable the TTM DMA pool if device can only do 32-bit DMA., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 09/11] ttm: Add 'no_dma' parameter to turn the TTM DMA pool off during runtime., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 11/11] radeon/ttm/dma: Enable the TTM DMA pool if the device can only do 32-bit., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 07/11] ttm: Do not set the ttm->be to NULL before calling the TTM page pool to free pages., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 06/11] ttm/driver: Expand ttm_backend_func to include two overrides for TTM page pool., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 08/11] ttm: Provide DMA aware TTM page pool code., Konrad Rzeszutek Wilk
|
|
|
|
|