minigbm: remove BO_USE_RENDERING from certain formats

We can't use GR88, R8, YV12, NV12, UYVY, YUYV buffers as render
targets, so let's remove the BO_USE_RENDERING flag from these
formats. However, we can sample from these formats (though this
feature still needs to be enabled in our drivers), so the
BO_USE_TEXTURE flag remains set.

Also, change our interpretation of the GRALLOC_USAGE_HW_COMPOSER
flag such that it implies BO_USE_SCANOUT | BO_USE_TEXTURE. This
is because the OpenGL fallback textures from the buffer if
can't be scanned-out, not renders to it.

BUG=none
TEST=run Youtube app on Kevin

Change-Id: I9ea8452279e110bc1a9579f162abe1c72192eb40
Reviewed-on: https://chromium-review.googlesource.com/506812
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
diff --git a/vc4.c b/vc4.c
index a120f3d..99896b9 100644
--- a/vc4.c
+++ b/vc4.c
@@ -16,12 +16,18 @@
 #include "helpers.h"
 #include "util.h"
 
-static const uint32_t supported_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_RGB565,
-					      DRM_FORMAT_XRGB8888 };
+static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_RGB565,
+						  DRM_FORMAT_XRGB8888 };
 
 static int vc4_init(struct driver *drv)
 {
-	return drv_add_linear_combinations(drv, supported_formats, ARRAY_SIZE(supported_formats));
+	int ret;
+	ret = drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
+				   &LINEAR_METADATA, BO_USE_RENDER_MASK);
+	if (ret)
+		return ret;
+
+	return drv_modify_linear_combinations(drv);
 }
 
 static int vc4_bo_create(struct bo *bo, uint32_t width, uint32_t height, uint32_t format,