aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-09-01 16:18:40 -0400
committerDave Airlie <airlied@redhat.com>2011-09-06 06:48:34 -0400
commit07999a7e0e409891cb27f34fa1da851d8484a5c5 (patch)
tree26536a623b5086aa20fb9c2a69b7a2d1ce82e3c9 /drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
parentfe0f5c657601c28d295b1d60691cce40e8b42d92 (diff)
vmwgfx: Remove the possibility to map the fifo from user-space
This was previously used by user-space to check whether a fence sequence had passed or not. With fence objects that's not needed anymore. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index d031c555fa47..aae01b9ae4dc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -491,51 +491,3 @@ int vmw_fifo_send_fence(struct vmw_private *dev_priv, uint32_t *sequence)
491out_err: 491out_err:
492 return ret; 492 return ret;
493} 493}
494
495/**
496 * Map the first page of the FIFO read-only to user-space.
497 */
498
499static int vmw_fifo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
500{
501 int ret;
502 unsigned long address = (unsigned long)vmf->virtual_address;
503
504 if (address != vma->vm_start)
505 return VM_FAULT_SIGBUS;
506
507 ret = vm_insert_pfn(vma, address, vma->vm_pgoff);
508 if (likely(ret == -EBUSY || ret == 0))
509 return VM_FAULT_NOPAGE;
510 else if (ret == -ENOMEM)
511 return VM_FAULT_OOM;
512
513 return VM_FAULT_SIGBUS;
514}
515
516static struct vm_operations_struct vmw_fifo_vm_ops = {
517 .fault = vmw_fifo_vm_fault,
518 .open = NULL,
519 .close = NULL
520};
521
522int vmw_fifo_mmap(struct file *filp, struct vm_area_struct *vma)
523{
524 struct drm_file *file_priv;
525 struct vmw_private *dev_priv;
526
527 file_priv = filp->private_data;
528 dev_priv = vmw_priv(file_priv->minor->dev);
529
530 if (vma->vm_pgoff != (dev_priv->mmio_start >> PAGE_SHIFT) ||
531 (vma->vm_end - vma->vm_start) != PAGE_SIZE)
532 return -EINVAL;
533
534 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
535 vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_SHARED;
536 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
537 vma->vm_page_prot = ttm_io_prot(TTM_PL_FLAG_UNCACHED,
538 vma->vm_page_prot);
539 vma->vm_ops = &vmw_fifo_vm_ops;
540 return 0;
541}