Some camera CTS tests pass down the following usage:
GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_WRITE_OFTEN,
which we convert. Since we generally want to create a tiled buffer when
GRALLOC_USAGE_HW_TEXTURE is specified and tiled buffers are inefficient for
frequent software access, many drivers don't support this combination.
When this occurs, let's drop the BO_USE_RENDERING flag and try the allocation again
with different flags.
BUG=chromium:616275
TEST=run cts --disable-reboot --class android.hardware.camera2.cts.MultiViewTest
passes on kevin
Change-Id: Id3364edb849fe92d4710c765ed664e8aa4a4738d
Reviewed-on: https://chromium-review.googlesource.com/424318
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
DRM_FORMAT_MOD_NONE);
}
+ if (!supported && (drv_usage & BO_USE_RENDERING) &&
+ (drv_usage && (BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN))) {
+ drv_usage &= ~BO_USE_RENDERING;
+ supported = drv_is_combination_supported(drv, drv_format,
+ drv_usage,
+ DRM_FORMAT_MOD_NONE);
+ }
+
if (!supported) {
cros_gralloc_error("Unsupported combination -- HAL format: %u, "
"HAL flags: %u, drv_format: %u, "