OSDN Git Service

drm/nouveau/engine: rename some functions to avoid upcoming conflicts
[uclinux-h8/linux.git] / drivers / gpu / drm / nouveau / include / nvkm / core / engine.h
1 #ifndef __NVKM_ENGINE_H__
2 #define __NVKM_ENGINE_H__
3 #include <core/subdev.h>
4
5 #define NV_ENGINE_(eng,var) (((var) << 8) | (eng))
6 #define NV_ENGINE(name,var)  NV_ENGINE_(NVDEV_ENGINE_##name, (var))
7
8 struct nvkm_engine {
9         struct nvkm_subdev subdev;
10         struct nvkm_oclass *cclass;
11         struct nvkm_oclass *sclass;
12
13         struct list_head contexts;
14         spinlock_t lock;
15
16         void (*tile_prog)(struct nvkm_engine *, int region);
17         int  (*tlb_flush)(struct nvkm_engine *);
18 };
19
20 static inline struct nvkm_engine *
21 nv_engine(void *obj)
22 {
23 #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
24         BUG_ON(!nv_iclass(obj, NV_ENGINE_CLASS));
25 #endif
26         return obj;
27 }
28
29 static inline int
30 nv_engidx(struct nvkm_engine *engine)
31 {
32         return nv_subidx(&engine->subdev);
33 }
34
35 struct nvkm_engine *nvkm_engine(void *obj, int idx);
36
37 #define nvkm_engine_create(p,e,c,d,i,f,r)                                   \
38         nvkm_engine_create_((p), (e), (c), (d), (i), (f),                   \
39                                sizeof(**r),(void **)r)
40
41 #define nvkm_engine_destroy(p)                                              \
42         nvkm_subdev_destroy(&(p)->subdev)
43 #define nvkm_engine_init_old(p)                                                \
44         nvkm_subdev_init_old(&(p)->subdev)
45 #define nvkm_engine_fini_old(p,s)                                              \
46         nvkm_subdev_fini_old(&(p)->subdev, (s))
47
48 int nvkm_engine_create_(struct nvkm_object *, struct nvkm_object *,
49                            struct nvkm_oclass *, bool, const char *,
50                            const char *, int, void **);
51
52 #define _nvkm_engine_dtor _nvkm_subdev_dtor
53 #define _nvkm_engine_init _nvkm_subdev_init
54 #define _nvkm_engine_fini _nvkm_subdev_fini
55
56 #include <core/device.h>
57 #endif