<div><br></div><div>Hello All</div><div>   </div><div>   I am using Mesa-7.10.2 stack. </div><div><br></div><div>I am trying to run EGL with egl_gallium state trackers (GLES=&gt;EGL=&gt;egl_gallium=&gt;fbdev) over fbdev with following </div>
<div><br></div><div>configuration</div><div><br></div><div><br></div><div>./configure --prefix=/opt/mesa-arm-genoa-new --host=arm-linux --build=i686-linux --enable-gles2 --with-x=no </div><div><br></div><div>--with-egl-platforms=fbdev  --with-egl-displays=fbdev --with-driver=no   --disable-glu --disable-glw --disable-glut </div>
<div><br></div><div>--disable-gl-osmesa --disable-opengl --enable-debug --enable-gles-overlay</div><div><br></div><div>I am able to run applications which can draw directly on scanout surfaces/pbuffer (es2gears).</div><div>
<br></div><div>I want to run application which uses eglCreateImageKHR (with user defined pixmap structures) to make textures</div><div>and eglCreatePixmapSurface (with user defined pixmap structures) to create a Pixmap surfaces. Since Native_fbdev.c doesnot </div>
<div><br></div><div>support pixmap surfaces both calls fail.</div><div>       I tried to put pixmap support in native_fbdev.c with following steps</div><div>1)putting a function in  </div><div> fbdpy-&gt;base.destroy = fbdev_display_destroy;</div>
<div> fbdpy-&gt;base.get_param = fbdev_display_get_param;</div><div> fbdpy-&gt;base.get_configs = fbdev_display_get_configs;</div><div><br></div><div> /*Adding function to create PIXMAP surface*/</div><div> fbdpy-&gt;base.is_pixmap_supported = fbdev_display_is_pixmap_supported;</div>
<div> fbdpy-&gt;base.create_pixmap_surface = fbdev_display_create_pixmap_surface;</div><div><br></div><div>2)Added support flag true in native_config</div><div>  pixmap_bit=true;</div><div><br></div><div>I am able to get finctions  eglCreateImageKHR/eglCreatePixmapSurface run successfully able to get user defined pixmap </div>
<div>to native_fbdev by typecasting it ot EGLNativePixmaptype. But I am not able to draw any texture on EGLImage. I suspect     </div><div>glEGLImageTargetTexture2DOES is not working properly with EGLImage returned from eglCreateImageKHR.</div>
<div><br></div><div>I dont know how I can make it visible to GLES by calling function like glEGLImageTargetTexture2DOES.</div><div><br></div><div>I am very new to GLES and EGL . Please provide me suggestions so that I can proceed further.</div>
<div><br></div><div>For convenient i am putting my code which I have inserted to native_fbdev.c</div><div><br></div><div>static struct native_surface *</div><div>fbdev_display_create_pixmap_surface(struct native_display *ndpy,</div>
<div>                                     EGLNativePixmapType pix,</div><div>                                     const struct native_config *nconf)</div><div>{</div><div>   printf(&quot;START %s    %s\n&quot;, __FUNCTION__, __FILE__);</div>
<div>   fbdev_pixmap  *pixmap = (fbdev_pixmap *)pix;</div><div>   /*Trying To print pixmap detail*/</div><div><br></div><div>   printf(&quot;pixmap-&gt;height                 ::%d\n&quot;, pixmap-&gt;height);</div><div>   printf(&quot;pixmap-&gt;width                  ::%d\n&quot;,  pixmap-&gt;width);</div>
<div>   printf(&quot;pixmap-&gt;bytes_per_pixel        ::%d\n&quot;, pixmap-&gt;bytes_per_pixel);</div><div>   printf(&quot;pixmap-&gt;buffer_size            ::%d\n&quot;,  pixmap-&gt;buffer_size);</div><div>   printf(&quot;pixmap-&gt;red_size               ::%d\n&quot;, pixmap-&gt;red_size);</div>
<div>   printf(&quot;pixmap-&gt;green_size             ::%d\n&quot;,  pixmap-&gt;green_size);</div><div>   printf(&quot;pixmap-&gt;red_size               ::%d\n&quot;, pixmap-&gt;blue_size);</div><div>   printf(&quot;pixmap-&gt;alpha_size             ::%d\n&quot;,  pixmap-&gt;alpha_size);</div>
<div>   printf(&quot;pixmap-&gt;luminance_size         ::%d\n&quot;, pixmap-&gt;luminance_size);</div><div>   printf(&quot;pixmap-&gt;flags                  ::%d\n&quot;,  pixmap-&gt;flags);</div><div>   printf(&quot;pixmap-&gt;data              ::%p\n&quot;,   pixmap-&gt;data);</div>
<div><br></div><div>   struct fbdev_display *fbdpy = fbdev_display(ndpy);</div><div>   struct fbdev_surface *fbsurf;</div><div>   fbsurf = CALLOC_STRUCT(fbdev_surface);</div><div>   if (!fbsurf)</div><div>      return NULL;</div>
<div>   fbsurf-&gt;fbdpy = fbdpy;</div><div>   fbsurf-&gt;width = pixmap-&gt;width;</div><div>   fbsurf-&gt;height =  pixmap-&gt;height;</div><div>   fbsurf-&gt;type = FBDEV_SURFACE_TYPE_PIXMAP;</div><div>   fbsurf-&gt;pixmap = pix;</div>
<div>   fbsurf-&gt;rsurf = resource_surface_create(fbdpy-&gt;base.screen,</div><div>         nconf-&gt;color_format,</div><div>         PIPE_BIND_RENDER_TARGET |</div><div>         PIPE_BIND_DISPLAY_TARGET |  PIPE_BIND_SCANOUT );</div>
<div><br></div><div>   if (!fbsurf-&gt;rsurf) {</div><div>      FREE(fbsurf);</div><div>      return NULL;</div><div>   }</div><div><br></div><div>   resource_surface_set_size(fbsurf-&gt;rsurf, fbsurf-&gt;width, fbsurf-&gt;height);</div>
<div><br></div><div>   fbsurf-&gt;base.destroy = fbdev_surface_destroy;</div><div>   fbsurf-&gt;base.present = fbdev_surface_present;</div><div>   fbsurf-&gt;base.validate = fbdev_surface_validate;</div><div>   fbsurf-&gt;base.wait = fbdev_surface_wait;</div>
<div><br></div><div>   printf(&quot;END %s    %s\n&quot;, __FUNCTION__, __FILE__);</div><div>   return &amp;fbsurf-&gt;base;</div><div><br></div><div>}</div><div><br></div><div>static struct native_display *</div><div>fbdev_display_create(int fd, struct native_event_handler *event_handler,</div>
<div>                     void *user_data)</div><div>{</div><div>   struct fbdev_display *fbdpy;</div><div><br></div><div>   fbdpy = CALLOC_STRUCT(fbdev_display);</div><div>   if (!fbdpy)</div><div>      return NULL;</div>
<div><br></div><div>   fbdpy-&gt;fd = fd;</div><div>   fbdpy-&gt;event_handler = event_handler;</div><div>   fbdpy-&gt;base.user_data = user_data;</div><div><br></div><div>   if (!fbdev_display_init(&amp;fbdpy-&gt;base)) {</div>
<div>      FREE(fbdpy);</div><div>      return NULL;</div><div>   }</div><div><br></div><div>   fbdpy-&gt;base.destroy = fbdev_display_destroy;</div><div>   fbdpy-&gt;base.get_param = fbdev_display_get_param;</div><div>   fbdpy-&gt;base.get_configs = fbdev_display_get_configs;</div>
<div><br></div><div>   /*Vivek:: Adding function to create PIXMAP surface*/</div><div>    fbdpy-&gt;base.is_pixmap_supported = fbdev_display_is_pixmap_supported;</div><div>    fbdpy-&gt;base.create_pixmap_surface = fbdev_display_create_pixmap_surface;</div>
<div><br></div><div>    fbdpy-&gt;base.modeset = &amp;fbdev_display_modeset;</div><div><br></div><div>   return &amp;fbdpy-&gt;base;</div><div>}</div><div><br></div><div>static boolean</div><div>fbdev_display_is_pixmap_supported(struct native_display *ndpy,</div>
<div>                                   EGLNativePixmapType pix,</div><div>                                   const struct native_config *nconf)</div><div>{</div><div>   printf(&quot;START   %s     %s\n&quot;, __FUNCTION__, __FILE__);</div>
<div>   struct fbdev_display *fdpy = fbdev_display(ndpy);</div><div>   enum pipe_format fmt;</div><div>   uint depth;</div><div>   depth =  32; //hard coded for 4bpp</div><div>   switch (depth) {</div><div>   case 32:</div>
<div>      fmt = PIPE_FORMAT_B8G8R8A8_UNORM;</div><div>      break;</div><div>   case 24:</div><div>      fmt = PIPE_FORMAT_B8G8R8X8_UNORM;</div><div>      break;</div><div>   case 16:</div><div>      fmt = PIPE_FORMAT_B5G6R5_UNORM;</div>
<div>      break;</div><div>   default:</div><div>      fmt = PIPE_FORMAT_NONE;</div><div>      break;</div><div>   }</div><div><br></div><div>   return (fmt == nconf-&gt;color_format);</div><div>}</div><div><br></div><div>
static boolean</div><div>fbdev_surface_flush_frontbuffer(struct native_surface *nsurf)</div><div>{</div><div>  printf(&quot;%s    %s\n&quot;, __FUNCTION__, __FILE__);</div><div>  struct fbdev_surface *fbsurf = fbdev_surface(nsurf);</div>
<div><br></div><div>   if (!fbsurf-&gt;is_current)</div><div>      return TRUE;</div><div><br></div><div>   if(fbsurf-&gt;type == FBDEV_SURFACE_TYPE_PIXMAP)   //Vivek</div><div>        {</div><div>           </div><div>           return resource_surface_present(fbsurf-&gt;rsurf, NATIVE_ATTACHMENT_FRONT_LEFT, fbsurf-&gt;pixmap);</div>
<div>        }</div><div>   else</div><div>        {</div><div>           return resource_surface_present(fbsurf-&gt;rsurf, NATIVE_ATTACHMENT_FRONT_LEFT, NULL);</div><div>        }</div><div><br></div><div>}</div><div><br>
</div><div><br></div><div>Regards</div><div>Vivek</div><div><br></div><div>   </div><div><br></div>