egl: inline fallback for get_sync_values
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:42:08 +0000 (00:42 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Jul 2020 22:11:25 +0000 (22:11 +0000)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5861>

src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/egl_dri2_fallbacks.h
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_device.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_surfaceless.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c

index a88f422bfacac9bbfef899498a384a911074b3e8..ea8f15de114e3856ec4aae92552cf9aa9ad5d14e 100644 (file)
@@ -2347,6 +2347,8 @@ dri2_get_sync_values_chromium(_EGLDisplay *disp, _EGLSurface *surf,
                               EGLuint64KHR *sbc)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   if (!dri2_dpy->vtbl->get_sync_values)
+      return EGL_FALSE;
    return dri2_dpy->vtbl->get_sync_values(disp, surf, ust, msc, sbc);
 }
 
index c90f560bc7873963fba3e479f5d3a344ec2af01d..df4fb76fe62ca0cd44d30ccdc7c0ade172b1c8ad 100644 (file)
@@ -152,6 +152,7 @@ struct dri2_egl_display_vtbl {
    struct wl_buffer* (*create_wayland_buffer_from_image)(
                         _EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img);
 
+   /* optional */
    EGLBoolean (*get_sync_values)(_EGLDisplay *display, _EGLSurface *surface,
                                  EGLuint64KHR *ust, EGLuint64KHR *msc,
                                  EGLuint64KHR *sbc);
index 3033903d5e8b988679711bb62a1d483f2ef35454..1fc7b8ea167f62e2d6004a1e67090ee8cd34c2a4 100644 (file)
 #include "eglcurrent.h"
 #include "egltypedefs.h"
 
-static inline EGLBoolean
-dri2_fallback_get_sync_values(_EGLDisplay *disp, _EGLSurface *surf,
-                              EGLuint64KHR *ust, EGLuint64KHR *msc,
-                              EGLuint64KHR *sbc)
-{
-   return EGL_FALSE;
-}
-
 #endif /* EGL_DRI2_FALLBACKS_INCLUDED */
index 1d86c6f550346a8b5fc032d196b23c8dd8b499dd..bee601c1fdd69693610d60a3b785cb2fcb5fae59 100644 (file)
@@ -1269,7 +1269,6 @@ static const struct dri2_egl_display_vtbl droid_display_vtbl = {
    .swap_interval = droid_swap_interval,
    .query_buffer_age = droid_query_buffer_age,
    .query_surface = droid_query_surface,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
    .set_shared_buffer_mode = droid_set_shared_buffer_mode,
 };
index fdb5652e3068163f77f579cfce4d800bf9430889..25b6cad1802dd4b7b019e944d51c654def0d8253 100644 (file)
@@ -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,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };
 
index c1104667bd2a3a2f201e292c0ac507f00cbe2e48..f986e100546427b00d7bdccca4d470d7894536b8 100644 (file)
@@ -679,7 +679,6 @@ static const struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
    .create_image = dri2_drm_create_image_khr,
    .swap_buffers = dri2_drm_swap_buffers,
    .query_buffer_age = dri2_drm_query_buffer_age,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };
 
index 9d4cdb00b78a9f929426899079503e4fa0ad7855..2569715ebcbd19b5851ba6ed65a24e0ec76e4d3e 100644 (file)
@@ -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,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };
 
index 5e37e979b9c66fb80a288c4abf0b23bc73f6fa66..8488d463f357b6792c1df350c2438a94a116906d 100644 (file)
@@ -1389,7 +1389,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
    .swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
    .query_buffer_age = dri2_wl_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };
 
@@ -2002,7 +2001,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,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };
 
index 81ce70de4791f0cee145f03b2b52690cc1a0c170..0ccc2b34bff12bc48809dc1783129290b36cfe76 100644 (file)
@@ -1183,7 +1183,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
    .swap_buffers = dri2_x11_swap_buffers,
    /* XXX: should really implement this since X11 has pixmaps */
    .query_surface = dri2_query_surface,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };