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.

AM5728: AM5728: QtwebEngine EGLConfig

Part Number: AM5728


Hello everybody,
I would like to ask you a question if Ti PSDK 6.0 is ready for QT 5.15.

  • Powervr: ti-sgx-ddk-km_1.17.4948957: k4.19
    •  2a777b8fb72a89d299b82845d42b63b2a2618daa
  • OpenGL: ti-sgx-ddk-um_1.17.494857:zeus
    • 551665bf9c321bc3e7721416e6ebbc9f65c18155

Everything is running well with QT 5.12.9, but after upgrading to version 5.15 I have an error: "Cannot find EGLConfig, returning null config".

From the QT sources I've founded, that they're just calling libEGL.eglChooseConfig from your library.

EGLConfig QWindowsEGLContext::chooseConfig(const QSurfaceFormat &format)
{
    QVector<EGLint> configureAttributes = createConfigAttributesFromFormat(format);
    configureAttributes.append(EGL_SURFACE_TYPE);
    configureAttributes.append(EGL_WINDOW_BIT);
    configureAttributes.append(EGL_RENDERABLE_TYPE);
    configureAttributes.append(EGL_OPENGL_ES2_BIT);
    configureAttributes.append(EGL_NONE);

    EGLDisplay display = m_staticContext->display();
    EGLConfig cfg = nullptr;
    do {
        // Get the number of matching configurations for this set of properties.
        EGLint matching = 0;
        if (!QWindowsEGLStaticContext::libEGL.eglChooseConfig(display, configureAttributes.constData(), nullptr, 0, &matching) || !matching)
            continue;

        // Fetch all of the matching configurations and find the
        // first that matches the pixel format we wanted.
        int i = configureAttributes.indexOf(EGL_RED_SIZE);
        int confAttrRed = configureAttributes.at(i+1);
        i = configureAttributes.indexOf(EGL_GREEN_SIZE);
        int confAttrGreen = configureAttributes.at(i+1);
        i = configureAttributes.indexOf(EGL_BLUE_SIZE);
        int confAttrBlue = configureAttributes.at(i+1);
        i = configureAttributes.indexOf(EGL_ALPHA_SIZE);
        int confAttrAlpha = i == -1 ? 0 : configureAttributes.at(i+1);

        QVector<EGLConfig> configs(matching);
        QWindowsEGLStaticContext::libEGL.eglChooseConfig(display, configureAttributes.constData(), configs.data(), configs.size(), &matching);
        if (!cfg && matching > 0)
            cfg = configs.constFirst();

        EGLint red = 0;
        EGLint green = 0;
        EGLint blue = 0;
        EGLint alpha = 0;
        for (const EGLConfig &config : configs) {
            if (confAttrRed)
                QWindowsEGLStaticContext::libEGL.eglGetConfigAttrib(display, config, EGL_RED_SIZE, &red);
            if (confAttrGreen)
                QWindowsEGLStaticContext::libEGL.eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &green);
            if (confAttrBlue)
                QWindowsEGLStaticContext::libEGL.eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &blue);
            if (confAttrAlpha)
                QWindowsEGLStaticContext::libEGL.eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &alpha);

            if (red == confAttrRed && green == confAttrGreen
                    && blue == confAttrBlue && alpha == confAttrAlpha)
                return config;
        }
    } while (reduceConfigAttributes(&configureAttributes));

    if (!cfg)
        qWarning("Cannot find EGLConfig, returning null config");

    return cfg;
}

Output from testing application:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root'
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms", "eglfs_emu", "eglfs_kms_egldevice")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"
qt.qpa.eglfs.kms: Loading KMS setup from "/etc/qt5/eglfs_kms_cfg.json"
qt.qpa.eglfs.kms: Requested configuration (some settings may be ignored):
        headless: false
        hwcursor: false
        pbuffers: true
        separateScreens: false
        virtualDesktopLayout: 0
        outputs: QMap(("VGA1", QMap(("mode", QVariant(QString, "off"))("name", QVariant(QString, "VGA1")))))
