Skip to content

glamor: Force to flush when copying an exporting pixmap

Luc Ma requested to merge lucmann/xserver:glamor-fix-potential-bo-race into master

Consider the following scenario involving egl-create-pbuffer-surface in Piglit:

egl-create-pbuffer-surface(Mesa)        Xorg
eglCreatePbufferSurface();
                                        ProcCreatePixmap()
xcb_dri3_buffers_from_pixmap();
                                        proc_dri3_buffers_from_pixmap()
                                        glamor_egl_fds_from_pixmap()
                                        glamor_make_pixmap_exportable()
                                        glamor_copy_fbo_fbo_draw()
                                        ( no flush )
eglBindTexImage();
draw();
glReadPixels();                         BlockHandler()
(flush)                                 (flush)

In this case, there is no guarantee that whose command stream goes into GPU first. There is a small chance that pixmap BO importer's render buffer could be overwritten by glamor.

Signed-off-by: Luc Ma luc@sietium.com

Edited by Luc Ma

Merge request reports