  	EGL_RED_SIZE, 1,
  	EGL_GREEN_SIZE, 1,
  	EGL_BLUE_SIZE, 1,
-@@ -3030,17 +3030,7 @@ output_handle_destroy(struct wl_listener *listener, void *data)
+@@ -3376,17 +3376,7 @@ output_handle_destroy(struct wl_listener *listener, void *data)
  
  static int
  gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) {

 
 	static const EGLint pbuffer_attribs[] = {
 		EGL_WIDTH, 10,
@@ -3048,13 +3038,21 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) {
 		EGL_NONE
 	};
 
-	if (egl_choose_config(gr, pbuffer_config_attribs, NULL, 0, &pbuffer_config) < 0) {
-		weston_log("failed to choose EGL config for PbufferSurface");
+	if(!eglGetConfigAttrib(gr->egl_display, gr->egl_config, EGL_SURFACE_TYPE, &surface_type)) {
+		weston_log("failed to get surface type for PbufferSurface\n");
+		return -1;

 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index 2c50d2d..8e04da1 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -3263,7 +3263,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
 }
 
 static const EGLint gl_renderer_opaque_attribs[] = {
