From: Eric Engestrom Date: Fri, 10 Jul 2020 22:40:20 +0000 (+0200) Subject: egl: inline fallback for copy_buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90000b0264d05e0a84a5fcfd7a00835b12a9cc11;p=mesa.git egl: inline fallback for copy_buffers Signed-off-by: Eric Engestrom Reviewed-by: Frank Binns Reviewed-by: Emil Velikov Part-of: --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e4eb9f0cbc9..e118509819f 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2058,6 +2058,8 @@ dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, void *native_pixmap_target) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + if (!dri2_dpy->vtbl->copy_buffers) + return _eglError(EGL_BAD_NATIVE_PIXMAP, "no support for native pixmaps"); return dri2_dpy->vtbl->copy_buffers(drv, disp, surf, native_pixmap_target); } diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index d0e31138feb..485097fad22 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -136,6 +136,7 @@ struct dri2_egl_display_vtbl { EGLint x, EGLint y, EGLint width, EGLint height); + /* optional */ EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, void *native_pixmap_target); diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h index 21f5bcb2a56..0456a4b1ed7 100644 --- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h +++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h @@ -30,14 +30,6 @@ struct wl_buffer; -static inline EGLBoolean -dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, - _EGLSurface *surf, - void *native_pixmap_target) -{ - return _eglError(EGL_BAD_NATIVE_PIXMAP, "no support for native pixmaps"); -} - static inline EGLint dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 021c6546055..a8ba65b2e9e 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -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, - .copy_buffers = dri2_fallback_copy_buffers, .query_buffer_age = droid_query_buffer_age, .query_surface = droid_query_surface, .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c index ceac91fd7fd..01aac6a1ec8 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, - .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, .get_sync_values = dri2_fallback_get_sync_values, diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index f3525220e96..0c695730d06 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, - .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, .get_sync_values = dri2_fallback_get_sync_values, diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index d656475f270..cbcb3f5c152 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, - .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, .get_sync_values = dri2_fallback_get_sync_values, diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index f011e8b8e19..41d1b454506 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, - .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, .get_sync_values = dri2_fallback_get_sync_values, @@ -2003,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, - .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, .get_sync_values = dri2_fallback_get_sync_values, diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 1788a13635f..65cb4c51c98 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 */ - .copy_buffers = dri2_fallback_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,