1 #ifndef __NVKM_DISP_CONN_H__
2 #define __NVKM_DISP_CONN_H__
3 #include "priv.h"
4 
5 #include <core/notify.h>
6 
7 struct nvkm_connector {
8 	struct nouveau_object base;
9 	struct list_head head;
10 
11 	struct nvbios_connE info;
12 	int index;
13 
14 	struct nvkm_notify hpd;
15 };
16 
17 #define nvkm_connector_create(p,e,c,b,i,d)                                     \
18 	nvkm_connector_create_((p), (e), (c), (b), (i), sizeof(**d), (void **)d)
19 #define nvkm_connector_destroy(d) ({                                           \
20 	struct nvkm_connector *disp = (d);                                     \
21 	_nvkm_connector_dtor(nv_object(disp));                                 \
22 })
23 #define nvkm_connector_init(d) ({                                              \
24 	struct nvkm_connector *disp = (d);                                     \
25 	_nvkm_connector_init(nv_object(disp));                                 \
26 })
27 #define nvkm_connector_fini(d,s) ({                                            \
28 	struct nvkm_connector *disp = (d);                                     \
29 	_nvkm_connector_fini(nv_object(disp), (s));                            \
30 })
31 
32 int nvkm_connector_create_(struct nouveau_object *, struct nouveau_object *,
33 			   struct nouveau_oclass *, struct nvbios_connE *,
34 			   int, int, void **);
35 
36 int  _nvkm_connector_ctor(struct nouveau_object *, struct nouveau_object *,
37 			  struct nouveau_oclass *, void *, u32,
38 			  struct nouveau_object **);
39 void _nvkm_connector_dtor(struct nouveau_object *);
40 int  _nvkm_connector_init(struct nouveau_object *);
41 int  _nvkm_connector_fini(struct nouveau_object *, bool);
42 
43 struct nvkm_connector_impl {
44 	struct nouveau_oclass base;
45 };
46 
47 #ifndef MSG
48 #define MSG(l,f,a...) do {                                                     \
49 	struct nvkm_connector *_conn = (void *)conn;                           \
50 	nv_##l(_conn, "%02x:%02x%02x: "f, _conn->index,                        \
51 	       _conn->info.location, _conn->info.type, ##a);                   \
52 } while(0)
53 #define DBG(f,a...) MSG(debug, f, ##a)
54 #define ERR(f,a...) MSG(error, f, ##a)
55 #endif
56 
57 #endif
58