drm/msm: Add syncobj support.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 23 Jan 2020 23:57:10 +0000 (00:57 +0100)
committerRob Clark <robdclark@chromium.org>
Mon, 18 May 2020 16:26:32 +0000 (09:26 -0700)
commitab723b7a992a19b843f798b183f53f7472f598c8
tree349a7ad33092ad4f673c201ba365b38a051ec6c1
parent6a523388a2d4a1a00ec4153592be997066fb596e
drm/msm: Add syncobj support.

This

1) Enables core DRM syncobj support.
2) Adds options to the submission ioctl to wait/signal syncobjs.

Just like the wait fence fd, this does inline waits. Using the
scheduler would be nice but I believe it is out of scope for
this work.

Support for timeline syncobjs is implemented and the interface
is ready for it, but I'm not enabling it yet until there is
some code for turnip to use it.

The reset is mostly in there because in the presence of waiting
and signalling the same semaphores, resetting them after
signalling can become very annoying.

v2:
  - Fixed style issues
  - Removed a cleanup issue in a failure case
  - Moved to a copy_from_user per syncobj

v3:
 - Fixed a missing declaration introduced in v2
 - Reworked to use ERR_PTR/PTR_ERR
 - Simplified failure gotos.

Used by: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gem_submit.c
include/uapi/drm/msm_drm.h