Closed Bug 1702463 Opened 3 years ago Closed 3 years ago

glxtest should try choosing both single and double buffered visuals

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox88 --- fixed
firefox89 --- fixed

People

(Reporter: simo.melenius+firefox, Assigned: rmader)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

Running Firefox under PRIME render offload on a system with no EGL available/configured might fail the GL detection in toolkit/xre/glxtest.cpp and leave WebGL unavailable for the end-user.

Actual results:

When running Firefox as a render offload client the glxtest.cpp can fail to detect GL properly because single-buffered visuals might not be available (render offload visuals can differ from the larger set of visuals of the primary desktop). The attributes passed in for glXChooseVisual() in get_glx_status() will only match single-buffered visuals.

Expected results:

At the glxtest stage it shouldn't matter which buffering the visual comes with as its purpose is to find a valid GL implementation for WebGL. If it also checked ChooseVisual() with GLX_DOUBLEBUFFER it would find a GLX implementation behind render offload, too. The actual WebGL initialization works correctly regardless of the pre-test in glxtest.cpp.

Flags: needinfo?(robert.mader)

I'm confused - according to the docs (1) the default value for GLX_DOUBLEBUFFER is GLX_DONT_CARE - and we don't specify GLX_DOUBLEBUFFER:false anywhere. Do I miss something? Is this simply a driver bug maybe?

1: https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXChooseFBConfig.xml

Flags: needinfo?(robert.mader)

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

I'm confused - according to the docs (1) the default value for GLX_DOUBLEBUFFER is GLX_DONT_CARE - and we don't specify GLX_DOUBLEBUFFER:false anywhere. Do I miss something? Is this simply a driver bug maybe?

1: https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXChooseFBConfig.xml

It's the glXChooseVisual() that fails on https://searchfox.org/mozilla-central/source/toolkit/xre/glxtest.cpp#718. From https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXChooseVisual.xml:

GLX_DOUBLEBUFFER

If present, only double-buffered visuals are considered. Otherwise, only single-buffered visuals are considered.

glXChooseVisual requires us to choose whether we want single or
double buffered visuals. We don't care here, so check for both
cases.

Assignee: nobody → robert.mader

Simo: the patch above should fix the issue - can you try the following build once it's ready?

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

If you don't know how to run download it, I can post a direct link once its build.

Edit: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Ma9jnKOJTuyN2FUcaAhNEg/runs/0/artifacts/public/build/target.tar.bz2

Flags: needinfo?(simo.melenius+firefox)

Thanks for the direct download link. I set up PRIME render offload and tested that a vanilla version of Firefox fails to enable webgl. Then I tested your build and it does correctly identify my NVIDIA GL that I've configured to be the render offload source. Both browsers correctly enable webgl with MESA drivers when I run them without PRIME render offload. So, this fixes it. Thanks!

The patch looks good, too.

Flags: needinfo?(simo.melenius+firefox)
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/c1b8b60b2e52
Also check for double buffered visual in glxtest, r=aosmond
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch

Comment on attachment 9213076 [details]
Bug 1702463 - Also check for double buffered visual in glxtest, r=aosmond

Beta/Release Uplift Approval Request

  • User impact if declined: A small set of dri prime nvidia users won't have WebGL support. They don't get WR, so normal browsing is not affected.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This patch introduces a fallback path. All users who currently have working WebGL/WR do not hit it, so only quite broken setups are affected.
  • String changes made/needed:
Attachment #9213076 - Flags: approval-mozilla-beta?

Comment on attachment 9213076 [details]
Bug 1702463 - Also check for double buffered visual in glxtest, r=aosmond

Approved for 88.0b7.

Attachment #9213076 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: