Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright © 2012 Intel Corporation
0003  * Copyright © 2014 The Chromium OS Authors
0004  *
0005  * Permission is hereby granted, free of charge, to any person obtaining a
0006  * copy of this software and associated documentation files (the "Software"),
0007  * to deal in the Software without restriction, including without limitation
0008  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0009  * and/or sell copies of the Software, and to permit persons to whom the
0010  * Software is furnished to do so, subject to the following conditions:
0011  *
0012  * The above copyright notice and this permission notice (including the next
0013  * paragraph) shall be included in all copies or substantial portions of the
0014  * Software.
0015  *
0016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0017  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0018  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0019  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0020  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0021  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
0022  * IN THE SOFTWARE.
0023  *
0024  * Authors:
0025  *    Ben Widawsky <ben@bwidawsk.net>
0026  *
0027  */
0028 
0029 #ifndef _VGEM_DRV_H_
0030 #define _VGEM_DRV_H_
0031 
0032 #include <drm/drm_gem.h>
0033 #include <drm/drm_cache.h>
0034 
0035 #include <uapi/drm/vgem_drm.h>
0036 
0037 struct vgem_file {
0038     struct idr fence_idr;
0039     struct mutex fence_mutex;
0040 };
0041 
0042 #define to_vgem_bo(x) container_of(x, struct drm_vgem_gem_object, base)
0043 struct drm_vgem_gem_object {
0044     struct drm_gem_object base;
0045 
0046     struct page **pages;
0047     unsigned int pages_pin_count;
0048     struct mutex pages_lock;
0049 
0050     struct sg_table *table;
0051 };
0052 
0053 int vgem_fence_open(struct vgem_file *file);
0054 int vgem_fence_attach_ioctl(struct drm_device *dev,
0055                 void *data,
0056                 struct drm_file *file);
0057 int vgem_fence_signal_ioctl(struct drm_device *dev,
0058                 void *data,
0059                 struct drm_file *file);
0060 void vgem_fence_close(struct vgem_file *file);
0061 
0062 #endif