1 /**************************************************************************
5 * Copyright 2021 Samsung Electronics co., Ltd. All Rights Reserved.
7 * Contact: SooChan Lim <sc1.lim@samsung.com>,
8 * Junkyeong Kim <jk0430.kim@samsung.com>,
9 * Changyeon Lee <cyeon.lee@samsung.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the
13 * "Software"), to deal in the Software without restriction, including
14 * without limitation the rights to use, copy, modify, merge, publish,
15 * distribute, sub license, and/or sell copies of the Software, and to
16 * permit persons to whom the Software is furnished to do so, subject to
17 * the following conditions:
19 * The above copyright notice and this permission notice (including the
20 * next paragraph) shall be included in all copies or substantial portions
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
26 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
27 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 **************************************************************************/
40 #include <hal-tbm-types.h>
43 hal_tbm_backend *hal_tbm_get_backend(hal_tbm_error *error);
44 hal_tbm_error hal_tbm_put_backend(hal_tbm_backend *backend_data);
47 hal_tbm_bufmgr *hal_tbm_backend_get_bufmgr(hal_tbm_backend *backend, hal_tbm_error *error);
48 int hal_tbm_backend_has_drm_device(hal_tbm_backend *backend, hal_tbm_error *error);
49 hal_tbm_fd hal_tbm_backend_get_master_drm_fd(hal_tbm_backend *backend, hal_tbm_error *error);
51 hal_tbm_error hal_tbm_backend_set_authenticated_drm_fd(hal_tbm_backend *backend, hal_tbm_fd auth_drm_fd);
53 /* hal_tbm_bufmgr_funcs */
54 hal_tbm_bufmgr_capability hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error);
55 hal_tbm_error hal_tbm_bufmgr_get_supported_formats(hal_tbm_bufmgr *bufmgr, uint32_t **formats, uint32_t *num);
56 hal_tbm_error hal_tbm_bufmgr_get_plane_data(hal_tbm_bufmgr *bufmgr, hal_tbm_format format, int plane_idx, int width, int height,
57 uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
58 hal_tbm_bo *hal_tbm_bufmgr_alloc_bo(hal_tbm_bufmgr *bufmgr, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
59 hal_tbm_bo *hal_tbm_bufmgr_alloc_bo_with_format(hal_tbm_bufmgr *bufmgr, int format, int bo_idx, int width, int height,
60 hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
61 hal_tbm_bo *hal_tbm_bufmgr_alloc_bo_with_tiled_format(hal_tbm_bufmgr *bufmgr, int width, int height, int bpp, int format,
62 hal_tbm_bo_memory_type flags, int bo_idx, hal_tbm_error *error);
63 hal_tbm_bo *hal_tbm_bufmgr_import_fd(hal_tbm_bufmgr *bufmgr, hal_tbm_fd fd, hal_tbm_error *error);
64 hal_tbm_bo *hal_tbm_bufmgr_import_key(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error *error);
67 void hal_tbm_bo_free(hal_tbm_bo *bo);
68 int hal_tbm_bo_get_size(hal_tbm_bo *bo, hal_tbm_error *error);
69 hal_tbm_bo_memory_type hal_tbm_bo_get_memory_types(hal_tbm_bo *bo, hal_tbm_error *error);
70 hal_tbm_bo_handle hal_tbm_bo_get_handle(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_error *error);
71 hal_tbm_bo_handle hal_tbm_bo_map(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error);
72 hal_tbm_error hal_tbm_bo_unmap(hal_tbm_bo *bo);
73 hal_tbm_error hal_tbm_bo_lock(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
74 hal_tbm_error hal_tbm_bo_unlock(hal_tbm_bo *bo);
75 hal_tbm_fd hal_tbm_bo_export_fd(hal_tbm_bo *bo, hal_tbm_error *error);
76 hal_tbm_key hal_tbm_bo_export_key(hal_tbm_bo *bo, hal_tbm_error *error);
81 #endif /* __HAL_TBM__ */