[Mesa-dev] dri3 thread safe

Michel Dänzer michel at daenzer.net
Tue Oct 10 08:43:23 UTC 2017


On 10/10/17 10:39 AM, Thomas Hellstrom wrote:
> Hi, Gregory.
> 
> I just noticed the following text in dri3_glx.c:
> 
> 63b78c93 (Gregory Hainaut   2017-05-29 13:18:26 +0200  506)    /* Unlike
> DRI2, DRI3 doesn't call GetBuffers/GetBuffersWithFormat
> 63b78c93 (Gregory Hainaut   2017-05-29 13:18:26 +0200  507)     * during
> draw so we're safe here.
> 63b78c93 (Gregory Hainaut   2017-05-29 13:18:26 +0200  508)     */
> 
> This isn't true anymore, as dri3 now invalidates drawables
> asynchronously, as the previous code generated numerous viewport
> inconsistencies and rendering errors. Do we need to explicitly make dri3
> thread-safe for your glthread work?

The comment refers to DRI2 calling GetBuffers/GetBuffersWithFormat from
the rendering thread, which isn't safe due to Xlib's design. Since DRI3
uses XCB directly, at least this particular issue shouldn't apply to it.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list