<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - PSR reactivation logic seems a bit dubious"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104931">104931</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>PSR reactivation logic seems a bit dubious
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DRI
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DRM/Intel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-gfx-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>luto@kernel.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-gfx-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>intel-gfx-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm running Fedora 27 with a gnome-shell Wayland session.  I think I'm using a
software cursor, but I'm not at all confident about that.  I seem to have small
amounts of cursor lag when I move the cursor after a bit of idle time.

On inspection of the code, I see nothing that keeps PSR off for any particular
amount of time or number of vblanks after intel_psr_flush() gets called. 
Adding some tracing confirms that intel_psr_work() can reactivate PSR almost
immediately after intel_psr_flush().  In fact, it seems that PSR gets
reactivated about every 100ms even when the display contents never stop
changing at all.

The attached hackish patch at least improves the trace, and it might be
improving the cursor lag too, but the latter could be the placebo effect. 
Nonetheless, I think the code could be improved.

My patch is a big gross.  I think a better solution would be to use mod_timer()
and/or to track whatever condition, if any, is needed to ensure that the panel
is up to date before reactivating PSR.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>