<br>Hello All<br>
<br>
I am using Mesa-7.10.2 stack.<br>
<br>
I am trying to run EGL with egl_gallium state trackers<br>
(GLES=>EGL=>egl_gallium=><div id=":1gu">fbdev) over fbdev with following<br>
<br>
configuration<br>
<br>
<br>
./configure --prefix=/opt/mesa-arm-genoa-new --host=arm-linux<br>
--build=i686-linux --enable-gles2 --with-x=no<br>
<br>
--with-egl-platforms=fbdev --with-egl-displays=fbdev --with-driver=no<br>
--disable-glu --disable-glw --disable-glut<br>
<br>
--disable-gl-osmesa --disable-opengl --enable-debug --enable-gles-overlay<br>
<br>
I am able to run applications which can draw directly on scanout<br>
surfaces/pbuffer (es2gears).<br>
<br>
I want to run application which uses eglCreateImageKHR (with user defined<br>
pixmap structures) to make textures<br>
and eglCreatePixmapSurface (with user defined pixmap structures) to create a<br>
Pixmap surfaces. Since Native_fbdev.c doesnot<br>
<br>
support pixmap surfaces both calls fail.<br>
I tried to put pixmap support in native_fbdev.c with following steps<br>
1)putting a function in<br>
fbdpy->base.destroy = fbdev_display_destroy;<br>
fbdpy->base.get_param = fbdev_display_get_param;<br>
fbdpy->base.get_configs = fbdev_display_get_configs;<br>
<br>
/*Adding function to create PIXMAP surface*/<br>
fbdpy->base.is_pixmap_supported = fbdev_display_is_pixmap_supported;<br>
fbdpy->base.create_pixmap_surface = fbdev_display_create_pixmap_surface;<br>
<br>
2)Added support flag true in native_config<br>
pixmap_bit=true;<br>
<br>
I am able to get finctions eglCreateImageKHR/eglCreatePixmapSurface run<br>
successfully able to get user defined pixmap<br>
to native_fbdev by typecasting it ot EGLNativePixmaptype. But I am not able<br>
to draw any texture on EGLImage. I suspect<br>
glEGLImageTargetTexture2DOES is not working properly with EGLImage returned<br>
from eglCreateImageKHR.<br>
<br>
I dont know how I can make it visible to GLES by calling function like<br>
glEGLImageTargetTexture2DOES.<br>
<br>
I am very new to GLES and EGL . Please provide me suggestions so that I can<br>
proceed further.<br>
<br>
For convenient i am putting my code which I have inserted to native_fbdev.c<br>
<br>
static struct native_surface *<br>
fbdev_display_create_pixmap_surface(struct native_display *ndpy,<br>
EGLNativePixmapType pix,<br>
const struct native_config *nconf)<br>
{<br>
printf("START %s %s\n", __FUNCTION__, __FILE__);<br>
fbdev_pixmap *pixmap = (fbdev_pixmap *)pix;<br>
/*Trying To print pixmap detail*/<br>
<br>
printf("pixmap->height ::%d\n", pixmap->height);<br>
printf("pixmap->width ::%d\n", pixmap->width);<br>
printf("pixmap->bytes_per_pixel ::%d\n", pixmap->bytes_per_pixel);<br>
printf("pixmap->buffer_size ::%d\n", pixmap->buffer_size);<br>
printf("pixmap->red_size ::%d\n", pixmap->red_size);<br>
printf("pixmap->green_size ::%d\n", pixmap->green_size);<br>
printf("pixmap->red_size ::%d\n", pixmap->blue_size);<br>
printf("pixmap->alpha_size ::%d\n", pixmap->alpha_size);<br>
printf("pixmap->luminance_size ::%d\n", pixmap->luminance_size);<br>
printf("pixmap->flags ::%d\n", pixmap->flags);<br>
printf("pixmap->data ::%p\n", pixmap->data);<br>
<br>
struct fbdev_display *fbdpy = fbdev_display(ndpy);<br>
struct fbdev_surface *fbsurf;<br>
fbsurf = CALLOC_STRUCT(fbdev_surface);<br>
if (!fbsurf)<br>
return NULL;<br>
fbsurf->fbdpy = fbdpy;<br>
fbsurf->width = pixmap->width;<br>
fbsurf->height = pixmap->height;<br>
fbsurf->type = FBDEV_SURFACE_TYPE_PIXMAP;<br>
fbsurf->pixmap = pix;<br>
fbsurf->rsurf = resource_surface_create(fbdpy->base.screen,<br>
nconf->color_format,<br>
PIPE_BIND_RENDER_TARGET |<br>
PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT );<br>
<br>
if (!fbsurf->rsurf) {<br>
FREE(fbsurf);<br>
return NULL;<br>
}<br>
<br>
resource_surface_set_size(fbsurf->rsurf, fbsurf->width, fbsurf->height);<br>
<br>
fbsurf->base.destroy = fbdev_surface_destroy;<br>
fbsurf->base.present = fbdev_surface_present;<br>
fbsurf->base.validate = fbdev_surface_validate;<br>
fbsurf->base.wait = fbdev_surface_wait;<br>
<br>
printf("END %s %s\n", __FUNCTION__, __FILE__);<br>
return &fbsurf->base;<br>
<br>
}<br>
<br>
static struct native_display *<br>
fbdev_display_create(int fd, struct native_event_handler *event_handler,<br>
void *user_data)<br>
{<br>
struct fbdev_display *fbdpy;<br>
<br>
fbdpy = CALLOC_STRUCT(fbdev_display);<br>
if (!fbdpy)<br>
return NULL;<br>
<br>
fbdpy->fd = fd;<br>
fbdpy->event_handler = event_handler;<br>
fbdpy->base.user_data = user_data;<br>
<br>
if (!fbdev_display_init(&fbdpy->base)) {<br>
FREE(fbdpy);<br>
return NULL;<br>
}<br>
<br>
fbdpy->base.destroy = fbdev_display_destroy;<br>
fbdpy->base.get_param = fbdev_display_get_param;<br>
fbdpy->base.get_configs = fbdev_display_get_configs;<br>
<br>
/*Vivek:: Adding function to create PIXMAP surface*/<br>
fbdpy->base.is_pixmap_supported = fbdev_display_is_pixmap_supported;<br>
fbdpy->base.create_pixmap_surface = fbdev_display_create_pixmap_surface;<br>
<br>
fbdpy->base.modeset = &fbdev_display_modeset;<br>
<br>
return &fbdpy->base;<br>
}<br>
<br>
static boolean<br>
fbdev_display_is_pixmap_supported(struct native_display *ndpy,<br>
EGLNativePixmapType pix,<br>
const struct native_config *nconf)<br>
{<br>
printf("START %s %s\n", __FUNCTION__, __FILE__);<br>
struct fbdev_display *fdpy = fbdev_display(ndpy);<br>
enum pipe_format fmt;<br>
uint depth;<br>
depth = 32; //hard coded for 4bpp<br>
switch (depth) {<br>
case 32:<br>
fmt = PIPE_FORMAT_B8G8R8A8_UNORM;<br>
break;<br>
case 24:<br>
fmt = PIPE_FORMAT_B8G8R8X8_UNORM;<br>
break;<br>
case 16:<br>
fmt = PIPE_FORMAT_B5G6R5_UNORM;<br>
break;<br>
default:<br>
fmt = PIPE_FORMAT_NONE;<br>
break;<br>
}<br>
<br>
return (fmt == nconf->color_format);<br>
}<br>
<br>
static boolean<br>
fbdev_surface_flush_frontbuffer(struct native_surface *nsurf)<br>
{<br>
printf("%s %s\n", __FUNCTION__, __FILE__);<br>
struct fbdev_surface *fbsurf = fbdev_surface(nsurf);<br>
<br>
if (!fbsurf->is_current)<br>
return TRUE;<br>
<br>
if(fbsurf->type == FBDEV_SURFACE_TYPE_PIXMAP) //Vivek<br>
{<br>
<br>
return resource_surface_present(fbsurf->rsurf,<br>
NATIVE_ATTACHMENT_FRONT_LEFT, fbsurf->pixmap);<br>
}<br>
else<br>
{<br>
return resource_surface_present(fbsurf->rsurf,<br>
NATIVE_ATTACHMENT_FRONT_LEFT, NULL);<br>
}<br>
<br>
}<br>
<br>
<br>
Regards<br>
Vivek</div><br><div class="gmail_quote">On Sat, Sep 24, 2011 at 11:08 PM, <span dir="ltr"><<a href="mailto:mesa-dev-request@lists.freedesktop.org">mesa-dev-request@lists.freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Welcome to the <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a> mailing list!<br>
<br>
To post to this list, send your email to:<br>
<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<br>
General information about the mailing list is at:<br>
<br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
<br>
If you ever want to unsubscribe or change your options (eg, switch to<br>
or from digest mode, change your password, etc.), visit your<br>
subscription page at:<br>
<br>
<a href="http://lists.freedesktop.org/mailman/options/mesa-dev/vivek.siwan%40gmail.com" target="_blank">http://lists.freedesktop.org/mailman/options/mesa-dev/vivek.siwan%40gmail.com</a><br>
<br>
<br>
You can also make such adjustments via email by sending a message to:<br>
<br>
<a href="mailto:mesa-dev-request@lists.freedesktop.org">mesa-dev-request@lists.freedesktop.org</a><br>
<br>
with the word `help' in the subject or body (don't include the<br>
quotes), and you will get back a message with instructions.<br>
<br>
You must know your password to change your options (including changing<br>
the password, itself) or to unsubscribe. It is:<br>
<br>
himmatwala<br>
<br>
Normally, Mailman will remind you of your <a href="http://lists.freedesktop.org" target="_blank">lists.freedesktop.org</a><br>
mailing list passwords once every month, although you can disable this<br>
if you prefer. This reminder will also include instructions on how to<br>
unsubscribe or change your account options. There is also a button on<br>
your options page that will email your current password to you.<br>
</blockquote></div><br>