blob: 7174fb83606c034e96f885ed6cdced6e0bbbb60b [file] [log] [blame]
Amit Pundirc738b812019-06-19 16:13:49 +05301/*
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
29extern "C" {
30#endif
31
32struct gbm_device;
33struct gbm_bo;
34
35int gralloc_gbm_handle_register(buffer_handle_t handle, struct gbm_device *gbm);
36int gralloc_gbm_handle_unregister(buffer_handle_t handle);
37
38buffer_handle_t gralloc_gbm_bo_create(struct gbm_device *gbm,
39 int width, int height, int format, int usage, int *stride);
40void gbm_free(buffer_handle_t handle);
41
42struct gbm_bo *gralloc_gbm_bo_from_handle(buffer_handle_t handle);
43buffer_handle_t gralloc_gbm_bo_get_handle(struct gbm_bo *bo);
44int gralloc_gbm_get_gem_handle(buffer_handle_t handle);
45
46int gralloc_gbm_bo_lock(buffer_handle_t handle, int x, int y, int w, int h, int enable_write, void **addr);
47int gralloc_gbm_bo_unlock(buffer_handle_t handle);
48
49struct gbm_device *gbm_dev_create(void);
50void gbm_dev_destroy(struct gbm_device *gbm);
51
52#ifdef __cplusplus
53}
54#endif
55#endif /* _GRALLOC_GBM_PRIV_H_ */