Last Comment Bug 707722 - Flickering and rendering artifacts with OpenGL layers on Intel SandyBridge (Linux)
: Flickering and rendering artifacts with OpenGL layers on Intel SandyBridge (L...
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Linux
: -- minor with 4 votes (vote)
: mozilla17
Assigned To: Karl Tomlinson (:karlt)
:
:
Mentors:
: 669983 778005 778013 (view as bug list)
Depends on: 779786 780059
Blocks: ogl-linux-beta
  Show dependency treegraph
 
Reported: 2011-12-05 09:14 PST by Robert Kaiser
Modified: 2012-12-17 20:38 PST (History)
17 users (show)
karlt: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Screenshot 1: Scrolling (285.40 KB, image/png)
2011-12-05 09:18 PST, Robert Kaiser
no flags Details
Screenshot 2: Bringing work space into view (272.56 KB, image/png)
2011-12-05 09:25 PST, Robert Kaiser
no flags Details
select config in CreatePixmap to match Pixmap format (4.04 KB, patch)
2012-07-25 00:46 PDT, Karl Tomlinson (:karlt)
matt.woodrow: review+
Details | Diff | Splinter Review

Description Robert Kaiser 2011-12-05 09:14:39 PST
This may be similar to or the same as bug 687831, but the info there is not enough for me to determine that.

I used layers.acceleration.force-enabled=true to turn on OpenGL layers on my current Nightly build, and I get flickering of apparently most or all areas that are redrawn at any stage, and I get some interesting rendering artifacts of which I'll attach screen shots.

This is an openSUSE Factory (right now roughly equivalent with the just-released openSUSE 12.1) system with Intel SandyBridge (i7-2600K) graphics, here's some info on what I'm running:

> uname -a
Linux robert 3.1.0-2-desktop #1 SMP PREEMPT Thu Nov 3 14:45:45 UTC 2011 (187dde0) x86_64 x86_64 x86_64 GNU/Linux


about:support (Excerpt):

  Application Basics

        Name
        Firefox

        Version
        11.0a1

        User Agent
        Mozilla/5.0 (X11; Linux x86_64; rv:11.0a1) Gecko/20111204 Firefox/11.0a1

[...]

  Graphics

        Adapter Description
        Tungsten Graphics, Inc -- Mesa DRI Intel(R) Sandybridge Desktop

        Driver Version
        2.1 Mesa 7.11.1

        WebGL Renderer
        Tungsten Graphics, Inc -- Mesa DRI Intel(R) Sandybridge Desktop  -- 2.1 Mesa 7.11.1

        GPU Accelerated Windows
        4/4 OpenGL
Comment 1 Robert Kaiser 2011-12-05 09:18:51 PST
Created attachment 579087 [details]
Screenshot 1: Scrolling

In this first screenshot, I scrolled a website one step down, so look for the artifacts at the bottom of the screen. when I move the mouse over the image, the whole artifact "line" disappears and things are normal again.
Comment 2 Robert Kaiser 2011-12-05 09:25:18 PST
Created attachment 579090 [details]
Screenshot 2: Bringing work space into view

The second screenshot was taken immediately after taking the first screenshot, going back to GIMP (on a different virtual desktop), telling it to take another screenshot, and switching back to the virtual desktop with Nightly on it. See that the artifact from scrolling before is gone, but now the toolbars at the top are mostly black. When I hover over them, they're back again.

Also, :hover effects (which are particularly frequent in my LCARStrek theme) seem to often be one step behind and sometimes an area, even possibly the whole content area goes blank and gets rendered only again when either the mouse is moved over some part of it or something else triggers repainting.
Comment 3 Robert Kaiser 2011-12-05 09:32:39 PST
I also saw my build swallowing 2-4 GB of additional RAM when that pref was enabled, unfortunately all going into "heap-unclassified" in about:memory.
Comment 4 Robert Kaiser 2012-01-15 04:25:16 PST
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #3)
> I also saw my build swallowing 2-4 GB of additional RAM when that pref was
> enabled, unfortunately all going into "heap-unclassified" in about:memory.

That's down to ~500M additional RAM in current builds after recent patches that promised to reduce that problem as far as I remember from some MemShrink post.

The other effects seem to still be the same or very similar on kernel 3.2 and a build from 2011-01-14.
Comment 5 Brandon Watkins 2012-02-14 11:41:17 PST
I have similar issues with intel ironlake. If layers is enabled the UI flickers everytime I click something. I don't seem to get any actual artifacts scrolling or anything though, just lots of flickering on UI elements.
Comment 6 russianneuromancer 2012-02-28 23:19:27 PST
For me there is no flickering, but same problem with scrolling (like on attached "Screenshot 1: Scrolling") on R600g and Mesa 8.0.1.
Comment 7 Robert Kaiser 2012-02-29 05:22:56 PST
(In reply to runetmember from comment #6)
> For me there is no flickering, but same problem with scrolling (like on
> attached "Screenshot 1: Scrolling") on R600g and Mesa 8.0.1.

R600g isn't Intel, it's ATI/AMD, right? Which driver are you using? Binary or open source?
Comment 8 russianneuromancer 2012-02-29 09:25:40 PST
R600g is FOSS driver. My config: https://bugzilla.mozilla.org/show_bug.cgi?id=731519#c1
Comment 9 Robert Kaiser 2012-02-29 17:12:14 PST
(In reply to runetmember from comment #8)
> R600g is FOSS driver. My config:
> https://bugzilla.mozilla.org/show_bug.cgi?id=731519#c1

OK, that driver AFAIK uses all the official kernel support, direct rendering library and Mesa stuff pretty much the same way the Intel driver does (which is what I'm using) - while the proprietary ATI/AMD and NVidia drivers might not, that's why I asked.

Us both seeing those problems might indicate that the bug is either in that open graphics stack or our interaction with it, which I guess is helpful info.
Comment 10 Ryan S Kingsbury 2012-03-14 18:48:35 PDT
This affects me as well on Arch Linux x64 with the 3.2.9 Kernel, mesa 8.0, and Intel Ironlake graphics. I've observed the issue on FF 10 and 11 stable as well as nightly 14.

I would LOVE to get this figured out as it's the last thing keeping WebGl from working properly on my system. Please let me know if there's anything helpful in the way of logs or system info I can post.
Comment 11 Ryan S Kingsbury 2012-03-14 18:49:59 PDT
I should have mentioned that like runetmember, I only experience the flickering, no artifacts.
Comment 12 Till Schäfer 2012-04-02 17:24:58 PDT
same issue here (flickering + artifacts): 

VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller 
Driver: xf86-video-intel 2.18.0
Mesa: 8.0.2
libdrm: 2.4.33
xorg-server: 1.11.2
OS: Gentoo Linux
Comment 13 Chris Lord [:cwiiis] 2012-04-04 04:35:15 PDT
Is this really a minor issue? This stops us from enabling accelerated layer rendering on this *extremely* common chipset...
Comment 14 Till Schäfer 2012-04-04 06:46:17 PDT
The title is not correct anymore. It does not apply to Sandy Bridge only (see Comment 12). 

For me (from the user perspective) it is not a minor issue since it really slows down some web pages. For example "command and conquer alliances" has about 1/10 of the fps when not having accelerated layering enabled. Corruptions with having it enabled are heavy, leaving the fox unusable. Need to move another window over ff to refresh the page. otherwise it seems to freeze. having empty entries in the address bar recommendations, etc.
Comment 15 antistress 2012-04-04 09:53:48 PDT
What is the current status of this bug : has it been refiled at bugs.freedesktop.org to work with Intel people on it ?
Besides the title should be more generic, i.e. : "Flickering and rendering artifacts with OpenGL layers with Mesa drivers"
Comment 16 Benoit Jacob [:bjacob] (mostly away) 2012-04-04 10:06:42 PDT
The reason why this bug isn't getting a lot of focus at the moment, is that we already know of bigger problems that need to be solved before GL layers can be enabled on Linux/x11. See the blockers of bug 594876. At least: not using xrender / x pixmaps anymore.
Comment 17 antistress 2012-04-04 10:14:56 PDT
Just for the record : you may talk about Bug 738937 - Use Cairo image surfaces and shm PutImage instead of xrender on GTK/Linux
Comment 18 Jeff Gilbert [:jgilbert] 2012-04-04 15:13:13 PDT
(In reply to Chris Lord [:cwiiis] from comment #13)
> Is this really a minor issue? This stops us from enabling accelerated layer
> rendering on this *extremely* common chipset...

I downgraded it from 'normal' because this is a problem with a configuration that 'non-supported'. (You need to force layers acceleration to overcome the blacklisting)

This certainly doesn't mean it's not a problem, and we certainly should fix it, but supported rendering paths come first.
Comment 19 Romain DEP. 2012-04-16 13:17:52 PDT
I encounter the same scrolling glitches as described in #c1, plus some UI controls not refreshing (mostly text fields),
this is the GPU I own : http://www.notebookcheck.biz/Intel-Graphics-Media-Accelerator-GMA-4500MHD.11468.0.html
(linux x86_64, kernel 3.3.0,
xorg-x11-drv-intel-2.17.0-8.fc16.x86_64,
mesa-libGL-7.11.2-3.fc16.x86_64,
libdrm-2.4.30-1.fc16.x86_64,
xorg-x11-server-common-1.11.4-3.fc16.x86_64)

That said, the WebGL experience is way better with layers forced enabled (ro.me runs just fine with but not at all without).

Has someone a bug report from freedesktop.org to link here (I found nothing) ?
Comment 20 Karl Tomlinson (:karlt) 2012-07-19 16:25:46 PDT
The black areas I'm seeing with Mesa r600 (artifacts that are not due to bug 687831) seem to be caused by GLXLibrary::CreatePixmap using an fbConfig with visual of depth 24 even for CONTENT_COLOR_ALPHA (depth 32) aSurface.

It seems that GLX_BIND_TO_TEXTURE_RGBA_EXT is not sufficient to select an fbConfig with an alpha channel.  We should select a visual compatible with the surface (or pick the visual for the surface from an appropriate fbConfig).

http://www.opengl.org/sdk/docs/man/xhtml/glXCreatePixmap.xml says
"BadMatch is generated if pixmap was not created with a visual
that corresponds to config."
A Pixmaps is not created with a visual, but it is created with a depth.
Comment 21 dE 2012-07-24 06:51:29 PDT
Reproducible with Intel HD20000 graphs. Typing is slow, UI is buggy and there's a HUGE memory leak.

This happens regardless of if composting is enabled or not.

And it appears Intel's mesa openGL implementation is ok, considering I see no problems with openGL accelerated QT (including kwin).
Comment 22 dE 2012-07-24 07:02:20 PDT
Also: Gentoo with mesa 7.11.2
Comment 23 dE 2012-07-24 07:04:56 PDT
aa... sorry for multiple posting, but on Debian stable with Nvidia 6100 graphics with backported iceweasel, it works fine.
Comment 24 Karl Tomlinson (:karlt) 2012-07-25 00:46:02 PDT
Created attachment 645674 [details] [diff] [review]
select config in CreatePixmap to match Pixmap format

The GLX_BIND_TO_TEXTURE_RGB_EXT/GLX_TEXTURE_FORMAT_EXT changes are orthogonal to the visual/size changes but related.  They texture format changes aren't necessary on my system (where all fbconfigs support both), but it sounds like the right thing to do, to avoid copies at least.

"The drawable attribute GLX_TEXTURE_FORMAT_EXT determines the base internal
 format of the texture."
"GLX_TEXTURE_FORMAT_EXT describes the texture format this pixmap can be
 bound to."
Comment 25 Karl Tomlinson (:karlt) 2012-07-26 18:49:41 PDT
*** Bug 778005 has been marked as a duplicate of this bug. ***
Comment 26 dE 2012-07-30 06:20:41 PDT
Reproducible with FF (iceweasel) 10 on Debian testing (now awaiting freeze) with core i3 2120.
Comment 28 Ed Morley [:emorley] 2012-08-01 02:53:32 PDT
https://hg.mozilla.org/mozilla-central/rev/d0fed2c58607
Comment 29 Kami 2012-08-01 22:46:51 PDT
I tested under latest nightly, and the black square problem has been solved.
The UI is still causes problem for example when I open the settings dialog, some of buttons, and text sometimes blinking, disappear and come back again. Should I fill a sepereted ticket?
Comment 30 Karl Tomlinson (:karlt) 2012-08-01 23:52:59 PDT
*** Bug 778013 has been marked as a duplicate of this bug. ***
Comment 31 Karl Tomlinson (:karlt) 2012-08-02 00:03:39 PDT
(In reply to Kami from comment #29)
I don't think this change made it into this most recent nightly:
20120801030520
http://hg.mozilla.org/mozilla-central/rev/582d4c67b3a7

It should be in the next nightly (not available yet), so if you still see issues with that then please file, including the revision from about:buildconfig, and CC me.
Comment 32 Kami 2012-08-02 02:40:46 PDT
I will check
Comment 33 Robert Kaiser 2012-08-02 06:23:10 PDT
OK, as I filed that bug, I guess I should test and verify as well. :)

tl;dr: Seems to work nicely now.


My openSUSE Factory now is roughly at the state of soon-to-be-released openSUSE 12.2, with kernel 3.4.4 and X.org 1.12.3, for reference.

Self-built trunk Firefox build:
UA: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Firefox/17.0
Built from http://hg.mozilla.org/mozilla-central/rev/2ac77f687a23
(if you don't want to check hg, that's a state from very recently today)

From about:support:
Adapter Description: Tungsten Graphics, Inc -- Mesa DRI Intel(R) Sandybridge Desktop
Vendor ID: Tungsten Graphics, IncDevice IDMesa DRI Intel(R) Sandybridge Desktop
Driver Version: 3.0 Mesa 8.0.4
WebGL Renderer: Tungsten Graphics, Inc -- Mesa DRI Intel(R) Sandybridge Desktop  -- 3.0 Mesa 8.0.4
GPU Accelerated Windows: 5/5 OpenGL


With all that, after a few minutes of use, it looks like everything's working and looking correctly. I will keep OpenGL layers enabled and also will do some WebGL testing in the next days, will report new bugs with details if needed.

That said, good work and thanks for figuring this out and fixing it!
Comment 34 Ryan S Kingsbury 2012-08-05 15:42:08 PDT
For what it's worth, I recently enabled SNA acceleration on my Ironlake system (using the 2.20 intel driver and the 3.5 kernel). The problem has disappeared EXCEPT when the Firefox "Add On Bar" is hidden. As long as the bar is visible, I get a big performance improvement with no flickering.
Comment 35 Karl Tomlinson (:karlt) 2012-08-05 19:07:07 PDT
Can you file a new bug, please Ryan, describing the artifacts and when you see them, and attach glxinfo output?
Comment 36 Kami 2012-08-06 10:49:56 PDT
Looks okay to me, thank you for the fix.
Comment 37 Ryan S Kingsbury 2012-08-06 18:56:19 PDT
My apologies; I should have noted that I was still running the Firefox 14 (just thought the behavior with SNA enable might shed further light into the cause).

Thank you for the fix!
Comment 38 Kami 2012-08-16 02:01:40 PDT
*** Bug 669983 has been marked as a duplicate of this bug. ***
Comment 39 dE 2012-12-17 20:38:01 PST
Since FF 17 there's been a new bug --

https://bugzilla.mozilla.org/show_bug.cgi?id=818041

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