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: Make sure ...



details:   https://anonhg.NetBSD.org/src/rev/cc228045c2d3
branches:  trunk
changeset: 368725:cc228045c2d3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jul 30 16:55:00 2022 +0000

description:
amdgpu: Make sure dummy page is zero-filled.

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 03b3fbfe0e52 -r cc228045c2d3 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c   Sat Jul 30 14:13:27 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c   Sat Jul 30 16:55:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_gart.c,v 1.8 2021/12/24 11:19:55 riastradh Exp $        */
+/*     $NetBSD: amdgpu_gart.c,v 1.9 2022/07/30 16:55:00 riastradh Exp $        */
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_gart.c,v 1.8 2021/12/24 11:19:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_gart.c,v 1.9 2022/07/30 16:55:00 riastradh Exp $");
 
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
@@ -78,6 +78,7 @@
 {
 #ifdef __NetBSD__
        int rsegs;
+       void *p;
        int error;
 
        /* XXX Can this be called more than once??  */
@@ -89,6 +90,12 @@
        if (error)
                goto fail0;
        KASSERT(rsegs == 1);
+       error = bus_dmamem_map(adev->ddev->dmat, &adev->dummy_page_seg, 1,
+           PAGE_SIZE, &p, BUS_DMA_WAITOK);
+       if (error)
+               goto fail1;
+       memset(p, 0, PAGE_SIZE);
+       bus_dmamem_unmap(adev->ddev->dmat, p, PAGE_SIZE);
        error = bus_dmamap_create(adev->ddev->dmat, PAGE_SIZE, 1, PAGE_SIZE, 0,
            BUS_DMA_WAITOK, &adev->dummy_page_map);
        if (error)



Home | Main Index | Thread Index | Old Index