OSDN Git Service

minigbm: cros_gralloc: support GRALLOC_MODULE_API_VERSION_0_3
[android-x86/external-minigbm.git] / drv.h
diff --git a/drv.h b/drv.h
index 18e9233..c92d0ca 100644 (file)
--- a/drv.h
+++ b/drv.h
@@ -33,12 +33,17 @@ extern "C" {
 #define BO_USE_EXTERNAL_DISP           (1ull << 10)
 #define BO_USE_PROTECTED               (1ull << 11)
 #define BO_USE_HW_VIDEO_ENCODER                (1ull << 12)
-#define BO_USE_HW_CAMERA_WRITE         (1ull << 13)
-#define BO_USE_HW_CAMERA_READ          (1ull << 14)
-#define BO_USE_HW_CAMERA_ZSL           (1ull << 15)
+#define BO_USE_CAMERA_WRITE            (1ull << 13)
+#define BO_USE_CAMERA_READ             (1ull << 14)
 #define BO_USE_RENDERSCRIPT            (1ull << 16)
 #define BO_USE_TEXTURE                 (1ull << 17)
 
+/* Read-Write permissions for drv_bo_map() flags */
+#define BO_TRANSFER_NONE 0
+#define BO_TRANSFER_READ (1 << 0)
+#define BO_TRANSFER_WRITE (1 << 1)
+#define BO_TRANSFER_READ_WRITE (BO_TRANSFER_READ | BO_TRANSFER_WRITE)
+
 /* This is our extension to <drm_fourcc.h>.  We need to make sure we don't step
  * on the namespace of already defined formats, which can be done by using invalid
  * fourcc codes.
@@ -49,10 +54,6 @@ extern "C" {
 #define DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED fourcc_code('9', '9', '9', '8')
 #define DRM_FORMAT_FLEX_YCbCr_420_888          fourcc_code('9', '9', '9', '9')
 
-#define BO_COMMON_USE_MASK BO_USE_LINEAR | BO_USE_RENDERING | \
-                          BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN | \
-                          BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY | \
-                          BO_USE_TEXTURE
 // clang-format on
 struct driver;
 struct bo;
@@ -136,7 +137,7 @@ uint32_t drv_bo_get_format(struct bo *bo);
 
 uint32_t drv_bo_get_stride_in_pixels(struct bo *bo);
 
-uint32_t drv_resolve_format(struct driver *drv, uint32_t format);
+uint32_t drv_resolve_format(struct driver *drv, uint32_t format, uint64_t usage);
 
 size_t drv_num_planes_from_format(uint32_t format);