xref: /linux/drivers/gpu/drm/vgem/vgem_drv.h (revision 4077798484459a2eced2050045099a466ecb618a)
1502e95c6SZach Reizner /*
2502e95c6SZach Reizner  * Copyright © 2012 Intel Corporation
3502e95c6SZach Reizner  * Copyright © 2014 The Chromium OS Authors
4502e95c6SZach Reizner  *
5502e95c6SZach Reizner  * Permission is hereby granted, free of charge, to any person obtaining a
6502e95c6SZach Reizner  * copy of this software and associated documentation files (the "Software"),
7502e95c6SZach Reizner  * to deal in the Software without restriction, including without limitation
8502e95c6SZach Reizner  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9502e95c6SZach Reizner  * and/or sell copies of the Software, and to permit persons to whom the
10502e95c6SZach Reizner  * Software is furnished to do so, subject to the following conditions:
11502e95c6SZach Reizner  *
12502e95c6SZach Reizner  * The above copyright notice and this permission notice (including the next
13502e95c6SZach Reizner  * paragraph) shall be included in all copies or substantial portions of the
14502e95c6SZach Reizner  * Software.
15502e95c6SZach Reizner  *
16502e95c6SZach Reizner  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17502e95c6SZach Reizner  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18502e95c6SZach Reizner  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19502e95c6SZach Reizner  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20502e95c6SZach Reizner  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21502e95c6SZach Reizner  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22502e95c6SZach Reizner  * IN THE SOFTWARE.
23502e95c6SZach Reizner  *
24502e95c6SZach Reizner  * Authors:
25502e95c6SZach Reizner  *    Ben Widawsky <ben@bwidawsk.net>
26502e95c6SZach Reizner  *
27502e95c6SZach Reizner  */
28502e95c6SZach Reizner 
29502e95c6SZach Reizner #ifndef _VGEM_DRV_H_
30502e95c6SZach Reizner #define _VGEM_DRV_H_
31502e95c6SZach Reizner 
32502e95c6SZach Reizner #include <drm/drmP.h>
33502e95c6SZach Reizner #include <drm/drm_gem.h>
34502e95c6SZach Reizner 
35*40777984SChris Wilson #include <uapi/drm/vgem_drm.h>
36*40777984SChris Wilson 
37*40777984SChris Wilson struct vgem_file {
38*40777984SChris Wilson 	struct idr fence_idr;
39*40777984SChris Wilson 	struct mutex fence_mutex;
40*40777984SChris Wilson };
41*40777984SChris Wilson 
42502e95c6SZach Reizner #define to_vgem_bo(x) container_of(x, struct drm_vgem_gem_object, base)
43502e95c6SZach Reizner struct drm_vgem_gem_object {
44502e95c6SZach Reizner 	struct drm_gem_object base;
45502e95c6SZach Reizner };
46502e95c6SZach Reizner 
47*40777984SChris Wilson int vgem_fence_open(struct vgem_file *file);
48*40777984SChris Wilson int vgem_fence_attach_ioctl(struct drm_device *dev,
49*40777984SChris Wilson 			    void *data,
50*40777984SChris Wilson 			    struct drm_file *file);
51*40777984SChris Wilson int vgem_fence_signal_ioctl(struct drm_device *dev,
52*40777984SChris Wilson 			    void *data,
53*40777984SChris Wilson 			    struct drm_file *file);
54*40777984SChris Wilson void vgem_fence_close(struct vgem_file *file);
55*40777984SChris Wilson 
56502e95c6SZach Reizner #endif
57