2014-05-16 14:36:15 +10:00
|
|
|
#ifndef __NVKM_DISP_OUTP_H__
|
|
|
|
|
#define __NVKM_DISP_OUTP_H__
|
2015-01-14 15:24:57 +10:00
|
|
|
#include <core/object.h>
|
2014-05-16 14:36:15 +10:00
|
|
|
|
2015-01-14 15:24:57 +10:00
|
|
|
#include <subdev/bios.h>
|
|
|
|
|
#include <subdev/bios/dcb.h>
|
2014-05-16 14:36:15 +10:00
|
|
|
|
|
|
|
|
struct nvkm_output {
|
2015-01-14 15:24:57 +10:00
|
|
|
struct nvkm_object base;
|
2014-05-16 14:36:15 +10:00
|
|
|
struct list_head head;
|
|
|
|
|
|
|
|
|
|
struct dcb_output info;
|
|
|
|
|
int index;
|
2014-08-10 04:10:26 +10:00
|
|
|
int or;
|
2014-05-16 14:36:15 +10:00
|
|
|
|
2015-01-14 15:24:57 +10:00
|
|
|
struct nvkm_i2c_port *port;
|
|
|
|
|
struct nvkm_i2c_port *edid;
|
2014-05-16 14:36:15 +10:00
|
|
|
|
|
|
|
|
struct nvkm_connector *conn;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define nvkm_output_create(p,e,c,b,i,d) \
|
|
|
|
|
nvkm_output_create_((p), (e), (c), (b), (i), sizeof(**d), (void **)d)
|
|
|
|
|
#define nvkm_output_destroy(d) ({ \
|
|
|
|
|
struct nvkm_output *_outp = (d); \
|
|
|
|
|
_nvkm_output_dtor(nv_object(_outp)); \
|
|
|
|
|
})
|
|
|
|
|
#define nvkm_output_init(d) ({ \
|
|
|
|
|
struct nvkm_output *_outp = (d); \
|
|
|
|
|
_nvkm_output_init(nv_object(_outp)); \
|
|
|
|
|
})
|
|
|
|
|
#define nvkm_output_fini(d,s) ({ \
|
|
|
|
|
struct nvkm_output *_outp = (d); \
|
|
|
|
|
_nvkm_output_fini(nv_object(_outp), (s)); \
|
|
|
|
|
})
|
|
|
|
|
|
2015-01-14 15:24:57 +10:00
|
|
|
int nvkm_output_create_(struct nvkm_object *, struct nvkm_object *,
|
|
|
|
|
struct nvkm_oclass *, struct dcb_output *,
|
2014-05-16 14:36:15 +10:00
|
|
|
int, int, void **);
|
|
|
|
|
|
2015-01-14 15:24:57 +10:00
|
|
|
int _nvkm_output_ctor(struct nvkm_object *, struct nvkm_object *,
|
|
|
|
|
struct nvkm_oclass *, void *, u32,
|
|
|
|
|
struct nvkm_object **);
|
|
|
|
|
void _nvkm_output_dtor(struct nvkm_object *);
|
|
|
|
|
int _nvkm_output_init(struct nvkm_object *);
|
|
|
|
|
int _nvkm_output_fini(struct nvkm_object *, bool);
|
2014-05-16 14:36:15 +10:00
|
|
|
|
|
|
|
|
struct nvkm_output_impl {
|
2015-01-14 15:24:57 +10:00
|
|
|
struct nvkm_oclass base;
|
2014-05-16 14:36:15 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#ifndef MSG
|
|
|
|
|
#define MSG(l,f,a...) do { \
|
|
|
|
|
struct nvkm_output *_outp = (void *)outp; \
|
2014-12-05 12:12:23 +10:00
|
|
|
nv_##l(_outp, "%02x:%04x:%04x: "f, _outp->index, \
|
2014-05-16 14:36:15 +10:00
|
|
|
_outp->info.hasht, _outp->info.hashm, ##a); \
|
|
|
|
|
} while(0)
|
|
|
|
|
#define DBG(f,a...) MSG(debug, f, ##a)
|
|
|
|
|
#define ERR(f,a...) MSG(error, f, ##a)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|