summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_bufs.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2010-04-22 18:44:23 +0000
committerrnoland <rnoland@FreeBSD.org>2010-04-22 18:44:23 +0000
commit50a4503e464790a7d2b96bb43ebb5094d8f430d8 (patch)
tree31b5c6321ec517bffe70279237d0b00e4debda92 /sys/dev/drm/drm_bufs.c
parentb733ebaa1ccc608f662359519c4712cf384b1360 (diff)
downloadFreeBSD-src-50a4503e464790a7d2b96bb43ebb5094d8f430d8.zip
FreeBSD-src-50a4503e464790a7d2b96bb43ebb5094d8f430d8.tar.gz
re-write scatter gather memory allocation yet again...
This time, abandon the use of busdma and start interacting with the VM system directly. Make use of the new kmem_alloc_attr() which allows us to easily allocate non-contiguous pages to back the GART table. This should help a lot when starting or restarting X after the system has been running for a while and memory has become fragmented. MFC after: 2 weeks
Diffstat (limited to 'sys/dev/drm/drm_bufs.c')
-rw-r--r--sys/dev/drm/drm_bufs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/drm/drm_bufs.c b/sys/dev/drm/drm_bufs.c
index 9c1ab5c..2d27cd4 100644
--- a/sys/dev/drm/drm_bufs.c
+++ b/sys/dev/drm/drm_bufs.c
@@ -226,8 +226,8 @@ int drm_addmap(struct drm_device * dev, unsigned long offset,
DRM_LOCK();
return EINVAL;
}
- map->virtual = (void *)(dev->sg->handle + offset);
- map->offset = dev->sg->handle + offset;
+ map->virtual = (void *)(dev->sg->vaddr + offset);
+ map->offset = dev->sg->vaddr + offset;
break;
case _DRM_CONSISTENT:
/* Unfortunately, we don't get any alignment specification from
@@ -744,7 +744,7 @@ static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *reques
buf->offset = (dma->byte_count + offset);
buf->bus_address = agp_offset + offset;
- buf->address = (void *)(agp_offset + offset + dev->sg->handle);
+ buf->address = (void *)(agp_offset + offset + dev->sg->vaddr);
buf->next = NULL;
buf->pending = 0;
buf->file_priv = NULL;
OpenPOWER on IntegriCloud