diff options
author | Eric Engestrom <[email protected]> | 2020-07-11 00:38:38 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-16 22:11:25 +0000 |
commit | 1ba5075a7e4840003ee0f0e5863704676b697b8e (patch) | |
tree | f92b9b69a70bb3e802d371f0449590df30ec7385 /src | |
parent | 7d5a13ebf31edab412a06c075b847fc9f0137da1 (diff) |
egl: inline fallback for swap_buffers_region
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.c | 2 | ||||
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.h | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2_fallbacks.h | 8 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_android.c | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_device.c | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_drm.c | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_surfaceless.c | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 2 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 1 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_x11_dri3.c | 1 |
10 files changed, 3 insertions, 16 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 60e0db3c781..0acd33961b5 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -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 diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index f3bed345c63..dfaf25bce66 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -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); diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h index 7a268dd3843..46fddccfafe 100644 --- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h +++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h @@ -31,14 +31,6 @@ 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, EGLint x, EGLint y, EGLint width, EGLint height) diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 6ea7d8ffc83..02ba764f948 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -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, diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c index 80035afdc5f..301aaeeac1d 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, - .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, diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index ce0bd1b137f..1c6595deacc 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -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, diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index 2a01c045575..5c735c7e142 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, - .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, diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index cfb777fc9a7..1400db0dda9 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -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, diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 340a7b5522b..7f6e71f0541 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -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, diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 0275da31b44..2b1faf1a396 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -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, |