egl: inline fallback for copy_buffers
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:40:20 +0000 (00:40 +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

index e4eb9f0cbc98536aaecafd241d5292ba3be83252..e118509819f91d600d07665280617900868512d4 100644 (file)
@@ -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);
 }
 
index d0e31138feb2c79a7118e838fc1dd9ff19fbe4b7..485097fad22bf2cd5836aeac36b3b767672e25ab 100644 (file)
@@ -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);
 
index 21f5bcb2a5605b5d9fffb1fbafb7add918cd9695..0456a4b1ed7e41c3c163d3a5af0dae746ef0d3a6 100644 (file)
 
 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)
index 021c6546055fb8bf9ac50702f14ccb2ce9892321..a8ba65b2e9e2dacac8968061fce6a3a0f1933eff 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,
-   .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,
index ceac91fd7fd10dadb2c67c4b2ab292d9688a9995..01aac6a1ec83d9e29dc9abd2c6736b0f6f7e40d8 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,
-   .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,
index f3525220e96b430c62a80d307a0003c61b02fcef..0c695730d068c8a35b103dfaa4cdc8218486bd6e 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,
-   .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,
index d656475f27005a414da7e7778a048b3bc415fc49..cbcb3f5c152e3ac98d1cc4efd001b6c2c7390977 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,
-   .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,
index f011e8b8e19d0378e45a4bab6480844286eafa66..41d1b454506b74b9e6cc1c572bf8821bdbea4dbe 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,
-   .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,
index 1788a13635f179446b1b7856d8dc6e58810b248f..65cb4c51c989a5531da6c121351ca8e71e9b4e4f 100644 (file)
@@ -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,