]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/gpu/drm/nouveau/include/nvkm/core/engine.h
Merge remote-tracking branches 'asoc/topic/max98925', 'asoc/topic/max98927', 'asoc...
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / nouveau / include / nvkm / core / engine.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_ENGINE_H__
3 #define __NVKM_ENGINE_H__
4 #define nvkm_engine(p) container_of((p), struct nvkm_engine, subdev)
5 #include <core/subdev.h>
6 struct nvkm_fifo_chan;
7 struct nvkm_fb_tile;
8
9 struct nvkm_engine {
10 const struct nvkm_engine_func *func;
11 struct nvkm_subdev subdev;
12 spinlock_t lock;
13
14 int usecount;
15 };
16
17 struct nvkm_engine_func {
18 void *(*dtor)(struct nvkm_engine *);
19 int (*oneinit)(struct nvkm_engine *);
20 int (*init)(struct nvkm_engine *);
21 int (*fini)(struct nvkm_engine *, bool suspend);
22 void (*intr)(struct nvkm_engine *);
23 void (*tile)(struct nvkm_engine *, int region, struct nvkm_fb_tile *);
24 bool (*chsw_load)(struct nvkm_engine *);
25
26 struct {
27 int (*sclass)(struct nvkm_oclass *, int index,
28 const struct nvkm_device_oclass **);
29 } base;
30
31 struct {
32 int (*cclass)(struct nvkm_fifo_chan *,
33 const struct nvkm_oclass *,
34 struct nvkm_object **);
35 int (*sclass)(struct nvkm_oclass *, int index);
36 } fifo;
37
38 const struct nvkm_object_func *cclass;
39 struct nvkm_sclass sclass[];
40 };
41
42 int nvkm_engine_ctor(const struct nvkm_engine_func *, struct nvkm_device *,
43 int index, bool enable, struct nvkm_engine *);
44 int nvkm_engine_new_(const struct nvkm_engine_func *, struct nvkm_device *,
45 int index, bool enable, struct nvkm_engine **);
46 struct nvkm_engine *nvkm_engine_ref(struct nvkm_engine *);
47 void nvkm_engine_unref(struct nvkm_engine **);
48 void nvkm_engine_tile(struct nvkm_engine *, int region);
49 bool nvkm_engine_chsw_load(struct nvkm_engine *);
50 #endif