]> git.baikalelectronics.ru Git - kernel.git/commit
drm: qxl: Consolidate bo reservation when pinning
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>
Mon, 27 Feb 2017 20:43:16 +0000 (17:43 -0300)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 28 Feb 2017 16:26:08 +0000 (17:26 +0100)
commit000f2ad5a994d144f4780899bb11a173f310655a
tree339d67c1dc7aa4ad326bc67519314748482619f9
parent726ab050c8858ea052fbdbe2b1068da508ddb70d
drm: qxl: Consolidate bo reservation when pinning

Every attempt to pin/unpin objects in memory requires
qxl_bo_reserve/unreserve calls around the pinning operation to protect
the object from concurrent access, which causes that call sequence to be
reproduced every place where pinning is needed.  In some cases, that
sequence was not executed correctly, resulting in potential unprotected
pinning operations.

This commit encapsulates the reservation inside a new wrapper to make
sure it is always handled properly.  In cases where reservation must be
done beforehand, for some reason, one can use the unprotected version
__qxl_bo_pin/unpin.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170227204328.18761-3-krisman@collabora.co.uk
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/qxl/qxl_display.c
drivers/gpu/drm/qxl/qxl_fb.c
drivers/gpu/drm/qxl/qxl_object.c