qt.qpa.eglfs.kms: New DRM/KMS via GBM integration created
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"
qt.qpa.eglfs.kms: platformInit: Opening DRM device
qt.qpa.eglfs.kms: GBM: Using DRM device "/dev/dri/card0" specified in config file
qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card0
qt.qpa.eglfs.kms: Creating GBM device for file descriptor 5 obtained from "/dev/dri/card0"
qt.qpa.eglfs.kms: Initalizing event reader for device 0x4c3de0 fd 5
qt.qpa.eglfs.kms: Querying EGLDisplay
...
qt.qpa.eglfs.kms: "UNKNOWN1" mode count: 1 crtc index: 0 crtc id: 55
qt.qpa.eglfs.kms: mode 0 1024 x 600 @ 60 hz
qt.qpa.eglfs.kms: Selected mode 0 : 1024 x 600 @ 60 hz for output "UNKNOWN1"
qt.qpa.eglfs.kms: Physical size is QSizeF(154, 86) mm for output "UNKNOWN1"
qt.qpa.eglfs.kms: Format is 34325258 requested_by_user = false for output "UNKNOWN1"
qt.qpa.eglfs.kms: Output "UNKNOWN1" framebuffer size is  QSize(1024, 600)
...
qt.qpa.eglfs.kms: Output UNKNOWN1 can use 4 planes: 35 38 43 48
qt.qpa.eglfs.kms: Chose plane 35 for output UNKNOWN1 (crtc id 55) (may not be applicable)
qt.qpa.eglfs.kms: Using plain OpenGL mouse cursor
qt.qpa.eglfs.kms: No EDID data for output "UNKNOWN1"
qt.qpa.eglfs.kms: Sorted screen list: QVector(OrderedScreen(QPlatformScreen=0x4e1430 ("UNKNOWN1") : 2147483647 / QPoint(0,0) / primary: false))
qt.qpa.eglfs.kms: Adding QPlatformScreen 0x4e1430 ( "UNKNOWN1" ) to QPA with geometry QRect(0,0 1024x600) and isPrimary= false
qt.qpa.input: evdevkeyboard: Using device discovery
qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Keyboard)
qt.qpa.input: Found matching devices ("/dev/input/event0")
qt.qpa.input: Adding keyboard at /dev/input/event0
qt.qpa.input: Try to create keyboard handler for "/dev/input/event0" ""
qt.qpa.input: Opening keyboard at /dev/input/event0
qt.qpa.input: Create keyboard handler with for device "/dev/input/event0"
qt.qpa.input: Unload current keymap and restore built-in
qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
qt.qpa.input: evdevmouse: Using device discovery
qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Mouse|Device_Touchpad)
qt.qpa.input: Found matching devices ()
qt.qpa.input: evdevtouch: Using device discovery
qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Touchpad|Device_Touchscreen)
qt.qpa.input: Found matching devices ("/dev/input/event1")
qt.qpa.input: evdevtouch: Adding device at /dev/input/event1
qt.qpa.input: evdevtouch: Using device /dev/input/event1
Created context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) with config:
        EGL_BUFFER_SIZE: 24
        EGL_ALPHA_SIZE: 0
        EGL_BLUE_SIZE: 8
        EGL_GREEN_SIZE: 8
        EGL_RED_SIZE: 8
        EGL_DEPTH_SIZE: 0
        EGL_STENCIL_SIZE: 0
        EGL_CONFIG_CAVEAT: 12344
        EGL_CONFIG_ID: 5
        EGL_LEVEL: 0
        EGL_MAX_PBUFFER_HEIGHT: 0
        EGL_MAX_PBUFFER_PIXELS: 0
        EGL_MAX_PBUFFER_WIDTH: 0
        EGL_NATIVE_RENDERABLE: 1
        EGL_NATIVE_VISUAL_ID: 875713112
        EGL_NATIVE_VISUAL_TYPE: 12344
        EGL_SAMPLES: 0
        EGL_SAMPLE_BUFFERS: 0
        EGL_SURFACE_TYPE: 4
        EGL_TRANSPARENT_TYPE: 12344
        EGL_TRANSPARENT_BLUE_VALUE: 0
        EGL_TRANSPARENT_GREEN_VALUE: 0
        EGL_TRANSPARENT_RED_VALUE: 0
        EGL_BIND_TO_TEXTURE_RGB: 0
        EGL_BIND_TO_TEXTURE_RGBA: 0
        EGL_MIN_SWAP_INTERVAL: 1
        EGL_MAX_SWAP_INTERVAL: 1
