libdrm atomic_add_unless() may reverse meaning of return value

Francois Tigeot ftigeot at
Tue Apr 11 12:33:13 PDT 2017

On Tue, Apr 11, 2017 at 06:02:46PM +0200, Francois Tigeot wrote:
> For what it's worth, an almost identical issue was fixed in the kernel version
> of atomic_add_unless() by Yellow Rabbit back in 2015:
> Now, I haven't heard reports of graphics glitches on i915 hardware which
> could have been caused by this particular function.
> Glxgears has also been operating perfectly fine on all the Intel GPU boxes
> I had the chance to test it on.
> I wonder what code paths common Linux distros use here; it could be useful
> to do the same thing they do and just remove the broken function.
> Thanks for the heads up though, I'll cook up a local dports patch.

In the end, the proposed libdrm patch was actually breaking OpenGL
I tested it on a Broadwell + Mesa 17.0.3 + DragonFly master laptop.

The only visible error message was this one:
"intel_do_flush_locked failed: No such file or directory"

The function still seems buggy but the end result was far from the expected
outcome; libdrm dports build instructions haven't been changed.

Francois Tigeot

More information about the Users mailing list