aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_bufs.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2006-10-24 15:03:04 -0400
committerairlied <airlied@linux.ie>2006-12-06 23:53:31 -0500
commit3417f33e762bf7d4277031a655e3ad07e73ce0be (patch)
tree255d4871a0a7affbeab8d35f5b072a70ef064cfd /drivers/char/drm/drm_bufs.c
parent5c2df2bfb121a77d925dba580f53da08b4020528 (diff)
drm: add flag for mapping PCI DMA buffers read-only.
Add DRM_PCI_BUFFER_RO flag for mapping PCI DMA buffer read-only. An additional flag is needed, since PCI DMA buffers do not have an associated map. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_bufs.c')
-rw-r--r--drivers/char/drm/drm_bufs.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index 6eafff13dab6..9f65f5697ba8 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -887,6 +887,9 @@ int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request)
887 request->count = entry->buf_count; 887 request->count = entry->buf_count;
888 request->size = size; 888 request->size = size;
889 889
890 if (request->flags & _DRM_PCI_BUFFER_RO)
891 dma->flags = _DRM_DMA_USE_PCI_RO;
892
890 atomic_dec(&dev->buf_alloc); 893 atomic_dec(&dev->buf_alloc);
891 return 0; 894 return 0;
892 895
@@ -1471,9 +1474,10 @@ int drm_freebufs(struct inode *inode, struct file *filp,
1471 * \param arg pointer to a drm_buf_map structure. 1474 * \param arg pointer to a drm_buf_map structure.
1472 * \return zero on success or a negative number on failure. 1475 * \return zero on success or a negative number on failure.
1473 * 1476 *
1474 * Maps the AGP or SG buffer region with do_mmap(), and copies information 1477 * Maps the AGP, SG or PCI buffer region with do_mmap(), and copies information
1475 * about each buffer into user space. The PCI buffers are already mapped on the 1478 * about each buffer into user space. For PCI buffers, it calls do_mmap() with
1476 * addbufs_pci() call. 1479 * offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls
1480 * drm_mmap_dma().
1477 */ 1481 */
1478int drm_mapbufs(struct inode *inode, struct file *filp, 1482int drm_mapbufs(struct inode *inode, struct file *filp,
1479 unsigned int cmd, unsigned long arg) 1483 unsigned int cmd, unsigned long arg)