New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 778264 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Chromium 61: fails to load arm native Mali EGL/GLES and uses ANGLE with GLX instead

Reported by kiagiada...@gmail.com, Oct 25 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0

Steps to reproduce the problem:
This is a bug that was discovered on an ARM Meson8 board, which features a Mali 450 GPU, running EndlessOS. Upon upgrading to chromium 61, we noticed that hardware video acceleration was broken:

1. Open any youtube video
2. Notice the unbearably slow playback, as well as an error message on stderr saying:

[1288:1288:1012/112259.113580:ERROR:v4l2_video_decode_accelerator.cc(244)] : Initialize(): context does not have EGL_KHR_fence_sync

What is the expected behavior?

What went wrong?
The platform on which this issue was observed runs a linux desktop environment based on X11. Therefore, chromium is being compiled with X11 support. However, the GLX implementation is provided by Mesa and is not hw accelerated, so one needs to use EGL/GLES provided by the SoC vendor to get proper hw acceleration.

The issue in this case is that chromium, although it is trying to use EGL, it loads the wrong EGL implementation (it loads ANGLE, which uses GLX as a backend, instead of loading the Mali EGL/GLES libraries from the system)

There is a function called InitializeStaticEGLInternal() in ui/gl/init/gl_initializer_x11.cc that is responsible for dlopen()ing the EGL and GLES libraries, when it has been determined that EGL/GLES is to be used. Before chromium 61, this function was testing whether it should load the internal ANGLE implementation with a check that looked like:

if (use_gl == kGLImplementationANGLEName) {

This used to fail and therefore the code would fall back to loading the system "libEGL.so.1" and "libGLESv2.so.2" instead of the ANGLE implementations.

In chromium 61 this code has been reworked and reads:

  // initializes variables to point to the system implementation
  base::FilePath glesv2_path(kGLESv2LibraryName);
  base::FilePath egl_path(kEGLLibraryName);

  if (implementation == kGLImplementationSwiftShaderGL) {
    // ...
    glesv2_path = module_path.Append(kGLESv2SwiftShaderLibraryName);
    egl_path = module_path.Append(kEGLSwiftShaderLibraryName);
  } else {
    // ...
    glesv2_path = module_path.Append(kGLESv2ANGLELibraryName);
    egl_path = module_path.Append(kEGLANGLELibraryName);
  }

With this code it is now impossible for the system implementation to be loaded, as the code will always load ANGLE.

I have created a patch that aggressively disables loading ANGLE on ARM (attached), however I understand that this is a hack and cannot be upstreamed like this. I would very much like your input on how to approach this in a way that it can be upstreamed.

Did this work before? Yes 60

Chrome version: 61.0.3163.79 (Developer Build)  Channel: n/a
OS Version: Endless 3.4.0
Flash Version: N/A
 
0001-Fix-loading-of-the-vendor-EGL-GLES-stack-on-ARM.patch
1.9 KB Download

Comment 1 by ajha@chromium.org, Oct 26 2017

Cc: wuchengli@chromium.org
Components: Internals>GPU>Video
Labels: Needs-Triage-M61
The particular OS is not available to test and confirm the behavior, hence adding proper component for someone from the respective team to take a look at this.
Cc: kcwu@chromium.org posciak@chromium.org

Comment 3 by danakj@chromium.org, Oct 27 2017

Cc: kbr@chromium.org
Owner: sugoi@chromium.org
Status: Assigned (was: Unconfirmed)
This is the CL that broke your config: https://chromium-review.googlesource.com/c/chromium/src/+/517912

sugoi/kbr, any feedback on how they can resolve this without regressing tests?

Comment 4 by sugoi@chromium.org, Oct 27 2017

This has already been fixed here:
https://chromium-review.googlesource.com/c/chromium/src/+/690074
Thank you for the quick response! Indeed, it looks like the patch in https://chromium-review.googlesource.com/c/chromium/src/+/690074 addresses this issue. This ticket can be closed.

Comment 6 by sugoi@chromium.org, Oct 30 2017

Status: Fixed (was: Assigned)

Sign in to add a comment