Linux Audio

Check our new training course

Real-Time Linux with PREEMPT_RT training

Feb 18-20, 2025
Register
Loading...
 1#ifndef __NVKM_DISP_OUTP_DP_H__
 2#define __NVKM_DISP_OUTP_DP_H__
 3#define nvkm_output_dp(p) container_of((p), struct nvkm_output_dp, base)
 4#ifndef MSG
 5#define MSG(l,f,a...)                                                          \
 6	nvkm_##l(&outp->base.disp->engine.subdev, "%02x:%04x:%04x: "f,         \
 7		 outp->base.index, outp->base.info.hasht,                      \
 8		 outp->base.info.hashm, ##a)
 9#define DBG(f,a...) MSG(debug, f, ##a)
10#define ERR(f,a...) MSG(error, f, ##a)
11#endif
12#include "outp.h"
13
14#include <core/notify.h>
15#include <subdev/bios.h>
16#include <subdev/bios/dp.h>
17
18struct nvkm_output_dp {
19	const struct nvkm_output_dp_func *func;
20	struct nvkm_output base;
21
22	struct nvbios_dpout info;
23	u8 version;
24
25	struct nvkm_i2c_aux *aux;
26
27	struct nvkm_notify irq;
28	struct nvkm_notify hpd;
29	bool present;
30	u8 dpcd[16];
31
32	struct mutex mutex;
33	struct {
34		atomic_t done;
35		bool mst;
36	} lt;
37};
38
39struct nvkm_output_dp_func {
40	int (*pattern)(struct nvkm_output_dp *, int);
41	int (*lnk_pwr)(struct nvkm_output_dp *, int nr);
42	int (*lnk_ctl)(struct nvkm_output_dp *, int nr, int bw, bool ef);
43	int (*drv_ctl)(struct nvkm_output_dp *, int ln, int vs, int pe, int pc);
44	void (*vcpi)(struct nvkm_output_dp *, int head, u8 start_slot,
45		     u8 num_slots, u16 pbn, u16 aligned_pbn);
46};
47
48int nvkm_output_dp_train(struct nvkm_output *, u32 rate);
49
50int nvkm_output_dp_ctor(const struct nvkm_output_dp_func *, struct nvkm_disp *,
51			int index, struct dcb_output *, struct nvkm_i2c_aux *,
52			struct nvkm_output_dp *);
53int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *,
54			int index, struct dcb_output *,
55			struct nvkm_output **);
56
57int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *,
58		     struct nvkm_output **);
59
60int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
61		   struct nvkm_output **);
62int g94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int);
63
64int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
65		     struct nvkm_output **);
66int gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *, int, int, bool);
67int gf119_sor_dp_drv_ctl(struct nvkm_output_dp *, int, int, int, int);
68void gf119_sor_dp_vcpi(struct nvkm_output_dp *, int, u8, u8, u16, u16);
69
70int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
71		     struct nvkm_output **);
72int gm107_sor_dp_pattern(struct nvkm_output_dp *, int);
73
74int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
75		     struct nvkm_output **);
76#endif