diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-07-04 20:26:20 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-07-04 23:44:52 -0400 |
commit | d196e16ebf8bc9489ee3dc41dc5dfd84a70cec18 (patch) | |
tree | 6dfd266b79ce92b5ec62a7452f2906071e2a6aa4 /drivers/gpu | |
parent | 0bfd6f734a99ce2c7217571c45c2456ae1da63c3 (diff) |
drm/nvc0-/gr: factor out yet more unknown magic into versioned functions
NVC1/NVD9 are the only chipsets that should have anything different
happen on them after this. We previously weren't doing these
register modifications, and NVIDIA do.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
9 files changed, 42 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c index 118b54b1b83f..b80723e7d49f 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c | |||
@@ -901,6 +901,11 @@ nvc0_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
901 | } | 901 | } |
902 | 902 | ||
903 | void | 903 | void |
904 | nvc0_grctx_generate_unkn(struct nvc0_graph_priv *priv) | ||
905 | { | ||
906 | } | ||
907 | |||
908 | void | ||
904 | nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *priv) | 909 | nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *priv) |
905 | { | 910 | { |
906 | int gpc, tpc, id; | 911 | int gpc, tpc, id; |
@@ -1060,6 +1065,7 @@ nvc0_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
1060 | nv_wr32(priv, 0x404154, 0x00000000); | 1065 | nv_wr32(priv, 0x404154, 0x00000000); |
1061 | 1066 | ||
1062 | oclass->mods(priv, info); | 1067 | oclass->mods(priv, info); |
1068 | oclass->unkn(priv); | ||
1063 | 1069 | ||
1064 | nvc0_grctx_generate_tpcid(priv); | 1070 | nvc0_grctx_generate_tpcid(priv); |
1065 | nvc0_grctx_generate_r406028(priv); | 1071 | nvc0_grctx_generate_r406028(priv); |
@@ -1235,6 +1241,7 @@ nvc0_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
1235 | }, | 1241 | }, |
1236 | .main = nvc0_grctx_generate_main, | 1242 | .main = nvc0_grctx_generate_main, |
1237 | .mods = nvc0_grctx_generate_mods, | 1243 | .mods = nvc0_grctx_generate_mods, |
1244 | .unkn = nvc0_grctx_generate_unkn, | ||
1238 | .hub = nvc0_grctx_init_hub, | 1245 | .hub = nvc0_grctx_init_hub, |
1239 | .gpc = nvc0_grctx_init_gpc, | 1246 | .gpc = nvc0_grctx_init_gpc, |
1240 | .icmd = nvc0_grctx_init_icmd, | 1247 | .icmd = nvc0_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c index b60dffab224f..e5be3ee7f172 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c | |||
@@ -756,6 +756,17 @@ nvc1_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
756 | } | 756 | } |
757 | } | 757 | } |
758 | 758 | ||
759 | void | ||
760 | nvc1_grctx_generate_unkn(struct nvc0_graph_priv *priv) | ||
761 | { | ||
762 | nv_mask(priv, 0x418c6c, 0x00000001, 0x00000001); | ||
763 | nv_mask(priv, 0x41980c, 0x00000010, 0x00000010); | ||
764 | nv_mask(priv, 0x419814, 0x00000004, 0x00000004); | ||
765 | nv_mask(priv, 0x4064c0, 0x80000000, 0x80000000); | ||
766 | nv_mask(priv, 0x405800, 0x08000000, 0x08000000); | ||
767 | nv_mask(priv, 0x419c00, 0x00000008, 0x00000008); | ||
768 | } | ||
769 | |||
759 | static struct nvc0_graph_init * | 770 | static struct nvc0_graph_init * |
760 | nvc1_grctx_init_hub[] = { | 771 | nvc1_grctx_init_hub[] = { |
761 | nvc0_grctx_init_base, | 772 | nvc0_grctx_init_base, |
@@ -804,6 +815,7 @@ nvc1_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
804 | }, | 815 | }, |
805 | .main = nvc0_grctx_generate_main, | 816 | .main = nvc0_grctx_generate_main, |
806 | .mods = nvc1_grctx_generate_mods, | 817 | .mods = nvc1_grctx_generate_mods, |
818 | .unkn = nvc1_grctx_generate_unkn, | ||
807 | .hub = nvc1_grctx_init_hub, | 819 | .hub = nvc1_grctx_init_hub, |
808 | .gpc = nvc1_grctx_init_gpc, | 820 | .gpc = nvc1_grctx_init_gpc, |
809 | .icmd = nvc1_grctx_init_icmd, | 821 | .icmd = nvc1_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc3.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc3.c index 56fa54719d2e..8f237b3bd8c6 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc3.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc3.c | |||
@@ -91,6 +91,7 @@ nvc3_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
91 | }, | 91 | }, |
92 | .main = nvc0_grctx_generate_main, | 92 | .main = nvc0_grctx_generate_main, |
93 | .mods = nvc0_grctx_generate_mods, | 93 | .mods = nvc0_grctx_generate_mods, |
94 | .unkn = nvc0_grctx_generate_unkn, | ||
94 | .hub = nvc0_grctx_init_hub, | 95 | .hub = nvc0_grctx_init_hub, |
95 | .gpc = nvc3_grctx_init_gpc, | 96 | .gpc = nvc3_grctx_init_gpc, |
96 | .icmd = nvc0_grctx_init_icmd, | 97 | .icmd = nvc0_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c index 2ba8ea81a63a..d0d4ce3c4892 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c | |||
@@ -362,6 +362,7 @@ nvc8_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
362 | }, | 362 | }, |
363 | .main = nvc0_grctx_generate_main, | 363 | .main = nvc0_grctx_generate_main, |
364 | .mods = nvc0_grctx_generate_mods, | 364 | .mods = nvc0_grctx_generate_mods, |
365 | .unkn = nvc0_grctx_generate_unkn, | ||
365 | .hub = nvc0_grctx_init_hub, | 366 | .hub = nvc0_grctx_init_hub, |
366 | .gpc = nvc8_grctx_init_gpc, | 367 | .gpc = nvc8_grctx_init_gpc, |
367 | .icmd = nvc8_grctx_init_icmd, | 368 | .icmd = nvc8_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c index 25d5676eec47..36fa4da66abb 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c | |||
@@ -227,13 +227,7 @@ nvd7_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
227 | nv_wr32(priv, 0x404154, 0x00000000); | 227 | nv_wr32(priv, 0x404154, 0x00000000); |
228 | 228 | ||
229 | oclass->mods(priv, info); | 229 | oclass->mods(priv, info); |
230 | 230 | oclass->unkn(priv); | |
231 | nv_wr32(priv, 0x418c6c, 0x1); | ||
232 | nv_wr32(priv, 0x41980c, 0x10); | ||
233 | nv_wr32(priv, 0x41be08, 0x4); | ||
234 | nv_wr32(priv, 0x4064c0, 0x801a0078); | ||
235 | nv_wr32(priv, 0x405800, 0xf8000bf); | ||
236 | nv_wr32(priv, 0x419c00, 0xa); | ||
237 | 231 | ||
238 | nvc0_grctx_generate_tpcid(priv); | 232 | nvc0_grctx_generate_tpcid(priv); |
239 | nvc0_grctx_generate_r406028(priv); | 233 | nvc0_grctx_generate_r406028(priv); |
@@ -296,6 +290,7 @@ nvd7_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
296 | }, | 290 | }, |
297 | .main = nvd7_grctx_generate_main, | 291 | .main = nvd7_grctx_generate_main, |
298 | .mods = nvd7_grctx_generate_mods, | 292 | .mods = nvd7_grctx_generate_mods, |
293 | .unkn = nve4_grctx_generate_unkn, | ||
299 | .hub = nvd7_grctx_init_hub, | 294 | .hub = nvd7_grctx_init_hub, |
300 | .gpc = nvd7_grctx_init_gpc, | 295 | .gpc = nvd7_grctx_init_gpc, |
301 | .icmd = nvd9_grctx_init_icmd, | 296 | .icmd = nvd9_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c index e4eb91670ef2..818a4751df46 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c | |||
@@ -507,6 +507,7 @@ nvd9_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
507 | }, | 507 | }, |
508 | .main = nvc0_grctx_generate_main, | 508 | .main = nvc0_grctx_generate_main, |
509 | .mods = nvc1_grctx_generate_mods, | 509 | .mods = nvc1_grctx_generate_mods, |
510 | .unkn = nvc1_grctx_generate_unkn, | ||
510 | .hub = nvd9_grctx_init_hub, | 511 | .hub = nvd9_grctx_init_hub, |
511 | .gpc = nvd9_grctx_init_gpc, | 512 | .gpc = nvd9_grctx_init_gpc, |
512 | .icmd = nvd9_grctx_init_icmd, | 513 | .icmd = nvd9_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c index 261a600c8ffb..0b72d7240b0b 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c | |||
@@ -849,6 +849,17 @@ nve4_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
849 | } | 849 | } |
850 | 850 | ||
851 | void | 851 | void |
852 | nve4_grctx_generate_unkn(struct nvc0_graph_priv *priv) | ||
853 | { | ||
854 | nv_mask(priv, 0x418c6c, 0x00000001, 0x00000001); | ||
855 | nv_mask(priv, 0x41980c, 0x00000010, 0x00000010); | ||
856 | nv_mask(priv, 0x41be08, 0x00000004, 0x00000004); | ||
857 | nv_mask(priv, 0x4064c0, 0x80000000, 0x80000000); | ||
858 | nv_mask(priv, 0x405800, 0x08000000, 0x08000000); | ||
859 | nv_mask(priv, 0x419c00, 0x00000008, 0x00000008); | ||
860 | } | ||
861 | |||
862 | void | ||
852 | nve4_grctx_generate_r418bb8(struct nvc0_graph_priv *priv) | 863 | nve4_grctx_generate_r418bb8(struct nvc0_graph_priv *priv) |
853 | { | 864 | { |
854 | u32 data[6] = {}, data2[2] = {}; | 865 | u32 data[6] = {}, data2[2] = {}; |
@@ -922,13 +933,7 @@ nve4_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
922 | nv_wr32(priv, 0x404154, 0x00000000); | 933 | nv_wr32(priv, 0x404154, 0x00000000); |
923 | 934 | ||
924 | oclass->mods(priv, info); | 935 | oclass->mods(priv, info); |
925 | 936 | oclass->unkn(priv); | |
926 | nv_wr32(priv, 0x418c6c, 0x1); | ||
927 | nv_wr32(priv, 0x41980c, 0x10); | ||
928 | nv_wr32(priv, 0x41be08, 0x4); | ||
929 | nv_wr32(priv, 0x4064c0, 0x801a00f0); | ||
930 | nv_wr32(priv, 0x405800, 0xf8000bf); | ||
931 | nv_wr32(priv, 0x419c00, 0xa); | ||
932 | 937 | ||
933 | nvc0_grctx_generate_tpcid(priv); | 938 | nvc0_grctx_generate_tpcid(priv); |
934 | nvc0_grctx_generate_r406028(priv); | 939 | nvc0_grctx_generate_r406028(priv); |
@@ -1013,6 +1018,7 @@ nve4_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
1013 | }, | 1018 | }, |
1014 | .main = nve4_grctx_generate_main, | 1019 | .main = nve4_grctx_generate_main, |
1015 | .mods = nve4_grctx_generate_mods, | 1020 | .mods = nve4_grctx_generate_mods, |
1021 | .unkn = nve4_grctx_generate_unkn, | ||
1016 | .hub = nve4_grctx_init_hub, | 1022 | .hub = nve4_grctx_init_hub, |
1017 | .gpc = nve4_grctx_init_gpc, | 1023 | .gpc = nve4_grctx_init_gpc, |
1018 | .icmd = nve4_grctx_init_icmd, | 1024 | .icmd = nve4_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c index c1bacc3d7374..dcb2ebb8c29d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c | |||
@@ -320,6 +320,7 @@ nvf0_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
320 | }, | 320 | }, |
321 | .main = nve4_grctx_generate_main, | 321 | .main = nve4_grctx_generate_main, |
322 | .mods = nvf0_grctx_generate_mods, | 322 | .mods = nvf0_grctx_generate_mods, |
323 | .unkn = nve4_grctx_generate_unkn, | ||
323 | .hub = nvf0_grctx_init_hub, | 324 | .hub = nvf0_grctx_init_hub, |
324 | .gpc = nvf0_grctx_init_gpc, | 325 | .gpc = nvf0_grctx_init_gpc, |
325 | .icmd = nvc0_grctx_init_icmd, | 326 | .icmd = nvc0_grctx_init_icmd, |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h index dd06674336b4..ea17a80ad7fc 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h | |||
@@ -150,6 +150,7 @@ struct nvc0_grctx_oclass { | |||
150 | void (*main)(struct nvc0_graph_priv *, struct nvc0_grctx *); | 150 | void (*main)(struct nvc0_graph_priv *, struct nvc0_grctx *); |
151 | /* context-specific modify-on-first-load list generation function */ | 151 | /* context-specific modify-on-first-load list generation function */ |
152 | void (*mods)(struct nvc0_graph_priv *, struct nvc0_grctx *); | 152 | void (*mods)(struct nvc0_graph_priv *, struct nvc0_grctx *); |
153 | void (*unkn)(struct nvc0_graph_priv *); | ||
153 | /* mmio context data */ | 154 | /* mmio context data */ |
154 | struct nvc0_graph_init **hub; | 155 | struct nvc0_graph_init **hub; |
155 | struct nvc0_graph_init **gpc; | 156 | struct nvc0_graph_init **gpc; |
@@ -207,6 +208,7 @@ extern struct nvc0_graph_init nve4_graph_init_unk88xx[]; | |||
207 | int nvc0_grctx_generate(struct nvc0_graph_priv *); | 208 | int nvc0_grctx_generate(struct nvc0_graph_priv *); |
208 | void nvc0_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); | 209 | void nvc0_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); |
209 | void nvc0_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); | 210 | void nvc0_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); |
211 | void nvc0_grctx_generate_unkn(struct nvc0_graph_priv *); | ||
210 | void nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *); | 212 | void nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *); |
211 | void nvc0_grctx_generate_r406028(struct nvc0_graph_priv *); | 213 | void nvc0_grctx_generate_r406028(struct nvc0_graph_priv *); |
212 | void nvc0_grctx_generate_r4060a8(struct nvc0_graph_priv *); | 214 | void nvc0_grctx_generate_r4060a8(struct nvc0_graph_priv *); |
@@ -238,6 +240,7 @@ extern struct nvc0_graph_init nvc0_grctx_init_90c0[]; | |||
238 | extern struct nvc0_graph_init nvc0_grctx_init_mthd_magic[]; | 240 | extern struct nvc0_graph_init nvc0_grctx_init_mthd_magic[]; |
239 | 241 | ||
240 | void nvc1_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); | 242 | void nvc1_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); |
243 | void nvc1_grctx_generate_unkn(struct nvc0_graph_priv *); | ||
241 | extern struct nouveau_oclass *nvc1_grctx_oclass; | 244 | extern struct nouveau_oclass *nvc1_grctx_oclass; |
242 | extern struct nvc0_graph_init nvc1_grctx_init_9097[]; | 245 | extern struct nvc0_graph_init nvc1_grctx_init_9097[]; |
243 | 246 | ||
@@ -254,6 +257,7 @@ extern struct nvc0_graph_init nvd9_grctx_init_rop[]; | |||
254 | extern struct nvc0_graph_mthd nvd9_grctx_init_mthd[]; | 257 | extern struct nvc0_graph_mthd nvd9_grctx_init_mthd[]; |
255 | 258 | ||
256 | void nve4_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); | 259 | void nve4_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); |
260 | void nve4_grctx_generate_unkn(struct nvc0_graph_priv *); | ||
257 | extern struct nouveau_oclass *nve4_grctx_oclass; | 261 | extern struct nouveau_oclass *nve4_grctx_oclass; |
258 | extern struct nvc0_graph_init nve4_grctx_init_unk46xx[]; | 262 | extern struct nvc0_graph_init nve4_grctx_init_unk46xx[]; |
259 | extern struct nvc0_graph_init nve4_grctx_init_unk47xx[]; | 263 | extern struct nvc0_graph_init nve4_grctx_init_unk47xx[]; |