Closed Bug 1738814 Opened 3 years ago Closed 2 years ago

Raspberry Pi 4: Recognize mesa/v3d, don't be confused by fallback to GLES, enable X11_EGL for this driver with Mesa baseline

Categories

(Core :: Graphics: WebRender, defect)

ARM64
Linux
defect

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: jan, Assigned: rmader)

References

(Blocks 1 open bug)

Details

(Keywords: nightly-community)

Attachments

(10 files, 1 obsolete file)

Attached file aboutsupport.txt

$ es2_info

EGL_VERSION: 1.4
EGL_VENDOR: Mesa Project
EGL_CLIENT_APIS: OpenGL OpenGL_ES
GL_VERSION: OpenGL ES 3.1 Mesa 20.3.5
GL_RENDERER: V3D 4.2

about:support

Description V3D 4.2
Vendor ID Broadcom
Device ID V3D 4.2
Driver Vendor mesa/software-unknown
Driver Version 20.3.5.0

OPENGL_COMPOSITING
available by default
Blocklisted; failure code BLOCKLIST_FEATURE_FAILURE_SOFTWARE_GL

  • It should be "mesa/v3d".
  • Failing at OGL3.2 might made it think it's using software gl although GLES is hardware.
  • Let Wayland and X11 behave the same: Enable X11_EGL by default for this driver (Mesa baseline == Mesa 10). It enables WebGL2 support.
  • (Enabling WebRender depends on fixing the PBO problem. HW WR performs better than SW WR.)

Can you run the test program from bug 1731480 comment 15 in this setup and post the out? Also with LIBGL_ALWAYS_SOFTWARE=1 for comparison?

GL_RENDERER of es2_info differs between with LIBGL_ALWAYS_SOFTWARE=1 (llvmpipe (LLVM 11.0.1, 128 bits)) and without (V3D 4.2).

$ ./test
0x3000 clientExtensions (EGL_EXTENSIONS for EGL_NO_DISPLAY): EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless

clientExtensions: EGL_KHR_client_get_all_proc_addresses supported
clientExtensions: EGL_EXT_platform_base supported
clientExtensions: EGL_KHR_platform_x11 supported
0x3000 eglGetPlatformDisplay
0x3000 eglInitialize ok
0x3000 EGL_VENDOR: Mesa Project

0x3000 displayExtensions (EGL_EXTENSIONS for initialized display): EGL_ANDROID_blob_cache EGL_CHROMIUM_sync_control EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_swap_buffers_with_damage EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap 

clientExtensions: EGL_EXT_device_query supported
0x3000 eglGetProcAddress(eglQueryDisplayAttribEXT)
0x3000 eglGetProcAddress(eglQueryDeviceStringEXT)
0x3000 device: eglQueryDisplayAttribEXT EGL_DEVICE_EXT ok

0x3000 deviceExtensions (EGL_EXTENSIONS for device): EGL_MESA_device_software

deviceExtensions: nvidia EGL_EXT_device_query_name not supported
deviceExtensions: EXT_device_drm not supported, ignoring
0x300c no EGL_DRM_DEVICE_FILE_EXT

es2_info from mesa-utils-extra:

$ es2_info
EGL_VERSION: 1.4
EGL_VENDOR: Mesa Project
EGL_EXTENSIONS:
    EGL_ANDROID_blob_cache, EGL_CHROMIUM_sync_control, EGL_EXT_buffer_age, 
    EGL_EXT_image_dma_buf_import, EGL_EXT_image_dma_buf_import_modifiers, 
    EGL_EXT_swap_buffers_with_damage, EGL_KHR_cl_event2, 
    EGL_KHR_config_attribs, EGL_KHR_create_context, 
    EGL_KHR_create_context_no_error, EGL_KHR_fence_sync, 
    EGL_KHR_get_all_proc_addresses, EGL_KHR_gl_colorspace, 
    EGL_KHR_gl_renderbuffer_image, EGL_KHR_gl_texture_2D_image, 
    EGL_KHR_gl_texture_3D_image, EGL_KHR_gl_texture_cubemap_image, 
    EGL_KHR_image, EGL_KHR_image_base, EGL_KHR_image_pixmap, 
    EGL_KHR_no_config_context, EGL_KHR_reusable_sync, 
    EGL_KHR_surfaceless_context, EGL_KHR_swap_buffers_with_damage, 
    EGL_EXT_pixel_format_float, EGL_KHR_wait_sync, 
    EGL_MESA_configless_context, EGL_MESA_drm_image, 
    EGL_MESA_image_dma_buf_export, EGL_MESA_query_driver, 
    EGL_NOK_texture_from_pixmap
