From 7f8a60758e685b065a48c9a14a74295b40af5bf3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 31 Jul 2024 10:52:16 -0400 Subject: [PATCH] kopper: reuse dri_image_fence_sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/frontends/dri/kopper.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index e3917f2f88e..c66bf205c1a 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -139,27 +139,6 @@ pipe_format_to_fourcc(enum pipe_format format) } } -static void -handle_in_fence(struct dri_context *ctx, __DRIimage *img) -{ - struct pipe_context *pipe = ctx->st->pipe; - struct pipe_fence_handle *fence; - int fd = img->in_fence_fd; - - if (fd == -1) - return; - - validate_fence_fd(fd); - - img->in_fence_fd = -1; - - pipe->create_fence_fd(pipe, &fence, fd, PIPE_FD_TYPE_NATIVE_SYNC); - pipe->fence_server_sync(pipe, fence); - pipe->screen->fence_reference(pipe->screen, &fence, NULL); - - close(fd); -} - /** kopper_get_pixmap_buffer * * Get the DRM object for a pixmap from the X server and @@ -399,7 +378,7 @@ XXX do this once swapinterval is hooked up else if (is_pixmap && statts[i] == ST_ATTACHMENT_FRONT_LEFT && !screen->is_sw) { drawable->textures[statts[i]] = kopper_get_pixmap_buffer(drawable, format); if (drawable->textures[statts[i]]) - handle_in_fence(ctx, drawable->image); + dri_image_fence_sync(ctx, drawable->image); } #endif if (!drawable->textures[statts[i]])