xf86-video-ati page flipping fixes

Ville Syrjälä ville.syrjala at nokia.com
Thu May 5 10:51:02 PDT 2011


On Thu, May 05, 2011 at 06:33:11PM +0200, ext Mario Kleiner wrote:
> 
> On May 5, 2011, at 6:06 PM, Ville Syrjälä wrote:
> 
> > On Thu, May 05, 2011 at 05:09:56PM +0200, Mario Kleiner wrote:
> >> On May 5, 2011, at 4:23 PM, Ville Syrjälä wrote:
> >>
> >>> On Thu, May 05, 2011 at 11:46:45AM +0200, Michel Dänzer wrote:
> >>>> On Mit, 2011-05-04 at 23:51 +0300, Ville Syrjala wrote:
> >>>>> I came to the conclusion that the xserver DRI2 invalidate patches
> >>>>> that
> >>>>> have been discussed aren't really fixing the problem. I suppose
> >>>>> they may
> >>>>> make the problem slightly less likely to happen, but at least for
> >>>>> me that
> >>>>> likelyhood is still very high. The whole mess looks like a simple
> >>>>> driver
> >>>>> bug to me.
> >>>>
> >>>> I think the xserver patches are still necessary, otherwise how are
> >>>> the
> >>>> cached DRI2 pPriv->buffers updated for other windows sharing the  
> >>>> same
> >>>> pixmap?
> >>>
> >>> As the real front buffers are not handed out to clients, there isn't
> >>> that much reason to update them. Making sure the fake front buffer
> >>> contain a more recent snapshot of the real front would be one reason
> >>> though.
> >>>
> >>
> >> Could it be that your patch fixes a closely related, but different
> >> bug? During OpenGL rendering, Mesa/Gallium caches the backbuffer
> >> assignment and only queries the current assignment from the x-server
> >> if its drawable has been invalidated, which is what the x-server
> >> patches do.
> >>
> >> I'd also think you will need both patch sets.
> >
> > Back buffers are private so a swap for one drawable doesn't need to
> > invalidate them for other drawables.
> >
> 
> Are you sure this is also the case even when kms page flipping is  
> used for fullscreen drawables?

Yes, and if not, it's a driver bug.

> The workaround i implemented in my toolkit for the page flipping  
> problem when using fullscreen drawables on current x servers was to  
> make sure that it always ends a session with an even number of  
> completed page-flipping swaps, by checking 'sbc' and issuing an extra  
> swap before closing its window if the sbc wasn't an even number. This  
> makes sure that the same buffer objects are assigned as front- and  
> backbuffer at the time the window closes as when the application  
> started and opened its fullscreen window. This fixed any desktop  
> corruption i'd usually get when running compiz with non-redirected  
> fullscreen windows after quitting my application.
> 
> I could be totally wrong, but at least the symptoms and the working  
> workaround suggested fullscreen drawables do share their back buffers  
> when page flipping is on.

The bug allows the BOs to get mixed up pretty much any which way between
DRI2 buffers.

Eg. if two drawables got the same BO as the front buffer in their
GetBuffers requests, and then both would do a page flip, both would
end up with the same BO as their new back buffer.

-- 
Ville Syrjälä


More information about the xorg-devel mailing list