EGL_CLIENT_APIS: OpenGL OpenGL_ES 
GL_VERSION: OpenGL ES 3.1 Mesa 20.3.5
GL_RENDERER: V3D 4.2
GL_EXTENSIONS:
    GL_EXT_blend_minmax, GL_EXT_multi_draw_arrays, 
    GL_EXT_texture_compression_s3tc, GL_EXT_texture_compression_dxt1, 
    GL_EXT_texture_format_BGRA8888, GL_OES_compressed_ETC1_RGB8_texture, 
    GL_OES_depth24, GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, 
    GL_OES_mapbuffer, GL_OES_rgb8_rgba8, GL_OES_standard_derivatives, 
    GL_OES_stencil8, GL_OES_texture_3D, GL_OES_texture_float, 
    GL_OES_texture_half_float, GL_OES_texture_half_float_linear, 
    GL_OES_texture_npot, GL_OES_vertex_half_float, GL_EXT_draw_instanced, 
    GL_EXT_texture_sRGB_decode, GL_OES_EGL_image, GL_OES_depth_texture, 
    GL_OES_packed_depth_stencil, GL_EXT_texture_type_2_10_10_10_REV, 
    GL_OES_get_program_binary, GL_APPLE_texture_max_level, 
    GL_EXT_discard_framebuffer, GL_EXT_read_format_bgra, GL_EXT_frag_depth, 
    GL_NV_fbo_color_attachments, GL_OES_EGL_image_external, GL_OES_EGL_sync, 
    GL_OES_vertex_array_object, GL_ANGLE_pack_reverse_row_order, 
    GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
    GL_EXT_occlusion_query_boolean, GL_EXT_texture_rg, GL_EXT_unpack_subimage, 
    GL_NV_draw_buffers, GL_NV_read_buffer, GL_NV_read_depth, 
    GL_NV_read_depth_stencil, GL_NV_read_stencil, GL_EXT_draw_buffers, 
    GL_EXT_map_buffer_range, GL_KHR_debug, 
    GL_KHR_texture_compression_astc_ldr, GL_NV_pixel_buffer_object, 
    GL_OES_depth_texture_cube_map, GL_OES_required_internalformat, 
    GL_OES_surfaceless_context, GL_EXT_color_buffer_float, 
    GL_EXT_sRGB_write_control, GL_EXT_separate_shader_objects, 
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix, 
    GL_EXT_base_instance, GL_EXT_compressed_ETC1_RGB8_sub_texture, 
    GL_EXT_draw_elements_base_vertex, GL_EXT_primitive_bounding_box, 
    GL_EXT_shader_io_blocks, GL_EXT_texture_border_clamp, 
    GL_KHR_context_flush_control, GL_NV_image_formats, 
    GL_OES_draw_elements_base_vertex, GL_OES_primitive_bounding_box, 
    GL_OES_shader_io_blocks, GL_OES_texture_border_clamp, 
    GL_OES_texture_stencil8, GL_OES_texture_storage_multisample_2d_array, 
    GL_EXT_buffer_storage, GL_EXT_float_blend, GL_EXT_geometry_point_size, 
    GL_EXT_geometry_shader, GL_KHR_no_error, 
    GL_KHR_texture_compression_astc_sliced_3d, GL_OES_EGL_image_external_essl3, 
    GL_OES_geometry_point_size, GL_OES_geometry_shader, 
    GL_OES_shader_image_atomic, GL_EXT_texture_compression_s3tc_srgb, 
    GL_MESA_shader_integer_functions, GL_KHR_parallel_shader_compile, 
    GL_EXT_EGL_image_storage, GL_MESA_framebuffer_flip_y, 
    GL_EXT_texture_query_lod
$ LIBGL_ALWAYS_SOFTWARE=1 ./test

0x3000 clientExtensions (EGL_EXTENSIONS for EGL_NO_DISPLAY): EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless

clientExtensions: EGL_KHR_client_get_all_proc_addresses supported
clientExtensions: EGL_EXT_platform_base supported
clientExtensions: EGL_KHR_platform_x11 supported
0x3000 eglGetPlatformDisplay
0x3000 eglInitialize ok
0x3000 EGL_VENDOR: Mesa Project

0x3000 displayExtensions (EGL_EXTENSIONS for initialized display): EGL_EXT_create_context_robustness EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_query_driver 

clientExtensions: EGL_EXT_device_query supported
0x3000 eglGetProcAddress(eglQueryDisplayAttribEXT)
0x3000 eglGetProcAddress(eglQueryDeviceStringEXT)
0x3000 device: eglQueryDisplayAttribEXT EGL_DEVICE_EXT ok

0x3000 deviceExtensions (EGL_EXTENSIONS for device): EGL_MESA_device_software

deviceExtensions: nvidia EGL_EXT_device_query_name not supported
deviceExtensions: EXT_device_drm not supported, ignoring
0x300c no EGL_DRM_DEVICE_FILE_EXT
$ LIBGL_ALWAYS_SOFTWARE=1 es2_info
EGL_VERSION: 1.5
EGL_VENDOR: Mesa Project
EGL_EXTENSIONS:
    EGL_EXT_create_context_robustness, EGL_KHR_cl_event2, 
    EGL_KHR_config_attribs, EGL_KHR_context_flush_control, 
    EGL_KHR_create_context, EGL_KHR_create_context_no_error, 
    EGL_KHR_fence_sync, EGL_KHR_get_all_proc_addresses, EGL_KHR_gl_colorspace, 
    EGL_KHR_gl_renderbuffer_image, EGL_KHR_gl_texture_2D_image, 
    EGL_KHR_gl_texture_3D_image, EGL_KHR_gl_texture_cubemap_image, 
    EGL_KHR_image_base, EGL_KHR_no_config_context, EGL_KHR_reusable_sync, 
    EGL_KHR_surfaceless_context, EGL_EXT_pixel_format_float, 
    EGL_KHR_wait_sync, EGL_MESA_configless_context, EGL_MESA_drm_image, 
    EGL_MESA_query_driver
EGL_CLIENT_APIS: OpenGL OpenGL_ES 
GL_VERSION: OpenGL ES 3.2 Mesa 20.3.5
GL_RENDERER: llvmpipe (LLVM 11.0.1, 128 bits)
GL_EXTENSIONS:
    GL_EXT_blend_minmax, GL_EXT_multi_draw_arrays, 
    GL_EXT_texture_compression_s3tc, GL_EXT_texture_compression_dxt1, 
    GL_EXT_texture_compression_rgtc, GL_EXT_texture_format_BGRA8888, 
    GL_OES_compressed_ETC1_RGB8_texture, GL_OES_depth24, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, GL_OES_mapbuffer, 
    GL_OES_rgb8_rgba8, GL_OES_standard_derivatives, GL_OES_stencil8, 
    GL_OES_texture_3D, GL_OES_texture_float, GL_OES_texture_float_linear, 
    GL_OES_texture_half_float, GL_OES_texture_half_float_linear, 
    GL_OES_texture_npot, GL_OES_vertex_half_float, GL_EXT_draw_instanced, 
    GL_EXT_texture_sRGB_decode, GL_OES_EGL_image, GL_OES_depth_texture, 
    GL_OES_packed_depth_stencil, GL_EXT_texture_type_2_10_10_10_REV, 
    GL_NV_conditional_render, GL_OES_get_program_binary, 
    GL_APPLE_texture_max_level, GL_EXT_discard_framebuffer, 
    GL_EXT_read_format_bgra, GL_EXT_frag_depth, GL_NV_fbo_color_attachments, 
    GL_OES_EGL_image_external, GL_OES_EGL_sync, GL_OES_vertex_array_object, 
    GL_OES_viewport_array, GL_ANGLE_pack_reverse_row_order, 
    GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
    GL_EXT_occlusion_query_boolean, GL_EXT_robustness, GL_EXT_texture_rg, 
    GL_EXT_unpack_subimage, GL_NV_draw_buffers, GL_NV_read_buffer, 
    GL_NV_read_depth, GL_NV_read_depth_stencil, GL_NV_read_stencil, 
    GL_EXT_draw_buffers, GL_EXT_map_buffer_range, GL_KHR_debug, 
    GL_KHR_robustness, GL_KHR_texture_compression_astc_ldr, 
    GL_NV_pixel_buffer_object, GL_OES_depth_texture_cube_map, 
    GL_OES_required_internalformat, GL_OES_surfaceless_context, 
    GL_EXT_color_buffer_float, GL_EXT_sRGB_write_control, 
    GL_EXT_separate_shader_objects, GL_EXT_shader_group_vote, 
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix, 
    GL_EXT_tessellation_point_size, GL_EXT_tessellation_shader, 
    GL_ANDROID_extension_pack_es31a, GL_EXT_base_instance, 
    GL_EXT_compressed_ETC1_RGB8_sub_texture, GL_EXT_copy_image, 
    GL_EXT_draw_buffers_indexed, GL_EXT_draw_elements_base_vertex, 
    GL_EXT_gpu_shader5, GL_EXT_polygon_offset_clamp, 
    GL_EXT_primitive_bounding_box, GL_EXT_render_snorm, 
    GL_EXT_shader_io_blocks, GL_EXT_texture_border_clamp, 
    GL_EXT_texture_buffer, GL_EXT_texture_cube_map_array, 
    GL_EXT_texture_norm16, GL_EXT_texture_view, 
    GL_KHR_blend_equation_advanced, GL_KHR_context_flush_control, 
    GL_KHR_robust_buffer_access_behavior, GL_NV_image_formats, 
    GL_OES_copy_image, GL_OES_draw_buffers_indexed, 
    GL_OES_draw_elements_base_vertex, GL_OES_gpu_shader5, 
    GL_OES_primitive_bounding_box, GL_OES_sample_shading, 
    GL_OES_sample_variables, GL_OES_shader_io_blocks, 
    GL_OES_shader_multisample_interpolation, GL_OES_tessellation_point_size, 
    GL_OES_tessellation_shader, GL_OES_texture_border_clamp, 
    GL_OES_texture_buffer, GL_OES_texture_cube_map_array, 
    GL_OES_texture_stencil8, GL_OES_texture_storage_multisample_2d_array, 
    GL_OES_texture_view, GL_EXT_blend_func_extended, GL_EXT_buffer_storage, 
    GL_EXT_float_blend, GL_EXT_geometry_point_size, GL_EXT_geometry_shader, 
    GL_KHR_no_error, GL_KHR_texture_compression_astc_sliced_3d, 
    GL_OES_EGL_image_external_essl3, GL_OES_geometry_point_size, 
    GL_OES_geometry_shader, GL_OES_shader_image_atomic, 
    GL_EXT_clip_cull_distance, GL_EXT_disjoint_timer_query, 
    GL_EXT_texture_compression_s3tc_srgb, GL_MESA_shader_integer_functions, 
    GL_EXT_clip_control, GL_EXT_color_buffer_half_float, 
    GL_EXT_texture_compression_bptc, GL_KHR_parallel_shader_compile, 
    GL_EXT_EGL_image_storage, GL_EXT_shader_framebuffer_fetch_non_coherent, 
    GL_EXT_texture_sRGB_R8, GL_EXT_texture_shadow_lod, 
    GL_MESA_framebuffer_flip_y, GL_EXT_depth_clamp, GL_EXT_texture_query_lod