qt.qpa.input: evdevtouch: /dev/input/event1: Protocol type B  (multi), filtered=no
qt.qpa.input: evdevtouch: /dev/input/event1: min X: 0 max X: 2047
qt.qpa.input: evdevtouch: /dev/input/event1: min Y: 0 max Y: 2047
qt.qpa.input: evdevtouch: /dev/input/event1: min pressure: 0 max pressure: 0
qt.qpa.input: evdevtouch: /dev/input/event1: device name: PenMount PM2203C
qt.qpa.eglfs.kms: Creating gbm_surface for screen UNKNOWN1
qt.qpa.eglfs.kms: Got native format 34325258 from eglGetConfigAttrib() with return code true
Created context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) with config:
        EGL_BUFFER_SIZE: 24
        EGL_ALPHA_SIZE: 0
        EGL_BLUE_SIZE: 8
        EGL_GREEN_SIZE: 8
        EGL_RED_SIZE: 8
        EGL_DEPTH_SIZE: 24
        EGL_STENCIL_SIZE: 8
        EGL_CONFIG_CAVEAT: 12344
        EGL_CONFIG_ID: 7
        EGL_LEVEL: 0
        EGL_MAX_PBUFFER_HEIGHT: 0
        EGL_MAX_PBUFFER_PIXELS: 0
        EGL_MAX_PBUFFER_WIDTH: 0
        EGL_NATIVE_RENDERABLE: 1
        EGL_NATIVE_VISUAL_ID: 875713112
        EGL_NATIVE_VISUAL_TYPE: 12344
        EGL_SAMPLES: 0
        EGL_SAMPLE_BUFFERS: 0
        EGL_SURFACE_TYPE: 4
        EGL_TRANSPARENT_TYPE: 12344
        EGL_TRANSPARENT_BLUE_VALUE: 0
        EGL_TRANSPARENT_GREEN_VALUE: 0
        EGL_TRANSPARENT_RED_VALUE: 0
        EGL_BIND_TO_TEXTURE_RGB: 0
        EGL_BIND_TO_TEXTURE_RGBA: 0
        EGL_MIN_SWAP_INTERVAL: 1
        EGL_MAX_SWAP_INTERVAL: 1
Cannot find EGLConfig, returning null config
qt.qpa.eglfs.kms: Adding FB, size 1024x600, DRM format 0x34325258
qt.qpa.eglfs.kms: Setting mode for screen UNKNOWN1
qt.qpa.input: evdevtouch: Updating QInputDeviceManager device count: 1 touch devices, 0 pending handler(s)
qt.qpa.eglfs.kms: Adding FB, size 1024x600, DRM format 0x34325258
qt.qpa.eglfs.kms: Adding FB, size 1024x600, DRM format 0x34325258

What's wrong here?

