treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / lima / lima_ctx.h
blob6154e5c9bfe4971ca094b4fe91beb988839cbd55
1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /* Copyright 2018-2019 Qiang Yu <yuq825@gmail.com> */
4 #ifndef __LIMA_CTX_H__
5 #define __LIMA_CTX_H__
7 #include <linux/xarray.h>
9 #include "lima_device.h"
11 struct lima_ctx {
12 struct kref refcnt;
13 struct lima_device *dev;
14 struct lima_sched_context context[lima_pipe_num];
15 atomic_t guilty;
18 struct lima_ctx_mgr {
19 struct mutex lock;
20 struct xarray handles;
23 int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id);
24 int lima_ctx_free(struct lima_ctx_mgr *mgr, u32 id);
25 struct lima_ctx *lima_ctx_get(struct lima_ctx_mgr *mgr, u32 id);
26 void lima_ctx_put(struct lima_ctx *ctx);
27 void lima_ctx_mgr_init(struct lima_ctx_mgr *mgr);
28 void lima_ctx_mgr_fini(struct lima_ctx_mgr *mgr);
30 #endif