minigbm: virtio: check caps version before disabling formats

Gfxstream backend does not yet populate supported formats cap
info.

Bug: b/146066070
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I28964c7701c5fd4cbe4ebc77f9fc553c64aeb924
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2103048
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
diff --git a/virtio_gpu.c b/virtio_gpu.c
index b061e8b..e059497 100644
--- a/virtio_gpu.c
+++ b/virtio_gpu.c
@@ -89,7 +89,7 @@
 {
 	struct virtio_gpu_priv *priv = (struct virtio_gpu_priv *)drv->priv;
 
-	if (priv->has_3d) {
+	if (priv->has_3d && priv->caps.max_version >= 1) {
 		if ((use_flags & BO_USE_RENDERING) &&
 		    !virtio_gpu_supports_format(&priv->caps.v1.render, drm_format)) {
 			drv_log("Skipping unsupported render format: %d\n", drm_format);