Bug 51718 - visible redraw (flash) with xfce4 notification icons
Summary: visible redraw (flash) with xfce4 notification icons
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-04 06:09 UTC by Lukas Hejtmanek
Modified: 2012-12-12 20:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
xorg log (31.07 KB, text/plain)
2012-07-04 06:25 UTC, Lukas Hejtmanek
no flags Details
xorg debug log (254.17 KB, application/octet-stream)
2012-07-17 18:11 UTC, Lukas Hejtmanek
no flags Details

Description Lukas Hejtmanek 2012-07-04 06:09:17 UTC
Hi,

the current git head 79309dd55f20098e12ead5427c811f237d5592fa results in render glitches, I guess bad flushes are in game. I got corruption resulted in two ways:
1) old window content is in place of new windows
2) text is missing and it is displayed after some time (several seconds)

the offending commit seems to be:
e7b31b6d0a32f76db4a8aef64c77d4afe808fb6c

HW is Lenovo T420 - SNB graphics, driver configured with --enable-snb --disable-uxa.

-- 
Lukas Hejtmanek
Comment 1 Chris Wilson 2012-07-04 06:18:09 UTC
Let's cover the basics by attaching you Xorg.0.log (basically just to confirm your hw details and to see which kernel we have).

What WM/compositing mode are you using?
Comment 2 Lukas Hejtmanek 2012-07-04 06:25:34 UTC
Created attachment 63803 [details]
xorg log
Comment 3 Lukas Hejtmanek 2012-07-04 06:30:32 UTC
(In reply to comment #1)
> Let's cover the basics by attaching you Xorg.0.log (basically just to confirm
> your hw details and to see which kernel we have).

attached.

> What WM/compositing mode are you using?

I use XFCE environment with Openbox WM. I believe that no compositing is in place.

Moreover, I noticed that notification icons flash on updates/animations in notification area, this is unrelated to the commit I mentioned, I did not track this down. Last good version I am aware of was 2.18.0-188-gdd093ea.

-- 
Lukas Hejtmanek
Comment 4 Chris Wilson 2012-07-04 07:02:31 UTC
Ok, and are you seeing this with any programs in particular? I haven't yet spotted any corruption, so I'm looking for a few clues as to how to reproduce.

If you can also take a few moments to compile with --enable-debug just to see if the assertions catch the buggy path, that would be very useful. If you are able to find an easy way to reproduce, please --enable-debug=full and attach the log file.
Comment 5 Lukas Hejtmanek 2012-07-04 08:29:34 UTC
This is log (enable-debug=full) with typical usage. But render glitch did not occur. So I try again just with enable-debug.

http://www.fi.muni.cz/~xhejtman/Xorg.0.log.old.bz2 (75MB) 

-- 
Lukas Hejtmanek
Comment 6 Chris Wilson 2012-07-04 09:50:22 UTC
Thanks for the debug log. Looks like you have a complex interplay of rendering techniques going on - so much for narrowing down the likely paths! :)

Looks like I'm just going to have to think instead...
Comment 7 Chris Wilson 2012-07-05 00:32:44 UTC
Ok, found something that could match your description that was made worse by e7b31b6:

commit c32bb286dc9a489232030f6abe9076411fbcecfd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 5 03:18:12 2012 +0100

    sna: Make sure damage is flushed to the CPU bo before use
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

