OSDN Git Service

Remove GRALLOC_MODULE_PERFORM_GET_USAGE
[android-x86/external-gbm_gralloc.git] / gralloc_gbm_priv.h
1 /*
2  * Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
3  * Copyright (C) 2010-2011 LunarG Inc.
4  * Copyright (C) 2016 Linaro, Ltd., Rob Herring <robh@kernel.org>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24
25 #ifndef _GRALLOC_GBM_PRIV_H_
26 #define _GRALLOC_GBM_PRIV_H_
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 struct gbm_device;
33 struct gbm_bo;
34
35 #define gralloc_gbm_handle_t gralloc_drm_handle_t
36 #define gralloc_gbm_handle gralloc_drm_handle
37
38 int gralloc_gbm_handle_register(buffer_handle_t handle, struct gbm_device *gbm);
39 int gralloc_gbm_handle_unregister(buffer_handle_t handle);
40
41 buffer_handle_t gralloc_gbm_bo_create(struct gbm_device *gbm,
42                 int width, int height, int format, int usage, int *stride);
43 void gbm_free(buffer_handle_t handle);
44
45 struct gbm_bo *gralloc_gbm_bo_from_handle(buffer_handle_t handle);
46 buffer_handle_t gralloc_gbm_bo_get_handle(struct gbm_bo *bo);
47 int gralloc_gbm_get_gem_handle(buffer_handle_t handle);
48
49 int gralloc_gbm_bo_lock(buffer_handle_t handle, int x, int y, int w, int h, int enable_write, void **addr);
50 int gralloc_gbm_bo_unlock(buffer_handle_t handle);
51
52 struct gbm_device *gbm_dev_create(void);
53 void gbm_dev_destroy(struct gbm_device *gbm);
54
55 #ifdef __cplusplus
56 }
57 #endif
58 #endif /* _GRALLOC_GBM_PRIV_H_ */