[PATCH 2/3] present: Query the Window's CRTC every time

Keith Packard keithp at keithp.com
Tue May 26 14:30:32 PDT 2015


Michel Dänzer <michel at daenzer.net> writes:

> The old code also called present_get_crtc() unless pixmap == NULL, so
> the problem couldn't affect flips but only MSC waits.

The original code was trying to let the client control which CRTC to
track for each window. For PresentPixmap requests, there's an explicit
CRTC argument, which allows the client to select the right one. For
PresentNotifyMSC, there's no such argument.

So, the code was trying to respect the client's wishes by using
whichever CRTC was last associated with the window -- either implicitly
through the last call to present_get_crtc or explicitly from the last
crtc passed to PresentPixmap for the same window.

Probably the right thing to do is to add an explicit CRTC parameter to
PresentNotifyMSC, and then have both requests call present_get_crtc when
an explicit CRTC is not provided.

That doesn't solve the problem when an explicitly requested CRTC is
disabled though, so this fix doesn't address the root cause, only one of
the symptoms.

> The problem I was hitting was that this code was running for an MSC wait
> when the CRTC referenced by window_priv->crtc was already disabled for
> DPMS off. This caused hangs at the GNOME lock screen. This patch seems
> to fix that problem.

Why isn't your queue_vblank function bailing when asked to queue a
request for a CRTC which is disabled? If it simply fails,
present_execute will get called immediately and the client would
continue happily along.

> So, I vote for applying this patch (possibly with a better commit log)
> to master ASAP and backporting it to stable branches.

It looks like this will only solve the problem of how to deal with new
PresentNotifyMSC requests; any PresentPixmap or PresentNotifyMSC
requests which are pending when the CRTC is disabled may end up getting
wedged too?

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150526/6468a9d9/attachment.sig>


More information about the xorg-devel mailing list