From e1da6c6615f4fab6bba1508746581ef4fa7feaec Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 29 Dec 2022 20:08:27 +0000 Subject: [PATCH] libweston: Add WESTON_RENDERER_AUTO type Add an 'auto' or unspecified renderer type, so we can use enum weston_renderer_type during the configuration stage, where the target renderer may be unspecified or unknown. Signed-off-by: Daniel Stone --- include/libweston/libweston.h | 1 + libweston/backend-headless/headless.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 25fca47b..f3f3e85c 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -2066,6 +2066,7 @@ enum weston_compositor_backend { }; enum weston_renderer_type { + WESTON_RENDERER_AUTO = 0, WESTON_RENDERER_NOOP = 1, WESTON_RENDERER_PIXMAN = 2, WESTON_RENDERER_GL = 3, diff --git a/libweston/backend-headless/headless.c b/libweston/backend-headless/headless.c index 965c8285..e3fdcfb4 100644 --- a/libweston/backend-headless/headless.c +++ b/libweston/backend-headless/headless.c @@ -218,6 +218,8 @@ headless_output_disable(struct weston_output *base) break; case WESTON_RENDERER_NOOP: break; + case WESTON_RENDERER_AUTO: + unreachable("cannot have auto renderer at runtime"); } return 0; @@ -351,6 +353,8 @@ headless_output_enable(struct weston_output *base) break; case WESTON_RENDERER_NOOP: break; + case WESTON_RENDERER_AUTO: + unreachable("cannot have auto renderer at runtime"); } if (ret < 0) {