diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-11-08 11:32:33 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-11-09 15:53:10 -0500 |
commit | 6eda9c390a897de81e526637b572c5eadffc96b5 (patch) | |
tree | c4cc7646739c4abef5a43b00d01056ed62250082 | |
parent | e91d0f00796c5800b604f51707a9fbed8f6ff513 (diff) | |
download | xen-6eda9c390a897de81e526637b572c5eadffc96b5.tar.gz |
ttm:dma: Add 'ttm_dma' module to radeon and nouveau to force enable the TTM DMA
.. irregardless of whether the device is restricted to DMA32. This
patch is for testing purposes.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ttm.c | 6 |
6 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 36234a748e8e20..0c9c5db3ef8c2a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1064,7 +1064,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm) dev = dev_priv->dev; #ifdef CONFIG_SWIOTLB - if ((dma_get_mask(dev->dev) <= DMA_BIT_MASK(32)) && swiotlb_nr_tbl()) { + if (((dma_get_mask(dev->dev) <= DMA_BIT_MASK(32)) && swiotlb_nr_tbl()) || nouveau_ttm_dma) { return ttm_dma_populate(ttm, dev->dev); } #endif @@ -1102,7 +1102,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm) dev = dev_priv->dev; #ifdef CONFIG_SWIOTLB - if ((dma_get_mask(dev->dev) <= DMA_BIT_MASK(32)) && swiotlb_nr_tbl()) { + if (((dma_get_mask(dev->dev) <= DMA_BIT_MASK(32)) && swiotlb_nr_tbl()) || nouveau_ttm_dma) { ttm_dma_unpopulate(ttm, dev->dev); return; } diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index 9f7bb12952623b..6325908fe9902b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c @@ -37,6 +37,10 @@ #include "drm_pciids.h" +MODULE_PARM_DESC(ttm_dma, "Enable TTM DMA mode irregardless if DMA32 is set"); +int nouveau_ttm_dma; +module_param_named(ttm_dma, nouveau_ttm_dma, int, 0444); + MODULE_PARM_DESC(agpmode, "AGP mode (0 to disable AGP)"); int nouveau_agpmode = -1; module_param_named(agpmode, nouveau_agpmode, int, 0400); diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 0c53e39fc6c9c4..cfdcd5de11106d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -829,6 +829,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo) } /* nouveau_drv.c */ +extern int nouveau_ttm_dma; extern int nouveau_modeset; extern int nouveau_agpmode; extern int nouveau_duallink; diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 63257badc1712d..9cae9e2b752409 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -94,6 +94,7 @@ extern int radeon_disp_priority; extern int radeon_hw_i2c; extern int radeon_pcie_gen2; +extern int radeon_ttm_dma; /* * Copy from radeon_drv.h so we don't have to include both and have conflicting * symbol; diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 969933833ccb82..e89c90642e9584 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -119,6 +119,10 @@ int radeon_audio = 0; int radeon_disp_priority = 0; int radeon_hw_i2c = 0; int radeon_pcie_gen2 = 0; +int radeon_ttm_dma = 0; + +MODULE_PARM_DESC(ttm_dma, "Enable TTM DMA page pool always irregardless of DMA32 flag"); +module_param_named(ttm_dma, radeon_ttm_dma, int, 0444); MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); module_param_named(no_wb, radeon_no_wb, int, 0444); diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 82119a5e55b55e..0dc0048f565c0a 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -593,7 +593,7 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm) rdev = radeon_get_rdev(ttm->bdev); #ifdef CONFIG_SWIOTLB - if (rdev->need_dma32 && swiotlb_nr_tbl()) { + if ((rdev->need_dma32 && swiotlb_nr_tbl()) || radeon_ttm_dma) { return ttm_dma_populate(ttm, rdev->dev); } #endif @@ -628,7 +628,7 @@ static void radeon_ttm_tt_unpopulate(struct ttm_tt *ttm) rdev = radeon_get_rdev(ttm->bdev); #ifdef CONFIG_SWIOTLB - if (rdev->need_dma32 && swiotlb_nr_tbl()) { + if ((rdev->need_dma32 && swiotlb_nr_tbl()) || radeon_ttm_dma) { ttm_dma_unpopulate(ttm, rdev->dev); return; } @@ -858,7 +858,7 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev) radeon_mem_types_list[i].driver_features = 0; radeon_mem_types_list[i++].data = NULL; #ifdef CONFIG_SWIOTLB - if (rdev->need_dma32 && swiotlb_nr_tbl()) { + if ((rdev->need_dma32 && swiotlb_nr_tbl()) || radeon_ttm_dma) { sprintf(radeon_mem_types_names[i], "ttm_dma_page_pool"); radeon_mem_types_list[i].name = radeon_mem_types_names[i]; radeon_mem_types_list[i].show = &ttm_dma_page_alloc_debugfs; |