modesetting TearFree / VSYNC aware rotation pageflipping

Michel Dänzer michel at
Mon Oct 1 15:57:20 UTC 2018

On 2018-09-28 2:52 p.m., Carsten Behling wrote:
> Hi all,
> I noticed ugly tearing when rotating the screen with modesetting.
> I already noticed this thread
> that suggests to implement the TearFree option into modesetting.
> So I took a look on the amd and ati implementations
> and compared it to modesetting and I found that pageflipping is already
> implemented since this patch:
> But:
> 1. The above stated Freedesktop bug is older and the modesetting
> pageflipping implementation is not mentioned there in the TearFree context.
> But e.g. AMD GPU is  doing a very similar thing for TearFree.
> 2. Modesettings pageflipping is disabled on rotation and I found just that
> comment in the above patch:
>> Don't do pageflipping if CRTCs are rotated (caught by Jason Ekstrand).
> So here are my questions:
> 1. What is the difference between flipping the scanout buffers in
> amdgpu/ati and the front buffer and back buffer flipping in modesetting?
> 2. I suppose in both cases that are real video buffers instead of shadow
> buffers for rotation. Right?
> 3. I did not found any background info about the limitation for
> pageflipping caught by Jason. Can anyone give me some more info? Since
> amdgpu does the nearly the same with its two scanout buffers it shouldn't
> be a big problem.
> So if TearFree support or something else that makes more sense is still an
> issue I can add that feature. I just need a little help.

Basically you're comparing apples (TearFree, the amdgpu/radeon driver
changes above) and oranges (DRI page flipping, the modesetting change

DRI page flipping is an old mechanism (supported by the amdgpu/radeon
drivers as well, "forever", since long before TearFree) for direct
scanout from buffers whose contents were produced with direct rendering
by the client. Because it scans out directly, output transformations
such as rotation are traditionally not supported with DRI page flipping.

TearFree uses separate dedicated scanout buffers, to which the "main"
buffer contents are copied on demand.

Originally, these three things (DRI page flipping, rotation and
TearFree) were separate and mutually exclusive. However, the
amdgpu/radeon drivers support all of them the same time these days; this
still requires an extra copy in some cases, but that could be eliminated
at least in the non-rotated DRI page flipping case. has the
start of TearFree support for the modesetting driver, but it's still
mutually exclusive with rotation (DRI3 page flipping should work with
TearFree, but may still exhibit tearing if the client/user disables

Hope this helps,

Earthling Michel Dänzer               |     
Libre software enthusiast             |             Mesa and X developer

More information about the xorg mailing list