After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724788 - stage-cogl: Fix buffer_age code path
stage-cogl: Fix buffer_age code path
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterStage
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-02-20 10:02 UTC by drago01
Modified: 2015-03-09 14:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stage-cogl: Fix buffer_age code path (1.55 KB, patch)
2014-02-20 10:02 UTC, drago01
committed Details | Review

Description drago01 2014-02-20 10:02:14 UTC
When I wrote that code back then I have been testing with the NVIDIA
drivers (there where the only ones to support it) and never noticed
that it was broken because their implementation was broken.

They have released a fixed driver[1] that has an entry in the changelog:
"Fixed a bug in the GLX_EXT_buffer_age extension where incorrect ages would be returned unless triple buffering was enabled."

I am currently adding support to mesa (dri3 finally allows us to do that), and noticed
some graphical corruption even though the reported age is correct. 

Also people are now seeing corruption when running gnome-shell with the newer driver[2].

The attached patch should fix that (and also don't pointlessly union a rectangle with itself).

1: http://www.nvidia.com/Download/driverResults.aspx/73100/en-us
2: https://devtalk.nvidia.com/default/topic/690704/linux/-334-16-parts-of-the-ui-randomly-flicker-when-moving-the-mouse/
Comment 1 drago01 2014-02-20 10:02:16 UTC
Created attachment 269784 [details] [review]
stage-cogl: Fix buffer_age code path

Currently we where checking whether the damage_history list contains
more or equal then buffer_age entries. This is wrong because we prepend
our current clip to the list just before the check.

Fix that to check whether we have more entries instead of more or equal.
Comment 2 Emmanuele Bassi (:ebassi) 2014-02-20 10:57:32 UTC
Review of attachment 269784 [details] [review]:

looks good to me, with one minor nitpick.

if you could fix it before pushing it, it would be great.

::: clutter/cogl/clutter-stage-cogl.c
@@ +488,3 @@
             int i = 0;
             GSList *tmp = NULL;
+            for (tmp = stage_cogl->damage_history->next; tmp; tmp = tmp->next)

it would be nice to have a comment, here, before the for() loop.
Comment 3 drago01 2014-02-20 11:00:44 UTC
Attachment 269784 [details] pushed as 2639395 - stage-cogl: Fix buffer_age code path
Comment 4 Joran Martinière 2014-03-28 17:48:38 UTC
Hi, it seems that the bug was not corrected entirely on clutter 1.16.4,
see:
https://bbs.archlinux.org/viewtopic.php?id=178024&p=3
https://bugs.archlinux.org/task/39371?project=1&cat[0]=2&string=clutter
Comment 5 Emmanuele Bassi (:ebassi) 2014-03-28 19:28:01 UTC
(In reply to comment #4)
> Hi, it seems that the bug was not corrected entirely on clutter 1.16.4,

unsurprisingly, since Adel's patch was cherry-picked after the 1.16.4 release. it'll be in a 1.16.6 release, once I have time to spin it.
Comment 6 Davi 2014-04-15 17:05:17 UTC
Hello! I am using Clutter 1.18.0-1 (archlinux) and the problem persists. The most annoying manifestations are in scrolling gnome-terminal (shift+pg up/pg down), changing tabs in firefox and typing in text areas. I'm using kernel linux 3.14.1-1 and driver nvidia 334.21-4.
Comment 7 drago01 2014-04-15 17:37:16 UTC
(In reply to comment #6)
> Hello! I am using Clutter 1.18.0-1 (archlinux) and the problem persists. The
> most annoying manifestations are in scrolling gnome-terminal (shift+pg up/pg
> down), changing tabs in firefox and typing in text areas. I'm using kernel
> linux 3.14.1-1 and driver nvidia 334.21-4.

This sounds like a different unrelated bug. Sounds like there are problems between x rendering and gl rendering synchronization. We should use x11_sync_object to fix that but no one has worked on any such patches. Feel free to open a new bug (against mutter) but it has nothing to do with this one.