summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i810
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-20 17:13:58 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-20 17:29:13 -0700
commit6be5ceb02e98eaf6cfc4f8b12a896d04023f340d (patch)
treef34de1392300bbf63549f4eeb20f7606d6f7b1f9 /drivers/gpu/drm/i810
parenta46ef99d80817a167477ed1c8b4d90ee0c2e726f (diff)
downloadblackbird-op-linux-6be5ceb02e98eaf6cfc4f8b12a896d04023f340d.tar.gz
blackbird-op-linux-6be5ceb02e98eaf6cfc4f8b12a896d04023f340d.zip
VM: add "vm_mmap()" helper function
This continues the theme started with vm_brk() and vm_munmap(): vm_mmap() does the same thing as do_mmap(), but additionally does the required VM locking. This uninlines (and rewrites it to be clearer) do_mmap(), which sadly duplicates it in mm/mmap.c and mm/nommu.c. But that way we don't have to export our internal do_mmap_pgoff() function. Some day we hopefully don't have to export do_mmap() either, if all modular users can become the simpler vm_mmap() instead. We're actually very close to that already, with the notable exception of the (broken) use in i810, and a couple of stragglers in binfmt_elf. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpu/drm/i810')
-rw-r--r--drivers/gpu/drm/i810/i810_dma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index b85337f06fbf..a4ba453b3d27 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
+++ b/drivers/gpu/drm/i810/i810_dma.c
@@ -129,6 +129,7 @@ static int i810_map_buffer(struct drm_buf *buf, struct drm_file *file_priv)
if (buf_priv->currently_mapped == I810_BUF_MAPPED)
return -EINVAL;
+ /* This is all entirely broken */
down_write(&current->mm->mmap_sem);
old_fops = file_priv->filp->f_op;
file_priv->filp->f_op = &i810_buffer_fops;
OpenPOWER on IntegriCloud