From 3fcf63f364ef9dddbe85f753b34b01e584598276 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 9 Jul 2025 15:28:22 -0700 Subject: [PATCH] dri2: Allow allocating suboptimal for sampling Fixes allocations via gbm, which doesn't necessarily need to be renderable. Fixes: ba7454a15565 ("dri2+gallium: Support to import suboptimal formats") Signed-off-by: Rob Clark Part-of: --- src/gallium/frontends/dri/dri2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 3c1ab2f2d6e..ac80d819495 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -919,8 +919,10 @@ dri_create_image(struct dri_screen *screen, if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, 0, 0, PIPE_BIND_RENDER_TARGET)) tex_usage |= PIPE_BIND_RENDER_TARGET; - if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, - 0, 0, PIPE_BIND_SAMPLER_VIEW)) + if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, 0, 0, + PIPE_BIND_SAMPLER_VIEW) || + pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, 0, 0, + PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SAMPLER_VIEW_SUBOPTIMAL)) tex_usage |= PIPE_BIND_SAMPLER_VIEW; if (!tex_usage)