Ben Skeggs | a8f8b48 | 2014-02-20 21:33:34 +1000 | [diff] [blame] | 1 | #ifndef __NVKM_DISP_PRIV_H__ |
| 2 | #define __NVKM_DISP_PRIV_H__ |
Ben Skeggs | a8f8b48 | 2014-02-20 21:33:34 +1000 | [diff] [blame] | 3 | #include <engine/disp.h> |
| 4 | |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 5 | struct nvkm_disp_impl { |
| 6 | struct nvkm_oclass base; |
| 7 | struct nvkm_oclass **outp; |
| 8 | struct nvkm_oclass **conn; |
Ben Skeggs | 79ca277 | 2014-08-10 04:10:20 +1000 | [diff] [blame] | 9 | const struct nvkm_event_func *vblank; |
Ben Skeggs | a8f8b48 | 2014-02-20 21:33:34 +1000 | [diff] [blame] | 10 | }; |
| 11 | |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 12 | #define nvkm_disp_create(p,e,c,h,i,x,d) \ |
| 13 | nvkm_disp_create_((p), (e), (c), (h), (i), (x), \ |
Ben Skeggs | 377b1f1 | 2014-05-14 10:26:02 +1000 | [diff] [blame] | 14 | sizeof(**d), (void **)d) |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 15 | #define nvkm_disp_destroy(d) ({ \ |
| 16 | struct nvkm_disp *disp = (d); \ |
| 17 | _nvkm_disp_dtor(nv_object(disp)); \ |
Ben Skeggs | 377b1f1 | 2014-05-14 10:26:02 +1000 | [diff] [blame] | 18 | }) |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 19 | #define nvkm_disp_init(d) ({ \ |
| 20 | struct nvkm_disp *disp = (d); \ |
| 21 | _nvkm_disp_init(nv_object(disp)); \ |
Ben Skeggs | 377b1f1 | 2014-05-14 10:26:02 +1000 | [diff] [blame] | 22 | }) |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 23 | #define nvkm_disp_fini(d,s) ({ \ |
| 24 | struct nvkm_disp *disp = (d); \ |
| 25 | _nvkm_disp_fini(nv_object(disp), (s)); \ |
Ben Skeggs | 377b1f1 | 2014-05-14 10:26:02 +1000 | [diff] [blame] | 26 | }) |
| 27 | |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 28 | int nvkm_disp_create_(struct nvkm_object *, struct nvkm_object *, |
| 29 | struct nvkm_oclass *, int heads, |
Ben Skeggs | 377b1f1 | 2014-05-14 10:26:02 +1000 | [diff] [blame] | 30 | const char *, const char *, int, void **); |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 31 | void _nvkm_disp_dtor(struct nvkm_object *); |
| 32 | int _nvkm_disp_init(struct nvkm_object *); |
| 33 | int _nvkm_disp_fini(struct nvkm_object *, bool); |
Ben Skeggs | 377b1f1 | 2014-05-14 10:26:02 +1000 | [diff] [blame] | 34 | |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 35 | extern struct nvkm_oclass *nvkm_output_oclass; |
| 36 | extern struct nvkm_oclass *nvkm_connector_oclass; |
Ben Skeggs | 7a014a8 | 2014-05-16 14:36:15 +1000 | [diff] [blame] | 37 | |
Ben Skeggs | 878da15 | 2015-01-14 15:24:57 +1000 | [diff] [blame] | 38 | int nvkm_disp_vblank_ctor(struct nvkm_object *, void *data, u32 size, |
| 39 | struct nvkm_notify *); |
| 40 | void nvkm_disp_vblank(struct nvkm_disp *, int head); |
| 41 | int nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **); |
Ben Skeggs | a8f8b48 | 2014-02-20 21:33:34 +1000 | [diff] [blame] | 42 | #endif |