Thank you,
Andy

  • Hello Andy,

    Sorry but this is not something we have tried. If you must have this, I recommend first reaching out to QT to help debug this down to platform/SoC specific details. Alternatively, you can take a simple graphics example and try the config attributes from the log to check if a particular attribute is what caused the mismatch. Also,  running eglinfo should dump out more information about the graphics driver.

    Regards

    Hemant

  • Hello Hemant,

    Sure, I've tested it on simple application, which is working with the current QT (5.12.9) and OpenGL.

    - I'm not sure, if it's QT related it the library call are the same.

    - There is an output from application with enabled debug logs. How I can provide something more?

    - Is the eglinfo important? Driver wasn't changed, so I can't compare some outputs.

    PS: Sorry it didn't resolved my issue, it was a wrong click on my side.

    Regards,

    Andy

  • I've made an another measurement between QT5.12.9 and 5.15.5 (same application + OpenGL).

    // not working
    qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card0
    qt.qpa.eglfs.kms: Creating GBM device for file descriptor 5 obtained from "/dev/dri/card0"
    qt.qpa.eglfs.kms: Initalizing event reader for device 0x4c3de0 fd 5
    qt.qpa.eglfs.kms: Querying EGLDisplay
    
    // working
    qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card0
    qt.qpa.eglfs.kms: Creating GBM device for file descriptor 5 obtained from "/dev/dri/card0"
    qt.qpa.eglfs.kms: Initalizing event reader for device 0x2bef0 fd 5
    qt.qpa.eglfs.kms: Querying EGLDisplay
    

    Just the device was changed.

    // not working
    qt.qpa.eglfs.kms: "UNKNOWN1" mode count: 1 crtc index: 0 crtc id: 55
    qt.qpa.eglfs.kms: mode 0 1024 x 600 @ 60 hz
    qt.qpa.eglfs.kms: Selected mode 0 : 1024 x 600 @ 60 hz for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Physical size is QSizeF(154, 86) mm for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Format is 34325258 requested_by_user = false for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Output "UNKNOWN1" framebuffer size is  QSize(1024, 600)
    
    // working
    qt.qpa.eglfs.kms: "UNKNOWN1" mode count: 1 crtc index: 0 crtc id: 55
    qt.qpa.eglfs.kms: mode 0 1024 x 600 @ 60 hz
    qt.qpa.eglfs.kms: Selected mode 0 : 1024 x 600 @ 60 hz for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Physical size is QSizeF(154, 86) mm for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Format is 34325258 requested_by_user = false for output "UNKNOWN1"
    Setting framebuffer size is only available with DRM atomic API
    qt.qpa.eglfs.kms: Output "UNKNOWN1" framebuffer size is  QSize(1024, 600)
    

    One more log line observed.

    // not working
    qt.qpa.eglfs.kms: Output UNKNOWN1 can use 4 planes: 35 38 43 48
    qt.qpa.eglfs.kms: Chose plane 35 for output UNKNOWN1 (crtc id 55) (may not be applicable)
    qt.qpa.eglfs.kms: Using plain OpenGL mouse cursor
    qt.qpa.eglfs.kms: No EDID data for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Sorted screen list: QVector(OrderedScreen(QPlatformScreen=0x4e1430 ("UNKNOWN1") : 2147483647 / QPoint(0,0) / primary: false))
    qt.qpa.eglfs.kms: Adding QPlatformScreen 0x4e1430 ( "UNKNOWN1" ) to QPA with geometry QRect(0,0 1024x600) and isPrimary= false
    qt.qpa.input: evdevkeyboard: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Keyboard)
    
    // working
    qt.qpa.eglfs.kms: Output UNKNOWN1 can use 4 planes: 35 38 43 48
    qt.qpa.eglfs.kms: Output eglfs plane is: 35
    qt.qpa.eglfs.kms: Using plain OpenGL mouse cursor
    qt.qpa.eglfs.kms: No EDID data for output "UNKNOWN1"
    qt.qpa.eglfs.kms: Sorted screen list: QVector(OrderedScreen(QPlatformScreen=0x494e8 ("UNKNOWN1") : 2147483647 / QPoint(0,0) / primary: false))
    qt.qpa.eglfs.kms: Adding QPlatformScreen 0x494e8 ( "UNKNOWN1" ) to QPA with geometry QRect(0,0 1024x600) and isPrimary= false
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    qt.qpa.input: evdevkeyboard: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags<QDeviceDiscovery::QDeviceType>(Device_Keyboard)
    

    crct id 55? QtPlatformScreen is different.

    Created context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) with config:
            EGL_BUFFER_SIZE: 24
            EGL_ALPHA_SIZE: 0
            EGL_BLUE_SIZE: 8
            EGL_GREEN_SIZE: 8
            EGL_RED_SIZE: 8
            EGL_DEPTH_SIZE: 0
            EGL_STENCIL_SIZE: 0
            EGL_CONFIG_CAVEAT: 12344
            EGL_CONFIG_ID: 5
            EGL_LEVEL: 0
            EGL_MAX_PBUFFER_HEIGHT: 0
            EGL_MAX_PBUFFER_PIXELS: 0
            EGL_MAX_PBUFFER_WIDTH: 0
            EGL_NATIVE_RENDERABLE: 1
            EGL_NATIVE_VISUAL_ID: 875713112
            EGL_NATIVE_VISUAL_TYPE: 12344
            EGL_SAMPLES: 0
            EGL_SAMPLE_BUFFERS: 0
            EGL_SURFACE_TYPE: 4
            EGL_TRANSPARENT_TYPE: 12344
            EGL_TRANSPARENT_BLUE_VALUE: 0
            EGL_TRANSPARENT_GREEN_VALUE: 0
            EGL_TRANSPARENT_RED_VALUE: 0
            EGL_BIND_TO_TEXTURE_RGB: 0
            EGL_BIND_TO_TEXTURE_RGBA: 0
            EGL_MIN_SWAP_INTERVAL: 1
            EGL_MAX_SWAP_INTERVAL: 1
    

    This part was completely missing in non-working variant.

    Working variant doesn't have log: "Cannot find EGLConfig, returning null config"

    So what to do next?

  • Hello Andrej,

    Seems like from the device perspective most things are the same - including crtc id if I interpret the logs correctly. Can you verify if the same config is being requested?

    Also, since we haven't done this at our end might be worth bringing this in qt forums to get a feedback from that perspective.

    Regards

    Hemant

  • Hello Hemant,

    Yes IDs are the same, but how I can verify which config is being request? Do you need same values? Or how I can dump, which profiles are available?
    I've created bug report on QT's side, but not sure, if it's a QT related problem (https://bugreports.qt.io/browse/QTBUG-95003).

    Regards,
    Andy

  • Hello Andy,

    Not sure where some of the values inside the config come from:

    Created context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) with config

    What might be worth trying is setting environment variable QT_QPA_EGLFS_FORCE888 to see if that helps.

    Regards

    Hemant

  • Hello Hemant,

    I've tried to set `QT_QPA_EGLFS_FORCE888` , but as I expected, it didn't work.

    I guess, the values come from QT. It's searching for some profile, which should be matching.

    Regards,
    Andy