egl: inline fallback for create_wayland_buffer_from_image
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:41:35 +0000 (00:41 +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 08c91984904d1561ec4848da8028cc9220e11e44..a88f422bfacac9bbfef899498a384a911074b3e8 100644 (file)
@@ -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);
 }
 
index de21579cd46e51c6bb6e0132e0887b8a823e8fc6..c90f560bc7873963fba3e479f5d3a344ec2af01d 100644 (file)
@@ -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);
 
index 6609aa28df5b4f825e211f1cf73a9b982d6d1492..3033903d5e8b988679711bb62a1d483f2ef35454 100644 (file)
 #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,
index a8ba65b2e9e2dacac8968061fce6a3a0f1933eff..1d86c6f550346a8b5fc032d196b23c8dd8b499dd 100644 (file)
@@ -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,
index c1ed30cca8b505511560f3f14a5eb193a03b0de3..fdb5652e3068163f77f579cfce4d800bf9430889 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,
-   .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,
 };
index 0c695730d068c8a35b103dfaa4cdc8218486bd6e..c1104667bd2a3a2f201e292c0ac507f00cbe2e48 100644 (file)
@@ -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,
 };
index c8ef1dc95a71049c75de67b53d27a8399604891d..9d4cdb00b78a9f929426899079503e4fa0ad7855 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,
-   .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,
 };
index 285c0b78eb2c07b556aad25157d862d4ae63fa34..5e37e979b9c66fb80a288c4abf0b23bc73f6fa66 100644 (file)
@@ -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,
 };
index b9b28ec844fe3855e4182ba9d1c5eaeff7194028..81ce70de4791f0cee145f03b2b52690cc1a0c170 100644 (file)
@@ -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,
 };
index 2cc2c093b2dc000369825ada742a11272eb3abf8..f525771ee0d3851e44d1283495c5014a6f0f81d0 100644 (file)
@@ -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,