aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-11-15 03:58:01 -0500
committerBen Skeggs <bskeggs@redhat.com>2012-11-28 18:57:54 -0500
commit8f2abc2586279166722f0d88d24990baba4a2eaf (patch)
tree627cf68ae1ecf2d4b95cae56a002ff7fc8070385 /drivers/gpu/drm/nouveau/core
parent6c8e4633d351f6f794c8a5c03f19e8d5a25f9639 (diff)
drm/nouveau/dp: remove last bits of VBIOS parsing from DRM code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nv50.h10
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nv94.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nva3.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nve0.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c14
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/sornv94.c58
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/class.h7
8 files changed, 96 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
index 3fb5920b6be..a6bb931450f 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
@@ -26,6 +26,12 @@ struct nv50_disp_priv {
26 int (*power)(struct nv50_disp_priv *, int sor, u32 data); 26 int (*power)(struct nv50_disp_priv *, int sor, u32 data);
27 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32); 27 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32);
28 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32); 28 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32);
29 int (*dp_train_init)(struct nv50_disp_priv *, int sor, int link,
30 int head, u16 type, u16 mask, u32 data,
31 struct dcb_output *);
32 int (*dp_train_fini)(struct nv50_disp_priv *, int sor, int link,
33 int head, u16 type, u16 mask, u32 data,
34 struct dcb_output *);
29 int (*dp_train)(struct nv50_disp_priv *, int sor, int link, 35 int (*dp_train)(struct nv50_disp_priv *, int sor, int link,
30 u16 type, u16 mask, u32 data, 36 u16 type, u16 mask, u32 data,
31 struct dcb_output *); 37 struct dcb_output *);
@@ -57,6 +63,10 @@ int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
57int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32); 63int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32);
58int nv50_sor_power(struct nv50_disp_priv *, int, u32); 64int nv50_sor_power(struct nv50_disp_priv *, int, u32);
59 65
66int nv94_sor_dp_train_init(struct nv50_disp_priv *, int, int, int, u16, u16,
67 u32, struct dcb_output *);
68int nv94_sor_dp_train_fini(struct nv50_disp_priv *, int, int, int, u16, u16,
69 u32, struct dcb_output *);
60int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32, 70int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
61 struct dcb_output *); 71 struct dcb_output *);
62int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, 72int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv94.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
index b5adcc0bc0d..ba9dfd4669a 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
@@ -87,6 +87,8 @@ nv94_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
87 priv->sor.power = nv50_sor_power; 87 priv->sor.power = nv50_sor_power;
88 priv->sor.hdmi = nv84_hdmi_ctrl; 88 priv->sor.hdmi = nv84_hdmi_ctrl;
89 priv->sor.dp_train = nv94_sor_dp_train; 89 priv->sor.dp_train = nv94_sor_dp_train;
90 priv->sor.dp_train_init = nv94_sor_dp_train_init;
91 priv->sor.dp_train_fini = nv94_sor_dp_train_fini;
90 priv->sor.dp_lnkctl = nv94_sor_dp_lnkctl; 92 priv->sor.dp_lnkctl = nv94_sor_dp_lnkctl;
91 priv->sor.dp_drvctl = nv94_sor_dp_drvctl; 93 priv->sor.dp_drvctl = nv94_sor_dp_drvctl;
92 94
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nva3.c b/drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
index 83ae695ac1d..e9192ca389f 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
@@ -89,6 +89,8 @@ nva3_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
89 priv->sor.hda_eld = nva3_hda_eld; 89 priv->sor.hda_eld = nva3_hda_eld;
90 priv->sor.hdmi = nva3_hdmi_ctrl; 90 priv->sor.hdmi = nva3_hdmi_ctrl;
91 priv->sor.dp_train = nv94_sor_dp_train; 91 priv->sor.dp_train = nv94_sor_dp_train;
92 priv->sor.dp_train_init = nv94_sor_dp_train_init;
93 priv->sor.dp_train_fini = nv94_sor_dp_train_fini;
92 priv->sor.dp_lnkctl = nv94_sor_dp_lnkctl; 94 priv->sor.dp_lnkctl = nv94_sor_dp_lnkctl;
93 priv->sor.dp_drvctl = nv94_sor_dp_drvctl; 95 priv->sor.dp_drvctl = nv94_sor_dp_drvctl;
94 96
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
index a618f2213a1..24bcbc6a88b 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
@@ -951,6 +951,8 @@ nvd0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
951 priv->sor.hda_eld = nvd0_hda_eld; 951 priv->sor.hda_eld = nvd0_hda_eld;
952 priv->sor.hdmi = nvd0_hdmi_ctrl; 952 priv->sor.hdmi = nvd0_hdmi_ctrl;
953 priv->sor.dp_train = nvd0_sor_dp_train; 953 priv->sor.dp_train = nvd0_sor_dp_train;
954 priv->sor.dp_train_init = nv94_sor_dp_train_init;
955 priv->sor.dp_train_fini = nv94_sor_dp_train_fini;
954 priv->sor.dp_lnkctl = nvd0_sor_dp_lnkctl; 956 priv->sor.dp_lnkctl = nvd0_sor_dp_lnkctl;
955 priv->sor.dp_drvctl = nvd0_sor_dp_drvctl; 957 priv->sor.dp_drvctl = nvd0_sor_dp_drvctl;
956 958
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c
index 9b83a70091f..259537c4587 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c
@@ -72,6 +72,8 @@ nve0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
72 priv->sor.hda_eld = nvd0_hda_eld; 72 priv->sor.hda_eld = nvd0_hda_eld;
73 priv->sor.hdmi = nvd0_hdmi_ctrl; 73 priv->sor.hdmi = nvd0_hdmi_ctrl;
74 priv->sor.dp_train = nvd0_sor_dp_train; 74 priv->sor.dp_train = nvd0_sor_dp_train;
75 priv->sor.dp_train_init = nv94_sor_dp_train_init;
76 priv->sor.dp_train_fini = nv94_sor_dp_train_fini;
75 priv->sor.dp_lnkctl = nvd0_sor_dp_lnkctl; 77 priv->sor.dp_lnkctl = nvd0_sor_dp_lnkctl;
76 priv->sor.dp_drvctl = nvd0_sor_dp_drvctl; 78 priv->sor.dp_drvctl = nvd0_sor_dp_drvctl;
77 79
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
index 6fd25730a58..39b6b67732d 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
@@ -80,7 +80,19 @@ nv50_sor_mthd(struct nouveau_object *object, u32 mthd, void *args, u32 size)
80 ret = 0; 80 ret = 0;
81 break; 81 break;
82 case NV94_DISP_SOR_DP_TRAIN: 82 case NV94_DISP_SOR_DP_TRAIN:
83 ret = priv->sor.dp_train(priv, or, link, type, mask, data, &outp); 83 switch (data & NV94_DISP_SOR_DP_TRAIN_OP) {
84 case NV94_DISP_SOR_DP_TRAIN_OP_PATTERN:
85 ret = priv->sor.dp_train(priv, or, link, type, mask, data, &outp);
86 break;
87 case NV94_DISP_SOR_DP_TRAIN_OP_INIT:
88 ret = priv->sor.dp_train_init(priv, or, link, head, type, mask, data, &outp);
89 break;
90 case NV94_DISP_SOR_DP_TRAIN_OP_FINI:
91 ret = priv->sor.dp_train_fini(priv, or, link, head, type, mask, data, &outp);
92 break;
93 default:
94 break;
95 }
84 break; 96 break;
85 case NV94_DISP_SOR_DP_LNKCTL: 97 case NV94_DISP_SOR_DP_LNKCTL:
86 ret = priv->sor.dp_lnkctl(priv, or, link, head, type, mask, data, &outp); 98 ret = priv->sor.dp_lnkctl(priv, or, link, head, type, mask, data, &outp);
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/sornv94.c b/drivers/gpu/drm/nouveau/core/engine/disp/sornv94.c
index 49bcc76261e..f6edd009762 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/sornv94.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/sornv94.c
@@ -43,6 +43,64 @@ nv94_sor_dp_lane_map(struct nv50_disp_priv *priv, u8 lane)
43} 43}
44 44
45int 45int
46nv94_sor_dp_train_init(struct nv50_disp_priv *priv, int or, int link, int head,
47 u16 type, u16 mask, u32 data, struct dcb_output *dcbo)
48{
49 struct nouveau_bios *bios = nouveau_bios(priv);
50 struct nvbios_dpout info;
51 u8 ver, hdr, cnt, len;
52 u16 outp;
53
54 outp = nvbios_dpout_match(bios, type, mask, &ver, &hdr, &cnt, &len, &info);
55 if (outp) {
56 struct nvbios_init init = {
57 .subdev = nv_subdev(priv),
58 .bios = bios,
59 .outp = dcbo,
60 .crtc = head,
61 .execute = 1,
62 };
63
64 if (data & NV94_DISP_SOR_DP_TRAIN_INIT_SPREAD_ON)
65 init.offset = info.script[2];
66 else
67 init.offset = info.script[3];
68 nvbios_exec(&init);
69
70 init.offset = info.script[0];
71 nvbios_exec(&init);
72 }
73
74 return 0;
75}
76
77int
78nv94_sor_dp_train_fini(struct nv50_disp_priv *priv, int or, int link, int head,
79 u16 type, u16 mask, u32 data, struct dcb_output *dcbo)
80{
81 struct nouveau_bios *bios = nouveau_bios(priv);
82 struct nvbios_dpout info;
83 u8 ver, hdr, cnt, len;
84 u16 outp;
85
86 outp = nvbios_dpout_match(bios, type, mask, &ver, &hdr, &cnt, &len, &info);
87 if (outp) {
88 struct nvbios_init init = {
89 .subdev = nv_subdev(priv),
90 .bios = bios,
91 .offset = info.script[1],
92 .outp = dcbo,
93 .crtc = head,
94 .execute = 1,
95 };
96
97 nvbios_exec(&init);
98 }
99
100 return 0;
101}
102
103int
46nv94_sor_dp_train(struct nv50_disp_priv *priv, int or, int link, 104nv94_sor_dp_train(struct nv50_disp_priv *priv, int or, int link,
47 u16 type, u16 mask, u32 data, struct dcb_output *info) 105 u16 type, u16 mask, u32 data, struct dcb_output *info)
48{ 106{
diff --git a/drivers/gpu/drm/nouveau/core/include/core/class.h b/drivers/gpu/drm/nouveau/core/include/core/class.h
index dd060234b0b..47c4b3a5bd3 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/class.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/class.h
@@ -191,6 +191,13 @@ struct nve0_channel_ind_class {
191#define NV50_DISP_SOR_LVDS_SCRIPT 0x00013000 191#define NV50_DISP_SOR_LVDS_SCRIPT 0x00013000
192#define NV50_DISP_SOR_LVDS_SCRIPT_ID 0x0000ffff 192#define NV50_DISP_SOR_LVDS_SCRIPT_ID 0x0000ffff
193#define NV94_DISP_SOR_DP_TRAIN 0x00016000 193#define NV94_DISP_SOR_DP_TRAIN 0x00016000
194#define NV94_DISP_SOR_DP_TRAIN_OP 0xf0000000
195#define NV94_DISP_SOR_DP_TRAIN_OP_PATTERN 0x00000000
196#define NV94_DISP_SOR_DP_TRAIN_OP_INIT 0x10000000
197#define NV94_DISP_SOR_DP_TRAIN_OP_FINI 0x20000000
198#define NV94_DISP_SOR_DP_TRAIN_INIT_SPREAD 0x00000001
199#define NV94_DISP_SOR_DP_TRAIN_INIT_SPREAD_OFF 0x00000000
200#define NV94_DISP_SOR_DP_TRAIN_INIT_SPREAD_ON 0x00000001
194#define NV94_DISP_SOR_DP_TRAIN_PATTERN 0x00000003 201#define NV94_DISP_SOR_DP_TRAIN_PATTERN 0x00000003
195#define NV94_DISP_SOR_DP_TRAIN_PATTERN_DISABLED 0x00000000 202#define NV94_DISP_SOR_DP_TRAIN_PATTERN_DISABLED 0x00000000
196#define NV94_DISP_SOR_DP_LNKCTL 0x00016040 203#define NV94_DISP_SOR_DP_LNKCTL 0x00016040