about:support

DMABUF
available by default
failed by runtime: Failed to configure

According to https://github.com/lgsvl/meta-lgsvl-browser/commit/282c2b24b604b7ab88c1904eafb17aff75e9ccac from a year ago, Gbm seems to be broken on Raspberry Pi 4.
The issue is still open: https://github.com/raspberrypi/linux/issues/3411


First Google result for "V3D EGL_MESA_device_software" is this commit: https://gitlab.freedesktop.org/mesa/mesa/-/commit/08a51770bd1b39262003a14850d416df04d13ac7

$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Broadcom (0x14e4)
    Device: V3D 4.2 (0xffffffff)
    Version: 20.3.5
    Accelerated: yes
    Video memory: 7812MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 20.3.5
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
LIBGL_ALWAYS_SOFTWARE=1 glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa/X.org (0xffffffff)
    Device: llvmpipe (LLVM 11.0.1, 128 bits) (0xffffffff)
    Version: 20.3.5
    Accelerated: no
    Video memory: 7812MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 11.0.1, 128 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.3.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 20.3.5
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

MOZ_LOG="Dmabuf:5" ./firefox
[Parent 8166: Main Thread]: D/Dmabuf nsDMABufDevice::Configure()
[Parent 8166: Main Thread]: D/Dmabuf Loading DMABuf system library libgbm.so.1 ...
[Parent 8166: Main Thread]: D/Dmabuf Failed: We're missing DRM render device!

(Icenowy Zheng from bug 1721053 comment 4)

It's a GPU w/o display capability, and use DRM PRIME to output to another display-only DRM device.

In this case, there is /dev/dri/card[01], card0 being the display-only device and card1 being the renderonly device; renderD128 is bound to card1, but when doing DRI it's still using /dev/dri/card0 (Mesa will notice that it's a display-only device and try to probe renderonly device, and thus open renderD128)

My Macbook has card0 and renderD128, but the Raspberry Pi 4 additionally has a card1.

$ ls -l /dev/dri
total 0
drwxr-xr-x  2 root root        100 Oct 31 15:18 by-path
crw-rw----+ 1 root video  226,   0 Oct 31 15:18 card0
crw-rw----+ 1 root video  226,   1 Oct 31 15:18 card1
crw-rw----+ 1 root render 226, 128 Oct 31 15:18 renderD128

Thanks, things start to make sense to me.

