From 43e2d80849c110ff7c9d1dc4390fdcb7907ae2b6 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sat, 11 Jul 2020 00:31:32 +0200 Subject: [PATCH] egl: inline fallback for create_pbuffer_surface Signed-off-by: Eric Engestrom Reviewed-by: Frank Binns Reviewed-by: Emil Velikov Part-of: --- src/egl/drivers/dri2/egl_dri2.c | 2 ++ src/egl/drivers/dri2/egl_dri2.h | 1 + src/egl/drivers/dri2/egl_dri2_fallbacks.h | 8 -------- src/egl/drivers/dri2/platform_drm.c | 1 - src/egl/drivers/dri2/platform_wayland.c | 2 -- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 659e00c8df9..147244f774b 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -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); } diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 56342e13295..d08af6fa7bf 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -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); diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h index 3c5f82d8140..44c130b9c14 100644 --- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h +++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h @@ -30,14 +30,6 @@ 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, diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 9e601e7d5b3..f1d02c8e041 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -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, diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index d5e16cf9308..e9b79f8fb18 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -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, -- 2.30.2