From: jsg Date: Thu, 13 Sep 2018 03:55:17 +0000 (+0000) Subject: drm/drivers: add support for using the arch wc mapping API. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=20916ea0818c0b53d9cea1a680f1d21e84e2aa76;p=openbsd 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 --- 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