summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_pci.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2008-08-23 20:59:12 +0000
committerrnoland <rnoland@FreeBSD.org>2008-08-23 20:59:12 +0000
commit8ebfdfe248e93b41d01041a5ec069bf5761f8741 (patch)
tree702bd8b6b1d2549932511454499d13cba551297c /sys/dev/drm/drm_pci.c
parentcd5da88fc1464a435965660ff2af024771c4333b (diff)
downloadFreeBSD-src-8ebfdfe248e93b41d01041a5ec069bf5761f8741.zip
FreeBSD-src-8ebfdfe248e93b41d01041a5ec069bf5761f8741.tar.gz
Update drm kernel drivers.
This is a sync to mesa/drm pre-gem, with a few fixes on top of that. It also contains one local patch supplied by kib@ that I can't apply to git.master shared code. Approved by: flz Obtained from: mesa/drm git.master MFC after: 2 weeks
Diffstat (limited to 'sys/dev/drm/drm_pci.c')
-rw-r--r--sys/dev/drm/drm_pci.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/drm/drm_pci.c b/sys/dev/drm/drm_pci.c
index 0dca37b..a6ddfdf 100644
--- a/sys/dev/drm/drm_pci.c
+++ b/sys/dev/drm/drm_pci.c
@@ -1,10 +1,3 @@
-/**
- * \file drm_pci.h
- * \brief PCI consistent, DMA-accessible memory functions.
- *
- * \author Eric Anholt <anholt@FreeBSD.org>
- */
-
/*-
* Copyright 2003 Eric Anholt.
* All Rights Reserved.
@@ -31,6 +24,13 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+/**
+ * \file drm_pci.h
+ * \brief PCI consistent, DMA-accessible memory allocation.
+ *
+ * \author Eric Anholt <anholt@FreeBSD.org>
+ */
+
#include "dev/drm/drmP.h"
/**********************************************************************/
@@ -56,7 +56,8 @@ drm_pci_busdma_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error
* memory block.
*/
drm_dma_handle_t *
-drm_pci_alloc(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr)
+drm_pci_alloc(struct drm_device *dev, size_t size,
+ size_t align, dma_addr_t maxaddr)
{
drm_dma_handle_t *dmah;
int ret;
@@ -73,6 +74,7 @@ drm_pci_alloc(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr)
return NULL;
#ifdef __FreeBSD__
+ DRM_UNLOCK();
ret = bus_dma_tag_create(NULL, align, 0, /* tag, align, boundary */
maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
NULL, NULL, /* filtfunc, filtfuncargs */
@@ -81,6 +83,7 @@ drm_pci_alloc(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr)
&dmah->tag);
if (ret != 0) {
free(dmah, M_DRM);
+ DRM_LOCK();
return NULL;
}
@@ -89,9 +92,10 @@ drm_pci_alloc(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr)
if (ret != 0) {
bus_dma_tag_destroy(dmah->tag);
free(dmah, M_DRM);
+ DRM_LOCK();
return NULL;
}
-
+ DRM_LOCK();
ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, size,
drm_pci_busdma_callback, dmah, 0);
if (ret != 0) {
@@ -126,7 +130,7 @@ drm_pci_alloc(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr)
* \brief Free a DMA-accessible consistent memory block.
*/
void
-drm_pci_free(drm_device_t *dev, drm_dma_handle_t *dmah)
+drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah)
{
if (dmah == NULL)
return;
OpenPOWER on IntegriCloud