OSDN Git Service

minigbm: add BO_USE_TEXTURE
authorGurchetan Singh <gurchetansingh@chromium.org>
Thu, 2 Mar 2017 17:48:49 +0000 (09:48 -0800)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 9 Mar 2017 06:27:41 +0000 (22:27 -0800)
Many people have requested re-adding BO_USE_TEXTURE as a flag
since:

BO_USE_RENDERING means the buffer will be used as a render target.
BO_USE_TEXTURE means the buffer will be textured from.

BUG=chromium:616275
TEST=minigbm/arc-cros-gralloc compiles

Change-Id: I63be6682cf4e2415dc42c78b2cab3ad694bcd818
Reviewed-on: https://chromium-review.googlesource.com/448251
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
cros_gralloc/cros_gralloc_helpers.cc
drv.h

index afb1a96..6a6bc2c 100644 (file)
@@ -26,7 +26,7 @@ uint64_t cros_gralloc_convert_flags(int flags)
        if ((flags & sw_write()) == GRALLOC_USAGE_SW_WRITE_OFTEN)
                usage |= BO_USE_SW_WRITE_OFTEN;
        if (flags & GRALLOC_USAGE_HW_TEXTURE)
-               usage |= BO_USE_RENDERING;
+               usage |= BO_USE_TEXTURE;
        if (flags & GRALLOC_USAGE_HW_RENDER)
                usage |= BO_USE_RENDERING;
        if (flags & GRALLOC_USAGE_HW_2D)
diff --git a/drv.h b/drv.h
index 355ea45..ff33c92 100644 (file)
--- a/drv.h
+++ b/drv.h
@@ -36,6 +36,7 @@ extern "C" {
 #define BO_USE_HW_CAMERA_READ          (1ull << 14)
 #define BO_USE_HW_CAMERA_ZSL           (1ull << 15)
 #define BO_USE_RENDERSCRIPT            (1ull << 16)
+#define BO_USE_TEXTURE                 (1ull << 17)
 
 /* 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