[Mesa-users] Give A directFB surface to EGL

Albert Freeman albertwdfreeman at gmail.com
Thu Oct 22 14:24:32 PDT 2015


On 22 October 2015 at 15:35, Albert Freeman <albertwdfreeman at gmail.com> wrote:
> On 22 October 2015 at 15:31, Albert Freeman <albertwdfreeman at gmail.com> wrote:
>> On 22 October 2015 at 12:25, 刘涛 <liutao586 at 163.com> wrote:
>>> Attachment  need approval and main output see below:
>>>
>>> Build options:
>>>   Version                   1.7.6
>>>   Linux powered             yes
>>>   Install prefix            /usr
>>>   Config files in           /usr/etc
>>>   Build shared libs         yes
>>>   Build static libs         no
>>>   Module directory          ${exec_prefix}/lib/directfb-1.7-6
>>>   CC                        gcc
>>>   CXX                       g++
>>>   LD                        /usr/bin/ld -m elf_x86_64
>>>   CPPFLAGS                  -D_REENTRANT
>>>   CFLAGS                    -Wall -Wstrict-prototypes -Wmissing-prototypes
>>> -Wno-strict-aliasing -Werror-implicit-function-declaration -O3 -g2
>>> -ffast-math -pipe  -D_GNU_SOURCE  -std=gnu99
>>> -Werror-implicit-function-declaration
>>>   CXXFLAGS                  -Wall -Wno-strict-aliasing -std=c++0x -g -O2 -O3
>>> -g2 -ffast-math -pipe  -D_GNU_SOURCE
>>>   LDFLAGS
>>>   LIBS                      -ldl -lrt -lpthread
>>>   DYNLIB                    -ldl
>>>   RTLIB                     -lrt
>>>   THREADFLAGS               -D_REENTRANT
>>>   THREADLIB                 -lpthread
>>>
>>> Misc options:
>>>   Multi Application Core    no
>>>   Fusion Kernel Device      yes
>>>   Fusion message size       16384
>>>   Fluxed args size          1024
>>>   One (IPC)                 no
>>>   Voodoo (network support)  no
>>>   Pure Voodoo (net only)    no
>>>   DiVine (virtual input)    no
>>>   FusionDale                no
>>>   Debug supported           yes
>>>   Debug enabled             no
>>>   Trace support             no
>>>   MMX support               yes
>>>   SSE support               yes
>>>   GCC Atomics usage         no
>>>   Network support           yes
>>>   Include all strings       yes
>>>   Software Rendering        yes
>>>   Smooth SW Scaling         no
>>>   Dithering                 none
>>>   Dithering 565             none
>>>   zlib compression          no
>>>   Using setsockopt          yes
>>>
>>> Building Tests              no
>>> Building Tools              yes
>>>
>>> Building System Modules:
>>>   Linux FBDev support       yes
>>>   Generic /dev/mem support  yes
>>>   Mesa/DRM/KMS support      yes                -I/usr/include/libdrm
>>> -lGLESv2 -lEGL -ldrm -lgbm
>>>   DRM/KMS support           no
>>>   PVR2D                     no
>>>   EGL                       no                 -I/usr/include/libdrm   -lGL
>>> -lEGL
>>>   X11 support               yes                   -lX11 -lXext
>>>   X11/VDPAU support         no
>>>   OSX support               no
>>>   SDL support               no
>>>   VNC support               no
>>>
>>> Building Window Manager Modules:
>>>   Default                   yes
>>>   UniQuE                    no
>>>   SaWMan                    no
>>>
>>> Building Image Provider Modules:
>>>   GIF                       yes
>>>   JPEG                      yes                 -ljpeg
>>>   PNG                       yes                  -I/usr/include/libpng12
>>> -lpng12
>>>   Imlib2                    no
>>>   PNM                       yes
>>>   SVG                       no
>>>   BMP                       yes
>>>   WEBP                      no
>>>   JPEG2000                  no
>>>   MPEG2                     yes
>>>   TIFF                      no
>>>
>>>
>>>
>>> Building Video Provider Modules:
>>>   GIF                       yes
>>>   Video4Linux               yes (v2: no)
>>>   MNG                       no
>>>   Gstreamer                 no (v1: no)
>>>     with FusionSound        no
>>>   AviFile                   no
>>>   Flash                     no
>>>   Libmpeg3                  no
>>>   OpenQuicktime             no
>>>   Xine                      no
>>>   Xine/VDPAU                no
>>>   Swfdec                    no
>>>   FFmpeg                    no
>>>
>>> Building Font Modules:
>>>   FreeType2                 yes                 -I/usr/include/freetype2
>>> -lfreetype
>>>   LinoType                  no
>>>   Default font              yes
>>>
>>> Building FusionSound        no
>>>
>>> Building Graphics Drivers:
>>>   3Dfx Voodoo               yes
>>>   ATI Mach64                yes
>>>   ATI Rage 128              yes
>>>   ATI Radeon                no
>>>   Cirrus EP9X               yes
>>>   Intel i810                yes
>>>   Intel i830                yes
>>>   Matrox                    yes
>>>   NeoMagic                  yes
>>>   NSC Geode                 yes
>>>   nVidia                    yes
>>>   PVR2D                     no
>>>   PXA 3xx                   yes
>>>   Renesas R-Car GP2D        no
>>>   Renesas SH7722/SH7723     no
>>>   S3 Savage                 no
>>>   SiS 315                   yes
>>>   TI Davinci                no
>>>   TI OMAP                   no
>>>   TVIA CyberPro             no
>>>   VIA CLE266                no
>>>   VIA UniChrome             no
>>>   VMWare                    no
>>>   VDPAU                     no
>>>   --
>>>   OpenGL                    yes (GLX: yes)
>>>   OpenGL ES 2.0             yes (Mesa:  yes, PVR2D: no)
>>>                                         -I/usr/include/libdrm   -DGLES2_MESA
>>> -lGLESv2 -lEGL -ldrm -lgbm
>>>
>>>   IDirectFBGL-EGL           yes       -I/usr/include/libdrm   -lGL -lEGL
>>>
>>> Building Input Drivers:
>>>   DBox2 Remote              no
>>>   DreamBox Remote           no
>>>   Dynapro Touchscreen       no
>>>   ELO Touchscreen           no
>>>   Gunze Touchscreen         no
>>>   H3600 Touchscreen         no
>>>   Input Hub                 yes
>>>   Joystick                  yes
>>>   Keyboard                  yes
>>>   Linux Input               yes
>>>   LiRC                      yes
>>>   MuTouch touchscreen       yes
>>>   Zytronic touchscreen      yes
>>>   PS/2 Mouse                yes
>>>   Serial Mouse              yes
>>>   SonyPI Jogdial            yes
>>>   tslib                     yes                   -lts
>>>   ucb1x00 Touchscreen       no
>>>   WM97xx Touchscreen        yes
>>>
>>>
>>>
>>>
>>> 在 2015-10-22 20:14:41,"刘涛" <liutao586 at 163.com> 写道:
>>>
>>> Sorry ,  add attachment for this time.
>>>
>>>
>>> 在 2015-10-22 20:13:36,"刘涛" <liutao586 at 163.com> 写道:
>>>
>>> I use "./configure --prefix=/usr --enable-idirectfbgl-egl" to configure
>>> DirectFB-1.7.6 and please see attachment config.log for output.
>> I was really really wrong about what DirectFB can support. It uses gbm
>> and therefore supports all the latest mesa hardware drivers. I have
>> got a slight modification of your code (adding stuff you would already
>> have setup) running on DirectFB with my r600 radeon card. I had to
>> modify directfb. I did by commenting out functions to avoid a runtime
>> dlopen warning that prevented stuff from working. Now to do it
>> properly (I believe DirectFB is not loading function pointers for some
>> EGL functions). I am not sure if it is the same issue you have though.
>>
>> My configuration is latest git mesa and Linux 4.2.3 and I actually had
>> success with just ./configure && make -j16 && make install with
>> DirectFB.
> Just to make sure it is the same issue, do you have:
> (!) Direct/Modules: Unable to dlopen
> `/usr/local/lib/directfb-1.7-0/systems/libdirectfb_mesa_system.so'!
>     --> /usr/local/lib/directfb-1.7-0/systems/libdirectfb_mesa_system.so:
> undefined symbol:
> in the DirectFB stdout/err log when you run your program (near the top
> of the log)?
Actually I did not solve the issue. I had setup a:
glClearColor(0.0f, 1.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
which for the first time actually cleared something for about a second.
But strangely enough EGL was erroring and it was still intermittently
clearing the screen.
The gles2 test DirectFB provides tests functionality that has since
been deleted (even though the tests are in the same repo).
DirectFBGL/EGL calls:
eglGetDisplay
eglInitialize
eglChooseConfig
eglBindAPI(EGL_OPENGL_ES_API)   which is hardwired, meaning no Desktop
OpenGL allowed (I just feel like noting that for some reason).
etc
So if you actually want to use DirectFBGL/EGL completely then I don't
think your supposed to call egl functions yourself.

Your program fails on
eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
with a EGL_BAD_NATIVE_WINDOW (I may have also seen a EGL_BAD_DISPLAY
but I doubt it)
of course that could be due to the infrastructure I built around it,
but I doubt that.

I messed around for ages doing stuff, I got a DirectFB mouse cursor
appearing both in X11 and with the test app started directly from the
linux console.
Although I think it is a matter of getting the DirectFB calls setup
right (before any egl functions are called) with X11 on PC. Of course
it could be a bug in DirectFB or EGL too.

Anyway, I am going to bed.

You might want to use this for debugging:
    EGLint eglerror = eglGetError();
        switch(eglerror) {
        case EGL_SUCCESS:
            printf("eglGetError indicated SUCCESS\n");
            break;
        case EGL_BAD_NATIVE_WINDOW:
            printf("eglGetError indicated BAD_NATIVE_WINDOW\n");
            break;
        case EGL_NOT_INITIALIZED:
            printf("eglGetError indicated NOT_INITIALIZED\n");
            break;
        case EGL_CONTEXT_LOST:
            printf("eglGetError indicated CONTEXT_LOST\n");
            break;
        case EGL_BAD_ACCESS:
            printf("eglGetError indicated BAD_ACCESS\n");
            break;
        case EGL_BAD_ALLOC:
            printf("eglGetError indicated BAD_ALLOC\n");
            break;
        case EGL_BAD_ATTRIBUTE:
            printf("eglGetError indicated BAD_ATTRIBUTE\n");
            break;
        case EGL_BAD_CONTEXT:
            printf("eglGetError indicated BAD_CONTEXT\n");
            break;
        case EGL_BAD_CONFIG:
            printf("eglGetError indicated BAD_CONFIG\n");
            break;
        case EGL_BAD_CURRENT_SURFACE:
            printf("eglGetError indicated BAD_CURRENT_SURFACE\n");
            break;
        case EGL_BAD_DISPLAY:
            printf("eglGetError indicated BAD_DISPLAY\n");
            break;
        case EGL_BAD_MATCH:
            printf("eglGetError indicated BAD_MATCH\n");
            break;
        case EGL_BAD_PARAMETER:
            printf("eglGetError indicated BAD_PARAMETER\n");
            break;
        case EGL_BAD_NATIVE_PIXMAP:
            printf("eglGetError indicated BAD_NATIVE_PIXMAP\n");
        default:
            printf("eglGetError returned an unknown EGL error\n");
            break;
        }


More information about the mesa-users mailing list