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 Some tweaks en route to ...



details:   https://anonhg.NetBSD.org/src/rev/590e0ace87c1
branches:  trunk
changeset: 992591:590e0ace87c1
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:08:07 2018 +0000

description:
Some tweaks en route to i915_gem_gtt.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c |  20 ++++++++++++++------
 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h |   5 +++--
 2 files changed, 17 insertions(+), 8 deletions(-)

diffs (94 lines):

diff -r e6706419fc66 -r 590e0ace87c1 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 07:07:56 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 07:08:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.c,v 1.9 2018/08/27 07:07:23 riastradh Exp $       */
+/*     $NetBSD: i915_gem_gtt.c,v 1.10 2018/08/27 07:08:07 riastradh Exp $      */
 
 /*
  * Copyright © 2010 Daniel Vetter
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.9 2018/08/27 07:07:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.10 2018/08/27 07:08:07 riastradh Exp $");
 
 #include <linux/err.h>
 #include <linux/seq_file.h>
@@ -328,8 +328,10 @@
 
        error = bus_dmamem_alloc(dev->dmat, PAGE_SIZE, PAGE_SIZE, PAGE_SIZE,
            &p->seg, nseg, &nseg, BUS_DMA_WAITOK);
-       if (error)
-fail0:         return -error;  /* XXX errno NetBSD->Linux */
+       if (error) {
+fail0:         p->map = NULL;
+               return -error;  /* XXX errno NetBSD->Linux */
+       }
        KASSERT(nseg == 1);
        error = bus_dmamap_create(dev->dmat, PAGE_SIZE, 1, PAGE_SIZE,
            PAGE_SIZE, BUS_DMA_WAITOK, &p->map);
@@ -375,8 +377,9 @@
                return;
 
        bus_dmamap_unload(dev->dmat, p->map);
-       bus_dmamap_destroy(dev->dmat, p->dmap);
+       bus_dmamap_destroy(dev->dmat, p->map);
        bus_dmamem_free(dev->dmat, &p->seg, 1);
+       p->map = NULL;
 #else
        if (WARN_ON(!p->page))
                return;
@@ -390,7 +393,8 @@
 static void *kmap_page_dma(struct i915_page_dma *p)
 {
 #ifdef __NetBSD__
-       return kmap_atomic(PHYS_TO_VM_PAGE(p->seg.ds_addr));
+       return kmap_atomic(container_of(PHYS_TO_VM_PAGE(p->seg.ds_addr),
+               struct page, p_vmp));
 #else
        return kmap_atomic(p->page);
 #endif
@@ -455,7 +459,9 @@
                return ERR_PTR(ret);
        }
 
+#ifndef __NetBSD__             /* XXX ??? */
        set_pages_uc(px_page(sp), 1);
+#endif
 
        return sp;
 }
@@ -463,7 +469,9 @@
 static void free_scratch_page(struct drm_device *dev,
                              struct i915_page_scratch *sp)
 {
+#ifndef __NetBSD__             /* XXX ??? */
        set_pages_wb(px_page(sp), 1);
+#endif
 
        cleanup_px(dev, sp);
        kfree(sp);
diff -r e6706419fc66 -r 590e0ace87c1 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h        Mon Aug 27 07:07:56 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h        Mon Aug 27 07:08:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.h,v 1.6 2018/08/27 07:01:42 riastradh Exp $       */
+/*     $NetBSD: i915_gem_gtt.h,v 1.7 2018/08/27 07:08:07 riastradh Exp $       */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -252,10 +252,11 @@
 };
 
 #define px_base(px) (&(px)->base)
-#define px_page(px) (px_base(px)->page)
 #ifdef __NetBSD__
+#define px_page(px) (px_base(px)->map)
 #define px_dma(px) (px_base(px)->map->dm_segs[0].ds_addr)
 #else
+#define px_page(px) (px_base(px)->page)
 #define px_dma(px) (px_base(px)->daddr)
 #endif
 



Home | Main Index | Thread Index | Old Index