Skip to content

Commit f674a21

Browse files
committed
drm/vmwgfx: remove code that was using physical page addresses
This code has been unused for a while now. When the explicit checks for whether the driver is running on top of non-coherent swiotlb have been deprecated we lost the ability to fallback to physical mappings. Instead of trying to readd a module parameter to force usage of physical addresses it's better to just force coherent TTM pages via the force_coherent module parameter making this code pointless. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Martin Krastev <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 7423104 commit f674a21

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ static const struct pci_device_id vmw_pci_id_list[] = {
272272
MODULE_DEVICE_TABLE(pci, vmw_pci_id_list);
273273

274274
static int enable_fbdev = IS_ENABLED(CONFIG_DRM_VMWGFX_FBCON);
275-
static int vmw_force_iommu;
276275
static int vmw_restrict_iommu;
277276
static int vmw_force_coherent;
278277
static int vmw_restrict_dma_mask;
@@ -284,8 +283,6 @@ static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
284283

285284
MODULE_PARM_DESC(enable_fbdev, "Enable vmwgfx fbdev");
286285
module_param_named(enable_fbdev, enable_fbdev, int, 0600);
287-
MODULE_PARM_DESC(force_dma_api, "Force using the DMA API for TTM pages");
288-
module_param_named(force_dma_api, vmw_force_iommu, int, 0600);
289286
MODULE_PARM_DESC(restrict_iommu, "Try to limit IOMMU usage for TTM pages");
290287
module_param_named(restrict_iommu, vmw_restrict_iommu, int, 0600);
291288
MODULE_PARM_DESC(force_coherent, "Force coherent TTM pages");
@@ -645,7 +642,6 @@ static void vmw_get_initial_size(struct vmw_private *dev_priv)
645642
static int vmw_dma_select_mode(struct vmw_private *dev_priv)
646643
{
647644
static const char *names[vmw_dma_map_max] = {
648-
[vmw_dma_phys] = "Using physical TTM page addresses.",
649645
[vmw_dma_alloc_coherent] = "Using coherent TTM pages.",
650646
[vmw_dma_map_populate] = "Caching DMA mappings.",
651647
[vmw_dma_map_bind] = "Giving up DMA mappings early."};
@@ -679,8 +675,7 @@ static int vmw_dma_masks(struct vmw_private *dev_priv)
679675
int ret = 0;
680676

681677
ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64));
682-
if (dev_priv->map_mode != vmw_dma_phys &&
683-
(sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) {
678+
if (sizeof(unsigned long) == 4 || vmw_restrict_dma_mask) {
684679
DRM_INFO("Restricting DMA addresses to 44 bits.\n");
685680
return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44));
686681
}

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ struct vmw_res_cache_entry {
314314
* enum vmw_dma_map_mode - indicate how to perform TTM page dma mappings.
315315
*/
316316
enum vmw_dma_map_mode {
317-
vmw_dma_phys, /* Use physical page addresses */
318317
vmw_dma_alloc_coherent, /* Use TTM coherent pages */
319318
vmw_dma_map_populate, /* Unmap from DMA just after unpopulate */
320319
vmw_dma_map_bind, /* Unmap from DMA just before unbind */

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,6 @@ static struct page *__vmw_piter_non_sg_page(struct vmw_piter *viter)
237237
return viter->pages[viter->i];
238238
}
239239

240-
/**
241-
* __vmw_piter_phys_addr: Helper functions to return the DMA
242-
* address of the current page.
243-
*
244-
* @viter: Pointer to the iterator
245-
*
246-
* These functions return the DMA address of the page currently
247-
* pointed to by @viter. Functions are selected depending on the
248-
* current mapping mode.
249-
*/
250-
static dma_addr_t __vmw_piter_phys_addr(struct vmw_piter *viter)
251-
{
252-
return page_to_phys(viter->pages[viter->i]);
253-
}
254-
255240
static dma_addr_t __vmw_piter_dma_addr(struct vmw_piter *viter)
256241
{
257242
return viter->addrs[viter->i];
@@ -282,10 +267,6 @@ void vmw_piter_start(struct vmw_piter *viter, const struct vmw_sg_table *vsgt,
282267
viter->page = &__vmw_piter_non_sg_page;
283268
viter->pages = vsgt->pages;
284269
switch (vsgt->mode) {
285-
case vmw_dma_phys:
286-
viter->next = &__vmw_piter_non_sg_next;
287-
viter->dma_address = &__vmw_piter_phys_addr;
288-
break;
289270
case vmw_dma_alloc_coherent:
290271
viter->next = &__vmw_piter_non_sg_next;
291272
viter->dma_address = &__vmw_piter_dma_addr;

0 commit comments

Comments
 (0)