1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_DISP_OUTP_H__
3 #define __NVKM_DISP_OUTP_H__
4 #include <engine/disp.h>
6 #include <subdev/bios.h>
7 #include <subdev/bios/dcb.h>
10 const struct nvkm_outp_func
*func
;
11 struct nvkm_disp
*disp
;
13 struct dcb_output info
;
15 struct nvkm_i2c_bus
*i2c
;
18 struct list_head head
;
19 struct nvkm_conn
*conn
;
22 #define NVKM_OUTP_PRIV 1
23 #define NVKM_OUTP_USER 2
28 int nvkm_outp_ctor(const struct nvkm_outp_func
*, struct nvkm_disp
*,
29 int index
, struct dcb_output
*, struct nvkm_outp
*);
30 int nvkm_outp_new(struct nvkm_disp
*, int index
, struct dcb_output
*,
32 void nvkm_outp_del(struct nvkm_outp
**);
33 void nvkm_outp_init(struct nvkm_outp
*);
34 void nvkm_outp_fini(struct nvkm_outp
*);
35 int nvkm_outp_acquire(struct nvkm_outp
*, u8 user
);
36 void nvkm_outp_release(struct nvkm_outp
*, u8 user
);
37 void nvkm_outp_route(struct nvkm_disp
*);
39 struct nvkm_outp_func
{
40 void *(*dtor
)(struct nvkm_outp
*);
41 void (*init
)(struct nvkm_outp
*);
42 void (*fini
)(struct nvkm_outp
*);
43 int (*acquire
)(struct nvkm_outp
*);
44 void (*release
)(struct nvkm_outp
*, struct nvkm_ior
*);
47 #define OUTP_MSG(o,l,f,a...) do { \
48 struct nvkm_outp *_outp = (o); \
49 nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n", \
50 _outp->index, _outp->info.hasht, _outp->info.hashm, ##a); \
52 #define OUTP_ERR(o,f,a...) OUTP_MSG((o), error, f, ##a)
53 #define OUTP_DBG(o,f,a...) OUTP_MSG((o), debug, f, ##a)
54 #define OUTP_TRACE(o,f,a...) OUTP_MSG((o), trace, f, ##a)