-From 43b66d46c10b3b2683f78fcf3278c0a6e10666bc Mon Sep 17 00:00:00 2001
+From d998dccafaf004a5c0d2c4265e74728e8fefd882 Mon Sep 17 00:00:00 2001
 From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
-Date: Wed, 29 Aug 2018 13:20:00 -0700
+Date: Mon, 4 Mar 2019 10:58:03 -0800
 Subject: [PATCH] gl-renderer.c: Use gr->egl_config to create pbuffer surface
 
 The original implementation always chose first egl config for pbuffer

 
 	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;

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