summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/cirrus
diff options
context:
space:
mode:
authorDave Airlie2016-10-24 07:37:48 +0200
committerDave Airlie2016-10-26 08:48:01 +0200
commit7cf321d118a825c1541b43ca45294126fd474efa (patch)
treeb9e21afa3815a4609610b16c6ae8402f363fb804 /drivers/gpu/drm/cirrus
parentx86/io: add interface to reserve io memtype for a resource range. (v1.1) (diff)
downloadkernel-qcow2-linux-7cf321d118a825c1541b43ca45294126fd474efa.tar.gz
kernel-qcow2-linux-7cf321d118a825c1541b43ca45294126fd474efa.tar.xz
kernel-qcow2-linux-7cf321d118a825c1541b43ca45294126fd474efa.zip
drm/drivers: add support for using the arch wc mapping API.
This fixes a regression in all these drivers since the cache mode tracking was fixed for mixed mappings. It uses the new arch API to add the VRAM range to the PAT mapping tracking tables. Fixes: 87744ab3832 (mm: fix cache mode tracking in vm_insert_mixed()) Reviewed-by: Christian König <christian.koenig@amd.com>. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/cirrus')
-rw-r--r--drivers/gpu/drm/cirrus/cirrus_ttm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
index bb2438dd8733..5e7e63ce7bce 100644
--- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
+++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
@@ -267,6 +267,9 @@ int cirrus_mm_init(struct cirrus_device *cirrus)
return ret;
}
+ arch_io_reserve_memtype_wc(pci_resource_start(dev->pdev, 0),
+ pci_resource_len(dev->pdev, 0));
+
cirrus->fb_mtrr = arch_phys_wc_add(pci_resource_start(dev->pdev, 0),
pci_resource_len(dev->pdev, 0));
@@ -276,6 +279,8 @@ int cirrus_mm_init(struct cirrus_device *cirrus)
void cirrus_mm_fini(struct cirrus_device *cirrus)
{
+ struct drm_device *dev = cirrus->dev;
+
if (!cirrus->mm_inited)
return;
@@ -285,6 +290,8 @@ void cirrus_mm_fini(struct cirrus_device *cirrus)
arch_phys_wc_del(cirrus->fb_mtrr);
cirrus->fb_mtrr = 0;
+ arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0),
+ pci_resource_len(dev->pdev, 0));
}
void cirrus_ttm_placement(struct cirrus_bo *bo, int domain)