  
  	static const EGLint pbuffer_attribs[] = {
  		EGL_WIDTH, 10,
-@@ -3048,13 +3038,21 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) {
+@@ -3394,13 +3384,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");
+-		weston_log("failed to choose EGL config for PbufferSurface\n");
 +	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;

From 43b66d46c10b3b2683f78fcf3278c0a6e10666bc Mon Sep 17 00:00:00 2001
From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
Date: Wed, 29 Aug 2018 13:20:00 -0700
Subject: [PATCH] gl-renderer.c: Use gr->egl_config to create pbuffer surface

The original implementation always chose first egl config for pbuffer

 	EGL_RED_SIZE, 1,
 	EGL_GREEN_SIZE, 1,
 	EGL_BLUE_SIZE, 1,
@@ -3273,7 +3273,7 @@ static const EGLint gl_renderer_opaque_attribs[] = {
 };
 
 static const EGLint gl_renderer_alpha_attribs[] = {
