xref: /linux/drivers/gpu/drm/vgem/vgem_drv.h (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
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/drm_gem.h>
33*f9a87bd7SGabriel Krisman Bertazi #include <drm/drm_cache.h>
34502e95c6SZach Reizner 
3540777984SChris Wilson #include <uapi/drm/vgem_drm.h>
3640777984SChris Wilson 
3740777984SChris Wilson struct vgem_file {
3840777984SChris Wilson 	struct idr fence_idr;
3940777984SChris Wilson 	struct mutex fence_mutex;
4040777984SChris Wilson };
4140777984SChris Wilson 
4240777984SChris Wilson int vgem_fence_open(struct vgem_file *file);
4340777984SChris Wilson int vgem_fence_attach_ioctl(struct drm_device *dev,
4440777984SChris Wilson 			    void *data,
4540777984SChris Wilson 			    struct drm_file *file);
4640777984SChris Wilson int vgem_fence_signal_ioctl(struct drm_device *dev,
4740777984SChris Wilson 			    void *data,
4840777984SChris Wilson 			    struct drm_file *file);
4940777984SChris Wilson void vgem_fence_close(struct vgem_file *file);
5040777984SChris Wilson 
51502e95c6SZach Reizner #endif
52