From owner-svn-src-all@FreeBSD.ORG Mon Mar 9 07:47:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20ED106564A; Mon, 9 Mar 2009 07:47:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D020B8FC08; Mon, 9 Mar 2009 07:47:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n297l34T013509; Mon, 9 Mar 2009 07:47:03 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n297l3tj013508; Mon, 9 Mar 2009 07:47:03 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903090747.n297l3tj013508@svn.freebsd.org> From: Robert Noland Date: Mon, 9 Mar 2009 07:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189560 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2009 07:47:04 -0000 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);