Bug 62198 - x11-drivers/xf86-video-intel-2.21.4 and transparency
Summary: x11-drivers/xf86-video-intel-2.21.4 and transparency
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 06:03 UTC by Ognian Tenchev
Modified: 2013-03-12 20:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Synapse screenshot with wrong transparent border (55.33 KB, image/png)
2013-03-12 06:03 UTC, Ognian Tenchev
no flags Details
xorg.conf (2.81 KB, text/plain)
2013-03-12 08:46 UTC, Ognian Tenchev
no flags Details
Xorg.0.log (25.51 KB, text/plain)
2013-03-12 09:10 UTC, Ognian Tenchev
no flags Details
Xorg 1st MB (75.56 KB, application/octet-stream)
2013-03-12 13:21 UTC, Ognian Tenchev
no flags Details
Xorg last MB (109.87 KB, application/octet-stream)
2013-03-12 13:21 UTC, Ognian Tenchev
no flags Details
gen3_render.o (71.63 KB, application/octet-stream)
2013-03-12 19:36 UTC, Ognian Tenchev
no flags Details
gen3_render.o - without && 0 (72.40 KB, application/octet-stream)
2013-03-12 19:53 UTC, Ognian Tenchev
no flags Details

Description Ognian Tenchev 2013-03-12 06:03:33 UTC
Created attachment 76359 [details]
Synapse screenshot with wrong transparent border

after upgrade from x11-drivers/xf86-video-intel-2.21.3 Synapse (https://launchpad.net/synapse-project) border is no longer transparent, but semi transparent (see attached Screenshot)
Comment 1 Chris Wilson 2013-03-12 08:39:10 UTC
Can you please always attach your Xorg.log?
Comment 2 Ognian Tenchev 2013-03-12 08:46:15 UTC
Created attachment 76374 [details]
xorg.conf
Comment 3 Chris Wilson 2013-03-12 09:04:30 UTC
The logfile, /var/log/Xorg.0.log.
Comment 4 Ognian Tenchev 2013-03-12 09:10:09 UTC
ah .. sorry :( my bad
Comment 5 Ognian Tenchev 2013-03-12 09:10:33 UTC
Created attachment 76375 [details]
Xorg.0.log
Comment 6 Chris Wilson 2013-03-12 10:16:50 UTC
Hmm, found a bug but you shouldn't have been hitting that on 945gm...

commit 4f8fba31d7317248e0d4710ef5553dc1f9593314
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 12 10:12:12 2013 +0000

    sna: Apply the source offset to the transform when fixing up gradients
    
    Otherwise pixman will apply the source transform to the offsets.
    
    Reported-by: Ognian Tenchev <drJeckyll@Jeckyll.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62198
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 7 Chris Wilson 2013-03-12 10:36:42 UTC
Indeed, that bug does not reproduce for me on gen3. Treating as fixed, please reopen if you can reproduce and attach an Xorg.0.log with --enable-debug=full.
Comment 8 Ognian Tenchev 2013-03-12 12:40:50 UTC
I'm little bit confused. 

After rebuilding xorg-server and xf86-video-intel (from git) both with --enable-debug=full Synapse windows is shown correctly, but everything is very slow, and Xorg.0.log become couple of GBs. 

Then again rebuild xorg-server and xf86-video-intel without debug same versions both, but Synapse windows is again corrupt.

I have 170MB Xorg.0.log (gzippped 17MB) can I upload it somewhere or extract relevant parts?
Comment 9 Chris Wilson 2013-03-12 13:08:06 UTC
It's hard to tell in advance what's going to be most relevant, but the first and last 1 MB of the file should be the most interesting, and compress into the attachment limits.
Comment 10 Chris Wilson 2013-03-12 13:09:12 UTC
Also, different compositing managers render the shadows using different techniques. It looks like you were using a gnome-shell variant, right?
Comment 11 Ognian Tenchev 2013-03-12 13:21:09 UTC
Created attachment 76402 [details]
Xorg 1st MB
Comment 12 Ognian Tenchev 2013-03-12 13:21:35 UTC
Created attachment 76403 [details]
Xorg last MB
Comment 13 Ognian Tenchev 2013-03-12 13:22:54 UTC
windows manager is xfwm4 4.10.0
Comment 14 Chris Wilson 2013-03-12 16:17:35 UTC
I haven't spotted anything worrying in there, no unusual paths or other oddities. Can you perhaps try a few different settings and see what peculiarities are required to trigger the bug?
Comment 15 Ognian Tenchev 2013-03-12 17:52:53 UTC
Since I don't change any settings and just upgrade driver for me it is pointless to do it :) 

Instead I start to revert revisions and find that last revision that works for me is:
417c3f9b8c6b9a50dc1af440c53e94d2c6401251 - sna/trapezoids: Add a pair of unlikely hints for forced box emission

Next one:
7bb06b02e67435354778fe87a3e0429fe3750c23 - sna/gen3: Expand the number of SSE2 routines for basic composite ops

produce incorrect transparent border with Synapse ...
Comment 16 Chris Wilson 2013-03-12 18:03:26 UTC
Interesting, very interesting. What version of gcc do you have?

So does

diff --git a/src/sna/sna_cpu.c b/src/sna/sna_cpu.c
index ef6843f..5b1c2d1 100644
--- a/src/sna/sna_cpu.c
+++ b/src/sna/sna_cpu.c
@@ -31,7 +31,7 @@
 
 #include "sna.h"
 
-#if HAS_GCC(4, 4)
+#if HAS_GCC(4, 4) && 0
 
 #include <cpuid.h>

restore your sanity?
Comment 17 Ognian Tenchev 2013-03-12 18:05:15 UTC
gcc --version
gcc (Gentoo 4.7.2-r1 p1.5, pie-0.5.5) 4.7.2

let me try ...
Comment 18 Ognian Tenchev 2013-03-12 18:09:19 UTC
#include "sna.h"

#if defined(__GNUC__) && (__GNUC__ >= 4) /* 4.4 */

#include <cpuid.h>

that is for me (rev 7bb06b02e67435354778fe87a3e0429fe3750c23) - to change 
#if defined(__GNUC__) && (__GNUC__ >= 4) /* 4.4 */

to:
#if HAS_GCC(4, 4) && 0

?
Comment 19 Chris Wilson 2013-03-12 18:14:02 UTC
On master, make the change to #if 0 out the cpuid checks, so that you use the sna_cpu_detect() {return 0; } path. That will confirm your diagnosis that the sse2 routines are bad.
Comment 20 Ognian Tenchev 2013-03-12 18:18:10 UTC
-#if HAS_GCC(4, 4)
+#if HAS_GCC(4, 4) && 0

on master make my poor Synapse look nice :) so sse2 is not playing nice for me ...
Comment 21 Chris Wilson 2013-03-12 19:07:40 UTC
Do you mind doing a bit of detective work, and going through src/sna/gen3_render.c and disable each sse routine individually, like:

diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 59d13db..fd7c13d 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3666,7 +3666,7 @@ gen3_render_composite(struct sna *sna,
                case SHADER_WHITE:
                case SHADER_CONSTANT:
 #if defined(sse2) && !defined(__x86_64__)
-                       if (sna->cpu_features & SSE2) {
+                       if (sna->cpu_features & SSE2 && 0) {
                                tmp->prim_emit = gen3_emit_composite_primitive_c
                                tmp->emit_boxes = gen3_emit_composite_boxes_cons
                        } else

Then when you find the one that is responsible for the error, please let me know and please attach your src/sna/.libs/gen3_render.o
Comment 22 Ognian Tenchev 2013-03-12 19:35:47 UTC
pfu! 
Checked all 16 
if (sna->cpu_features & SSE2) {

I get lucky on second one:
        case SHADER_LINEAR:
        case SHADER_RADIAL:
            if (tmp->src.transform == NULL) {
#if defined(sse2) && !defined(__x86_64__)
                if (sna->cpu_features & SSE2 && 0) { //2 - ok
                    tmp->prim_emit = gen3_emit_composite_primitive_identity_gradient__sse2;
                    tmp->emit_boxes = gen3_emit_composite_boxes_identity_gradient__sse2;
                } else
#endif
Comment 23 Ognian Tenchev 2013-03-12 19:36:48 UTC
Created attachment 76441 [details]
gen3_render.o
Comment 24 Chris Wilson 2013-03-12 19:48:10 UTC
* scratches head.

Was the gen3_render.o from after you commented out the use of gen3_emit_composite_primitive_identity_gradient__sse2? I'm not finding it in the object file...
Comment 25 Ognian Tenchev 2013-03-12 19:52:02 UTC
(In reply to comment #24)
> * scratches head.
> 
> Was the gen3_render.o from after you commented out the use of
> gen3_emit_composite_primitive_identity_gradient__sse2? I'm not finding it in
> the object file...

ah ... you want it without && 0? ok then
Comment 26 Ognian Tenchev 2013-03-12 19:53:19 UTC
Created attachment 76442 [details]
gen3_render.o - without && 0
Comment 27 Chris Wilson 2013-03-12 20:01:06 UTC
Can you please try with master?

commit f320e6908f24ff356303c8905c78ac290e24c2e6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 12 19:53:20 2013 +0000

    sna/gen3: Tweak code generation for gen3_emit_composite_primitive_identity_g
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
Comment 28 Chris Wilson 2013-03-12 20:04:48 UTC
Oh my word. The problem there was that is was making out-of-line calls to vertex_emit(), passing the value in %xmm0, but the vertex_emit() was compiled without sse2 and so expecting the parameter via %fp0. I had presumed that those functions would be inlined and so recompiled with sse2 at the callsite.

master should work, and I should have not had such high expectations.
Comment 29 Ognian Tenchev 2013-03-12 20:07:52 UTC
have no idea what exactly this mean, but master WORK for me now :)
Thanks
Comment 30 Chris Wilson 2013-03-12 20:24:44 UTC
Many, many thanks for your hard work. I believe I understand the bug now and I've scrutinized the code for similar issues, and think I have caught them all.


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.