[Mesa-dev] Welcome to the "mesa-dev" mailing list (Digest mode)

Vivek Singh vivek.siwan at gmail.com
Sat Sep 24 10:43:52 PDT 2011


Hello All

  I am using Mesa-7.10.2 stack.

I am trying to run EGL with egl_gallium state trackers
(GLES=>EGL=>egl_gallium=>
fbdev) over fbdev with following

configuration


./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

I am able to run applications which can draw directly on scanout
surfaces/pbuffer (es2gears).

I want to run application which uses eglCreateImageKHR (with user defined
pixmap structures) to make textures
and eglCreatePixmapSurface (with user defined pixmap structures) to create a
Pixmap surfaces. Since Native_fbdev.c doesnot

support pixmap surfaces both calls fail.
      I tried to put pixmap support in native_fbdev.c with following steps
1)putting a function in
 fbdpy->base.destroy = fbdev_display_destroy;
 fbdpy->base.get_param = fbdev_display_get_param;
 fbdpy->base.get_configs = fbdev_display_get_configs;

 /*Adding function to create PIXMAP surface*/
 fbdpy->base.is_pixmap_supported = fbdev_display_is_pixmap_supported;
 fbdpy->base.create_pixmap_surface = fbdev_display_create_pixmap_surface;

2)Added support flag true in native_config
 pixmap_bit=true;

I am able to get finctions  eglCreateImageKHR/eglCreatePixmapSurface run
successfully able to get user defined pixmap
to native_fbdev by typecasting it ot EGLNativePixmaptype. But I am not able
to draw any texture on EGLImage. I suspect
glEGLImageTargetTexture2DOES is not working properly with EGLImage returned
from eglCreateImageKHR.

I dont know how I can make it visible to GLES by calling function like
glEGLImageTargetTexture2DOES.

I am very new to GLES and EGL . Please provide me suggestions so that I can
proceed further.

For convenient i am putting my code which I have inserted to native_fbdev.c

static struct native_surface *
fbdev_display_create_pixmap_surface(struct native_display *ndpy,
                                    EGLNativePixmapType pix,
                                    const struct native_config *nconf)
{
  printf("START %s    %s\n", __FUNCTION__, __FILE__);
  fbdev_pixmap  *pixmap = (fbdev_pixmap *)pix;
  /*Trying To print pixmap detail*/

  printf("pixmap->height                 ::%d\n", pixmap->height);
  printf("pixmap->width                  ::%d\n",  pixmap->width);
  printf("pixmap->bytes_per_pixel        ::%d\n", pixmap->bytes_per_pixel);
  printf("pixmap->buffer_size            ::%d\n",  pixmap->buffer_size);
  printf("pixmap->red_size               ::%d\n", pixmap->red_size);
  printf("pixmap->green_size             ::%d\n",  pixmap->green_size);
  printf("pixmap->red_size               ::%d\n", pixmap->blue_size);
  printf("pixmap->alpha_size             ::%d\n",  pixmap->alpha_size);
  printf("pixmap->luminance_size         ::%d\n", pixmap->luminance_size);
  printf("pixmap->flags                  ::%d\n",  pixmap->flags);
  printf("pixmap->data              ::%p\n",   pixmap->data);

  struct fbdev_display *fbdpy = fbdev_display(ndpy);
  struct fbdev_surface *fbsurf;
  fbsurf = CALLOC_STRUCT(fbdev_surface);
  if (!fbsurf)
     return NULL;
  fbsurf->fbdpy = fbdpy;
  fbsurf->width = pixmap->width;
  fbsurf->height =  pixmap->height;
  fbsurf->type = FBDEV_SURFACE_TYPE_PIXMAP;
  fbsurf->pixmap = pix;
  fbsurf->rsurf = resource_surface_create(fbdpy->base.screen,
        nconf->color_format,
        PIPE_BIND_RENDER_TARGET |
        PIPE_BIND_DISPLAY_TARGET |  PIPE_BIND_SCANOUT );

  if (!fbsurf->rsurf) {
     FREE(fbsurf);
     return NULL;
  }

  resource_surface_set_size(fbsurf->rsurf, fbsurf->width, fbsurf->height);

  fbsurf->base.destroy = fbdev_surface_destroy;
  fbsurf->base.present = fbdev_surface_present;
  fbsurf->base.validate = fbdev_surface_validate;
  fbsurf->base.wait = fbdev_surface_wait;

  printf("END %s    %s\n", __FUNCTION__, __FILE__);
  return &fbsurf->base;

}

