egl: inline DRI2_FLUSH usage

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30494>
This commit is contained in:
Mike Blumenkrantz
2024-07-30 09:49:00 -04:00
committed by Marge Bot
parent 09b52c61bf
commit 3b050af311
5 changed files with 12 additions and 19 deletions
+2 -3
View File
@@ -1723,8 +1723,7 @@ dri2_flush_drawable_for_swapbuffers_flags(
* "The contents of ancillary buffers are always undefined
* after calling eglSwapBuffers."
*/
dri2_dpy->flush->flush_with_flags(
dri2_ctx->dri_context, dri_drawable,
dri_flush(dri2_ctx->dri_context, dri_drawable,
__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_INVALIDATE_ANCILLARY,
throttle_reason);
}
@@ -1874,7 +1873,7 @@ dri2_wait_client(_EGLDisplay *disp, _EGLContext *ctx)
* we need to copy fake to real here.*/
if (!dri2_dpy->swrast_not_kms)
dri2_dpy->flush->flush(dri_drawable);
dri_flush_drawable(dri_drawable);
return EGL_TRUE;
}
+2 -6
View File
@@ -616,7 +616,6 @@ droid_query_buffer_age(_EGLDisplay *disp, _EGLSurface *surface)
static EGLBoolean
droid_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
const bool has_mutable_rb = _eglSurfaceHasMutableRenderBuffer(draw);
@@ -655,7 +654,7 @@ droid_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
if (dri2_surf->buffer)
droid_window_enqueue_buffer(disp, dri2_surf);
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
dri_invalidate_drawable(dri2_surf->dri_drawable);
/* Update the shared buffer mode */
if (has_mutable_rb &&
@@ -924,9 +923,6 @@ droid_display_shared_buffer(__DRIdrawable *driDrawable, int fence_fd,
if (ANativeWindow_dequeueBuffer(dri2_surf->window, &dri2_surf->buffer,
&fence_fd)) {
/* Tear down the surface because it no longer has a back buffer. */
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
_eglLog(_EGL_WARNING, "%s: ANativeWindow_dequeueBuffer failed", __func__);
dri2_surf->base.Lost = true;
@@ -938,7 +934,7 @@ droid_display_shared_buffer(__DRIdrawable *driDrawable, int fence_fd,
dri2_surf->dri_image_back = NULL;
}
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
dri_invalidate_drawable(dri2_surf->dri_drawable);
return;
}
+1 -1
View File
@@ -330,7 +330,7 @@ dri2_drm_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
* call get_back_bo (eg: through dri2_drm_image_get_buffers).
*/
dri2_flush_drawable_for_swapbuffers(disp, draw);
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
dri_invalidate_drawable(dri2_surf->dri_drawable);
/* Make sure we have a back buffer in case we're swapping without
* ever rendering. */
+3 -5
View File
@@ -417,8 +417,6 @@ static void
resize_callback(struct wl_egl_window *wl_win, void *data)
{
struct dri2_egl_surface *dri2_surf = data;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
if (dri2_surf->base.Width == wl_win->width &&
dri2_surf->base.Height == wl_win->height)
@@ -437,7 +435,7 @@ resize_callback(struct wl_egl_window *wl_win, void *data)
dri2_surf->base.Width = wl_win->width;
dri2_surf->base.Height = wl_win->height;
}
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
dri_invalidate_drawable(dri2_surf->dri_drawable);
}
static void
@@ -1638,7 +1636,7 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *draw,
* and glthread causes troubles (see #7624 and #8136)
*/
dri2_flush_drawable_for_swapbuffers(disp, draw);
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
dri_invalidate_drawable(dri2_surf->dri_drawable);
while (dri2_surf->throttle_callback != NULL)
if (loader_wayland_dispatch(dri2_dpy->wl_dpy, dri2_surf->wl_queue, NULL) ==
@@ -1714,7 +1712,7 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *draw,
if (dri2_dpy->flush) {
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(draw);
dri2_dpy->flush->flush(dri_drawable);
dri_flush_drawable(dri_drawable);
}
}
+4 -4
View File
@@ -617,7 +617,7 @@ dri2_query_surface(_EGLDisplay *disp, _EGLSurface *surf, EGLint attribute,
surf->Width = w;
surf->Height = h;
if (changed && dri2_dpy->flush)
dri2_dpy->flush->invalidate(drawable);
dri_invalidate_drawable(drawable);
}
break;
default:
@@ -1034,7 +1034,7 @@ dri2_copy_region(_EGLDisplay *disp, _EGLSurface *draw,
return EGL_TRUE;
assert(!dri2_dpy->kopper);
dri2_dpy->flush->flush(dri2_surf->dri_drawable);
dri_flush_drawable(dri2_surf->dri_drawable);
if (dri2_surf->have_fake_front)
render_attachment = XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT;
@@ -1093,7 +1093,7 @@ dri2_x11_swap_buffers_msc(_EGLDisplay *disp, _EGLSurface *draw, int64_t msc,
* happened. The driver should still be using the viewport hack to catch
* window resizes.
*/
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
dri_invalidate_drawable(dri2_surf->dri_drawable);
return swap_count;
}
@@ -1241,7 +1241,7 @@ dri2_x11_copy_buffers(_EGLDisplay *disp, _EGLSurface *surf,
target = (uintptr_t)native_pixmap_target;
if (dri2_dpy->flush)
dri2_dpy->flush->flush(dri2_surf->dri_drawable);
dri_flush_drawable(dri2_surf->dri_drawable);
else {
/* This should not be a swapBuffers, because it could present an
* incomplete frame, and it could invalidate the back buffer if it's not