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.

AM3358: EGLFS detects wrong color depth

Expert 2590 points
Part Number: AM3358

I'm using the SDK ti-processor-sdk-linux-am335x-evm-03.02.00.05 and I'm having problem with Qt and eglfs because blue and red are swapped. I have added to /etc/powervr.ini DefaultPixelFormat=RGB565. This helps to get the right colors for the SGX demos but does nothing for the eglfs.

My fb settings are correct:

mode "800x480"
    geometry 800 480 800 480 16
    timings 0 0 0 0 0 0 0
    accel true
    rgba 5/11,6/5,5/0,0/0
endmode

If I run my Qt program in debug mode I'll get wrong screen size and color depth from the EGL. Qrect is printed out from app with availableGeometry and is correct but the depth is 32. EGL debug info on the other hand reports something else:

loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
QRect(0,0 800x480)
32
Created context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile  0) with config:
        EGL_BUFFER_SIZE: 32
        EGL_ALPHA_SIZE: 8
        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: 14
        EGL_LEVEL: 0
        EGL_MAX_PBUFFER_HEIGHT: 2048
        EGL_MAX_PBUFFER_PIXELS: 4194304
        EGL_MAX_PBUFFER_WIDTH: 2048
        EGL_NATIVE_RENDERABLE: 0
        EGL_NATIVE_VISUAL_ID: 0
        EGL_NATIVE_VISUAL_TYPE: 0
        EGL_SAMPLES: 0
        EGL_SAMPLE_BUFFERS: 0
        EGL_SURFACE_TYPE: 5
        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

How can I get the colors right with eglfs?

BR

