<div>ello 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=>EGL=>egl_gallium=>fbdev) over fbdev with following 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 --with-egl-platforms=fbdev --with-egl-displays=fbdev --with-driver=no --disable-glu --disable-glw --disable-glut --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 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->base.destroy = fbdev_display_destroy;</div><div> fbdpy->base.get_param = fbdev_display_get_param;</div><div> fbdpy->base.get_configs = fbdev_display_get_configs;</div>
<div><br></div><div> /*Adding function to create PIXMAP surface*/</div><div> fbdpy->base.is_pixmap_supported = fbdev_display_is_pixmap_supported;</div><div> fbdpy->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("START %s %s\n", __FUNCTION__, __FILE__);</div>
<div> fbdev_pixmap *pixmap = (fbdev_pixmap *)pix;</div><div> /*Trying To print pixmap detail*/</div><div><br></div><div> printf("pixmap->height ::%d\n", pixmap->height);</div><div> printf("pixmap->width ::%d\n", pixmap->width);</div>
<div> printf("pixmap->bytes_per_pixel ::%d\n", pixmap->bytes_per_pixel);</div><div> printf("pixmap->buffer_size ::%d\n", pixmap->buffer_size);</div><div> printf("pixmap->red_size ::%d\n", pixmap->red_size);</div>
<div> printf("pixmap->green_size ::%d\n", pixmap->green_size);</div><div> printf("pixmap->red_size ::%d\n", pixmap->blue_size);</div><div> printf("pixmap->alpha_size ::%d\n", pixmap->alpha_size);</div>
<div> printf("pixmap->luminance_size ::%d\n", pixmap->luminance_size);</div><div> printf("pixmap->flags ::%d\n", pixmap->flags);</div><div> printf("pixmap->data ::%p\n", pixmap->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->fbdpy = fbdpy;</div><div> fbsurf->width = pixmap->width;</div><div> fbsurf->height = pixmap->height;</div><div> fbsurf->type = FBDEV_SURFACE_TYPE_PIXMAP;</div><div> fbsurf->pixmap = pix;</div>
<div> fbsurf->rsurf = resource_surface_create(fbdpy->base.screen,</div><div> nconf->color_format,</div><div> PIPE_BIND_RENDER_TARGET |</div><div> PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT );</div>
<div><br></div><div> if (!fbsurf->rsurf) {</div><div> FREE(fbsurf);</div><div> return NULL;</div><div> }</div><div><br></div><div> resource_surface_set_size(fbsurf->rsurf, fbsurf->width, fbsurf->height);</div>
<div><br></div><div> fbsurf->base.destroy = fbdev_surface_destroy;</div><div> fbsurf->base.present = fbdev_surface_present;</div><div> fbsurf->base.validate = fbdev_surface_validate;</div><div> fbsurf->base.wait = fbdev_surface_wait;</div>
<div><br></div><div> printf("END %s %s\n", __FUNCTION__, __FILE__);</div><div> return &fbsurf->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->fd = fd;</div><div> fbdpy->event_handler = event_handler;</div><div> fbdpy->base.user_data = user_data;</div><div><br></div><div> if (!fbdev_display_init(&fbdpy->base)) {</div>
<div> FREE(fbdpy);</div><div> return NULL;</div><div> }</div><div><br></div><div> fbdpy->base.destroy = fbdev_display_destroy;</div><div> fbdpy->base.get_param = fbdev_display_get_param;</div><div> fbdpy->base.get_configs = fbdev_display_get_configs;</div>
<div><br></div><div> /*Vivek:: Adding function to create PIXMAP surface*/</div><div> fbdpy->base.is_pixmap_supported = fbdev_display_is_pixmap_supported;</div><div> fbdpy->base.create_pixmap_surface = fbdev_display_create_pixmap_surface;</div>
<div><br></div><div> fbdpy->base.modeset = &fbdev_display_modeset;</div><div><br></div><div> return &fbdpy->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("START %s %s\n", __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->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("%s %s\n", __FUNCTION__, __FILE__);</div><div> struct fbdev_surface *fbsurf = fbdev_surface(nsurf);</div>
<div><br></div><div> if (!fbsurf->is_current)</div><div> return TRUE;</div><div><br></div><div> if(fbsurf->type == FBDEV_SURFACE_TYPE_PIXMAP) //Vivek</div><div> {</div><div> </div><div> return resource_surface_present(fbsurf->rsurf, NATIVE_ATTACHMENT_FRONT_LEFT, fbsurf->pixmap);</div>
<div> }</div><div> else</div><div> {</div><div> return resource_surface_present(fbsurf->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>