diff options
author | Marcin Radomski <dextero@google.com> | 2024-03-07 12:08:08 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-03-12 11:19:34 +0000 |
commit | 3b508e145f1acfd3895daab0089ebd54cd924bb2 (patch) | |
tree | bc8f802c8fc6243cdd59fa36279db7b038f52f0a | |
parent | e950d82ae26aedd1b7738ea093e46fc54aa29f65 (diff) | |
download | minigbm-3b508e145f1acfd3895daab0089ebd54cd924bb2.tar.gz |
minigbm: use int instead of size_t for plane index
Rationale: this will help get Rust gbm bindings into Android
(go/drm-gbm-rust-crates-for-android) without needing minigbm-specific
patches to upstream Rust code.
Mesa gbm defines the plane argument for some functions as int rather
than size_t. While this doesn't bother C/C++ compilers too much,
attempting to use bindgen-generated Rust bindings to minigbm with gbm
Rust crate[1] fails.
[1] https://crates.io/crates/gbm
Bug: 328363177
Test: cros build-packages --board=amd64-generic minigbm drm-tests
Change-Id: I5938633e0936bf1b9aafb856bfb966ceb1fb1a2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5352370
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Marcin Radomski <dextero@google.com>
Tested-by: Marcin Radomski <dextero@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
-rw-r--r-- | gbm.c | 6 | ||||
-rw-r--r-- | gbm.h | 6 |
2 files changed, 6 insertions, 6 deletions
@@ -330,7 +330,7 @@ PUBLIC int gbm_bo_get_plane_count(struct gbm_bo *bo) return drv_bo_get_num_planes(bo->bo); } -PUBLIC union gbm_bo_handle gbm_bo_get_handle_for_plane(struct gbm_bo *bo, size_t plane) +PUBLIC union gbm_bo_handle gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane) { return (union gbm_bo_handle)drv_bo_get_plane_handle(bo->bo, (size_t)plane).u64; } @@ -340,12 +340,12 @@ PUBLIC int gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane) return drv_bo_get_plane_fd(bo->bo, plane); } -PUBLIC uint32_t gbm_bo_get_offset(struct gbm_bo *bo, size_t plane) +PUBLIC uint32_t gbm_bo_get_offset(struct gbm_bo *bo, int plane) { return drv_bo_get_plane_offset(bo->bo, (size_t)plane); } -PUBLIC uint32_t gbm_bo_get_stride_for_plane(struct gbm_bo *bo, size_t plane) +PUBLIC uint32_t gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane) { return drv_bo_get_plane_stride(bo->bo, (size_t)plane); } @@ -434,7 +434,7 @@ uint32_t gbm_bo_get_stride(struct gbm_bo *bo); uint32_t -gbm_bo_get_stride_for_plane(struct gbm_bo *bo, size_t plane); +gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane); uint32_t gbm_bo_get_format(struct gbm_bo *bo); @@ -443,7 +443,7 @@ uint32_t gbm_bo_get_bpp(struct gbm_bo *bo); uint32_t -gbm_bo_get_offset(struct gbm_bo *bo, size_t plane); +gbm_bo_get_offset(struct gbm_bo *bo, int plane); struct gbm_device * gbm_bo_get_device(struct gbm_bo *bo); @@ -461,7 +461,7 @@ int gbm_bo_get_plane_count(struct gbm_bo *bo); union gbm_bo_handle -gbm_bo_get_handle_for_plane(struct gbm_bo *bo, size_t plane); +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); |