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