From 6f3cfe1069a44732d81df8a1c81bfa8d7e66c08f Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Fri, 28 Feb 2020 10:33:16 -0800 Subject: [PATCH] vrend: guard minigbm usage bit in vrend_fromat_can_sample() GBM_BO_USE_TEXTURING is available in minigbm's gbm.h but not in mesa's gbm.h. Texture usage is implied with usage 0 in mesa gbm. Signed-off-by: Jason Macnak Reviewed-by: Gurchetan Singh --- src/vrend_renderer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 3a1180d..70a63f2 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -689,7 +689,13 @@ static inline bool vrend_format_can_sample(enum virgl_formats format) if (!gbm || !gbm->device || !gbm_format) return false; - return gbm_device_is_format_supported(gbm->device, gbm_format, GBM_BO_USE_TEXTURING); +#ifdef MINIGBM + uint32_t gbm_usage = GBM_BO_USE_TEXTURING; +#else + uint32_t gbm_usage = 0; +#endif + + return gbm_device_is_format_supported(gbm->device, gbm_format, gbm_usage); #else return false; #endif