OSDN Git Service

minigbm: add the BO_USE_RENDERSCRIPT flag back in
authorGurchetan Singh <gurchetansingh@chromium.org>
Fri, 4 Aug 2017 01:34:05 +0000 (18:34 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Sun, 6 Aug 2017 05:07:49 +0000 (22:07 -0700)
Previously, we mapped BO_USE_RENDERSCRIPT to BO_USE_LINEAR,
which made sense at the moment. However, we know have a case
where we need to special things with renderscript buffers on
ARM boards. Let's add back in the flag so we can differentiate
between normal linear buffers and renderscript buffers at map
and unmap time.

BUG=b:38097499
TEST=run cts -m CtsViewTestCases -t android.view.cts.SurfaceViewSyncTests
     passes on 9776.0.0 veyron_minnie

Change-Id: I7f1ee76735280ab6495a2d4af332cce5bc1c1727
Reviewed-on: https://chromium-review.googlesource.com/602735
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
cros_gralloc/gralloc0/gralloc0.cc
drv_priv.h
i915.c

index e62c670..a5c8181 100644 (file)
@@ -73,8 +73,7 @@ static int64_t gralloc0_convert_flags(int flags)
        if (flags & GRALLOC_USAGE_HW_CAMERA_READ)
                usage |= BO_USE_CAMERA_READ;
        if (flags & GRALLOC_USAGE_RENDERSCRIPT)
-               /* We use CPU for compute. */
-               usage |= BO_USE_LINEAR;
+               usage |= BO_USE_RENDERSCRIPT;
 
        return usage;
 }
index 13032e5..5547b78 100644 (file)
@@ -81,12 +81,13 @@ struct backend {
 };
 
 // clang-format off
-#define BO_USE_RENDER_MASK BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | \
-                          BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | \
+#define BO_USE_RENDER_MASK BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_RENDERSCRIPT | \
+                          BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | \
                           BO_USE_SW_WRITE_RARELY | BO_USE_TEXTURE
 
-#define BO_USE_TEXTURE_MASK BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN | \
-                           BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY | BO_USE_TEXTURE
+#define BO_USE_TEXTURE_MASK BO_USE_LINEAR | BO_USE_RENDERSCRIPT | BO_USE_SW_READ_OFTEN | \
+                           BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | \
+                           BO_USE_SW_WRITE_RARELY | BO_USE_TEXTURE
 
 #define LINEAR_METADATA (struct format_metadata) { 0, 1, DRM_FORMAT_MOD_NONE }
 // clang-format on
diff --git a/i915.c b/i915.c
index f100767..fe162f1 100644 (file)
--- a/i915.c
+++ b/i915.c
@@ -124,10 +124,12 @@ static int i915_add_combinations(struct driver *drv)
        drv_modify_combination(drv, DRM_FORMAT_R8, &metadata,
                               BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE);
 
+       render_flags &= ~BO_USE_RENDERSCRIPT;
        render_flags &= ~BO_USE_SW_WRITE_OFTEN;
        render_flags &= ~BO_USE_SW_READ_OFTEN;
        render_flags &= ~BO_USE_LINEAR;
 
+       texture_flags &= ~BO_USE_RENDERSCRIPT;
        texture_flags &= ~BO_USE_SW_WRITE_OFTEN;
        texture_flags &= ~BO_USE_SW_READ_OFTEN;
        texture_flags &= ~BO_USE_LINEAR;