Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 2009 07:47:03 +0000 (UTC)
From:      Robert Noland <rnoland@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189560 - head/sys/dev/drm
Message-ID:  <200903090747.n297l3tj013508@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rnoland
Date: Mon Mar  9 07:47:03 2009
New Revision: 189560
URL: http://svn.freebsd.org/changeset/base/189560

Log:
  Change the flags to bus_dmamem around to allow it to sleep waiting for
  resources during allocation, but not during map load.  Also, zero the
  buffers here.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_pci.c

Modified: head/sys/dev/drm/drm_pci.c
==============================================================================
--- head/sys/dev/drm/drm_pci.c	Mon Mar  9 07:38:22 2009	(r189559)
+++ head/sys/dev/drm/drm_pci.c	Mon Mar  9 07:47:03 2009	(r189560)
@@ -83,15 +83,15 @@ drm_pci_alloc(struct drm_device *dev, si
 	    maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
 	    NULL, NULL, /* filtfunc, filtfuncargs */
 	    size, 1, size, /* maxsize, nsegs, maxsegsize */
-	    BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */
+	    0, NULL, NULL, /* flags, lockfunc, lockfuncargs */
 	    &dmah->tag);
 	if (ret != 0) {
 		free(dmah, DRM_MEM_DMA);
 		return NULL;
 	}
 
-	ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, BUS_DMA_NOWAIT,
-	    &dmah->map);
+	ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
+	    BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map);
 	if (ret != 0) {
 		bus_dma_tag_destroy(dmah->tag);
 		free(dmah, DRM_MEM_DMA);
@@ -99,7 +99,7 @@ drm_pci_alloc(struct drm_device *dev, si
 	}
 
 	ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, size,
-	    drm_pci_busdma_callback, dmah, 0);
+	    drm_pci_busdma_callback, dmah, BUS_DMA_NOWAIT);
 	if (ret != 0) {
 		bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
 		bus_dma_tag_destroy(dmah->tag);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903090747.n297l3tj013508>