From 43ba07f7d43e94b5f971f89835972ead7a1ada72 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 3 Aug 2017 18:34:05 -0700 Subject: [PATCH] minigbm: add the BO_USE_RENDERSCRIPT flag back in MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Tested-by: Gurchetan Singh Reviewed-by: Stéphane Marchesin --- cros_gralloc/gralloc0/gralloc0.cc | 3 +-- drv_priv.h | 9 +++++---- i915.c | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cros_gralloc/gralloc0/gralloc0.cc b/cros_gralloc/gralloc0/gralloc0.cc index e62c670..a5c8181 100644 --- a/cros_gralloc/gralloc0/gralloc0.cc +++ b/cros_gralloc/gralloc0/gralloc0.cc @@ -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; } diff --git a/drv_priv.h b/drv_priv.h index 13032e5..5547b78 100644 --- a/drv_priv.h +++ b/drv_priv.h @@ -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 --- 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; -- 2.11.0