1 | #ifndef __NOUVEAU_DISP_H__ |
2 | #define __NOUVEAU_DISP_H__ |
3 | |
4 | #include <core/object.h> |
5 | #include <core/engine.h> |
6 | #include <core/device.h> |
7 | #include <core/event.h> |
8 | |
9 | struct nouveau_disp { |
10 | struct nouveau_engine base; |
11 | struct nouveau_event *vblank; |
12 | }; |
13 | |
14 | static inline struct nouveau_disp * |
15 | nouveau_disp(void *obj) |
16 | { |
17 | return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_DISP]; |
18 | } |
19 | |
20 | #define nouveau_disp_create(p,e,c,h,i,x,d) \ |
21 | nouveau_disp_create_((p), (e), (c), (h), (i), (x), \ |
22 | sizeof(**d), (void **)d) |
23 | #define nouveau_disp_destroy(d) ({ \ |
24 | struct nouveau_disp *disp = (d); \ |
25 | _nouveau_disp_dtor(nv_object(disp)); \ |
26 | }) |
27 | #define nouveau_disp_init(d) \ |
28 | nouveau_engine_init(&(d)->base) |
29 | #define nouveau_disp_fini(d,s) \ |
30 | nouveau_engine_fini(&(d)->base, (s)) |
31 | |
32 | int nouveau_disp_create_(struct nouveau_object *, struct nouveau_object *, |
33 | struct nouveau_oclass *, int heads, |
34 | const char *, const char *, int, void **); |
35 | void _nouveau_disp_dtor(struct nouveau_object *); |
36 | #define _nouveau_disp_init _nouveau_engine_init |
37 | #define _nouveau_disp_fini _nouveau_engine_fini |
38 | |
39 | extern struct nouveau_oclass *nv04_disp_oclass; |
40 | extern struct nouveau_oclass *nv50_disp_oclass; |
41 | extern struct nouveau_oclass *nv84_disp_oclass; |
42 | extern struct nouveau_oclass *nva0_disp_oclass; |
43 | extern struct nouveau_oclass *nv94_disp_oclass; |
44 | extern struct nouveau_oclass *nva3_disp_oclass; |
45 | extern struct nouveau_oclass *nvd0_disp_oclass; |
46 | extern struct nouveau_oclass *nve0_disp_oclass; |
47 | extern struct nouveau_oclass *nvf0_disp_oclass; |
48 | extern struct nouveau_oclass *gm107_disp_oclass; |
49 | |
50 | #endif |
51 | |