TDA4VH-Q1: TDA4VH-Q1: How to Enable and Verify EGL_MESA_platform_surfaceless Extension on TDA4 (J784S4) with DDK 23.3

Part Number: TDA4VH-Q1

Tool/software:

Could you please help answer the below queries:
1. How to verify that the EGL_MESA_platform_surfaceless extension is supported and enabled on the current IMG DDK 23.3 image?

2. Could you please share the DDK code or configuration changes required to enable the EGL_MESA_platform_surfaceless extension which is supported by libraries released in SDK

3. Could you confirm whether EGL_KHR_surfaceless_context is the alternative to EGL_MESA_platform_surfaceless?

 

Note: Logs are updated in the Forum Link : https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1520434/tda4vh-q1-how-to-enable-and-verify-egl_mesa_platform_surfaceless-extension-on-tda4-j784s4-with-sdk-09_02_00_05/5923051

  • Hello,

    1. How to verify that the EGL_MESA_platform_surfaceless extension is supported and enabled on the current IMG DDK 23.3 image?

    As mentioned in the past thread, if you enable debug logs by running setting the environment variable EGL_LOG_LEVEL=debug and then running the glmark-es2-wayland demo application. This will print all the extensions that are being used, including the EGL platform surfaceless extension. The GPU demos we have enabled require EGL platform surfaceless extension. This is enabled by default in the SDK to run these demo apps.

    3. Could you confirm whether EGL_KHR_surfaceless_context is the alternative to EGL_MESA_platform_surfaceless?

    • EGL_KHR_surfaceless_context lets you make a GL(ES) context current with no EGLSurface. You can still render, but not to a default/window framebuffer—you’d render to textures/FBOs. This is about using a context without a surface.

    • EGL_MESA_platform_surfaceless — defines a platform so you can get an EGLDisplay without any native window system (ex: Wayland). This is about creating a display with no window system.

    They’re independent but often used together: first get a surfaceless display (MESA), then run a context without a surface (KHR).


    Thank you,
    Sarabesh S.

     

  • We are using  IMG DDK 23.3 source to build Graphics stack which contains OpenGL ES 3.2, EGL 1.5 & Vulkan 1.3 for TI-TDA4VH BX-6 series GPU.

     

    As part of our requirement, we need to support EGL_MESA_platform_surfaceless extension in EGL. We tried an example app code given by TI Forum
    ( https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1520434/tda4vh-q1-how-to-enable-and-verify-egl_mesa_platform_surfaceless-extension-on-tda4-j784s4-with-sdk-09_02_00_05/5923051 ) to check whether EGL_MESA_platform_surfaceless, app code doesn’t compile if it is built with  IMG DDK 23.3 source on linux(refer e2e ticket) and if pre-compiled library( released in linux SDK) is used, app code builds and runs fine. Looks like there is a gap between the DDK code shared with us and the IMG DDK code used in linux SDK.

  • Hi Akash, 

    I'm not familiar with the history of the DDK source you're referring to. Did TI deliver you UM source or are you referring to the KM? 

    You should be able to find the UM binaries here: https://git.ti.com/cgit/graphics/ti-img-rogue-umlibs/

    Thanks,
    Sarabesh S.

  • Hi Sarabesh,

     

    Yes we are working on IMG DDK source code from TI and not referring to UM libs. The issue we are facing while building an example with EGL_MESA_platform_surfaceless extension has been posted in this https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1520434/tda4vh-q1-how-to-enable-and-verify-egl_mesa_platform_surfaceless-extension-on-tda4-j784s4-with-sdk-09_02_00_05/5923051 regarding enabling eglGetPlatformDisplay function.

    Could we get missing source for the same to support EGL_MESA_platform_surfaceless extension ?

     

    Regards.

    Akash

  • Hi Akash, 

    Are you testing an application with the EGL_MESA_platform_surfaceless extension and it is not working? Do you have any logs to help us confirm that this extension is not working in the driver?

    Regards,
    Sarabesh S.

  • Hi Sarabesh

    Yes, I am testing sample application lightweight-offscreen/lightweight-offscreen.c at master · StaticRocket/lightweight-offscreen · GitHub

    and we are facing build issues while building with IMG DDK 23.3 source

    Kindly find the attached logs.

    testpc2@blr-testpc-l1:~/satendra/TDA4-DDK/8xe-ddk-rogue-docker_demo/build/darren-8xe-ddk-rogue$ make  RISCV_ELF_ROOT=/opt/imgtec/catapult-sdk_1.7.1 ARCH=arm64 CROSS_COMPILE=/home/testpc2/satendra/ti-processor-sdk-linux-adas-j784s4-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux- KERNELDIR=/home/testpc2/satendra/ti-processor-sdk-linux-adas-j784s4-evm-09_02_00_05/board-support/ti-linux-kernel-6.1.80+gitAUTOINC+2e423244f8-ti LLVM_BUILD_DIR=/home/testpc2/satendra/TDA4-DDK/8xe-ddk-rogue-docker_demo/build/llvm RGX_BVNC="36.53.104.796" BUILD=debug PVR_BUILD_DIR=j784s4_linux WINDOW_SYSTEM=nulldrmws SYSROOT=/home/testpc2/satendra/ti-processor-sdk-linux-adas-j784s4-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux
    ../config/preconfig.mk:321: Could not determine TARGET_OS so assuming Linux
    ******* Multiarch build:     no
    ******* Primary arch:        target_aarch64
    ******* Secondary arch:      none
    ******* PVR top-level arch:  rogue
    ******* PVR DEFS arch:       rogue
    ******* PVR USC arch:        rogue
    ******* PVR TPU arch:        rogue
    ******* HWDefs Root:         /home/testpc2/satendra/TDA4-DDK/8xe-ddk-rogue-docker_demo/build/darren-8xe-ddk-rogue/hwdefs/rogue
    ******* Host OS:             linux
    ******* Target OS:           linux
      LD       binary_j784s4_linux_nulldrmws_debug/target_aarch64/libVK_IMG.so
      GEN      binary_j784s4_linux_nulldrmws_debug/target_aarch64/install_um.sh
      GEN      binary_j784s4_linux_nulldrmws_debug/target_neutral/install_um.sh
      OD       binary_j784s4_linux_nulldrmws_debug/target_neutral/intermediates/gles3test1_vertshader/gles3test1_vertshader.txt.h
      OD       binary_j784s4_linux_nulldrmws_debug/target_neutral/intermediates/gles3test1_fragshaderA/gles3test1_fragshaderA.txt.h
      OD       binary_j784s4_linux_nulldrmws_debug/target_neutral/intermediates/gles3test1_fragshaderB/gles3test1_fragshaderB.txt.h
      CC       unittests/gles3/gles3test1/gles3test1.c
    unittests/gles3/gles3test1/gles3test1.c:68:6: warning: no previous prototype for 'dump' [-Wmissing-prototypes]
       68 | void dump(ContextData *data)
          |      ^~~~
    unittests/gles3/gles3test1/gles3test1.c: In function 'dump':
    unittests/gles3/gles3test1/gles3test1.c:72:13: warning: unused variable 'fd' [-Wunused-variable]
       72 |         int fd;
          |             ^~
    unittests/gles3/gles3test1/gles3test1.c: At top level:
    unittests/gles3/gles3test1/gles3test1.c:83:6: warning: no previous prototype for 'draw' [-Wmissing-prototypes]
       83 | bool draw(ContextData *data)
          |      ^~~~
    unittests/gles3/gles3test1/gles3test1.c:147:6: warning: no previous prototype for 'setup_shader' [-Wmissing-prototypes]
      147 | bool setup_shader(ContextData *data, const char *shader_source,
          |      ^~~~~~~~~~~~
    unittests/gles3/gles3test1/gles3test1.c:189:6: warning: no previous prototype for 'egl_create_surface' [-Wmissing-prototypes]
      189 | bool egl_create_surface(ContextData *data)
          |      ^~~~~~~~~~~~~~~~~~
    unittests/gles3/gles3test1/gles3test1.c:204:6: warning: no previous prototype for 'egl_create_context' [-Wmissing-prototypes]
      204 | bool egl_create_context(ContextData *data)
          |      ^~~~~~~~~~~~~~~~~~
    unittests/gles3/gles3test1/gles3test1.c:218:6: warning: no previous prototype for 'egl_choose_config' [-Wmissing-prototypes]
      218 | bool egl_choose_config(ContextData *data)
          |      ^~~~~~~~~~~~~~~~~
    unittests/gles3/gles3test1/gles3test1.c:238:6: warning: no previous prototype for 'egl_init' [-Wmissing-prototypes]
      238 | bool egl_init(ContextData *data)
          |      ^~~~~~~~
    cc1: note: unrecognized command-line option '-Wno-typedef-redefinition' may have been intended to silence earlier diagnostics
    cc1: note: unrecognized command-line option '-Wno-parentheses-equality' may have been intended to silence earlier diagnostics
    cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
      CC       unittests/common/maths.c
      CC       unittests/common/eglutils.c
      LD       binary_j784s4_linux_nulldrmws_debug/target_aarch64/gles3test1
    /home/testpc2/satendra/ti-processor-sdk-linux-adas-j784s4-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/11.4.0/ld: binary_j784s4_linux_nulldrmws_debug/target_aarch64/intermediates/gles3test1/unittests/gles3/gles3test1/gles3test1.o: in function `egl_init':
    home/testpc2/satendra/TDA4-DDK/8xe-ddk-rogue-docker_demo/build/darren-8xe-ddk-rogue/unittests/gles3/gles3test1/gles3test1.c:241: undefined reference to `eglGetPlatformDisplay'
    collect2: error: ld returned 1 exit status
    make[2]: *** [build/linux/modules/executable.mk:153: binary_j784s4_linux_nulldrmws_debug/target_aarch64/gles3test1] Error 1
    make[1]: *** [../config/core.mk:3116: build] Error 2
    make: *** [Makefile:19: build] Error 2
    

    We have copied the source code (lightweight-offscreen/lightweight-offscreen.c at master · StaticRocket/lightweight-offscreen · GitHub) from lightweight-offscreen.c into the DDK unit test framework under the test file gles3test1.c. However, during the build process, we are encountering compilation issues related to the use of eglGetPlatformDisplay().
    Upon investigation, we found that the function is conditionally compiled under the following macro in the header:
    #if defined(IMGEGL_PLATFORM_ANDROID_HAS_1_5)
    This macro appears to be defined only for Android platforms, and thus the eglGetPlatformDisplay() symbol is not exposed in our Linux-based build environment.

    Kindly let us know how enable this function or can we get the Linux version of this function.

    Regards,

    Akash

  • Hello, 

    I'll bring this up with the team. The application lightweight-offscreen is built and tested on our Linux SDK so this should be enabled in the 23.3 DDK. I'm going to be out of office the rest of the week so I won't be able to test this until early next week. 

    Thank you,
    Sarabesh S.

  • Hi Sarabesh,

    Any update on this?

    Regards

    Akash

  • Hi Akash,

    I was able to build the example. I will test and get back to you today. 

    Thank you,
    Sarabesh S.

  • Hi Sarabesh ,

    Thanks for the update,

    Are you building it with 23.3 DDK source  or a prebuilt binaries.

    Regards

    Akash

  • Hi Akash, 

    I built it against the 9.2 SDK filesystem which is using the 23.3 DDK. I will note down the steps and send it to you. For now, you should be able to run the below executable on the j721s2 9.2 SDK to verify the demo.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/lightweight_2D00_offscreen 

  • Hi Sarabesh,

    Earlier, we have also tested the demo application with SDK(which uses prebuilt Libraries) successfully. Currently, we are attempting to build it with the DDK 23.3 "source code" along with the SDK. Are you explicitly including DDK 23.3 source code to build the demo application? 
    Please share the build steps & configuration parameters

  • Hi Akash, 

    1. git clone the repo (https://github.com/StaticRocket/lightweight-offscreen)
    2. in the SDK directory source environment-setup-aarch64-oe-linux
    3. create the crossfile located in /ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/share/meson/aarch64-oe-linux-meson.cross as shown here:
      [binaries]
      c = '/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc'
      cpp = '/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-g++'
      ar = '/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-ar'
      strip = '/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-strip'
      pkgconfig = 'pkg-config'
      
      [properties]
      needs_exe_wrapper = true
      sys_root = '/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux'
      pkg_config_libdir = '/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux/usr/lib/pkgconfig'
      
      [built-in options]
      c_args = ['--sysroot=/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux', '-mbranch-protection=standard']
      cpp_args = ['--sysroot=/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux', '-mbranch-protection=standard']
      c_link_args = ['--sysroot=/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux']
      cpp_link_args = ['--sysroot=/home/user/tisdk_releases/j7aep/902/ti-processor-sdk-linux-adas-j721s2-evm-09_02_00_05/linux-devkit/sysroots/aarch64-oe-linux']
      
      [host_machine]
      system = 'linux'
      cpu_family = 'aarch64'
      cpu = 'armv8-a'
      endian = 'little'
    4. Now inside the repo configure the build by running meson setup build --buildtype=release
    5. Build the demo with ninja -C build
    6. Copy the executable in the build directory of the repo onto the target and run the demo.

    Adding the crossfile to download here:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/aarch64_2D00_oe_2D00_linux_2D00_meson.cross

    The demo is only built against the 9.2 SDK's sysroots. The DDK source is not needed.

    Thank you,
    Sarabesh S.