Last Comment Bug 678053 - Blacklist WebGL on some cards on Mac, like Chrome does
: Blacklist WebGL on some cards on Mac, like Chrome does
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: All Mac OS X
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on: 678330
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-10 14:17 PDT by Benoit Jacob [:bjacob] (mostly away)
Modified: 2011-08-11 18:02 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
blacklist geforce <= 7 for WebGL on Mac (1.20 KB, patch)
2011-08-11 13:07 PDT, Benoit Jacob [:bjacob] (mostly away)
jmuizelaar: review+
Details | Diff | Review

Description Benoit Jacob [:bjacob] (mostly away) 2011-08-10 14:17:08 PDT
See for example this crash:

https://crash-stats.mozilla.com/report/index/1bdd501b-cf53-4815-8aa8-bcae42110707

It's on a Geforce 7300 GT. Chrome already blacklists this card and now it seems we have to do the same. Here's their blacklist:

http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/resources/software_rendering_list.json

We need to borrow the no-WebGL-on-certain-cards-on-Mac rules.

Now the problem is that our current Mac blacklist is based on CGL Renderer IDs which only give a very rough approximation of what the GPU is. For example it doesn't allow to distinguish between Geforce FX, 6 and 7, let alone distinguish models within these Geforce series.

So what we need is to figure if there's a way to get precise device identification without creating a OpenGL context: does CGL allow that?

If not, as a last ditch solution, we can do the check post-GL-context-creation, by using glGetString(GL_RENDERER). Then that would no longer be done in GfxInfo, instead that would go in GLContext initialization. But really try hard to avoid that. For speed and safety reasons it's better to implement the blacklisting before GL context creation.
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2011-08-10 14:26:58 PDT
One thing that we can do easily is block WebGL on all the kCGLRendererGeForceFXID family on Macs. This seems to include all Geforce FX/6/7 series. At least the crash link above was with this ID (see the Renderers: 0x22400 and the above CGL documentation page). So this would fix this crash, at the expense of disabling WebGL on more macs than necessary. Then again, Geforce 7 cards are old, and I don't know if it's a big deal to disable WebGL on Macs with old cards especially as we disable it on Mac OS 10.5 already. So, if this crash is a big deal (I have no idea) we can just do that.
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2011-08-10 14:27:35 PDT
Mo: I'd be interested to know how you detect precise devices on Mac? Does CGL allow that?
Comment 3 Zhenyao Mo 2011-08-10 14:47:16 PDT
We use IOKit to scan for PCI-based GPUs.

See http://src.chromium.org/viewvc/chrome/trunk/src/content/gpu/gpu_info_collector_mac.mm?view=markup
Comment 4 Benoit Jacob [:bjacob] (mostly away) 2011-08-10 14:57:04 PDT
Ah! Thanks for the tip.
Comment 5 Benoit Jacob [:bjacob] (mostly away) 2011-08-11 12:54:56 PDT
Filed bug 678330 about implementing the right IOKit-based solution like Chrome.

Meanwhile let's do as explained in comment 1 to be safe for now. It will only affect people who have 5+ years old hardware with Mac OS 10.6, which shouldn't be too many people anyways.
Comment 6 Benoit Jacob [:bjacob] (mostly away) 2011-08-11 13:07:25 PDT
Created attachment 552480 [details] [diff] [review]
blacklist geforce <= 7 for WebGL on Mac

Notice we were already blacklisting them for GL layers, as we couldn' distinguish the FX from the 6/7 series and the FX used software fallbacks. We've been needing bug 678330 for a long time.
Comment 7 Benoit Jacob [:bjacob] (mostly away) 2011-08-11 15:19:46 PDT
http://hg.mozilla.org/mozilla-central/rev/cffe69e9357e

Note You need to log in before you can comment on or make changes to this bug.