More DRI2 invalidate stuff

Ville Syrjälä ville.syrjala at nokia.com
Mon May 9 14:40:45 PDT 2011


On Mon, May 09, 2011 at 01:42:03PM -0700, ext Eric Anholt wrote:
> On Fri,  6 May 2011 18:18:14 +0300, ville.syrjala at nokia.com wrote:
> > The proposed DRI@ invalidate patch [1] causes a lot more invalidate events
> > to be sent out. That will cause processes to wake up needlessly. Eg. if
> > an unredirected fullscreen app is flipping, each flip will also send an
> > invalidate event to the compositor, since the composite overlay and client
> > window share the same pixmap. Now, assuming that the compositor hasn't
> > done a GetBuffers yet, there's no need to send an invalidate event to it.
> > 
> > I took the easy approach and stuck the boolean flag into the DRI2DrawableRec.
> > The optimal solution would have been to put it into DRI2DrawableRefRec and
> > keep track of the invalidate state per reference, but that would require the
> > client's drawable ID and client ID so that the correct ref could be found in
> > GetBuffers. Too much hassle for my taste, and I think this simple approach
> > should provide equal benefit in most cases.
> 
> Have you measured this to reduce invalidates?

Yes, of course. Someone else at Nokia noticed the problem too, since
soon after integrating the patch from [1] to our internal X server
tree, I got a blocker bug saying that some unrelated processes get
woken up while scrolling some list in one app. Good thing I had
realized the problem already, so I had the fix ready.

> I don't see how something
> that is producing flip requests that produce invalidates will do so
> without having called getbuffers in between.

You're barking up the wrong drawable, so to speak. Of course the
drawable being flipped needs its GetBuffers and invalidate events. It's
all the other drawables which have a DRI2 drawable and share the same
pixmap, that get hammered with the unwanted invalidate events.

-- 
Ville Syrjälä


More information about the xorg-devel mailing list