1 /*
2  * Copyright (C) 2011 Texas Instruments, Inc
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21  * SOFTWARE.
22  *
23  * Authors:
24  *    Rob Clark <rob@ti.com>
25  */
26 
27 #ifndef OMAP_DRMIF_H_
28 #define OMAP_DRMIF_H_
29 
30 #include <xf86drm.h>
31 #include <stdint.h>
32 #include <omap_drm.h>
33 
34 struct omap_bo;
35 struct omap_device;
36 
37 /* device related functions:
38  */
39 
40 struct omap_device * omap_device_new(int fd);
41 struct omap_device * omap_device_ref(struct omap_device *dev);
42 void omap_device_del(struct omap_device *dev);
43 int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value);
44 int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value);
45 
46 /* buffer-object related functions:
47  */
48 
49 struct omap_bo * omap_bo_new(struct omap_device *dev,
50 		uint32_t size, uint32_t flags);
51 struct omap_bo * omap_bo_new_tiled(struct omap_device *dev,
52 		uint32_t width, uint32_t height, uint32_t flags);
53 struct omap_bo * omap_bo_ref(struct omap_bo *bo);
54 struct omap_bo * omap_bo_from_name(struct omap_device *dev, uint32_t name);
55 struct omap_bo * omap_bo_from_dmabuf(struct omap_device *dev, int fd);
56 void omap_bo_del(struct omap_bo *bo);
57 int omap_bo_get_name(struct omap_bo *bo, uint32_t *name);
58 uint32_t omap_bo_handle(struct omap_bo *bo);
59 int omap_bo_dmabuf(struct omap_bo *bo);
60 uint32_t omap_bo_size(struct omap_bo *bo);
61 void * omap_bo_map(struct omap_bo *bo);
62 int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op);
63 int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op);
64 
65 #endif /* OMAP_DRMIF_H_ */
66