egl: inline fallback for swap_buffers_region
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:38:38 +0000 (00:38 +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
src/egl/drivers/dri2/platform_x11_dri3.c

index 60e0db3c7818c67583a49b70f516e0447eab0d72..0acd33961b5725dfb576f5acd3b6af3fabcd06bf 100644 (file)
@@ -2015,6 +2015,8 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
    __DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
    EGLBoolean ret;
 
+   if (!dri2_dpy->vtbl->swap_buffers_region)
+      return EGL_FALSE;
    ret = dri2_dpy->vtbl->swap_buffers_region(drv, disp, surf, numRects, rects);
 
    /* SwapBuffers marks the end of the frame; reset the damage region for
index f3bed345c63d4e7f091586cd3a339375b91ac1a5..dfaf25bce66df0eba2093d5e6a2e4fab282b926d 100644 (file)
@@ -125,6 +125,7 @@ struct dri2_egl_display_vtbl {
                                           _EGLSurface *surface,
                                           const EGLint *rects, EGLint n_rects);
 
+   /* optional */
    EGLBoolean (*swap_buffers_region)(_EGLDriver *drv, _EGLDisplay *disp,
                                      _EGLSurface *surf, EGLint numRects,
                                      const EGLint *rects);
index 7a268dd3843c5f7366c72772f7b9fc6cfb868ef2..46fddccfafe15521fabb38be41a64d3ee64da313 100644 (file)
 
 struct wl_buffer;
 
-static inline EGLBoolean
-dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
-                                  _EGLSurface *surf,
-                                  EGLint numRects, const EGLint *rects)
-{
-   return EGL_FALSE;
-}
-
 static inline EGLBoolean
 dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp,
                               _EGLSurface *draw,
index 6ea7d8ffc83ded19b8bd4283317c5b7e3bc50df8..02ba764f9483f5ef3a57e83cf6ec404849908958 100644 (file)
@@ -1266,7 +1266,6 @@ static const struct dri2_egl_display_vtbl droid_display_vtbl = {
    .destroy_surface = droid_destroy_surface,
    .create_image = droid_create_image_khr,
    .swap_buffers = droid_swap_buffers,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .swap_interval = droid_swap_interval,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
index 80035afdc5f5f34f086cafd9bfc3a876c35582c7..301aaeeac1dc1cad19b0ce3d177f4bad87d1b96f 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,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
index ce0bd1b137f2cc79d0c280cea8957e6ba0dc6f26..1c6595deaccd160d57c7fdb26b19d092a93a38b3 100644 (file)
@@ -678,7 +678,6 @@ static const struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
    .destroy_surface = dri2_drm_destroy_surface,
    .create_image = dri2_drm_create_image_khr,
    .swap_buffers = dri2_drm_swap_buffers,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_drm_query_buffer_age,
index 2a01c045575b5ee75cc01fc53370b63b006fe227..5c735c7e1429f17dca0ab0db1acd11bd5b9ae134 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,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
index cfb777fc9a7bae6a8c345be6d3f40c5b1e696501..1400db0dda91426b636ba0560245f8b8958e563a 100644 (file)
@@ -1387,7 +1387,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
    .create_image = dri2_create_image_khr,
    .swap_buffers = dri2_wl_swap_buffers,
    .swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_wl_query_buffer_age,
@@ -2005,7 +2004,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,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
index 340a7b5522b45815712c6b3a51793fb03ec0dab0..7f6e71f05418fe2c3eaee6586b6052b785dd2141 100644 (file)
@@ -1181,7 +1181,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
    .destroy_surface = dri2_x11_destroy_surface,
    .create_image = dri2_create_image_khr,
    .swap_buffers = dri2_x11_swap_buffers,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    /* XXX: should really implement this since X11 has pixmaps */
    .copy_buffers = dri2_fallback_copy_buffers,
index 0275da31b440fe892ab43b203688f69690924d1e..2b1faf1a396c4953ff762d19a2d635b67fff4801 100644 (file)
@@ -499,7 +499,6 @@ struct dri2_egl_display_vtbl dri3_x11_display_vtbl = {
    .create_image = dri3_create_image_khr,
    .swap_interval = dri3_set_swap_interval,
    .swap_buffers = dri3_swap_buffers,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
    .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri3_copy_buffers,
    .query_buffer_age = dri3_query_buffer_age,