summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/drmP.h12
-rw-r--r--sys/dev/pci/drm/drm_bufs.c20
-rw-r--r--sys/dev/pci/drm/drm_dma.c2
3 files changed, 17 insertions, 17 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index c75f60b2fc0..bf67a7780e6 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -313,12 +313,12 @@ struct drm_dmamem {
};
typedef struct drm_buf_entry {
- int buf_size;
- int buf_count;
- drm_buf_t *buflist;
- int seg_count;
- drm_dma_handle_t **seglist;
- int page_order;
+ struct drm_dmamem **seglist;
+ drm_buf_t *buflist;
+ int buf_size;
+ int buf_count;
+ int page_order;
+ int seg_count;
} drm_buf_entry_t;
typedef TAILQ_HEAD(drm_file_list, drm_file) drm_file_list_t;
diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c
index d46943c5b32..dcb236b8c20 100644
--- a/sys/dev/pci/drm/drm_bufs.c
+++ b/sys/dev/pci/drm/drm_bufs.c
@@ -549,9 +549,9 @@ drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
page_count = 0;
while (entry->buf_count < count) {
- drm_dma_handle_t *dmah = drm_pci_alloc(dev->dmat, size,
- alignment, 0xfffffffful);
- if (dmah == NULL) {
+ struct drm_dmamem *mem = drm_dmamem_alloc(dev->dmat, size,
+ alignment, 1, size, 0, 0);
+ if (mem == NULL) {
/* Set count correctly so we free the proper amount. */
entry->buf_count = count;
entry->seg_count = count;
@@ -562,13 +562,12 @@ drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
return ENOMEM;
}
- entry->seglist[entry->seg_count++] = dmah;
+ entry->seglist[entry->seg_count++] = mem;
for (i = 0; i < (1 << page_order); i++) {
- DRM_DEBUG("page %d @ %p\n",
- dma->page_count + page_count,
- (char *)dmah->vaddr + PAGE_SIZE * i);
+ DRM_DEBUG("page %d @ %p\n", dma->page_count +
+ page_count, mem->kva + PAGE_SIZE * i);
temp_pagelist[dma->page_count + page_count++] =
- (long)dmah->vaddr + PAGE_SIZE * i;
+ (long)mem->kva + PAGE_SIZE * i;
}
for (offset = 0;
offset + size <= total && entry->buf_count < count;
@@ -578,8 +577,9 @@ drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
buf->total = alignment;
buf->used = 0;
buf->offset = (dma->byte_count + byte_count + offset);
- buf->address = dmah->vaddr + offset;
- buf->bus_address = dmah->busaddr + offset;
+ buf->address = mem->kva + offset;
+ buf->bus_address = mem->map->dm_segs[0].ds_addr +
+ offset;
buf->pending = 0;
buf->file_priv = NULL;
diff --git a/sys/dev/pci/drm/drm_dma.c b/sys/dev/pci/drm/drm_dma.c
index 88334924a6f..e0385def268 100644
--- a/sys/dev/pci/drm/drm_dma.c
+++ b/sys/dev/pci/drm/drm_dma.c
@@ -60,7 +60,7 @@ drm_cleanup_buf(struct drm_device *dev, drm_buf_entry_t *entry)
if (entry->seg_count) {
for (i = 0; i < entry->seg_count; i++)
- drm_pci_free(dev->dmat, entry->seglist[i]);
+ drm_dmamem_free(dev->dmat, entry->seglist[i]);
drm_free(entry->seglist, entry->seg_count *
sizeof(*entry->seglist), DRM_MEM_BUFS);