aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2020-07-11 00:40:57 +0200
committerMarge Bot <[email protected]>2020-07-16 22:11:25 +0000
commitc5fb1fbc9b92dcf26e749783b7a482e158f28883 (patch)
tree4fc607b158095746902ef0f583eb64f054f7c6d8 /src
parent90000b0264d05e0a84a5fcfd7a00835b12a9cc11 (diff)
egl: inline fallback for query_buffer_age
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Frank Binns <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5861>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c2
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h1
-rw-r--r--src/egl/drivers/dri2/egl_dri2_fallbacks.h7
-rw-r--r--src/egl/drivers/dri2/platform_device.c1
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c1
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c1
-rw-r--r--src/egl/drivers/dri2/platform_x11.c2
7 files changed, 3 insertions, 12 deletions
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,