“562a060611de60d6cceecb8a71847216679eef2a”上不存在“drivers/git@gitcode.net:openeuler/kernel.git”
outpdp.h 2.4 KB
Newer Older
1 2
#ifndef __NVKM_DISP_OUTP_DP_H__
#define __NVKM_DISP_OUTP_DP_H__
3 4 5 6 7 8 9 10 11
#define nvkm_output_dp(p) container_of((p), struct nvkm_output_dp, base)
#ifndef MSG
#define MSG(l,f,a...)                                                          \
	nvkm_##l(&outp->base.disp->engine.subdev, "%02x:%04x:%04x: "f,         \
		 outp->base.index, outp->base.info.hasht,                      \
		 outp->base.info.hashm, ##a)
#define DBG(f,a...) MSG(debug, f, ##a)
#define ERR(f,a...) MSG(error, f, ##a)
#endif
12
#include "outp.h"
13

14
#include <core/notify.h>
15 16 17 18
#include <subdev/bios.h>
#include <subdev/bios/dp.h>

struct nvkm_output_dp {
19
	const struct nvkm_output_dp_func *func;
20 21 22 23 24
	struct nvkm_output base;

	struct nvbios_dpout info;
	u8 version;

25 26
	struct nvkm_i2c_aux *aux;

27
	struct nvkm_notify irq;
28
	struct nvkm_notify hpd;
29 30
	bool present;
	u8 dpcd[16];
31

32
	struct mutex mutex;
33 34
	struct {
		atomic_t done;
35
		bool mst;
36
	} lt;
37 38
};

39
struct nvkm_output_dp_func {
40
	int (*pattern)(struct nvkm_output_dp *, int);
41
	int (*lnk_pwr)(struct nvkm_output_dp *, int nr);
42 43
	int (*lnk_ctl)(struct nvkm_output_dp *, int nr, int bw, bool ef);
	int (*drv_ctl)(struct nvkm_output_dp *, int ln, int vs, int pe, int pc);
44 45
	void (*vcpi)(struct nvkm_output_dp *, int head, u8 start_slot,
		     u8 num_slots, u16 pbn, u16 aligned_pbn);
46 47
};

48
int nvkm_output_dp_train(struct nvkm_output *, u32 rate);
49 50 51 52 53 54 55 56

int nvkm_output_dp_ctor(const struct nvkm_output_dp_func *, struct nvkm_disp *,
			int index, struct dcb_output *, struct nvkm_i2c_aux *,
			struct nvkm_output_dp *);
int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *,
			int index, struct dcb_output *,
			struct nvkm_output **);

57 58
int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);
59

60 61 62
int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		   struct nvkm_output **);
int g94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int);
63

64 65 66
int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);
int gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *, int, int, bool);
67
int gf119_sor_dp_drv_ctl(struct nvkm_output_dp *, int, int, int, int);
68
void gf119_sor_dp_vcpi(struct nvkm_output_dp *, int, u8, u8, u16, u16);
69

70 71 72 73 74 75
int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);
int gm107_sor_dp_pattern(struct nvkm_output_dp *, int);

int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
		     struct nvkm_output **);
76
#endif