On Tue, Jul 30, 2013 at 2:06 AM, Thomas Senyk
<[email protected]>wrote:

> On Monday, 29 July, 2013 16:06:17 Rogerio Nunes wrote:
> > On Mon, Jul 29, 2013 at 3:54 PM, Eric Nelson
> >
> > <[email protected]> wrote:
> > > Hi Rogerio,
> > >
> > > On 07/29/2013 12:29 PM, Rogerio Nunes wrote:
> > >> My apologies, Eric.
> > >>
> > >> I misread your email the first time.
> > >>
> > >> I'm trying a clean build now with master-next, but I'm having
> dependency
> > >> issues.
> > >> As soon as I fix this I'll look into glimagesink.
> > >
> > > I had some dependency issues as well, and I had to revert
> > > Abhijit's wayland patch (78936c1994cb2db102bd200123be976a7c051b98)
> > > to get past them.
> > >
> > > For some reason, with that patch, I was seeing the wayland version
> > > of some libraries, so configure failed on gst-plugins-gl.
> >
> > That's exactly the same issue I'm having here... no fb* symbols in
> > libEGL, so configure fails to link...
>
> I wonder if the fb* symbols should actually vanish?
>
> In a wl enabled version I've tested before I had both, wl_* and fb*
> symbols.
>   .. and IMO this is the right way, because it enabled you to have opengl-
> based compositors and wayland-egl based clients with the same libraries.
>
>
> Also from a include/define perspective only if EGL_API_FB is set, it makes
> sense to set WL_EGL_PLATFORM.
> quote from eglvivante.h:
>
> ...
> #elif defined(LINUX) && defined(EGL_API_FB) && !defined(__APPLE__)
>
> #if defined(WL_EGL_PLATFORM)
> ...
>
>
> Does anyone know the reason why fb* symbols got removed from libEGL-wl.so?
>

Freescale probides framebuffer based backend implementation for weston,
which run
with libEGL-wl.so. So this does equate to libEGL-wl.so having fb* symbols.
I did check
that a few functions like `fbGetDisplayByIndex`  `fbGetDisplayGeometry'
`fbCreateWindow'
are supported over libEGL-wl.so

I used the attached sample code to test fb on the imx6qsaberlite.

arm-none-linux-gnueabi-g++ fb_test.c -o n900gles -lEGL-wl -lGAL-wl
-lgc_wayland_protocol -lwayland-client -lffi -lwayland-server

Note the above never ending list of libs to link to. That where it gets
messy. GAL-wl lib throws in
dependencies over to Wayland client and server library and I ended up
adding them.

Regards,
Abhijit

>
> Greet
> Thomas
>
> >
> > Thanks.
> >
> > > Regards,
> > >
> > >
> > > Eric
> >
> > _______________________________________________
> > meta-freescale mailing list
> > [email protected]
> > https://lists.yoctoproject.org/listinfo/meta-freescale
> _______________________________________________
> meta-freescale mailing list
> [email protected]
> https://lists.yoctoproject.org/listinfo/meta-freescale
>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>

#define LINUX
#define EGL_API_FB

#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <EGL/eglvivante.h>

int
main( int argc, char *argv[] )
{
        int fd;
        struct fb_fix_screeninfo finfo;
        struct fb_var_screeninfo vinfo;
        void *fb;
        int w, h;
        int i, j;
        int size;
        int ret;

        EGLNativeDisplayType eglNativeDisplay = fbGetDisplayByIndex(    0    );

        int Width = 0, Height = 0;

	     fbGetDisplayGeometry( eglNativeDisplay, &Width, &Height);	
        printf( "Width = %d \n Height = %d\n", Width, Height);

   	  fb = fbCreateWindow( eglNativeDisplay,  0,  0, Width ,  Height );


        w = Width;
        h = Height;

        printf( "w %d, h%d\n", w, h );
        
     printf("MMSFBDev: var screen info ------------\n");
     printf("    xres           = %d\n", vinfo.xres);
     printf("    yres           = %d\n", vinfo.yres);
     printf("    xres_virtual   = %d\n", vinfo.xres_virtual);
     printf("    yres_virtual   = %d\n", vinfo.yres_virtual);
     printf("    xoffset        = %d\n", vinfo.xoffset);
     printf("    yoffset        = %d\n", vinfo.yoffset);
     printf("    bits_per_pixel = %d\n", vinfo.bits_per_pixel);
     printf("    grayscale      = %d\n", vinfo.grayscale);
     printf("    red            = %d(offs=%d)\n", vinfo.red.length, vinfo.red.offset);
     printf("    green          = %d(offs=%d)\n", vinfo.green.length, vinfo.green.offset);
     printf("    blue           = %d(offs=%d)\n", vinfo.blue.length, vinfo.blue.offset);
     printf("    transp         = %d(offs=%d)\n", vinfo.transp.length, vinfo.transp.offset);
     printf("    nonstd         = %d\n", vinfo.nonstd);
     printf("    activate       = %d\n", vinfo.activate);
     printf("    height         = %d\n", vinfo.height);
     printf("    width          = %d\n", vinfo.width);
     printf("    accel_flags    = %d\n", vinfo.accel_flags);
 
     printf("    pixclock       = %d\n", vinfo.pixclock);
     printf("    left_margin    = %d\n", vinfo.left_margin);
     printf("    right_margin   = %d\n", vinfo.right_margin);
     printf("    upper_margin   = %d\n", vinfo.upper_margin);
     printf("    lower_margin   = %d\n", vinfo.lower_margin);
     printf("    hsync_len      = %d\n", vinfo.hsync_len);
     printf("    vsync_len      = %d\n", vinfo.vsync_len);
     printf("    sync           = %d\n", vinfo.sync);
     printf("    vmode          = %d\n", vinfo.vmode);
     printf("    rotate         = %d\n", vinfo.rotate);
     printf("    accel_flags    = %d\n", vinfo.accel_flags);
     printf("    reserved[5]    = %d, %d, %d, %d, %d\n", vinfo.reserved[0], vinfo.reserved[1], vinfo.reserved[2], vinfo.reserved[3], vinfo.reserved[4]);        
     printf("MMSFBDev: var screen info ------------\n");
     
     int VFL = vinfo.lower_margin + vinfo.upper_margin + vinfo.vsync_len + vinfo.yres;
     int HFL = vinfo.right_margin + vinfo.left_margin + vinfo.hsync_len + vinfo.xres;
     printf("    HFL            = %d\n", HFL);
     printf("    VFL            = %d\n", VFL);
     
     if ( HFL > 0 && VFL > 0 && vinfo.pixclock > 0 )
     {
         float refresh_rate = (1000000.0F * ( 1000000.0F / vinfo.pixclock )) / ( HFL * VFL ) ;
         printf("    Refresh Rate   = %f\n", refresh_rate);
     }
     else 
     {
         printf("    Refresh Rate   = unknown\n");
     }
        

        if ( argc == 2 ) {
#define BUF_SIZE        1280
                static unsigned int buf[BUF_SIZE];
                for ( i = 0; i < BUF_SIZE; i++ ) {
                        buf[i] = 0x0000FF00 | (i & 0xFF);
                }

                for ( i = 0; i < 390; i++ ) {
                        size += write( fd, buf, BUF_SIZE );
                        lseek( fd, (2048 - 1280), SEEK_CUR );
                        lseek( fd, 2, SEEK_CUR );       // for test
                }
                printf( "write size %d\n", size );

        } else if ( argc == 3 ) {
                unsigned int *vram;
                unsigned int *ip;

                size = 2048 * 390 * 4;

                // do not use shared
                // fb = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)
;

                fb = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
                printf( "get frame buffer -> 0x%08X\n", fb );
                if ( fb == (void * ) -1 ) {
                        printf( "fb mmap error %d (0x%X)\n", errno );
                        fflush( NULL );
                        goto err;
                }

                vram = (unsigned int *) fb;
                for ( i = 0; i < 390; i++ ) {
                        ip = vram;
                        for ( j = 0; j < 1280; j++ ) {
                                *ip = 0x00FF0000 | ((i & 0xFF) << 8) | (j & 0xFF
);
                                ip++;
                        }
                        vram += 2048;
                }

                ret = munmap( fb, 0 );
                if ( ret < 0 ) {
                        printf( "munmap failed %d\n", errno );
                }
        }

err:
        close( fd );

        return 0;
}
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to