From: Eric Engestrom Date: Fri, 10 Jul 2020 22:40:57 +0000 (+0200) Subject: egl: inline fallback for query_buffer_age X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5fb1fbc9b92dcf26e749783b7a482e158f28883;p=mesa.git egl: inline fallback for query_buffer_age Signed-off-by: Eric Engestrom Reviewed-by: Frank Binns Reviewed-by: Emil Velikov Part-of: --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e118509819f..08c91984904 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2067,6 +2067,8 @@ static EGLint dri2_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + if (!dri2_dpy->vtbl->query_buffer_age) + return 0; return dri2_dpy->vtbl->query_buffer_age(drv, disp, surf); } diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 485097fad22..de21579cd46 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -140,6 +140,7 @@ struct dri2_egl_display_vtbl { EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, void *native_pixmap_target); + /* optional */ EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf); diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h index 0456a4b1ed7..6609aa28df5 100644 --- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h +++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h @@ -30,13 +30,6 @@ struct wl_buffer; -static inline EGLint -dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp, - _EGLSurface *surf) -{ - return 0; -} - static inline struct wl_buffer* dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *disp, diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c index 01aac6a1ec8..c1ed30cca8b 100644 --- a/src/egl/drivers/dri2/platform_device.c +++ b/src/egl/drivers/dri2/platform_device.c @@ -186,7 +186,6 @@ static const struct dri2_egl_display_vtbl dri2_device_display_vtbl = { .create_pbuffer_surface = dri2_device_create_pbuffer_surface, .destroy_surface = device_destroy_surface, .create_image = dri2_create_image_khr, - .query_buffer_age = dri2_fallback_query_buffer_age, .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index cbcb3f5c152..c8ef1dc95a7 100644 --- a/src/egl/drivers/dri2/platform_surfaceless.c +++ b/src/egl/drivers/dri2/platform_surfaceless.c @@ -180,7 +180,6 @@ static const struct dri2_egl_display_vtbl dri2_surfaceless_display_vtbl = { .create_pbuffer_surface = dri2_surfaceless_create_pbuffer_surface, .destroy_surface = surfaceless_destroy_surface, .create_image = dri2_create_image_khr, - .query_buffer_age = dri2_fallback_query_buffer_age, .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 41d1b454506..285c0b78eb2 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2002,7 +2002,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_swrast_display_vtbl = { .destroy_surface = dri2_wl_destroy_surface, .create_image = dri2_create_image_khr, .swap_buffers = dri2_wl_swrast_swap_buffers, - .query_buffer_age = dri2_fallback_query_buffer_age, .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 65cb4c51c98..b9b28ec844f 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -1182,7 +1182,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = { .create_image = dri2_create_image_khr, .swap_buffers = dri2_x11_swap_buffers, /* XXX: should really implement this since X11 has pixmaps */ - .query_buffer_age = dri2_fallback_query_buffer_age, .query_surface = dri2_query_surface, .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, @@ -1201,7 +1200,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_display_vtbl = { .swap_buffers_region = dri2_x11_swap_buffers_region, .post_sub_buffer = dri2_x11_post_sub_buffer, .copy_buffers = dri2_x11_copy_buffers, - .query_buffer_age = dri2_fallback_query_buffer_age, .query_surface = dri2_query_surface, .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_x11_get_sync_values,