diff options
author | Rob Clark <robdclark@gmail.com> | 2016-03-15 17:22:13 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-05-08 10:19:51 -0400 |
commit | ca762a8ae7f453978a4769af9dcd3cb08e45b932 (patch) | |
tree | 1869cbdbcd1ec7cc4aec82e4dced7acc1a0a3535 /drivers/gpu/drm/msm/msm_fence.h | |
parent | 340faef2418989b2573b82e6c708ef9e24ca439b (diff) | |
download | linux-ca762a8ae7f453978a4769af9dcd3cb08e45b932.tar.gz linux-ca762a8ae7f453978a4769af9dcd3cb08e45b932.tar.bz2 linux-ca762a8ae7f453978a4769af9dcd3cb08e45b932.zip |
drm/msm: introduce msm_fence_context
Better encapsulate the per-timeline stuff into fence-context. For now
there is just a single fence-context, but eventually we'll also have one
per-CRTC to enable fully explicit fencing.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_fence.h')
-rw-r--r-- | drivers/gpu/drm/msm/msm_fence.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/msm_fence.h b/drivers/gpu/drm/msm/msm_fence.h index 6ddb81c2c366..3ed20981fc05 100644 --- a/drivers/gpu/drm/msm/msm_fence.h +++ b/drivers/gpu/drm/msm/msm_fence.h @@ -20,6 +20,21 @@ #include "msm_drv.h" +struct msm_fence_context { + struct drm_device *dev; + const char *name; + /* last_fence == completed_fence --> no pending work */ + uint32_t last_fence; /* last assigned fence */ + uint32_t completed_fence; /* last completed fence */ + wait_queue_head_t event; + /* callbacks deferred until bo is inactive: */ + struct list_head fence_cbs; +}; + +struct msm_fence_context * msm_fence_context_alloc(struct drm_device *dev, + const char *name); +void msm_fence_context_free(struct msm_fence_context *fctx); + /* callback from wq once fence has passed: */ struct msm_fence_cb { struct work_struct work; @@ -34,10 +49,10 @@ void __msm_fence_worker(struct work_struct *work); (_cb)->func = _func; \ } while (0) -int msm_wait_fence(struct drm_device *dev, uint32_t fence, +int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence, ktime_t *timeout, bool interruptible); -int msm_queue_fence_cb(struct drm_device *dev, +int msm_queue_fence_cb(struct msm_fence_context *fctx, struct msm_fence_cb *cb, uint32_t fence); -void msm_update_fence(struct drm_device *dev, uint32_t fence); +void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence); #endif |