From: Eric Engestrom Date: Fri, 10 Jul 2020 22:41:35 +0000 (+0200) Subject: egl: inline fallback for create_wayland_buffer_from_image X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e3eb0c90b7c70a28a50e424648b00e300940b53;p=mesa.git egl: inline fallback for create_wayland_buffer_from_image 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 08c91984904..a88f422bfac 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2463,6 +2463,8 @@ dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + if (!dri2_dpy->vtbl->create_wayland_buffer_from_image) + return NULL; return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, disp, img); } diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index de21579cd46..c90f560bc78 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -148,6 +148,7 @@ struct dri2_egl_display_vtbl { _EGLSurface *surf, EGLint attribute, EGLint *value); + /* optional */ struct wl_buffer* (*create_wayland_buffer_from_image)( _EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img); diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h index 6609aa28df5..3033903d5e8 100644 --- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h +++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h @@ -28,16 +28,6 @@ #include "eglcurrent.h" #include "egltypedefs.h" -struct wl_buffer; - -static inline struct wl_buffer* -dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv, - _EGLDisplay *disp, - _EGLImage *img) -{ - return NULL; -} - static inline EGLBoolean dri2_fallback_get_sync_values(_EGLDisplay *disp, _EGLSurface *surf, EGLuint64KHR *ust, EGLuint64KHR *msc, diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index a8ba65b2e9e..1d86c6f5503 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -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, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .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, diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c index c1ed30cca8b..fdb5652e306 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, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, }; diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 0c695730d06..c1104667bd2 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -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, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, }; diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index c8ef1dc95a7..9d4cdb00b78 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, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, }; diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 285c0b78eb2..5e37e979b9c 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2002,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, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, }; diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index b9b28ec844f..81ce70de479 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -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, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_fallback_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, }; @@ -1201,7 +1200,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_display_vtbl = { .post_sub_buffer = dri2_x11_post_sub_buffer, .copy_buffers = dri2_x11_copy_buffers, .query_surface = dri2_query_surface, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri2_x11_get_sync_values, .get_dri_drawable = dri2_surface_get_dri_drawable, }; diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 2cc2c093b2d..f525771ee0d 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -502,7 +502,6 @@ struct dri2_egl_display_vtbl dri3_x11_display_vtbl = { .copy_buffers = dri3_copy_buffers, .query_buffer_age = dri3_query_buffer_age, .query_surface = dri3_query_surface, - .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image, .get_sync_values = dri3_get_sync_values, .get_dri_drawable = dri3_get_dri_drawable, .close_screen_notify = dri3_close_screen_notify,