diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-02-15 19:52:22 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-02-15 19:52:22 +0000 |
commit | 298391c1d66394b015b45d4bd7c17dfe2c0efb01 (patch) | |
tree | 1ff58626152daf6032d1c5ad1488bfc73a110773 /sys/dev/pci/drm/drmP.h | |
parent | b8dbc425f67bab28cab6e652d43332c68d6d0071 (diff) |
introduce drm_dmamem_alloc() to allocate dma memory with bus_dma.
The next few commits will convert calls to drm_pci_alloc (which I hate)
over to this new api, and convert other handrolled stuff over too.
First part of my cleaning up bus_dma useage in drm.
Diffstat (limited to 'sys/dev/pci/drm/drmP.h')
-rw-r--r-- | sys/dev/pci/drm/drmP.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index 7b50ea58ab5..c75f60b2fc0 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -304,6 +304,14 @@ typedef struct drm_dma_handle { size_t size; } drm_dma_handle_t; +struct drm_dmamem { + bus_dmamap_t map; + caddr_t kva; + bus_size_t size; + int nsegs; + bus_dma_segment_t segs[1]; +}; + typedef struct drm_buf_entry { int buf_size; int buf_count; @@ -570,6 +578,9 @@ dev_type_open(drmopen); dev_type_close(drmclose); dev_type_mmap(drmmmap); extern drm_local_map_t *drm_getsarea(struct drm_device *); +struct drm_dmamem *drm_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, + int, bus_size_t, int, int); +void drm_dmamem_free(bus_dma_tag_t, struct drm_dmamem *); drm_pci_id_list_t *drm_find_description(int , int , drm_pci_id_list_t *); |