egl: inline fallback for create_pixmap_surface
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:29:17 +0000 (00:29 +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_surfaceless.c

index 5baa0c9b647e42a7c3691419350f7da417750231..659e00c8df94fad4762c39773df99d01239cca39 100644 (file)
@@ -1895,6 +1895,8 @@ dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
                            const EGLint *attrib_list)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   if (!dri2_dpy->vtbl->create_pixmap_surface)
+      return NULL;
    return dri2_dpy->vtbl->create_pixmap_surface(drv, disp, conf, native_pixmap,
                                                 attrib_list);
 }
index 38fa7c6a47421521be49214a14a6b19f3923e88e..56342e1329519538ba356887c9341ce1e0385743 100644 (file)
@@ -95,6 +95,7 @@ struct dri2_egl_display_vtbl {
                                          void *native_window,
                                          const EGLint *attrib_list);
 
+   /* optional */
    _EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *disp,
                                          _EGLConfig *config,
                                          void *native_pixmap,
index d975b7a8b1304c1da0e8e6ec578e36617a91bbc7..3c5f82d8140e99128a7fac3ae4150705628a092d 100644 (file)
 
 struct wl_buffer;
 
-static inline _EGLSurface *
-dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
-                                    _EGLConfig *conf,
-                                    void *native_pixmap,
-                                    const EGLint *attrib_list)
-{
-   return NULL;
-}
-
 static inline _EGLSurface *
 dri2_fallback_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
                                      _EGLConfig *conf,
index b72ee0479448425f35b770503699e6264bf446ec..1d9aebc95b6d6699f09f4ca1159e217347de1d80 100644 (file)
@@ -1262,7 +1262,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
 static const struct dri2_egl_display_vtbl droid_display_vtbl = {
    .authenticate = NULL,
    .create_window_surface = droid_create_window_surface,
-   .create_pixmap_surface = dri2_fallback_create_pixmap_surface,
    .create_pbuffer_surface = droid_create_pbuffer_surface,
    .destroy_surface = droid_destroy_surface,
    .create_image = droid_create_image_khr,
index 7380a6d75c431947b186cbafccefdff7df53036a..80035afdc5f5f34f086cafd9bfc3a876c35582c7 100644 (file)
@@ -183,7 +183,6 @@ dri2_device_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
 }
 
 static const struct dri2_egl_display_vtbl dri2_device_display_vtbl = {
-   .create_pixmap_surface = dri2_fallback_create_pixmap_surface,
    .create_pbuffer_surface = dri2_device_create_pbuffer_surface,
    .destroy_surface = device_destroy_surface,
    .create_image = dri2_create_image_khr,
index 8d37e8e9f4f4d9ca6342ec0df0195c4415bd1dd8..2a01c045575b5ee75cc01fc53370b63b006fe227 100644 (file)
@@ -177,7 +177,6 @@ dri2_surfaceless_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
 }
 
 static const struct dri2_egl_display_vtbl dri2_surfaceless_display_vtbl = {
-   .create_pixmap_surface = dri2_fallback_create_pixmap_surface,
    .create_pbuffer_surface = dri2_surfaceless_create_pbuffer_surface,
    .destroy_surface = surfaceless_destroy_surface,
    .create_image = dri2_create_image_khr,