diff --git a/cros_gralloc/cros_gralloc_driver.cc b/cros_gralloc/cros_gralloc_driver.cc index 8a0dd12..847316e 100644 --- a/cros_gralloc/cros_gralloc_driver.cc +++ b/cros_gralloc/cros_gralloc_driver.cc @@ -255,6 +255,9 @@ bool cros_gralloc_driver::get_resolved_format_and_use_flags( return true; } + if ((descriptor->use_flags & BO_USE_PRIVATE_1)) { + ALOGI("prop set, sepeical flag BO_USE_PRIVATE_1\n"); + } drv_resolve_format_and_use_flags(drv, descriptor->drm_format, descriptor->use_flags, &resolved_format, &resolved_use_flags); diff --git a/cros_gralloc/cros_gralloc_helpers.cc b/cros_gralloc/cros_gralloc_helpers.cc index cb2d1cc..1ec1b22 100644 --- a/cros_gralloc/cros_gralloc_helpers.cc +++ b/cros_gralloc/cros_gralloc_helpers.cc @@ -26,6 +26,9 @@ /* Define to match AIDL PixelFormat::R_8. */ #define HAL_PIXEL_FORMAT_R8 0x38 +/* Define to match BufferUsage::GRALLOC_USAGE_PRIVATE_0. */ +#define GRALLOC_USAGE_PRIVATE_1 (1 << 29) + const char *drmFormat2Str(int drm_format) { static char buf[5]; @@ -160,6 +163,7 @@ uint64_t cros_gralloc_convert_usage(uint64_t usage) BO_USE_SENSOR_DIRECT_DATA); handle_usage(&usage, BUFFER_USAGE_GPU_DATA_BUFFER, &use_flags, BO_USE_GPU_DATA_BUFFER); handle_usage(&usage, BUFFER_USAGE_FRONT_RENDERING_MASK, &use_flags, BO_USE_FRONT_RENDERING); + handle_usage(&usage, GRALLOC_USAGE_PRIVATE_1, &use_flags, BO_USE_PRIVATE_1); if (usage) { ALOGE("Unhandled gralloc usage: %llx", (unsigned long long)usage); diff --git a/drv.h b/drv.h index 3411d03..d374de2 100644 --- a/drv.h +++ b/drv.h @@ -45,6 +45,7 @@ extern "C" { #define BO_USE_RENDERSCRIPT (1ull << 17) #define BO_USE_GPU_DATA_BUFFER (1ull << 18) #define BO_USE_SENSOR_DIRECT_DATA (1ull << 19) +#define BO_USE_PRIVATE_1 (1ull << 29) #define BO_USE_ARC_SCREEN_CAP_PROBED (1ull << 63) diff --git a/i915.c b/i915.c index a8a237a..09e24f0 100644 --- a/i915.c +++ b/i915.c @@ -338,7 +338,7 @@ static int i915_add_combinations(struct driver *drv) { struct i915_device *i915 = drv->priv; - const uint64_t scanout_and_render = BO_USE_RENDER_MASK | BO_USE_SCANOUT; + const uint64_t scanout_and_render = BO_USE_RENDER_MASK | BO_USE_SCANOUT | BO_USE_PRIVATE_1; const uint64_t render = BO_USE_RENDER_MASK; const uint64_t texture_only = BO_USE_TEXTURE_MASK; uint64_t render_flags = BO_USE_RENDER_MASK;