OSDN Git Service

Make drv_mapping_destroy() be called in release builds
[android-x86/external-minigbm.git] / drv.h
diff --git a/drv.h b/drv.h
index 2271a9f..0cb062d 100644 (file)
--- a/drv.h
+++ b/drv.h
@@ -23,20 +23,20 @@ extern "C" {
 #define BO_USE_CURSOR                  (1ull << 1)
 #define BO_USE_CURSOR_64X64            BO_USE_CURSOR
 #define BO_USE_RENDERING               (1ull << 2)
-#define BO_USE_LINEAR                  (1ull << 3)
-#define BO_USE_SW_READ_NEVER           (1ull << 4)
-#define BO_USE_SW_READ_RARELY          (1ull << 5)
-#define BO_USE_SW_READ_OFTEN           (1ull << 6)
-#define BO_USE_SW_WRITE_NEVER          (1ull << 7)
-#define BO_USE_SW_WRITE_RARELY         (1ull << 8)
-#define BO_USE_SW_WRITE_OFTEN          (1ull << 9)
-#define BO_USE_EXTERNAL_DISP           (1ull << 10)
-#define BO_USE_PROTECTED               (1ull << 11)
-#define BO_USE_HW_VIDEO_ENCODER                (1ull << 12)
-#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)
+/* Skip for GBM_BO_USE_WRITE */
+#define BO_USE_LINEAR                  (1ull << 4)
+#define BO_USE_TEXTURE                 (1ull << 5)
+#define BO_USE_CAMERA_WRITE            (1ull << 6)
+#define BO_USE_CAMERA_READ             (1ull << 7)
+#define BO_USE_PROTECTED               (1ull << 8)
+#define BO_USE_SW_READ_OFTEN           (1ull << 9)
+#define BO_USE_SW_READ_RARELY          (1ull << 10)
+#define BO_USE_SW_WRITE_OFTEN          (1ull << 11)
+#define BO_USE_SW_WRITE_RARELY         (1ull << 12)
+#define BO_USE_HW_VIDEO_ENCODER         (1ull << 13)
+#define BO_USE_HW_VIDEO_DECODER         (1ull << 14)
+#define BO_USE_RENDERSCRIPT            (1ull << 15)
+
 
 /* Map flags */
 #define BO_MAP_NONE 0
@@ -54,6 +54,11 @@ 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')
 
+// TODO(crbug.com/958181): remove this definition once drm_fourcc.h contains it.
+#ifndef DRM_FORMAT_P010
+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0')
+#endif
+
 // clang-format on
 struct driver;
 struct bo;
@@ -84,6 +89,7 @@ struct vma {
        uint32_t handle;
        uint32_t map_flags;
        int32_t refcount;
+       uint32_t map_strides[DRV_MAX_PLANES];
        void *priv;
 };
 
@@ -130,7 +136,7 @@ int drv_bo_unmap(struct bo *bo, struct mapping *mapping);
 
 int drv_bo_invalidate(struct bo *bo, struct mapping *mapping);
 
-int drv_bo_flush(struct bo *bo, struct mapping *mapping);
+int drv_bo_flush_or_unmap(struct bo *bo, struct mapping *mapping);
 
 uint32_t drv_bo_get_width(struct bo *bo);
 
@@ -154,7 +160,7 @@ uint64_t drv_bo_get_plane_format_modifier(struct bo *bo, size_t plane);
 
 uint32_t drv_bo_get_format(struct bo *bo);
 
-uint32_t drv_bo_get_stride_in_pixels(struct bo *bo);
+uint32_t drv_bytes_per_pixel_from_format(uint32_t format, size_t plane);
 
 uint32_t drv_stride_from_format(uint32_t format, uint32_t width, size_t plane);