JHi

  • I forgot to say that setting QT_QPA_EGLFS_DEPTH=16 or QT_QPA_EGLFS_FORCE565 doesn't help.

    JHi
  • Is this a custom board or one of the AM335x EVM boards?
  • It is a custom board but it's very much like am335x-evm.

    JHi
  • How are your display signals connected? Have you seen Usage Note 3.1.1 in the AM335x Errata Rev. I?
  • As I said in a first post, SGX demos are working correctly with correct colors when I set DefaultPixelFormat=RGB565. So the signals should be correct. Also the boot logo is showing correctly means frame buffer. Only the eglfs causes me troubles.

    JHi
  • And more information with export QSG_INFO=1:

    qt.scenegraph.general: Animation Driver: using vsync: 16.39 ms
    qt.scenegraph.general: texture atlas dimensions: 1024x512
    qt.scenegraph.general: R/G/B/A Buffers:    8 8 8 8
    qt.scenegraph.general: Depth Buffer:       24
    qt.scenegraph.general: Stencil Buffer:     8
    qt.scenegraph.general: Samples:            0
    qt.scenegraph.general: GL_VENDOR:          Imagination Technologies
    qt.scenegraph.general: GL_RENDERER:        PowerVR SGX 530
    qt.scenegraph.general: GL_VERSION:         OpenGL ES 2.0 build 1.14@3699939 (MAIN)
    qt.scenegraph.general: GL_EXTENSIONS:      GL_OES_vertex_array_object GL_EXT_discard_framebuffer GL_EXT_texture_format_BGRA8888 GL_OES_texture_float GL_OES_rgb8_rgba8 GL_OES_surfaceless_context GL_OES_get_program_binary GL_IMG_texture_npot GL_OES_egl_sync GL_IMG_uniform_buffer_object GL_OES_element_index_uint GL_OES_required_internalformat GL_OES_depth_texture GL_OES_mapbuffer GL_OES_EGL_image GL_IMG_program_binary GL_OES_vertex_half_float GL_OES_texture_half_float GL_OES_standard_derivatives GL_EXT_blend_minmax GL_EXT_texture_rg GL_EXT_shader_texture_lod GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_OES_packed_depth_stencil GL_EXT_multi_draw_arrays GL_OES_compressed_ETC1_RGB8_texture GL_IMG_multisampled_render_to_texture GL_OES_depth24 GL_IMG_read_format GL_KHR_debug GL_OES_fragment_precision_high GL_OES_EGL_image_external GL_EXT_multisampled_render_to_texture GL_IMG_shader_binary
    qt.scenegraph.general: Max Texture Size:  2048
    qt.scenegraph.general: Debug context:     false



    JHi
  • I have asked the video experts to look at this. They will respond here.
  • I tired with -platform minimalegl and the colors are correct but I don't have touch :(

    Opened display 0x1
    
    Initialized display 1 4
    
    Created context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 16, redBufferSize 5, greenBufferSize 6, blueBufferSize 5, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior 0, swapInterval 1, profile  0) with config:
            EGL_BUFFER_SIZE: 16
            EGL_ALPHA_SIZE: 0
            EGL_BLUE_SIZE: 5
            EGL_GREEN_SIZE: 6
            EGL_RED_SIZE: 5
            EGL_DEPTH_SIZE: 24
            EGL_STENCIL_SIZE: 8
            EGL_CONFIG_CAVEAT: 12344
            EGL_CONFIG_ID: 8
            EGL_LEVEL: 0
            EGL_MAX_PBUFFER_HEIGHT: 2048
            EGL_MAX_PBUFFER_PIXELS: 4194304
            EGL_MAX_PBUFFER_WIDTH: 2048
            EGL_NATIVE_RENDERABLE: 0
            EGL_NATIVE_VISUAL_ID: 0
            EGL_NATIVE_VISUAL_TYPE: 0
            EGL_SAMPLES: 0
            EGL_SAMPLE_BUFFERS: 0
            EGL_SURFACE_TYPE: 5
            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: 10
    qt.scenegraph.general: threaded render loop
    qt.scenegraph.general: Using sg animation driver
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.scenegraph.general: texture atlas dimensions: 1024x512
    qt.scenegraph.general: R/G/B/A Buffers:    5 6 5 0
    qt.scenegraph.general: Depth Buffer:       24
    qt.scenegraph.general: Stencil Buffer:     8
    qt.scenegraph.general: Samples:            0
    qt.scenegraph.general: GL_VENDOR:          Imagination Technologies
    qt.scenegraph.general: GL_RENDERER:        PowerVR SGX 530
    qt.scenegraph.general: GL_VERSION:         OpenGL ES 2.0 build 1.14@3699939 (MAIN)
    qt.scenegraph.general: GL_EXTENSIONS:      GL_IMG_texture_compression_pvrtc GL_IMG_program_binary GL_OES_vertex_array_object GL_EXT_discard_framebuffer GL_OES_vertex_half_float GL_OES_element_index_uint GL_EXT_multisampled_render_to_texture GL_OES_mapbuffer GL_IMG_texture_npot GL_OES_EGL_image GL_OES_required_internalformat GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_rgb8_rgba8 GL_EXT_multi_draw_arrays GL_IMG_read_format GL_OES_depth24 GL_OES_packed_depth_stencil GL_OES_egl_sync GL_EXT_blend_minmax GL_KHR_debug GL_OES_texture_half_float GL_IMG_shader_binary GL_OES_compressed_ETC1_RGB8_texture GL_EXT_shader_texture_lod GL_IMG_texture_format_BGRA8888 GL_OES_EGL_image_external GL_OES_texture_float GL_OES_fragment_precision_high GL_EXT_texture_rg GL_IMG_uniform_buffer_object GL_EXT_texture_format_BGRA8888 GL_OES_get_program_binary GL_OES_depth_texture GL_IMG_multisampled_render_to_texture
    qt.scenegraph.general: Max Texture Size:  2048
    qt.scenegraph.general: Debug context:     false
    

    JHi

  • By default, custom eglfs is enabled on PSDK 3.2. Try disabling eglfs_kms as mentioned in below link and re run the application.

    • export QT_QPA_EGLFS_INTEGRATION=none

    http://processors.wiki.ti.com/index.php/Processor_Linux_SDK_Graphics_and_Display#Migration_Guide_from_Processor_SDK_3.1_to_3.x_for_AM3.2F4.2F5

  • Thanks! It's working now.

    JHi