egl: inline fallback for post_sub_buffer
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:39:41 +0000 (00:39 +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 0acd33961b5725dfb576f5acd3b6af3fabcd06bf..e4eb9f0cbc98536aaecafd241d5292ba3be83252 100644 (file)
@@ -2048,6 +2048,8 @@ dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
                      EGLint x, EGLint y, EGLint width, EGLint height)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   if (!dri2_dpy->vtbl->post_sub_buffer)
+      return EGL_FALSE;
    return dri2_dpy->vtbl->post_sub_buffer(drv, disp, surf, x, y, width, height);
 }
 
index dfaf25bce66df0eba2093d5e6a2e4fab282b926d..d0e31138feb2c79a7118e838fc1dd9ff19fbe4b7 100644 (file)
@@ -130,6 +130,7 @@ struct dri2_egl_display_vtbl {
                                      _EGLSurface *surf, EGLint numRects,
                                      const EGLint *rects);
 
+   /* optional */
    EGLBoolean (*post_sub_buffer)(_EGLDriver *drv, _EGLDisplay *disp,
                                  _EGLSurface *surf,
                                  EGLint x, EGLint y,
index 46fddccfafe15521fabb38be41a64d3ee64da313..21f5bcb2a5605b5d9fffb1fbafb7add918cd9695 100644 (file)
 
 struct wl_buffer;
 
-static inline EGLBoolean
-dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp,
-                              _EGLSurface *draw,
-                              EGLint x, EGLint y, EGLint width, EGLint height)
-{
-   return EGL_FALSE;
-}
-
 static inline EGLBoolean
 dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp,
                            _EGLSurface *surf,
index 02ba764f9483f5ef3a57e83cf6ec404849908958..021c6546055fb8bf9ac50702f14ccb2ce9892321 100644 (file)
@@ -1267,7 +1267,6 @@ static const struct dri2_egl_display_vtbl droid_display_vtbl = {
    .create_image = droid_create_image_khr,
    .swap_buffers = droid_swap_buffers,
    .swap_interval = droid_swap_interval,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = droid_query_buffer_age,
    .query_surface = droid_query_surface,
index 301aaeeac1dc1cad19b0ce3d177f4bad87d1b96f..ceac91fd7fd10dadb2c67c4b2ab292d9688a9995 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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
index 1c6595deaccd160d57c7fdb26b19d092a93a38b3..f3525220e96b430c62a80d307a0003c61b02fcef 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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_drm_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
index 5c735c7e1429f17dca0ab0db1acd11bd5b9ae134..d656475f27005a414da7e7778a048b3bc415fc49 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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
index 1400db0dda91426b636ba0560245f8b8958e563a..f011e8b8e19d0378e45a4bab6480844286eafa66 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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_wl_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
@@ -2004,7 +2003,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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
index 7f6e71f05418fe2c3eaee6586b6052b785dd2141..1788a13635f179446b1b7856d8dc6e58810b248f 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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    /* XXX: should really implement this since X11 has pixmaps */
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
index 2b1faf1a396c4953ff762d19a2d635b67fff4801..2cc2c093b2dc000369825ada742a11272eb3abf8 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,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri3_copy_buffers,
    .query_buffer_age = dri3_query_buffer_age,
    .query_surface = dri3_query_surface,