summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h
blob: e48251c378227e219311fc1f44894bc639db9119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __NVKM_DISP_OUTP_H__
#define __NVKM_DISP_OUTP_H__
#include <engine/disp.h>

#include <subdev/bios.h>
#include <subdev/bios/dcb.h>

struct nvkm_outp {
	const struct nvkm_outp_func *func;
	struct nvkm_disp *disp;
	int index;
	struct dcb_output info;

	struct nvkm_i2c_bus *i2c;
	int or;

	struct list_head head;
	struct nvkm_conn *conn;

	/* Assembly state. */
	struct nvkm_ior *ior;
};

int nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *,
		   int index, struct dcb_output *, struct nvkm_outp *);
void nvkm_outp_del(struct nvkm_outp **);
void nvkm_outp_init(struct nvkm_outp *);
void nvkm_outp_fini(struct nvkm_outp *);

struct nvkm_outp_func {
	void *(*dtor)(struct nvkm_outp *);
	void (*init)(struct nvkm_outp *);
	void (*fini)(struct nvkm_outp *);
};

#define nvkm_output nvkm_outp
#define nvkm_output_func nvkm_outp_func
#define nvkm_output_new_ nvkm_outp_new_

int nvkm_outp_new_(const struct nvkm_outp_func *, struct nvkm_disp *,
		   int index, struct dcb_output *, struct nvkm_output **);

int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *,
			struct nvkm_output **);
int nv50_sor_output_new(struct nvkm_disp *, int, struct dcb_output *,
			struct nvkm_output **);
int nv50_pior_output_new(struct nvkm_disp *, int, struct dcb_output *,
			 struct nvkm_output **);

u32 g94_sor_dp_lane_map(struct nvkm_device *, u8 lane);

void gm200_sor_magic(struct nvkm_output *outp);

#define OUTP_MSG(o,l,f,a...) do {                                              \
	struct nvkm_outp *_outp = (o);                                         \
	nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n",    \
		 _outp->index, _outp->info.hasht, _outp->info.hashm, ##a);     \
} while(0)
#define OUTP_ERR(o,f,a...) OUTP_MSG((o), error, f, ##a)
#define OUTP_DBG(o,f,a...) OUTP_MSG((o), debug, f, ##a)
#define OUTP_TRACE(o,f,a...) OUTP_MSG((o), trace, f, ##a)
#endif