diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-09-13 03:55:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-09-13 03:55:18 +0000 |
commit | e82ef8c90bc90606145b142b872c7b33fd137d2f (patch) | |
tree | 65ce4f41edff6a2b2290767e52260d8d140069a6 /sys/dev/pci | |
parent | 321a712f603a4b93691eda4a88d4d2a4bbd1609b (diff) |
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
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_object.c | 7 |
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 |