From 51593c6b34daa45b8c1a8bdf0c5d31d94e536f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 14 Mar 2024 15:38:30 +0100 Subject: [PATCH] dri/kopper: Assume a non-null drawable in flush_frontbuffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is expected that drawable is non-null here so don't add check for it. Signed-off-by: Corentin Noël Part-of: --- src/gallium/frontends/dri/kopper.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index 14dea714c79..462a2b0dcb1 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -639,13 +639,11 @@ kopper_flush_frontbuffer(struct dri_context *ctx, */ _mesa_glthread_finish(ctx->st->ctx); - if (drawable) { - /* prevent recursion */ - if (drawable->flushing) - return true; + /* prevent recursion */ + if (drawable->flushing) + return true; - drawable->flushing = true; - } + drawable->flushing = true; if (drawable->stvis.samples > 1) { /* Resolve the front buffer. */ @@ -664,9 +662,8 @@ kopper_flush_frontbuffer(struct dri_context *ctx, st = ctx->st; st_context_flush(st, ST_FLUSH_FRONT, &new_fence, NULL, NULL); - if (drawable) { - drawable->flushing = false; - } + drawable->flushing = false; + /* throttle on the previous fence */ if (drawable->throttle_fence) { screen->fence_finish(screen, NULL, drawable->throttle_fence, OS_TIMEOUT_INFINITE);