OSDN Git Service

minigbm: virtio_gpu: select dumb/virgl at runtime.
[android-x86/external-minigbm.git] / vgem.c
diff --git a/vgem.c b/vgem.c
index 867b439..5380b78 100644 (file)
--- a/vgem.c
+++ b/vgem.c
@@ -20,16 +20,11 @@ static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_YVU
 
 static int vgem_init(struct driver *drv)
 {
-       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;
+       drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
+                            &LINEAR_METADATA, BO_USE_RENDER_MASK);
 
-       ret = drv_add_combinations(drv, texture_source_formats, ARRAY_SIZE(texture_source_formats),
-                                  &LINEAR_METADATA, BO_USE_TEXTURE_MASK);
-       if (ret)
-               return ret;
+       drv_add_combinations(drv, texture_source_formats, ARRAY_SIZE(texture_source_formats),
+                            &LINEAR_METADATA, BO_USE_TEXTURE_MASK);
 
        return drv_modify_linear_combinations(drv);
 }
@@ -60,7 +55,7 @@ static uint32_t vgem_resolve_format(uint32_t format, uint64_t flags)
        }
 }
 
-struct backend backend_vgem = {
+const struct backend backend_vgem = {
        .name = "vgem",
        .init = vgem_init,
        .bo_create = vgem_bo_create,