int width, int height,
int format, int usage)
{
+ int32_t supported;
uint64_t drv_usage;
uint32_t drv_format;
struct cros_gralloc_bo *bo;
drv_format = drv_resolve_format(drv, drv_format);
drv_usage = cros_gralloc_convert_flags(usage);
- if (!drv_is_combination_supported(drv, drv_format, drv_usage,
- DRM_FORMAT_MOD_NONE)) {
+ supported = drv_is_combination_supported(drv, drv_format, drv_usage,
+ DRM_FORMAT_MOD_NONE);
+
+ if (!supported && (drv_usage & BO_USE_SCANOUT)) {
+ drv_usage &= ~BO_USE_SCANOUT;
+ 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, "
- "drv_flags: %llu", format, usage,
+ "HAL flags: %u, drv_format: %u, "
+ "drv_flags: %llu", format, usage,
drv_format, drv_usage);
return NULL;
}
uint64_t usage = BO_USE_NONE;
if (flags & GRALLOC_USAGE_CURSOR)
- usage |= BO_USE_CURSOR;
+ usage |= BO_USE_NONE;
if ((flags & sw_read()) == GRALLOC_USAGE_SW_READ_RARELY)
usage |= BO_USE_SW_READ_RARELY;
if ((flags & sw_read()) == GRALLOC_USAGE_SW_READ_OFTEN)
/* HWC wants to use display hardware, but can defer to OpenGL. */
usage |= BO_USE_SCANOUT | BO_USE_RENDERING;
if (flags & GRALLOC_USAGE_HW_FB)
- usage |= BO_USE_SCANOUT;
+ usage |= BO_USE_SCANOUT | BO_USE_RENDERING;
if (flags & GRALLOC_USAGE_EXTERNAL_DISP)
/* We're ignoring this flag until we decide what to with display link */
usage |= BO_USE_NONE;