static struct native_display *
fbdev_display_create(int fd, struct native_event_handler *event_handler,
                    void *user_data)
{
  struct fbdev_display *fbdpy;

  fbdpy = CALLOC_STRUCT(fbdev_display);
  if (!fbdpy)
     return NULL;

  fbdpy->fd = fd;
  fbdpy->event_handler = event_handler;
  fbdpy->base.user_data = user_data;

  if (!fbdev_display_init(&fbdpy->base)) {
     FREE(fbdpy);
     return NULL;
  }

  fbdpy->base.destroy = fbdev_display_destroy;
  fbdpy->base.get_param = fbdev_display_get_param;
  fbdpy->base.get_configs = fbdev_display_get_configs;

  /*Vivek:: Adding function to create PIXMAP surface*/
   fbdpy->base.is_pixmap_supported = fbdev_display_is_pixmap_supported;
   fbdpy->base.create_pixmap_surface = fbdev_display_create_pixmap_surface;

   fbdpy->base.modeset = &fbdev_display_modeset;

  return &fbdpy->base;
}

static boolean
fbdev_display_is_pixmap_supported(struct native_display *ndpy,
                                  EGLNativePixmapType pix,
                                  const struct native_config *nconf)
{
  printf("START   %s     %s\n", __FUNCTION__, __FILE__);
  struct fbdev_display *fdpy = fbdev_display(ndpy);
  enum pipe_format fmt;
  uint depth;
  depth =  32; //hard coded for 4bpp
  switch (depth) {
  case 32:
     fmt = PIPE_FORMAT_B8G8R8A8_UNORM;
     break;
  case 24:
     fmt = PIPE_FORMAT_B8G8R8X8_UNORM;
     break;
  case 16:
     fmt = PIPE_FORMAT_B5G6R5_UNORM;
     break;
  default:
     fmt = PIPE_FORMAT_NONE;
     break;
  }

  return (fmt == nconf->color_format);
}

static boolean
fbdev_surface_flush_frontbuffer(struct native_surface *nsurf)
{
 printf("%s    %s\n", __FUNCTION__, __FILE__);
 struct fbdev_surface *fbsurf = fbdev_surface(nsurf);

  if (!fbsurf->is_current)
     return TRUE;

  if(fbsurf->type == FBDEV_SURFACE_TYPE_PIXMAP)   //Vivek
       {

          return resource_surface_present(fbsurf->rsurf,
NATIVE_ATTACHMENT_FRONT_LEFT, fbsurf->pixmap);
       }
  else
       {
          return resource_surface_present(fbsurf->rsurf,
NATIVE_ATTACHMENT_FRONT_LEFT, NULL);
       }

}


Regards
Vivek

On Sat, Sep 24, 2011 at 11:08 PM, <mesa-dev-request at lists.freedesktop.org>wrote:

> Welcome to the mesa-dev at lists.freedesktop.org mailing list!
>
> To post to this list, send your email to:
>
>  mesa-dev at lists.freedesktop.org
>
> General information about the mailing list is at:
>
>  http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> If you ever want to unsubscribe or change your options (eg, switch to
> or from digest mode, change your password, etc.), visit your
> subscription page at:
>
>
> http://lists.freedesktop.org/mailman/options/mesa-dev/vivek.siwan%40gmail.com
>
>
> You can also make such adjustments via email by sending a message to:
>
>  mesa-dev-request at lists.freedesktop.org
>
> with the word `help' in the subject or body (don't include the
> quotes), and you will get back a message with instructions.
>
> You must know your password to change your options (including changing
> the password, itself) or to unsubscribe.  It is:
>
>  himmatwala
>
> Normally, Mailman will remind you of your lists.freedesktop.org
> mailing list passwords once every month, although you can disable this
> if you prefer.  This reminder will also include instructions on how to
> unsubscribe or change your account options.  There is also a button on
> your options page that will email your current password to you.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110924/e3646c39/attachment-0001.html>


More information about the mesa-dev mailing list