This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3354: Setup SGX driver and libraries for QT to run with EGLFS

Part Number: AM3354
Other Parts Discussed in Thread: AM3358,

Hi expert,

 

We have an AM3358 EVM board and can load the default image in the SDK 08.02.00.24 successfully.

 

And we want to use QT with eglfs in our board (Linux 5.15, AM3354), so, I need to get the EGL library and SGX driver from you.

 

I had gotten the repos of SGX kernel module and SGX user mode library, I built the pvrsrvkm.ko from branch "ti-img-sgx/1.17.4948957/k5.10", also I found the libraries of user mode for 5.10 on branch "remotes/origin/ti-img-sgx/thud/1.17.4948957" in user mode repo.

 

I had built and inserted the kernel module "pvrsrvkm.ko" successfully, the dmesg likes below image.

But I found the "libEGL.so" and "libGLESv2.so" are based on "libwayland-server.so" and "libwayland-client.so". It's not OK for me, because we will not have wayland in our system.

 

 

So, my questions are:

 

  1. Is there any document for setup env for Qt based on eglfs on AM335x with PowerVR SGX?
  2. Where/How can I get the user mode libraries that do not depend on wayland?
  3. How could I confirm the kernel module "pvrsrvkm.ko" and user mode libraries could work well?

 

 

Looking forward to your reply! :)

  • Hello,

    1. If you are building Qt through Yocto, it will install all the necessary plugins/env variables in your filesystem. Here is a document that talks about building Qt application (https://dev.ti.com/tirex/content/linux-academy-AM62X-8.4.1.3.v2/ch-develop/dev-gpu-porting-guide.html) and for running, it's as simple as <app_name> --platform eglfs. 

    2. We are no longer supporting the GPU driver and if you want to modify the driver, we can share the driver with you. The process involves having your local FAE reach out to us and going through a legal process before we can share anything. 

    3. There are multiple tests to validate the GPU functionality and a common one to use is kmscube (binary included by default in SDK FS).

    Regards,
    Krunal

  • Hi Krunal,

    Thanks for your quick reply.

    Unfortunately, we are using buildroot to make our rootfs. So, we need to build the QT and it's dependences by ourselves.

    You said you are no longer supporting the GPU driver, does this mean we can't get the libraries (EGL) for DRM from you now?

    I don't know whether I  understood correctly, I read this architecture(https://software-dl.ti.com/processor-sdk-linux/esd/docs/05_01_00_11/linux/Foundational_Components_Graphics.html#software-architecture) and I thought if we need to setup the QT environment without window system, then we need to get the EGL library for DRM from you.

    Thanks.

    Best Regards.

    Hang

  • Hello Hang,

    We have released the libs on the following repo: https://git.ti.com/cgit/graphics/omap5-sgx-ddk-um-linux/?h=ti-img-sgx%2Fdunfell%2F1.17.4948957. However, we are not doing any maintenance or providing support for SGX GPU. 

    Regards,
    Krunal 

  • Hi Krunal,

    Sorry for the late response, now I have fixed all the issues and the 3d demo and even the qt can run based on the EGL.

    I put the solution here, hope this can help other people.

    1. Download code from https://git.ti.com/cgit/graphics/omap5-sgx-ddk-linux/, and switch to 5.10 branch(1.17.4948957)
    2. Configure the window system to "nulldrmws" in default_window_system.mk, because in my environment, I will not use x11 or Wayland, only DRM
    3. Adapt with 5.15 kernel, port some functions to new kernel version
    4. Build with bellow parameters:
      1. ARCH=arm
      2. TARGET_PRODUCT=ti335x
      3. BUILD=release
    5. Get the pvrsrvkm.ko
    6. Download repo https://git.ti.com/cgit/graphics/omap5-sgx-ddk-um-linux/, and switch to branch "thud" (1.17.4948957)
    7. Install the files to sysroot and rootfs
    8. Install latest SDK and copy the libgbm.so and libdrm.so
    9. Build rootfs, and copy the examples for DRM in repo https://git.ti.com/cgit/graphics/img-pvr-sdk/
    10. Build QT 6.4.1 with EGLFS
    11. Add the KMSconfigure file
    12. Run Qt application

    The KMS configuration file is:

    {
      "device": "/dev/dri/card0",
      "hwcursor": false,
      "pbuffers": true,
      "outputs": [
        {
          "name": "LVDS1",
          "mode": "800x480",
          "format": "xrgb8888",
          "primary": true
        }
      ]
    }

    When first time run QT application with eglfs, there had some issues:

    qt.qpa.eglfs.kms: Setting mode for screen LVDS1
    Could not set DRM mode for screen LVDS1 (Invalid argument)
    Could not queue DRM page flip on screen LVDS1 (Invalid argument)

    After search, finally, resolved by "e2e.ti.com/.../3240619

    Thanks.

    Best Regards

    Bob

  • Hi, this has been helpful but I am still having issues, here are my questions:

    1. in step 7, did you copy them from the sdk file system?

    2. for the example in step 9 which branch did you use? because when i copy the examples they require wayland-*.so modules and i do not have it (the same way you did not).

    3. was this error:

    Could not set DRM mode for screen LVDS1 (Invalid argument)
    Could not queue DRM page flip on screen LVDS1 (Invalid argument)

    because of missing ksmconfig file ? I have the config file but its gives me the same issue.

    Could not set DRM mode for screen HDMI1 (Invalid argument)
    Could not queue DRM page flip on screen HDMI1 (Invalid argument)

    any help would be appreciated.

    Thank you

    Janusz