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/i915 Zero the scratch page.



details:   https://anonhg.NetBSD.org/src/rev/220acbdc2bdc
branches:  trunk
changeset: 993031:220acbdc2bdc
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:52:40 2018 +0000

description:
Zero the scratch page.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r fd0edf4f5324 -r 220acbdc2bdc sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 14:52:16 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 14:52:40 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.c,v 1.12 2018/08/27 14:49:39 riastradh Exp $      */
+/*     $NetBSD: i915_gem_gtt.c,v 1.13 2018/08/27 14:52:40 riastradh Exp $      */
 
 /*
  * Copyright © 2010 Daniel Vetter
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.12 2018/08/27 14:49:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.13 2018/08/27 14:52:40 riastradh Exp $");
 
 #include <linux/bitmap.h>
 #include <linux/err.h>
@@ -321,6 +321,9 @@
        return pte;
 }
 
+static void *kmap_page_dma(struct i915_page_dma *);
+static void kunmap_page_dma(struct drm_device *, void *);
+
 static int __setup_page_dma(struct drm_device *dev,
                            struct i915_page_dma *p, gfp_t flags)
 {
@@ -354,6 +357,12 @@
                bus_dmamap_destroy(dev->dmat, p->map);
                goto fail1;
        }
+
+       if (flags & __GFP_ZERO) {
+               void *va = kmap_page_dma(p);
+               memset(va, 0, PAGE_SIZE);
+               kunmap_page_dma(dev, va);
+       }
 #else
        struct device *device = &dev->pdev->dev;
 



Home | Main Index | Thread Index | Old Index