egl: inline fallback for create_pbuffer_surface
authorEric Engestrom <eric@engestrom.ch>
Fri, 10 Jul 2020 22:31:32 +0000 (00:31 +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_drm.c
src/egl/drivers/dri2/platform_wayland.c

index 659e00c8df94fad4762c39773df99d01239cca39..147244f774bcd49f09e5b61be397364b06815893 100644 (file)
@@ -1906,6 +1906,8 @@ dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
                            _EGLConfig *conf, const EGLint *attrib_list)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   if (!dri2_dpy->vtbl->create_pbuffer_surface)
+      return NULL;
    return dri2_dpy->vtbl->create_pbuffer_surface(drv, disp, conf, attrib_list);
 }
 
index 56342e1329519538ba356887c9341ce1e0385743..d08af6fa7bf15a9469fd7b5366821dc1980801a4 100644 (file)
@@ -101,6 +101,7 @@ struct dri2_egl_display_vtbl {
                                          void *native_pixmap,
                                          const EGLint *attrib_list);
 
+   /* optional */
    _EGLSurface* (*create_pbuffer_surface)(_EGLDriver *drv, _EGLDisplay *disp,
                                           _EGLConfig *config,
                                           const EGLint *attrib_list);
index 3c5f82d8140e99128a7fac3ae4150705628a092d..44c130b9c142607a5b1dc6cbf96b19b9091c782d 100644 (file)
 
 struct wl_buffer;
 
-static inline _EGLSurface *
-dri2_fallback_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
-                                     _EGLConfig *conf,
-                                     const EGLint *attrib_list)
-{
-   return NULL;
-}
-
 static inline _EGLImage*
 dri2_fallback_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
                                _EGLContext *ctx, EGLenum target,
index 9e601e7d5b375addbea679b30afa826fde8e9c7a..f1d02c8e0416d6f1691d3a35bb2d4ae514de7cef 100644 (file)
@@ -675,7 +675,6 @@ static const struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
    .authenticate = dri2_drm_authenticate,
    .create_window_surface = dri2_drm_create_window_surface,
    .create_pixmap_surface = dri2_drm_create_pixmap_surface,
-   .create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
    .destroy_surface = dri2_drm_destroy_surface,
    .create_image = dri2_drm_create_image_khr,
    .swap_buffers = dri2_drm_swap_buffers,
index d5e16cf930820f38e33489f9dad8cfb12e061336..e9b79f8fb185359ec193b93edde5ff6af738ad56 100644 (file)
@@ -1383,7 +1383,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
    .authenticate = dri2_wl_authenticate,
    .create_window_surface = dri2_wl_create_window_surface,
    .create_pixmap_surface = dri2_wl_create_pixmap_surface,
-   .create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
    .destroy_surface = dri2_wl_destroy_surface,
    .create_image = dri2_create_image_khr,
    .swap_buffers = dri2_wl_swap_buffers,
@@ -2003,7 +2002,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_swrast_display_vtbl = {
    .authenticate = NULL,
    .create_window_surface = dri2_wl_create_window_surface,
    .create_pixmap_surface = dri2_wl_create_pixmap_surface,
-   .create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
    .destroy_surface = dri2_wl_destroy_surface,
    .create_image = dri2_create_image_khr,
    .swap_buffers = dri2_wl_swrast_swap_buffers,