diff options
author | Rob Clark <robdclark@gmail.com> | 2014-11-07 18:10:04 -0500 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-11-16 14:27:35 -0500 |
commit | 69193e5060dd1c8f7cd614bad05f33f3e042ae6d (patch) | |
tree | 94f8c5ab7e2847e8955cbd6323c7365dbf83e918 /drivers/gpu/drm/msm/msm_gem.h | |
parent | a8cecf33249b80d8a3c2ca5df1c45eb3b5231b28 (diff) |
drm/msm: small fence cleanup
Give ourselves a way to wait for certain fence #.. makes it easier to
wait on a set of bo's, which we'll need for atomic.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem.h')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h index bfb052688f8e..8fbbd0594c46 100644 --- a/drivers/gpu/drm/msm/msm_gem.h +++ b/drivers/gpu/drm/msm/msm_gem.h @@ -70,6 +70,19 @@ static inline bool is_active(struct msm_gem_object *msm_obj) return msm_obj->gpu != NULL; } +static inline uint32_t msm_gem_fence(struct msm_gem_object *msm_obj, + uint32_t op) +{ + uint32_t fence = 0; + + if (op & MSM_PREP_READ) + fence = msm_obj->write_fence; + if (op & MSM_PREP_WRITE) + fence = max(fence, msm_obj->read_fence); + + return fence; +} + #define MAX_CMDS 4 /* Created per submit-ioctl, to track bo's and cmdstream bufs, etc, |