1 #ifndef __NVKM_DISP_OUTP_H__ 2 #define __NVKM_DISP_OUTP_H__ 3 4 #include "priv.h" 5 6 struct nvkm_output { 7 struct nouveau_object base; 8 struct list_head head; 9 10 struct dcb_output info; 11 int index; 12 int or; 13 14 struct nouveau_i2c_port *port; 15 struct nouveau_i2c_port *edid; 16 17 struct nvkm_connector *conn; 18 }; 19 20 #define nvkm_output_create(p,e,c,b,i,d) \ 21 nvkm_output_create_((p), (e), (c), (b), (i), sizeof(**d), (void **)d) 22 #define nvkm_output_destroy(d) ({ \ 23 struct nvkm_output *_outp = (d); \ 24 _nvkm_output_dtor(nv_object(_outp)); \ 25 }) 26 #define nvkm_output_init(d) ({ \ 27 struct nvkm_output *_outp = (d); \ 28 _nvkm_output_init(nv_object(_outp)); \ 29 }) 30 #define nvkm_output_fini(d,s) ({ \ 31 struct nvkm_output *_outp = (d); \ 32 _nvkm_output_fini(nv_object(_outp), (s)); \ 33 }) 34 35 int nvkm_output_create_(struct nouveau_object *, struct nouveau_object *, 36 struct nouveau_oclass *, struct dcb_output *, 37 int, int, void **); 38 39 int _nvkm_output_ctor(struct nouveau_object *, struct nouveau_object *, 40 struct nouveau_oclass *, void *, u32, 41 struct nouveau_object **); 42 void _nvkm_output_dtor(struct nouveau_object *); 43 int _nvkm_output_init(struct nouveau_object *); 44 int _nvkm_output_fini(struct nouveau_object *, bool); 45 46 struct nvkm_output_impl { 47 struct nouveau_oclass base; 48 }; 49 50 #ifndef MSG 51 #define MSG(l,f,a...) do { \ 52 struct nvkm_output *_outp = (void *)outp; \ 53 nv_##l(nv_object(outp)->engine, "%02x:%04x:%04x: "f, _outp->index, \ 54 _outp->info.hasht, _outp->info.hashm, ##a); \ 55 } while(0) 56 #define DBG(f,a...) MSG(debug, f, ##a) 57 #define ERR(f,a...) MSG(error, f, ##a) 58 #endif 59 60 #endif 61