Module Name:    src
Committed By:   mrg
Date:           Mon Mar 30 01:44:41 UTC 2009

Modified Files:
        src/sys/external/bsd/drm/dist/bsd-core: drm_pci.c

Log Message:
- apply from sys/dev:
revision 1.14
date: 2009/03/29 19:39:10;  author: mrg;  state: Exp;  lines: +4 -3
include the size in a falled allocation message.

- use BUS_DMA_ALLOCNOW in bus_dmamap_create() call

- remove a redundant check for NULL


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4 src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.5
--- src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c:1.4	Fri Jul 25 06:54:33 2008
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_pci.c	Mon Mar 30 01:44:41 2009
@@ -111,7 +111,8 @@
 
 	if ((ret = bus_dmamem_alloc(dmah->tag, size, align, maxaddr,
 	    dmah->segs, 1, &nsegs, BUS_DMA_NOWAIT)) != 0) {
-		printf("drm: Unable to allocate DMA, error %d\n", ret);
+		printf("drm: Unable to allocate %ld bytes of DMA, error %d\n",
+		    (long)size, ret);
 		goto fail;
 	}
 	/* XXX is there a better way to deal with this? */
@@ -125,7 +126,7 @@
 	     	goto free;
 	}
 	if ((ret = bus_dmamap_create(dmah->tag, size, 1, size, maxaddr,
-	     BUS_DMA_NOWAIT, &dmah->map)) != 0) {
+	     BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &dmah->map)) != 0) {
 		printf("drm: Unable to create DMA map, error %d\n", ret);
 		goto unmap;
 	}
@@ -166,8 +167,6 @@
 	bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
 	bus_dma_tag_destroy(dmah->tag);
 #elif defined(__NetBSD__)
-	if (dmah == NULL)
-		return;
 	bus_dmamap_unload(dmah->tag, dmah->map);
 	bus_dmamap_destroy(dmah->tag, dmah->map);
 	bus_dmamem_unmap(dmah->tag, dmah->vaddr, dmah->size);

Reply via email to