summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2018-09-13 03:55:17 +0000
committerjsg <jsg@openbsd.org>2018-09-13 03:55:17 +0000
commit20916ea0818c0b53d9cea1a680f1d21e84e2aa76 (patch)
treee5f06144f25cb4fdb24c62cf5acf243be30d0b20
parentAdd initial set of unveil's to vmctl. (diff)
downloadwireguard-openbsd-20916ea0818c0b53d9cea1a680f1d21e84e2aa76.tar.xz
wireguard-openbsd-20916ea0818c0b53d9cea1a680f1d21e84e2aa76.zip
drm/drivers: add support for using the arch wc mapping API.
From Dave Airlie c59fdc4cfbda52ce081c59540762185d765c3369 in linux 4.4.y/4.4.155 7cf321d118a825c1541b43ca45294126fd474efa in mainline linux
-rw-r--r--sys/dev/pci/drm/radeon/radeon_object.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_object.c b/sys/dev/pci/drm/radeon/radeon_object.c
index 9b45d533ce7..d8006d66ccf 100644
--- a/sys/dev/pci/drm/radeon/radeon_object.c
+++ b/sys/dev/pci/drm/radeon/radeon_object.c
@@ -447,6 +447,12 @@ int radeon_bo_init(struct radeon_device *rdev)
{
paddr_t start, end;
+#ifdef __linux__
+ /* reserve PAT memory space to WC for VRAM */
+ arch_io_reserve_memtype_wc(rdev->mc.aper_base,
+ rdev->mc.aper_size);
+#endif
+
/* Add an MTRR for the VRAM */
if (!rdev->fastfb_working) {
#ifdef __linux__
@@ -476,6 +482,7 @@ void radeon_bo_fini(struct radeon_device *rdev)
radeon_ttm_fini(rdev);
#ifdef __linux__
arch_phys_wc_del(rdev->mc.vram_mtrr);
+ arch_io_free_memtype_wc(rdev->mc.aper_base, rdev->mc.aper_size);
#else
drm_mtrr_del(0, rdev->mc.aper_base, rdev->mc.aper_size, DRM_MTRR_WC);
#endif