summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Radomski <dextero@google.com>2024-03-07 12:08:08 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-03-12 11:19:34 +0000
commit3b508e145f1acfd3895daab0089ebd54cd924bb2 (patch)
treebc8f802c8fc6243cdd59fa36279db7b038f52f0a
parente950d82ae26aedd1b7738ea093e46fc54aa29f65 (diff)
downloadminigbm-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.c6
-rw-r--r--gbm.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/gbm.c b/gbm.c
index cf14ac4..b432b38 100644
--- a/gbm.c
+++ b/gbm.c
@@ -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);
}
diff --git a/gbm.h b/gbm.h
index 5216899..ab614f7 100644
--- a/gbm.h
+++ b/gbm.h
@@ -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);