So it the problem still as prevalent on HEAD?
Comment 8 Lukas Hejtmanek 2012-07-05 03:10:03 UTC
(In reply to comment #7)
> Ok, found something that could match your description that was made worse by
> e7b31b6:

I give it a try and let you know.

I just reproduced it again without this patch but with enable-debug. Unfortunately, no assertions are hit.
Comment 9 Chris Wilson 2012-07-05 11:53:53 UTC
Is your render corruption limited to text? I've spotted an issue where lowriter is redrawing its gtk+ text elements (menus and statusbar) above over windows (i.e. the clip is being dropped somewhere).
Comment 10 Chris Wilson 2012-07-05 12:01:45 UTC
If it is text related, then

commit cd2dd3016e0834d1636aa96511608022a4cdbcd1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 5 19:58:54 2012 +0100

    sna: Fix clipping of glyphs-to-dst for partially obscurred windows

might be relevant as well.
Comment 11 Chris Wilson 2012-07-05 12:06:53 UTC
I'm pretty sure the icon flashing is going to be a front buffer rendering artifact. I have to balance between keeping the GPU busy and building up a large batch for efficiency. So I use a mix of emitting a batch if ever the GPU is idle and emitting at least once a vblank.

However, in the past the flash was because the icons were being modified across multiple batches with a significant (> 1 vblank interval). This is partly because the icons are being client-side rendered onto a GPU buffer (i.e. the client fills the background using the GPU, reads back the pixmap and then puts the icon image over top). Once we have the render corruption solved, I'd like to find a small example with flashing icons so that I can examine its debug logs.
Comment 12 Lukas Hejtmanek 2012-07-05 12:11:08 UTC
(In reply to comment #11)
> Once we have the render corruption solved, I'd like
> to find a small example with flashing icons so that I can examine its debug
> logs.

I think I could provide full-debug for isolated icon flashing (not necessarily flashing but I guess that render path is still the same).

Maybe relevant info, the flasing is not constant but it flashes more or less probably based on GPU load balancer as you stated.

-- 
Lukas Hejtmanek
Comment 13 Lukas Hejtmanek 2012-07-05 12:16:05 UTC
(In reply to comment #9)
> Is your render corruption limited to text? I've spotted an issue where lowriter
> is redrawing its gtk+ text elements (menus and statusbar) above over windows
> (i.e. the clip is being dropped somewhere).

I think they are mostly text related. I am not aware of any non-text glitches. However, text related - it means background including - i.e., text is mis-rendered including its background. I don't know whether this is this case or not.

Anyway, I'm running flush fix and so far it seems to be OK, I will do more testing. Btw, render glitches are getting worse with uptime. The higher uptime, the more glitches and basically no glitches just after boot.

-- 
Lukas Hejtmanek
Comment 14 Chris Wilson 2012-07-14 09:18:54 UTC
How are we faring with the corruption? Is that gone now?
Comment 15 Lukas Hejtmanek 2012-07-14 09:50:48 UTC
(In reply to comment #14)
> How are we faring with the corruption? Is that gone now?

Yes, it seems to be gone.

Do you want me to create another bug report for flashing notification icons?

-- 
Lukas Hejtmanek
Comment 16 Chris Wilson 2012-07-14 12:50:53 UTC
This will do fine, retitling for clarity.
Comment 17 Lukas Hejtmanek 2012-07-14 18:40:05 UTC
(In reply to comment #16)
> This will do fine, retitling for clarity.

So what should I provide for this issue?
Comment 18 Chris Wilson 2012-07-14 19:18:35 UTC
A minimal test case or method to reproduce would be best. Failing that a debug=full log of a session where you recreate the conditions (if not necessarily the flash due to the timing effect of the debugging).
Comment 19 Lukas Hejtmanek 2012-07-17 18:10:29 UTC
Ok, my test case is as follows:
X :1.0 &
export DISPLAY=:1.0
xfce4-panel & (it is OK to have just plain panel only with notification area)
sleep 10;
psi-plus (jabber client, default configuration)

and just let you someone send you a message, icon in notification area should be animated.

Anyway, I upload debug-log=full in this case. I believe, fast debugs at the end of the log result directly from icon animation..
Comment 20 Lukas Hejtmanek 2012-07-17 18:11:13 UTC
Created attachment 64327 [details]
xorg debug log
Comment 21 Chris Wilson 2012-07-17 21:20:46 UTC
Ok, for starters this is not the same problem as last time - that we redrew the elements across multiple batches spaced over several vblanks. As far as I can tell, we don't use deferred batches in that sequence - the GPU is never busy enough to warrant it.

I'll look over the debug log some more and see if I can make sense of it, and try and reproduce the issue once I've cleared up some of the more perplexing corruption reports.

Thanks.
Comment 22 Chris Wilson 2012-09-05 13:37:30 UTC
Note to self, I want you check after we land userptr in the kernel.
Comment 23 Chris Wilson 2012-12-10 11:10:15 UTC
commit 3e9120d73c6f0c0e06b617da91cc2edce4434bc3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Dec 10 11:05:16 2012 +0000

    sna: Immediately flush a split batch
    
    If we submit a batch early (for example if the GPU is idle), then submit
    whatever else the client drew immediately upon completion of its
    blockhandler. This is required to prevent flashing due to visible delay
    between the clear at the start of the cycle and then the overdraw later.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=51718
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

That's as good as I can make it, I believe.
Comment 24 Lukas Hejtmanek 2012-12-12 20:29:16 UTC
Yes, it seems to be a lot better. Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.