static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_BGR888,
DRM_FORMAT_XRGB8888 };
+static const uint32_t supported_formats[] = { DRM_FORMAT_NV12 };
+
static int msm_init(struct driver *drv)
{
drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
&LINEAR_METADATA, BO_USE_RENDER_MASK);
+ drv_add_combinations(drv, supported_formats, ARRAY_SIZE(supported_formats),
+ &LINEAR_METADATA, BO_USE_TEXTURE_MASK | BO_USE_HW_VIDEO_DECODER);
+
return drv_modify_linear_combinations(drv);
}
if (bo->format == DRM_FORMAT_YVU420_ANDROID)
height = bo->height;
+ /* Adjust the height of NV12 buffers to include room for the UV plane */
+ /* The extra 12KB at the end are a requirement of the Venus codec driver */
+ if (bo->format == DRM_FORMAT_NV12)
+ height += DIV_ROUND_UP(height, 2) + DIV_ROUND_UP(0x3000, width);
+
return drv_dumb_bo_create(bo, width, height, format, flags);
}