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 At chuq's suggestion, use paddr_t rath...



details:   https://anonhg.NetBSD.org/src/rev/5793e7d76538
branches:  trunk
changeset: 993120:5793e7d76538
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:29:31 2018 +0000

description:
At chuq's suggestion, use paddr_t rather than struct vm_page *.

Doesn't make much of a substantive difference.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_prime.c        |  10 +++++-----
 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h |  10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (89 lines):

diff -r f57745f89225 -r 5793e7d76538 sys/external/bsd/drm2/dist/drm/drm_prime.c
--- a/sys/external/bsd/drm2/dist/drm/drm_prime.c        Mon Aug 27 15:29:19 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_prime.c        Mon Aug 27 15:29:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_prime.c,v 1.5 2018/08/27 15:26:50 riastradh Exp $  */
+/*     $NetBSD: drm_prime.c,v 1.6 2018/08/27 15:29:31 riastradh Exp $  */
 
 /*
  * Copyright © 2012 Red Hat
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_prime.c,v 1.5 2018/08/27 15:26:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_prime.c,v 1.6 2018/08/27 15:29:31 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/dma-buf.h>
@@ -54,7 +54,7 @@
  */
 
 struct sg_table {
-       struct vm_page  **sgt_pgs;
+       paddr_t         *sgt_pgs;
        unsigned        sgt_npgs;
 };
 
@@ -73,7 +73,7 @@
        sgt->sgt_npgs = npages;
 
        for (i = 0; i < npages; i++)
-               sgt->sgt_pgs[i] = &pages[i]->p_vmp;
+               sgt->sgt_pgs[i] = VM_PAGE_TO_PHYS(&pages[i]->p_vmp);
 
        return 0;
 }
@@ -96,7 +96,7 @@
        i = 0;
        TAILQ_FOREACH(pg, pglist, pageq.queue) {
                KASSERT(i < npages);
-               sgt->sgt_pgs[i] = pg;
+               sgt->sgt_pgs[i] = VM_PAGE_TO_PHYS(pg);
        }
        KASSERT(i == npages);
 
diff -r f57745f89225 -r 5793e7d76538 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
--- a/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Mon Aug 27 15:29:19 2018 +0000
+++ b/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Mon Aug 27 15:29:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma_hacks.h,v 1.14 2018/08/27 15:29:08 riastradh Exp $     */
+/*     $NetBSD: bus_dma_hacks.h,v 1.15 2018/08/27 15:29:31 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -120,7 +120,7 @@
 
 static inline int
 bus_dmamem_export_pages(bus_dma_tag_t dmat, const bus_dma_segment_t *segs,
-    int nsegs, struct vm_page **pgs, unsigned npgs)
+    int nsegs, paddr_t *pgs, unsigned npgs)
 {
        int seg;
        unsigned i;
@@ -134,7 +134,7 @@
                        paddr_t paddr = BUS_MEM_TO_PHYS(dmat, baddr);
 
                        KASSERT(i < npgs);
-                       pgs[i++] = PHYS_TO_VM_PAGE(paddr);
+                       pgs[i++] = paddr;
 
                        baddr += PAGE_SIZE;
                        len -= PAGE_SIZE;
@@ -148,14 +148,14 @@
 
 static inline int
 bus_dmamem_import_pages(bus_dma_tag_t dmat, bus_dma_segment_t *segs,
-    int nsegs, int *rsegs, struct vm_page *const *pgs, unsigned npgs)
+    int nsegs, int *rsegs, const paddr_t *pgs, unsigned npgs)
 {
        int seg;
        unsigned i;
 
        seg = 0;
        for (i = 0; i < npgs; i++) {
-               paddr_t paddr = VM_PAGE_TO_PHYS(pgs[i]);
+               paddr_t paddr = pgs[i];
                bus_addr_t baddr = PHYS_TO_BUS_MEM(dmat, paddr);
 
                if (seg > 0 && segs[seg - 1].ds_addr + PAGE_SIZE == baddr) {



Home | Main Index | Thread Index | Old Index