Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu amdgpu: call pmap_...



details:   https://anonhg.NetBSD.org/src/rev/788b505adf7c
branches:  trunk
changeset: 1028946:788b505adf7c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:33:19 2021 +0000

description:
amdgpu: call pmap_pv_track/untrack for the graphics aperture.


Author: phone <mrg%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_object.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r f107733fccd2 -r 788b505adf7c sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_object.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_object.c Sun Dec 19 12:33:11 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_object.c Sun Dec 19 12:33:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_object.c,v 1.6 2021/12/19 12:21:29 riastradh Exp $      */
+/*     $NetBSD: amdgpu_object.c,v 1.7 2021/12/19 12:33:19 riastradh Exp $      */
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -32,7 +32,7 @@
  *    Dave Airlie
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_object.c,v 1.6 2021/12/19 12:21:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_object.c,v 1.7 2021/12/19 12:33:19 riastradh Exp $");
 
 #include <linux/io.h>
 #include <linux/list.h>
@@ -1079,6 +1079,10 @@
        /* Add an MTRR for the VRAM */
        adev->gmc.vram_mtrr = arch_phys_wc_add(adev->gmc.aper_base,
                                              adev->gmc.aper_size);
+#ifdef __NetBSD__
+       if (adev->gmc.aper_base)
+               pmap_pv_track(adev->gmc.aper_base, adev->gmc.aper_size);
+#endif
        DRM_INFO("Detected VRAM RAM=%"PRIu64"M, BAR=%lluM\n",
                 adev->gmc.mc_vram_size >> 20,
                 (unsigned long long)adev->gmc.aper_size >> 20);
@@ -1113,6 +1117,10 @@
 void amdgpu_bo_fini(struct amdgpu_device *adev)
 {
        amdgpu_ttm_fini(adev);
+#ifdef __NetBSD__
+       if (adev->gmc.aper_base)
+               pmap_pv_untrack(adev->gmc.aper_base, adev->gmc.aper_size);
+#endif
        arch_phys_wc_del(adev->gmc.vram_mtrr);
        arch_io_free_memtype_wc(adev->gmc.aper_base, adev->gmc.aper_size);
 }



Home | Main Index | Thread Index | Old Index