[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request 113767: Do not force unnecessary GPU pipeline flushes.
From:       "Andreas Hartmetz" <ahartmetz () gmail ! com>
Date:       2013-12-19 4:14:12
Message-ID: 20131219041412.17849.77793 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113767/
-----------------------------------------------------------

(Updated Dec. 19, 2013, 4:14 a.m.)


Status
------

This change has been discarded.


Review request for kwin, Fredrik Höglund and Martin Gräßlin.


Repository: kde-workspace


Description
-------

This patch is obviously not supposed to be applied verbatim. It is a base for \
discussion. I've taken some traces with Apitrace and looked for suspicious patterns. \
There are, apparently, gratuitous pipeline flushes before swapping the buffers and \
elsewhere. AFAICS the buffer swapping itself and glXWaitX() / glXWaitGL() are already \
sufficient to enforce all the synchronization that is really necessary.

A basic rule for good GL performance is forcing as few pipeline flushes as possible.
The action of glFlush() should be clear.
glGetGraphicsResetStatusARB() has a similar effect and can also cause performance \
problems, see here: http://code.google.com/p/chromium/issues/detail?id=160318

I've found that kwin works fine (for me) with this hacky patch applied, and the magic \
lamp effect (really the only effect that is choppy here, not sure why exactly... I \
have looked a bit) works much more fluidly with it. I've added debug output in \
MagicLampEffect::prePaintScreen() that showed a maximum frame time decrease from \
about 220(!) milliseconds to about 100. Still not a good value, but much better. Most \
frames after the first slow one only take 16-22 milliseconds now, which is *much* \
better than before. kwin also feels a bit more fluid overall, including the present \
windows effect, but that could be subjective and I haven't measured it, so let's \
disregard that for now. My GPU is a Radeon HD 7750 with the very latest version of \
the radeonsi driver from git.


Diffs
-----

  kwin/glxbackend.cpp f1b9a6a 
  kwin/scene_opengl.cpp a1bf789 

Diff: http://git.reviewboard.kde.org/r/113767/diff/


Testing
-------


Thanks,

Andreas Hartmetz


[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://git.reviewboard.kde.org/r/113767/">http://git.reviewboard.kde.org/r/113767/</a>
  </td>
    </tr>
   </table>
   <br />



<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray \
solid;">  <tr>
  <td>
   <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been \
discarded.</h1>  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin, Fredrik Höglund and Martin Gräßlin.</div>
<div>By Andreas Hartmetz.</div>


<p style="color: grey;"><i>Updated Dec. 19, 2013, 4:14 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-workspace
</div>


<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;">This patch is obviously not supposed to be applied verbatim. It is a \
base for discussion. I&#39;ve taken some traces with Apitrace and looked for \
suspicious patterns. There are, apparently, gratuitous pipeline flushes before \
swapping the buffers and elsewhere. AFAICS the buffer swapping itself and glXWaitX() \
/ glXWaitGL() are already sufficient to enforce all the synchronization that is \
really necessary.

A basic rule for good GL performance is forcing as few pipeline flushes as possible.
The action of glFlush() should be clear.
glGetGraphicsResetStatusARB() has a similar effect and can also cause performance \
problems, see here: http://code.google.com/p/chromium/issues/detail?id=160318

I&#39;ve found that kwin works fine (for me) with this hacky patch applied, and the \
magic lamp effect (really the only effect that is choppy here, not sure why \
exactly... I have looked a bit) works much more fluidly with it. I&#39;ve added debug \
output in MagicLampEffect::prePaintScreen() that showed a maximum frame time decrease \
from about 220(!) milliseconds to about 100. Still not a good value, but much better. \
Most frames after the first slow one only take 16-22 milliseconds now, which is \
*much* better than before. kwin also feels a bit more fluid overall, including the \
present windows effect, but that could be subjective and I haven&#39;t measured it, \
so let&#39;s disregard that for now. My GPU is a Radeon HD 7750 with the very latest \
version of the radeonsi driver from git.</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>kwin/glxbackend.cpp <span style="color: grey">(f1b9a6a)</span></li>

 <li>kwin/scene_opengl.cpp <span style="color: grey">(a1bf789)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/113767/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