(In reply to Darkspirit from comment #0)

...

  • It should be "mesa/v3d".

Per comment 2 and the linked Mesa MR (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9697) it makes sense that we detect software rendering here. So this requires more recent Mesa to get fixed. It would, however, probably make sense to explicitly check for EGL_MESA_device_software to not accidentally detect software rendering. Will create a patch for that.

  • Failing at OGL3.2 might made it think it's using software gl although GLES is hardware.

I don't think so. The context creation happens long after our hardware detection in glxtest. With bug 1644606 in place we could, however, make these targets (e.g. ARM builds) prefer GLES over GL to avoid the noise of the warnings.

  • Let Wayland and X11 behave the same: Enable X11_EGL by default for this driver (Mesa baseline == Mesa 10). It enables WebGL2 support.

Looks like this won't work, see above.

  • (Enabling WebRender depends on fixing the PBO problem. HW WR performs better than SW WR.)

So you did confirm that disabling gfx.webrender.pbo-uploads fixes the issues? And are the glitches you are seeing the same like the ones reported in https://gitlab.freedesktop.org/mesa/mesa/-/issues/4620? If so, that's likely a good hint for the Mesa devs.
I don't see Android blocking that feature on any devices, which too me sounds like it should work.

(In reply to Darkspirit from comment #6)

...
My Macbook has card0 and renderD128, but the Raspberry Pi 4 additionally has a card1.

Yes, the Pi is a "split render/display SoC" and has a kms read only device. This will likely be an issue for DMABUF detection (bug 1730936), because our normal detection likely doesn't work there and the new extension for it (EGL_EXT_device_drm_render_node) does not yet get exposed on such devices, at least not in the original MR (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11797). But that's again not our job and should be fixed by Mesa going forward.

(In reply to Robert Mader [:rmader] from comment #7)

  • It should be "mesa/v3d".

Per comment 2 and the linked Mesa MR (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9697) it makes sense that we detect software rendering here. So this requires more recent Mesa to get fixed. It would, however, probably make sense to explicitly check for EGL_MESA_device_software to not accidentally detect software rendering. Will create a patch for that.

Yes, that's what I meant with recognize "mesa/v3d": There needs to be a rule that Firefox doesn't classify v3d (GL_RENDERER: V3D 4.2) as software GL.
EGL_MESA_device_software is shown for V3D although hardware GL is definitely used.
LIBGL_ALWAYS_SOFTWARE=1 is incredible slow in comparison.

WR/v3d (smoother scrolling) > SW WR > WR/llvmpipe

With bug 1644606 in place we could, however, make these targets (e.g. ARM builds) prefer GLES over GL to avoid the noise of the warnings.

Nice to have, but not required. The warning is no problem.

  • Let Wayland and X11 behave the same: Enable X11_EGL by default for this driver (Mesa baseline == Mesa 10). It enables WebGL2 support.

Looks like this won't work, see above.

I don't understand, why would this not work? I'm using it.
GLX is OGL2.1, that's WebGL 1-only.
Wayland would already try to use WebGL/EGL/Mesa with Mesa >= 10. https://searchfox.org/mozilla-central/rev/d21e359bd26dd0a7ba216472184d6fed8f0afd48/widget/gtk/GfxInfo.cpp#649

  • To have the same on Wayland and X11, I assume such a rule would be needed:

    APPEND_TO_DRIVER_BLOCKLIST_EXT(
        OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
        DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaV3d, // <----
        DeviceFamily::All, nsIGfxInfo::FEATURE_X11_EGL,
        nsIGfxInfo::FEATURE_ALLOW_ALWAYS, DRIVER_GREATER_THAN_OR_EQUAL,
        V(10, 0, 0, 0), "FEATURE_ROLLOUT_X11_EGL_MESA_V3D", "Mesa 10.0.0.0");
    
  • Or we lower minimum required EGL/Mesa version for all users to 20 as a next step. That seems easier and better. It's fine on Debian oldstable: bug 1730768 comment 6.

  • (Enabling WebRender depends on fixing the PBO problem. HW WR performs better than SW WR.)

So you did confirm that disabling gfx.webrender.pbo-uploads fixes the issues?
And are the glitches you are seeing the same like the ones reported in https://gitlab.freedesktop.org/mesa/mesa/-/issues/4620?
I don't see Android blocking that feature on any devices, which too me sounds like it should work.

Yes. I assume the problem lies in an aspect of it.
It looks far worse for me: bug 1738816
There are some specific config rules, there is even a rule for Android Mesa:
https://searchfox.org/mozilla-central/rev/d21e359bd26dd0a7ba216472184d6fed8f0afd48/gfx/wr/webrender/src/device/gl.rs#1655-1718

I don't understand, why would this not work? I'm using it.

The thing is that older Mesa versions explicitly mark this driver as a software one by exposing EGL_MESA_device_software. This is an external bug that I personally wouldn't want to work around with special rules if instead distros can just update their Mesa version (or backport the fix). That's the job of distro maintainers.

Do you think you could install a recent Mesa version on your device, ideally directly from git? It would be great to know how the current status of the driver looks like, not that of a year ago (also regarding the PBO bug).

Severity: -- → S3

Gnome X11 / Raspberry Pi OS 64-bit (Debian Stable + rpi repo) + Mesa 21.2.6 from Debian Testing also needs gfx.webrender.pbo-uploads:false for HW WR.
(Next step will be trying out 21.3.0~rc5-1 from Debian experimental.)

The device is still detected as "mesa/software-unknown" / FEATURE_FAILURE_SOFTWARE_GL.
gfx.webrender.reject-software-driver:false does not help, it is the second of two blocking mechanisms.

bug 1736267 comment 5 caused FEATURE_FAILURE_OPENGL_LESS_THAN_3.
gfx.egl.prefer-gles.enabled:true does not help.

"gfx.blacklist.webrender.failureid": "FEATURE_FAILURE_OPENGL_LESS_THAN_3",
"gfx.blacklist.layers.opengl.failureid": "FEATURE_FAILURE_SOFTWARE_GL",
"gfx.blacklist.layers.opengl": 4,
"gfx.blacklist.webrender": 4,
"gfx.egl.prefer-gles.enabled": true,
"gfx.webrender.reject-software-driver": false,

"windowLayerManagerType": "WebRender (Software)",
"adapterDescription": "V3D 4.2",
"driverVendor": "mesa/software-unknown",
"windowProtocol": "x11",
"desktopEnvironment": "gnome",

"webgl2Version": "OpenGL ES 3.1 Mesa 21.2.6",

"name": "WEBRENDER_QUALIFIED",
"message": "No qualified hardware"

No changes with Mesa 21.3.0-rc5

  • Detected as software
  • FEATURE_FAILURE_OPENGL_LESS_THAN_3
  • gfx.webrender.pbo-uploads:false required for HW WR correctness

Does running with MESA_GL_VERSION_OVERRIDE=3.0 bypass the FEATURE_FAILURE_OPENGL_LESS_THAN_3 issue? Looks like d3d is the only mesa driver exposing GLES 3 but not GL 3.0.
I'm slightly unsure if it's worth to fix that check as long as the state of that driver is so bad. OTOH we should make it as easy as possible for driver devs to work on it.

As for the software part: will look into that now.

Keywords: leave-open

Mesa explicitly advertises the EGL_MESA_device_software extension
when appropriate. Only ever set MESA_ACCELERATED when that is the
case to avoid confusion around edge-cases and driver bugs.

Assignee: nobody → robert.mader
Status: NEW → ASSIGNED

We have a custom render node discovery code (needed for DMABUF) that
predates the EGL_DRM_RENDER_NODE_FILE_EXT extension. It has additional
value that it helps us discover the right vendor and device ID on
multi-GPU setups (there's a EGL extension far that backing, but
not ready yet).
In case our custom code fails - notably split display/render SoCs,
which are common in the ARM world - lets use
EGL_DRM_RENDER_NODE_FILE_EXT as fallback. This will ensure we
get a valid render node path on all devices, assuming the driver
supports that extension right. These SoCs are usually no multi-GPU
systems. If they are, we still don't get the right IDs - but an
extension for that is in the making.

Note: Mesa does not implement this right for such SoCs, i.e. it
will fail just as our own custom code. However, there's a MR in
review - once it lands, things should start working, see
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12796

Depends on D134254

Comment on attachment 9256229 [details]
Bug 1738814 - Use EGL_DRM_RENDER_NODE_FILE_EXT in glxtest, r=#gfx-reviewers

Revision D134322 was moved to bug 1730936. Setting attachment 9256229 [details] to obsolete.

Attachment #9256229 - Attachment is obsolete: true
See Also: → 1730936
Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/084688f0cf60
Only set MESA_ACCELERATED when explicitly advertised by Mesa, r=gfx-reviewers,jrmuizel

Raspberry Pi4, Debian Bullseye (stable)

Edit: This is with Mesa 21.3.0 (old package from debian experimental) from comment 11.

New since comment 2:

  • previously: EGL_MESA_device_software
    now: EGL_EXT_device_drm
  • previously: missing extension
    now: EGL_DRM_DEVICE_FILE_EXT: /dev/dri/renderD128
    Vendor ID:0x3120
    Device ID:0x16ff
./test

0x3000 clientExtensions (EGL_EXTENSIONS for EGL_NO_DISPLAY): EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless

clientExtensions: EGL_KHR_client_get_all_proc_addresses supported
clientExtensions: EGL_EXT_platform_base supported
clientExtensions: EGL_KHR_platform_x11 supported
0x3000 eglGetPlatformDisplay
0x3000 eglInitialize ok
0x3000 EGL_VENDOR: Mesa Project

0x3000 displayExtensions (EGL_EXTENSIONS for initialized display): EGL_ANDROID_blob_cache EGL_CHROMIUM_sync_control EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_swap_buffers_with_damage EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap 

clientExtensions: EGL_EXT_device_query supported
0x3000 eglGetProcAddress(eglQueryDisplayAttribEXT)
0x3000 eglGetProcAddress(eglQueryDeviceStringEXT)
0x3000 device: eglQueryDisplayAttribEXT EGL_DEVICE_EXT ok

0x3000 deviceExtensions (EGL_EXTENSIONS for device): EGL_EXT_device_drm

deviceExtensions: nvidia EGL_EXT_device_query_name not supported
deviceExtensions: EXT_device_drm supported
0x3000 EGL_DRM_DEVICE_FILE_EXT: /dev/dri/renderD128
Vendor ID:0x3120
Device ID:0x16ff

Oh, previous comment was with Mesa 21.3.0 (old package from debian experimental) from comment 11.
There is still no official bookworm/testing on https://archive.raspberrypi.org/debian/dists/.

Now I downgraded to official mesa 20.3.5-1+rpt4+rpi1 (stable).

  • It still has EGL_MESA_device_software.
  • mesa/software-unknown on about:support.
./test

0x3000 clientExtensions (EGL_EXTENSIONS for EGL_NO_DISPLAY): EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless

clientExtensions: EGL_KHR_client_get_all_proc_addresses supported
clientExtensions: EGL_EXT_platform_base supported
clientExtensions: EGL_KHR_platform_x11 supported
0x3000 eglGetPlatformDisplay
0x3000 eglInitialize ok
0x3000 EGL_VENDOR: Mesa Project

0x3000 displayExtensions (EGL_EXTENSIONS for initialized display): EGL_ANDROID_blob_cache EGL_CHROMIUM_sync_control EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_swap_buffers_with_damage EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap 

clientExtensions: EGL_EXT_device_query supported
0x3000 eglGetProcAddress(eglQueryDisplayAttribEXT)
0x3000 eglGetProcAddress(eglQueryDeviceStringEXT)
0x3000 device: eglQueryDisplayAttribEXT EGL_DEVICE_EXT ok

0x3000 deviceExtensions (EGL_EXTENSIONS for device): EGL_MESA_device_software

deviceExtensions: nvidia EGL_EXT_device_query_name not supported
deviceExtensions: EXT_device_drm not supported, ignoring
0x3000 EGL_DRM_DEVICE_FILE_EXT: /dev/dri/renderD128
Vendor ID:0xb850
Device ID:0x31b0

Jan, can I ask you to test latest nightly on bookworm/with Mesa 22.2.0~rc1? It should work in most regards now - but it would be great to have an about:support. And important to know if there are still rendering issues with HW-WR. Right now after bug 1783924 HW-WR is shipping to release, but we might want to block it a bit longer on v3d.

https://treeherder.mozilla.org/jobs?repo=try&revision=5ada11f4a0b7b20fdcd5b6ab9b9befa808026325

Flags: needinfo?(jan)

Raspberry Pi OS (Debian bullseye) + apt install -t testing libegl-mesa0 --no-install-recommends from bookworm:

  • SW WR is default because of FEATURE_FAILURE_OPENGL_LESS_THAN_3
  • No UI glitches with gfx.webrender.all=true. But YouTube VP9&H264 video color glitches with gfx.webrender.pbo-uploads=true&false.
Flags: needinfo?(jan)
See Also: → 1784327

SW WR is default because of FEATURE_FAILURE_OPENGL_LESS_THAN_3

That plus the annoying warning about failed context creation should be possible to fix by choosing GLES first by default. Will create a patch for that.

Not fixed with try build from bug 1784453 comment 8 and a fresh profile.
gfx.egl.prefer-gles.enabled is true by default, but:

"gfx.blacklist.webrender.failureid": "FEATURE_FAILURE_OPENGL_LESS_THAN_3",
"gfx.blacklist.webrender": 4,

"windowLayerManagerType": "WebRender (Software)",

"status": "blocklisted",
"message": "No qualified hardware"

And fall back to a 2.x context otherwise.

Most drivers will create a 3.x/4.x context when setting the major
version to 2, however in cases where that's not supported we need to
actively ask for 3.0 in order to determine up-front that HW-WR is not
supported. We do so in order to avoid flodding users with such hardware
with error messages (or to have every device ID in the database,
alternatively).

We don't need to care about 1.x as we actively disable all GL
functionality in that case.

(In reply to Robert Mader [:rmader] from comment #26)

The patch above should fix that, can you give it a try? https://treeherder.mozilla.org/jobs?repo=try&revision=8b5a20bac9dad2364f6d715b9c1500b4514412d5

Still FEATURE_FAILURE_OPENGL_LESS_THAN_3 and SW WR on Gnome Xorg and Gnome Wayland. Tested with fresh profiles.

 ./firefox -P
[GFX1-]: No GPUs detected via PCI
[GFX1-]: No GPUs detected via PCI
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.

(In reply to Darkspirit from comment #27)

Still FEATURE_FAILURE_OPENGL_LESS_THAN_3 and SW WR on Gnome Xorg and Gnome Wayland. Tested with fresh profiles.

Wild - now I'm more and more confused. Could you run https://treeherder.mozilla.org/jobs?repo=try&revision=81ced8e6fd393ce4fc0ab2bc9afacb78f96545cf and post which terminal output you get right at the beginning, the line starting with get_gles_status?

(In reply to Robert Mader [:rmader] from comment #28)

post which terminal output you get right at the beginning, the line starting with get_gles_status?

get_gles_status versionString: 2.1 Mesa 22.2.0-rc1

vs. es2_info from package mesa-utils-extra:

$ es2_info
EGL_VERSION: 1.4
EGL_VENDOR: Mesa Project
EGL_EXTENSIONS:
    EGL_ANDROID_blob_cache, EGL_CHROMIUM_sync_control, EGL_EXT_buffer_age, 
    EGL_EXT_image_dma_buf_import, EGL_EXT_image_dma_buf_import_modifiers, 
    EGL_EXT_swap_buffers_with_damage, EGL_KHR_cl_event2, 
    EGL_KHR_config_attribs, EGL_KHR_context_flush_control, 
    EGL_KHR_create_context, EGL_KHR_create_context_no_error, 
    EGL_KHR_fence_sync, EGL_KHR_get_all_proc_addresses, EGL_KHR_gl_colorspace, 
    EGL_KHR_gl_renderbuffer_image, EGL_KHR_gl_texture_2D_image, 
    EGL_KHR_gl_texture_3D_image, EGL_KHR_gl_texture_cubemap_image, 
    EGL_KHR_image, EGL_KHR_image_base, EGL_KHR_image_pixmap, 
    EGL_KHR_no_config_context, EGL_KHR_reusable_sync, 
    EGL_KHR_surfaceless_context, EGL_KHR_swap_buffers_with_damage, 
    EGL_EXT_pixel_format_float, EGL_KHR_wait_sync, 
    EGL_MESA_configless_context, EGL_MESA_drm_image, 
    EGL_MESA_image_dma_buf_export, EGL_MESA_query_driver, 
    EGL_NOK_texture_from_pixmap
EGL_CLIENT_APIS: OpenGL OpenGL_ES 
GL_VERSION: OpenGL ES 3.1 Mesa 22.2.0-rc1
GL_RENDERER: V3D 4.2
GL_EXTENSIONS:
    GL_EXT_blend_minmax, GL_EXT_multi_draw_arrays, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_compression_s3tc, 
    GL_EXT_texture_compression_dxt1, GL_EXT_texture_format_BGRA8888, 
    GL_OES_compressed_ETC1_RGB8_texture, GL_OES_depth24, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, GL_OES_mapbuffer, 
    GL_OES_rgb8_rgba8, GL_OES_standard_derivatives, GL_OES_stencil8, 
    GL_OES_texture_3D, GL_OES_texture_float, GL_OES_texture_half_float, 
    GL_OES_texture_half_float_linear, GL_OES_texture_npot, 
    GL_OES_vertex_half_float, GL_EXT_draw_instanced, 
    GL_EXT_texture_sRGB_decode, GL_OES_EGL_image, GL_OES_depth_texture, 
    GL_AMD_performance_monitor, GL_OES_packed_depth_stencil, 
    GL_EXT_texture_type_2_10_10_10_REV, GL_OES_get_program_binary, 
    GL_APPLE_texture_max_level, GL_EXT_discard_framebuffer, 
    GL_EXT_read_format_bgra, GL_NV_pack_subimage, GL_EXT_frag_depth, 
    GL_NV_fbo_color_attachments, GL_OES_EGL_image_external, GL_OES_EGL_sync, 
    GL_OES_vertex_array_object, GL_ANGLE_pack_reverse_row_order, 
    GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, 
    GL_EXT_occlusion_query_boolean, GL_EXT_texture_rg, GL_EXT_unpack_subimage, 
    GL_NV_draw_buffers, GL_NV_read_buffer, GL_NV_read_depth, 
    GL_NV_read_depth_stencil, GL_NV_read_stencil, GL_EXT_draw_buffers, 
    GL_EXT_map_buffer_range, GL_KHR_debug, 
    GL_KHR_texture_compression_astc_ldr, GL_NV_pixel_buffer_object, 
    GL_OES_depth_texture_cube_map, GL_OES_required_internalformat, 
    GL_OES_surfaceless_context, GL_EXT_color_buffer_float, 
    GL_EXT_sRGB_write_control, GL_EXT_separate_shader_objects, 
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix, 
    GL_EXT_base_instance, GL_EXT_compressed_ETC1_RGB8_sub_texture, 
    GL_EXT_copy_image, GL_EXT_draw_buffers_indexed, 
    GL_EXT_draw_elements_base_vertex, GL_EXT_polygon_offset_clamp, 
    GL_EXT_primitive_bounding_box, GL_EXT_shader_io_blocks, 
    GL_EXT_texture_border_clamp, GL_EXT_texture_view, 
    GL_KHR_context_flush_control, GL_NV_image_formats, GL_OES_copy_image, 
    GL_OES_draw_buffers_indexed, GL_OES_draw_elements_base_vertex, 
    GL_OES_primitive_bounding_box, GL_OES_shader_io_blocks, 
    GL_OES_texture_border_clamp, GL_OES_texture_stencil8, 
    GL_OES_texture_storage_multisample_2d_array, GL_OES_texture_view, 
    GL_EXT_buffer_storage, GL_EXT_float_blend, GL_EXT_geometry_point_size, 
    GL_EXT_geometry_shader, GL_KHR_no_error, 
    GL_KHR_texture_compression_astc_sliced_3d, GL_OES_EGL_image_external_essl3, 
    GL_OES_geometry_point_size, GL_OES_geometry_shader, 
    GL_OES_shader_image_atomic, GL_EXT_texture_compression_s3tc_srgb, 
    GL_MESA_shader_integer_functions, GL_EXT_texture_mirror_clamp_to_edge, 
    GL_KHR_parallel_shader_compile, GL_EXT_EGL_image_storage, 
    GL_MESA_framebuffer_flip_y, GL_EXT_texture_query_lod, GL_MESA_bgra

(In reply to Darkspirit from bug 1784777 comment #9)

Don't hesitate to add printfs everywhere and I'll post the output.

Lovely, thanks! :)

How is this one? https://treeherder.mozilla.org/jobs?repo=try&revision=358186dc886fae744b52e12619ad9f1ce9b1808f

(In reply to Robert Mader [:rmader] from comment #31)

How is this one? https://treeherder.mozilla.org/jobs?repo=try&revision=358186dc886fae744b52e12619ad9f1ce9b1808f

(I am on Gnome Xorg.)

$ ./firefox -P
get_gles_status useGles: 0
get_gles_status versionString: 2.1 Mesa 22.2.0-rc1
[GFX1-]: No GPUs detected via PCI
ATTENTION: default value of option mesa_glthread overridden by environment.

get_gles_status useGles: 0

Ouch, ok, that explains what's up...

https://searchfox.org/mozilla-central/search?q=MOZ_AARCH64&path=&case=false&regexp=false
It's set to true in generate_static_pref_list.py, so it might only be true in StaticPrefList.yaml.

__aarch64__ is used at least on Mac:
https://searchfox.org/mozilla-central/search?q=__aarch64__&path=&case=false&regexp=false

This mentions Linux:
https://searchfox.org/mozilla-central/rev/4ab01781c4191ffc3bf52ceaca2a2d5c762de5fd/mozglue/baseprofiler/core/PlatformMacros.h#79

#elif defined(__linux__) && defined(__aarch64__)

This works: HW WR is enabled by default. :)

$ ./firefox -P
get_gles_status useGles: 1
get_gles_status versionString: OpenGL ES 3.1 Mesa 22.2.0-rc1
Attachment #9289809 - Attachment description: Bug 1738814 - Explicitly ask for >= 3.x GL(ES) context in glxtest, r=#gfx-reviewers → Bug 1738814 - Fixes for GLES context creation in glxtest, r=#gfx-reviewers
Keywords: leave-open
Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/c1245a74819a
Fixes for GLES context creation in glxtest, r=gfx-reviewers,jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: