OSDN Git Service

minigbm: cros_gralloc: Use pkg-config for LIBS
[android-x86/external-minigbm.git] / gbm.h
diff --git a/gbm.h b/gbm.h
index 87c1eb7..1fb338f 100644 (file)
--- a/gbm.h
+++ b/gbm.h
@@ -35,6 +35,7 @@ extern "C" {
 
 #define __GBM__ 1
 
+#include <stddef.h>
 #include <stdint.h>
 
 /**
@@ -68,6 +69,8 @@ union gbm_bo_handle {
    uint64_t u64;
 };
 
+#define GBM_MAX_PLANES 4
+
 #define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
                              ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
 
@@ -259,6 +262,12 @@ gbm_bo_create(struct gbm_device *gbm,
               uint32_t width, uint32_t height,
               uint32_t format, uint32_t flags);
 
+struct gbm_bo *
+gbm_bo_create_with_modifiers(struct gbm_device *gbm,
+                             uint32_t width, uint32_t height,
+                             uint32_t format,
+                             const uint64_t *modifiers, uint32_t count);
+
 #define GBM_BO_IMPORT_WL_BUFFER         0x5501
 #define GBM_BO_IMPORT_EGL_IMAGE         0x5502
 #define GBM_BO_IMPORT_FD                0x5503
@@ -273,13 +282,13 @@ struct gbm_import_fd_data {
 };
 
 struct gbm_import_fd_planar_data {
-   int fds[4];
+   int fds[GBM_MAX_PLANES];
    uint32_t width;
    uint32_t height;
    uint32_t format;
-   uint32_t offsets[4];
-   uint32_t strides[4];
-   uint64_t format_modifiers[4];
+   uint32_t strides[GBM_MAX_PLANES];
+   uint32_t offsets[GBM_MAX_PLANES];
+   uint64_t format_modifiers[GBM_MAX_PLANES];
 };
 
 struct gbm_bo *