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/include/drm Eliminate now-unused bus_d...



details:   https://anonhg.NetBSD.org/src/rev/236917fc243e
branches:  trunk
changeset: 364880:236917fc243e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:27:28 2018 +0000

description:
Eliminate now-unused bus_dmamap_load_pgarray.

diffstat:

 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h |  44 +----------------------
 1 files changed, 1 insertions(+), 43 deletions(-)

diffs (58 lines):

diff -r c3da0d090055 -r 236917fc243e 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:27:16 2018 +0000
+++ b/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Mon Aug 27 15:27:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma_hacks.h,v 1.12 2018/08/27 15:26:50 riastradh Exp $     */
+/*     $NetBSD: bus_dma_hacks.h,v 1.13 2018/08/27 15:27:28 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -116,48 +116,6 @@
 }
 
 static inline int
-bus_dmamap_load_pgarray(bus_dma_tag_t tag, bus_dmamap_t map,
-    struct vm_page **pgs, unsigned npgs, bus_size_t size, int flags)
-{
-       km_flag_t kmflags;
-       bus_dma_segment_t *segs;
-       unsigned i;
-       int error;
-
-       KASSERT((int)npgs <= (SIZE_MAX / sizeof(segs[0])));
-       switch (flags & (BUS_DMA_WAITOK|BUS_DMA_NOWAIT)) {
-       case BUS_DMA_WAITOK:    kmflags = KM_SLEEP;     break;
-       case BUS_DMA_NOWAIT:    kmflags = KM_NOSLEEP;   break;
-       default:                panic("invalid flags: %d", flags);
-       }
-       segs = kmem_alloc((npgs * sizeof(segs[0])), kmflags);
-       if (segs == NULL)
-               return ENOMEM;
-
-       for (i = 0; i < npgs; i++) {
-               paddr_t paddr = VM_PAGE_TO_PHYS(pgs[i]);
-               bus_addr_t baddr = PHYS_TO_BUS_MEM(tag, paddr);
-
-               segs[i].ds_addr = baddr;
-               segs[i].ds_len = PAGE_SIZE;
-       }
-
-       error = bus_dmamap_load_raw(tag, map, segs, npgs, size, flags);
-       if (error)
-               goto fail0;
-
-       /* Success!  */
-       error = 0;
-       goto out;
-
-fail1: __unused
-       bus_dmamap_unload(tag, map);
-fail0: KASSERT(error);
-out:   kmem_free(segs, (npgs * sizeof(segs[0])));
-       return error;
-}
-
-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)
 {



Home | Main Index | Thread Index | Old Index