Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / msm / msm_fence.h
blob2d9af66dcca55825f375b800cf12638f543169a6
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2013-2016 Red Hat
4 * Author: Rob Clark <robdclark@gmail.com>
5 */
7 #ifndef __MSM_FENCE_H__
8 #define __MSM_FENCE_H__
10 #include "msm_drv.h"
12 struct msm_fence_context {
13 struct drm_device *dev;
14 char name[32];
15 unsigned context;
16 /* last_fence == completed_fence --> no pending work */
17 uint32_t last_fence; /* last assigned fence */
18 uint32_t completed_fence; /* last completed fence */
19 wait_queue_head_t event;
20 spinlock_t spinlock;
23 struct msm_fence_context * msm_fence_context_alloc(struct drm_device *dev,
24 const char *name);
25 void msm_fence_context_free(struct msm_fence_context *fctx);
27 int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence,
28 ktime_t *timeout, bool interruptible);
29 void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence);
31 struct dma_fence * msm_fence_alloc(struct msm_fence_context *fctx);
33 #endif