From 2f395cdb3387dd388ddc215d88238f5d57974324 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Mon, 29 Nov 2021 11:09:45 +0800 Subject: [PATCH] gbm_wrapper: Bump to meson3d 21.2.6 Major changes: 1/ Add wrapper for gbm_bo_get_fd_for_plane(only support plane 0). 2/ Drop gbm_surface_needs_lock_front_buffer. 3/ Add GBM_BO_USE_PROTECTED(just for compiling). Change-Id: I8075c37708153cf5f7f4b2cbbf931e90ec3ac24e Signed-off-by: Jeffy Chen --- include/GBM/gbm.h | 17 ++++++++++++----- meson.build | 3 ++- src/gbm_wrapper.c | 11 +++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/include/GBM/gbm.h b/include/GBM/gbm.h index c64f0c3..8af4263 100644 --- a/include/GBM/gbm.h +++ b/include/GBM/gbm.h @@ -238,10 +238,17 @@ enum gbm_bo_flags { * Buffer is linear, i.e. not tiled. */ GBM_BO_USE_LINEAR = (1 << 4), + /** + * Buffer is protected, i.e. encrypted and not readable by CPU or any + * other non-secure / non-trusted components nor by non-trusted OpenGL, + * OpenCL, and Vulkan applications. + */ + GBM_BO_USE_PROTECTED = (1 << 5), }; -/* HACK: Mali doesn't support this flag */ +/* HACK: Mali doesn't support these flag */ #define GBM_BO_USE_LINEAR 0 +#define GBM_BO_USE_PROTECTED 0 int gbm_device_get_fd(struct gbm_device *gbm); @@ -313,7 +320,7 @@ gbm_bo_import(struct gbm_device *gbm, uint32_t type, * These flags are independent of the GBM_BO_USE_* creation flags. However, * mapping the buffer may require copying to/from a staging buffer. * - * See also: pipe_transfer_usage + * See also: pipe_map_flags */ enum gbm_bo_transfer_flags { /** @@ -379,6 +386,9 @@ gbm_bo_get_plane_count(struct gbm_bo *bo); union gbm_bo_handle gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane); +int +gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane); + int gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count); @@ -406,9 +416,6 @@ gbm_surface_create_with_modifiers(struct gbm_device *gbm, const uint64_t *modifiers, const unsigned int count); -int -gbm_surface_needs_lock_front_buffer(struct gbm_surface *surface); - struct gbm_bo * gbm_surface_lock_front_buffer(struct gbm_surface *surface); diff --git a/meson.build b/meson.build index 55c3928..d453187 100644 --- a/meson.build +++ b/meson.build @@ -112,7 +112,7 @@ cl_headers = { } # Provide newer GBM version with wrappers -gbm_version = wrappers ? '20.1.5' : '10.4.0' +gbm_version = wrappers ? '21.2.6' : '10.4.0' # Package name : required symbol, wrappers, headers, package version map = { @@ -150,6 +150,7 @@ gbm_check_funcs = [ 'gbm_device_get_format_modifier_plane_count', 'gbm_bo_get_handle_for_plane', 'gbm_bo_get_stride_for_plane', + 'gbm_bo_get_fd_for_plane', 'gbm_bo_get_modifier', 'gbm_bo_create_with_modifiers', 'gbm_surface_create_with_modifiers', diff --git a/src/gbm_wrapper.c b/src/gbm_wrapper.c index abcb011..6b86a9f 100644 --- a/src/gbm_wrapper.c +++ b/src/gbm_wrapper.c @@ -67,6 +67,17 @@ gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane) } #endif +#ifndef HAS_gbm_bo_get_fd_for_plane +int +gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane) +{ + if (plane) + return -1; + + return gbm_bo_get_fd(bo); +} +#endif + #ifndef HAS_gbm_bo_get_handle_for_plane union gbm_bo_handle gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane)