[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Review Request: Move Compositing self check into an effect
From: Thomas_Lübking <thomas.luebking () web ! de>
Date: 2010-10-17 20:37:27
Message-ID: 20101017203727.28990.45370 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5643/#review8205
-----------------------------------------------------------
trunk/KDE/kdebase/workspace/kwin/effects.cpp
<http://svn.reviewboard.kde.org/r/5643/#comment8474>
foreach ( KActionCollection *ac, KActionCollection::allActions() )
{
if ( QAction *act = ac->action("Suspend Compositing") )
{
act->trigger(); // or setChecked() - no idea whether it's implemented \
checkable break;
}
}
trunk/KDE/kdebase/workspace/kwin/effects.cpp
<http://svn.reviewboard.kde.org/r/5643/#comment8475>
What about: "The effect system appears to not work correctly on your system and \
was therefore suspended.\nTo prevent this check and enforce desktop effects, disable \
the <dialog link?!>Effect Check</a> plugin" ?
(an effect detected that effects are broken seems weird)
- Thomas
On 2010-10-17 19:47:34, Martin Gräßlin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5643/
> -----------------------------------------------------------
>
> (Updated 2010-10-17 19:47:34)
>
>
> Review request for kwin, Fredrik Höglund and Lubos Lunak.
>
>
> Summary
> -------
>
> I tried to address the problem of failing self-checks at KWin startup. So far it \
> seems that the self-check fails due to a race condition and all my ideas to fix it \
> in scene_opengl directly did not succeed. My idea is now to move the self-check \
> into an own effect and use our effect capabilities to perform the \
> check:
> * use only one self-check window and move it's EffectWindow to the correct \
> positions
> * add sufficient delay between creating the self-check window and the rendering (5 \
> sec)
> * add sufficient delay between the rendering and grabbing the pixmap (rendering in \
> paint screen, grabbing in next pre-paint-screen and effect does not cause another \
> repaint)
> * hide the self-check window till the self-check starts
>
> This approach has some advantages, e.g. we have just one code base for both OpenGL \
> and XRender and use the exact same methods as we use for the "real" compositing. I \
> also added a notification giving a proper reason why desktop effects are not \
> working. The self-check is now decoupled from the "functionality checks" option. \
> Another advantage is that we could use this effect to perform more tests in future: \
> does FBO work, does ARB shader work, does GLSL work?
> The disadvantage is that we now have a delay, which means in case it fails there \
> might be 5 sec of video garbage on the screen. On the other hand I doubt this is a \
> problem as at the time of 4.6 really all default shipped drivers should support \
> proper OpenGL compositing, leaving it to bogous setups like VMs for failing (and in \
> VM/live CD case there are more things which fail). I also dislike that I added \
> another virtual to the effectshandler which is just used by one effect. My initial \
> idea was to use the dbus slot, but that would have raised a notification telling \
> "another application" suspended compositing (which is not true). If someone has \
> better ideas, please tell me.
>
> Diffs
> -----
>
> trunk/KDE/kdebase/workspace/kwin/effects.h 1186710
> trunk/KDE/kdebase/workspace/kwin/effects.cpp 1186710
> trunk/KDE/kdebase/workspace/kwin/effects/CMakeLists.txt 1186710
> trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/CMakeLists.txt PRE-CREATION
> trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/selfcheck.h PRE-CREATION
> trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/selfcheck.cpp PRE-CREATION
> trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/selfcheck.desktop PRE-CREATION
> trunk/KDE/kdebase/workspace/kwin/kwin.notifyrc 1186710
> trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.h 1186710
> trunk/KDE/kdebase/workspace/kwin/notifications.h 1186710
> trunk/KDE/kdebase/workspace/kwin/scene.h 1186710
> trunk/KDE/kdebase/workspace/kwin/scene.cpp 1186710
> trunk/KDE/kdebase/workspace/kwin/scene_opengl.h 1186710
> trunk/KDE/kdebase/workspace/kwin/scene_opengl.cpp 1186710
> trunk/KDE/kdebase/workspace/kwin/scene_xrender.cpp 1186710
>
> Diff: http://svn.reviewboard.kde.org/r/5643/diff
>
>
> Testing
> -------
>
> * Self-check works on hardware where it failed previously (fglrx)
> * Self-check disables compositing if it fails
>
> Untested:
> * behaviour at session start
> * behaviour on systems where it has to fail (VM)
> * notifications (at the moment not working at all on my system)
>
> My plan to test the failing self-check with VirtualBox failed. It seems like we did \
> at least one thing correctly in 4.5 :-D Compositing get's enabled now in the VM and \
> works properly (though slow).
> Erm it used Software Rasterizer with indirect rendering and falled back to xrender, \
> that's why it worked. With KWIN_DIRECT_GL=1 the correct driver is selected, but it \
> crashes in glGetString through initGL :-( I tested now with disabling the fallback \
> to XRender: it's five seconds black screen during splash screen, then we see Plasma \
> and a notification for the suspended state (I noticed the code misses a part for \
> notification.)
>
> Thanks,
>
> Martin
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://svn.reviewboard.kde.org/r/5643/">http://svn.reviewboard.kde.org/r/5643/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://svn.reviewboard.kde.org/r/5643/diff/1/?file=39482#file39482line1188" \
style="color: black; font-weight: bold; text-decoration: \
underline;">trunk/KDE/kdebase/workspace/kwin/effects.cpp</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
EffectsHandlerImpl::effectsChanged()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">1188</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="kt">void</span> <span class="n">EffectsHandlerImpl</span><span \
class="o">::</span><span class="n">suspendCompositing</span><span \
class="p">()</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">foreach ( \
KActionCollection *ac, KActionCollection::allActions() ) {
if ( QAction *act = ac->action("Suspend Compositing") )
{
act->trigger(); // or setChecked() - no idea whether it's implemented \
checkable break;
}
}</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://svn.reviewboard.kde.org/r/5643/diff/1/?file=39482#file39482line1192" \
style="color: black; font-weight: bold; text-decoration: \
underline;">trunk/KDE/kdebase/workspace/kwin/effects.cpp</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
EffectsHandlerImpl::effectsChanged()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">1192</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="s">"A desktop effect noticed that the effect system is working \
incorrectly. Therefore desktop effects have been suspended."</span><span \
class="p">));</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">What about: \
"The effect system appears to not work correctly on your system and was \
therefore suspended.\nTo prevent this check and enforce desktop effects, disable the \
<dialog link?!>Effect Check</a> plugin" ?
(an effect detected that effects are broken seems weird)</pre>
</div>
<br />
<p>- Thomas</p>
<br />
<p>On October 17th, 2010, 7:47 p.m., Martin Gräßlin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kwin, Fredrik Höglund and Lubos Lunak.</div>
<div>By Martin Gräßlin.</div>
<p style="color: grey;"><i>Updated 2010-10-17 19:47:34</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I tried to address the problem of failing self-checks at KWin startup. \
So far it seems that the self-check fails due to a race condition and all my ideas to \
fix it in scene_opengl directly did not succeed. My idea is now to move the \
self-check into an own effect and use our effect capabilities to \
perform the check:
* use only one self-check window and move it's EffectWindow to the correct \
positions
* add sufficient delay between creating the self-check window and the rendering (5 \
sec)
* add sufficient delay between the rendering and grabbing the pixmap (rendering in \
paint screen, grabbing in next pre-paint-screen and effect does not cause another \
repaint)
* hide the self-check window till the self-check starts
This approach has some advantages, e.g. we have just one code base for both OpenGL \
and XRender and use the exact same methods as we use for the "real" \
compositing. I also added a notification giving a proper reason why desktop effects \
are not working. The self-check is now decoupled from the "functionality \
checks" option. Another advantage is that we could use this effect to perform \
more tests in future: does FBO work, does ARB shader work, does GLSL work?
The disadvantage is that we now have a delay, which means in case it fails there \
might be 5 sec of video garbage on the screen. On the other hand I doubt this is a \
problem as at the time of 4.6 really all default shipped drivers should support \
proper OpenGL compositing, leaving it to bogous setups like VMs for failing (and in \
VM/live CD case there are more things which fail). I also dislike that I added \
another virtual to the effectshandler which is just used by one effect. My initial \
idea was to use the dbus slot, but that would have raised a notification telling \
"another application" suspended compositing (which is not true). If someone \
has better ideas, please tell me.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">* Self-check works on hardware where it failed \
previously (fglrx)
* Self-check disables compositing if it fails
Untested:
* behaviour at session start
* behaviour on systems where it has to fail (VM)
* notifications (at the moment not working at all on my system)
My plan to test the failing self-check with VirtualBox failed. It seems like we did \
at least one thing correctly in 4.5 :-D Compositing get's enabled now in the VM \
and works properly (though slow).
Erm it used Software Rasterizer with indirect rendering and falled back to xrender, \
that's why it worked. With KWIN_DIRECT_GL=1 the correct driver is selected, but \
it crashes in glGetString through initGL :-( I tested now with disabling the fallback \
to XRender: it's five seconds black screen during splash screen, then we see \
Plasma and a notification for the suspended state (I noticed the code misses a part \
for notification.)</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/KDE/kdebase/workspace/kwin/effects.h <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/effects.cpp <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/effects/CMakeLists.txt <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/CMakeLists.txt <span \
style="color: grey">(PRE-CREATION)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/selfcheck.h <span \
style="color: grey">(PRE-CREATION)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/selfcheck.cpp <span \
style="color: grey">(PRE-CREATION)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/effects/selfcheck/selfcheck.desktop <span \
style="color: grey">(PRE-CREATION)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/kwin.notifyrc <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.h <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/notifications.h <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/scene.h <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/scene.cpp <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/scene_opengl.h <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/scene_opengl.cpp <span style="color: \
grey">(1186710)</span></li>
<li>trunk/KDE/kdebase/workspace/kwin/scene_xrender.cpp <span style="color: \
grey">(1186710)</span></li>
</ul>
<p><a href="http://svn.reviewboard.kde.org/r/5643/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic