diff options
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) | |||
70 | return msm_obj->gpu != NULL; | 70 | return msm_obj->gpu != NULL; |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline uint32_t msm_gem_fence(struct msm_gem_object *msm_obj, | ||
74 | uint32_t op) | ||
75 | { | ||
76 | uint32_t fence = 0; | ||
77 | |||
78 | if (op & MSM_PREP_READ) | ||
79 | fence = msm_obj->write_fence; | ||
80 | if (op & MSM_PREP_WRITE) | ||
81 | fence = max(fence, msm_obj->read_fence); | ||
82 | |||
83 | return fence; | ||
84 | } | ||
85 | |||
73 | #define MAX_CMDS 4 | 86 | #define MAX_CMDS 4 |
74 | 87 | ||
75 | /* Created per submit-ioctl, to track bo's and cmdstream bufs, etc, | 88 | /* Created per submit-ioctl, to track bo's and cmdstream bufs, etc, |