minigbm: Added gralloc API to internal API
Added the drv analogues of the 2 flexible formats we need to support.
Added analogues of most of the gralloc use flags, except:
GRALLOC_USAGE_SW_READ_MASK
GRALLOC_USAGE_SW_WRITE_MASK
GRALLOC_USAGE_HW_MASK
GRALLOC_USAGE_FOREIGN_BUFFERS
GRALLOC_USAGE_ALLOC_MASK
These are used as masks and don't make sense as usage hints. In
addition, put the new flags in the drivers' supported lists and
added a flexible format query function.
BUG=chromium:616275
TEST=minigbm still builds
CQ-DEPEND=CL:371501
Change-Id: Idd2ecd6fde3e6c5caaaf3a8404d0d7db20b4ecf4
Reviewed-on: https://chromium-review.googlesource.com/372359
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
diff --git a/drv.h b/drv.h
index bc2d421..6fc83cf 100644
--- a/drv.h
+++ b/drv.h
@@ -33,6 +33,24 @@
#define DRV_BO_USE_CURSOR_64X64 DRV_BO_USE_CURSOR
#define DRV_BO_USE_RENDERING (1ull << 2)
#define DRV_BO_USE_LINEAR (1ull << 3)
+#define DRV_BO_USE_SW_READ_NEVER (1ull << 4)
+#define DRV_BO_USE_SW_READ_RARELY (1ull << 5)
+#define DRV_BO_USE_SW_READ_OFTEN (1ull << 6)
+#define DRV_BO_USE_SW_WRITE_NEVER (1ull << 7)
+#define DRV_BO_USE_SW_WRITE_RARELY (1ull << 8)
+#define DRV_BO_USE_SW_WRITE_OFTEN (1ull << 9)
+#define DRV_BO_USE_HW_TEXTURE (1ull << 10)
+#define DRV_BO_USE_HW_RENDER (1ull << 11)
+#define DRV_BO_USE_HW_2D (1ull << 12)
+#define DRV_BO_USE_HW_COMPOSER (1ull << 13)
+#define DRV_BO_USE_HW_FB (1ull << 14)
+#define DRV_BO_USE_EXTERNAL_DISP (1ull << 15)
+#define DRV_BO_USE_PROTECTED (1ull << 16)
+#define DRV_BO_USE_HW_VIDEO_ENCODE (1ull << 17)
+#define DRV_BO_USE_HW_CAMERA_WRITE (1ull << 18)
+#define DRV_BO_USE_HW_CAMERA_READ (1ull << 19)
+#define DRV_BO_USE_HW_CAMERA_ZSL (1ull << 20)
+#define DRV_BO_USE_RENDERSCRIPT (1ull << 21)
typedef enum {
DRV_FORMAT_NONE,
@@ -97,6 +115,8 @@
DRV_FORMAT_YVU422,
DRV_FORMAT_YUV444,
DRV_FORMAT_YVU444,
+ DRV_FORMAT_FLEX_IMPLEMENTATION_DEFINED,
+ DRV_FORMAT_FLEX_YCbCr_420_888,
} drv_format_t;
struct driver;
@@ -184,6 +204,9 @@
uint64_t
drv_bo_get_plane_format_modifier(struct bo *bo, size_t plane);
+drv_format_t
+drv_resolve_format(struct driver *drv, drv_format_t format);
+
#ifdef __cplusplus
}
#endif