diff options
13 files changed, 75 insertions, 41 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk110b.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk110b.c index b3f5ea66566e..11bf8b3a45df 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk110b.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk110b.c | |||
@@ -95,4 +95,6 @@ gk110b_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
95 | .bundle_size = 0x3000, | 95 | .bundle_size = 0x3000, |
96 | .bundle_min_gpm_fifo_depth = 0x180, | 96 | .bundle_min_gpm_fifo_depth = 0x180, |
97 | .bundle_token_limit = 0x600, | 97 | .bundle_token_limit = 0x600, |
98 | .pagepool = nve4_grctx_generate_pagepool, | ||
99 | .pagepool_size = 0x8000, | ||
98 | }.base; | 100 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk20a.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk20a.c index 1ec78bdca4b1..c560f486dcfb 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk20a.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxgk20a.c | |||
@@ -54,4 +54,6 @@ gk20a_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
54 | .bundle_size = 0x1800, | 54 | .bundle_size = 0x1800, |
55 | .bundle_min_gpm_fifo_depth = 0x62, | 55 | .bundle_min_gpm_fifo_depth = 0x62, |
56 | .bundle_token_limit = 0x100, | 56 | .bundle_token_limit = 0x100, |
57 | .pagepool = nve4_grctx_generate_pagepool, | ||
58 | .pagepool_size = 0x8000, | ||
57 | }.base; | 59 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxgm107.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxgm107.c index a4f008855966..5f4d60e0ea07 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxgm107.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxgm107.c | |||
@@ -876,18 +876,25 @@ gm107_grctx_generate_bundle(struct nvc0_grctx *info) | |||
876 | } | 876 | } |
877 | 877 | ||
878 | static void | 878 | static void |
879 | gm107_grctx_generate_pagepool(struct nvc0_grctx *info) | ||
880 | { | ||
881 | const struct nvc0_grctx_oclass *impl = nvc0_grctx_impl(info->priv); | ||
882 | const u32 access = NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS; | ||
883 | const int s = 8; | ||
884 | const int b = mmio_vram(info, impl->pagepool_size, (1 << s), access); | ||
885 | mmio_refn(info, 0x40800c, 0x00000000, s, b); | ||
886 | mmio_wr32(info, 0x408010, 0x80000000); | ||
887 | mmio_refn(info, 0x419004, 0x00000000, s, b); | ||
888 | mmio_wr32(info, 0x419008, 0x00000000); | ||
889 | mmio_wr32(info, 0x4064cc, 0x80000000); | ||
890 | mmio_wr32(info, 0x418e30, 0x80000000); /* guess at it being related */ | ||
891 | } | ||
892 | |||
893 | static void | ||
879 | gm107_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | 894 | gm107_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) |
880 | { | 895 | { |
881 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
882 | mmio_data(0x200000, 0x1000, NV_MEM_ACCESS_RW); | 896 | mmio_data(0x200000, 0x1000, NV_MEM_ACCESS_RW); |
883 | 897 | ||
884 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
885 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
886 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
887 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
888 | mmio_list(0x4064cc, 0x80000000, 0, 0); | ||
889 | mmio_list(0x418e30, 0x80000000, 0, 0); | ||
890 | |||
891 | mmio_list(0x418810, 0x80000000, 12, 2); | 898 | mmio_list(0x418810, 0x80000000, 12, 2); |
892 | mmio_list(0x419848, 0x10000000, 12, 2); | 899 | mmio_list(0x419848, 0x10000000, 12, 2); |
893 | mmio_list(0x419c2c, 0x10000000, 12, 2); | 900 | mmio_list(0x419c2c, 0x10000000, 12, 2); |
@@ -944,6 +951,7 @@ gm107_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
944 | nv_wr32(priv, 0x404154, 0x00000000); | 951 | nv_wr32(priv, 0x404154, 0x00000000); |
945 | 952 | ||
946 | oclass->bundle(info); | 953 | oclass->bundle(info); |
954 | oclass->pagepool(info); | ||
947 | oclass->mods(priv, info); | 955 | oclass->mods(priv, info); |
948 | oclass->unkn(priv); | 956 | oclass->unkn(priv); |
949 | 957 | ||
@@ -1002,4 +1010,6 @@ gm107_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
1002 | .bundle_size = 0x3000, | 1010 | .bundle_size = 0x3000, |
1003 | .bundle_min_gpm_fifo_depth = 0x180, | 1011 | .bundle_min_gpm_fifo_depth = 0x180, |
1004 | .bundle_token_limit = 0x2c0, | 1012 | .bundle_token_limit = 0x2c0, |
1013 | .pagepool = gm107_grctx_generate_pagepool, | ||
1014 | .pagepool_size = 0x8000, | ||
1005 | }.base; | 1015 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c index c9eb8ed46d12..c3487c42e5d6 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c | |||
@@ -538,13 +538,7 @@ nv108_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
538 | u32 offset; | 538 | u32 offset; |
539 | int gpc; | 539 | int gpc; |
540 | 540 | ||
541 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
542 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); | 541 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
543 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
544 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
545 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
546 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
547 | mmio_list(0x4064cc, 0x80000000, 0, 0); | ||
548 | mmio_list(0x418810, 0x80000000, 12, 2); | 542 | mmio_list(0x418810, 0x80000000, 12, 2); |
549 | mmio_list(0x419848, 0x10000000, 12, 2); | 543 | mmio_list(0x419848, 0x10000000, 12, 2); |
550 | 544 | ||
@@ -594,4 +588,6 @@ nv108_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
594 | .bundle_size = 0x3000, | 588 | .bundle_size = 0x3000, |
595 | .bundle_min_gpm_fifo_depth = 0xc2, | 589 | .bundle_min_gpm_fifo_depth = 0xc2, |
596 | .bundle_token_limit = 0x200, | 590 | .bundle_token_limit = 0x200, |
591 | .pagepool = nve4_grctx_generate_pagepool, | ||
592 | .pagepool_size = 0x8000, | ||
597 | }.base; | 593 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c index 4186a0a2baa5..8dd3a5b56cd3 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c | |||
@@ -1034,20 +1034,28 @@ nvc0_grctx_generate_bundle(struct nvc0_grctx *info) | |||
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | void | 1036 | void |
1037 | nvc0_grctx_generate_pagepool(struct nvc0_grctx *info) | ||
1038 | { | ||
1039 | const struct nvc0_grctx_oclass *impl = nvc0_grctx_impl(info->priv); | ||
1040 | const u32 access = NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS; | ||
1041 | const int s = 8; | ||
1042 | const int b = mmio_vram(info, impl->pagepool_size, (1 << s), access); | ||
1043 | mmio_refn(info, 0x40800c, 0x00000000, s, b); | ||
1044 | mmio_wr32(info, 0x408010, 0x80000000); | ||
1045 | mmio_refn(info, 0x419004, 0x00000000, s, b); | ||
1046 | mmio_wr32(info, 0x419008, 0x00000000); | ||
1047 | } | ||
1048 | |||
1049 | void | ||
1037 | nvc0_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | 1050 | nvc0_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) |
1038 | { | 1051 | { |
1039 | int gpc, tpc; | 1052 | int gpc, tpc; |
1040 | u32 offset; | 1053 | u32 offset; |
1041 | 1054 | ||
1042 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
1043 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); | 1055 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
1044 | 1056 | ||
1045 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
1046 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
1047 | mmio_list(0x418810, 0x80000000, 12, 2); | 1057 | mmio_list(0x418810, 0x80000000, 12, 2); |
1048 | mmio_list(0x419848, 0x10000000, 12, 2); | 1058 | mmio_list(0x419848, 0x10000000, 12, 2); |
1049 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
1050 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
1051 | 1059 | ||
1052 | mmio_list(0x405830, 0x02180000, 0, 0); | 1060 | mmio_list(0x405830, 0x02180000, 0, 0); |
1053 | 1061 | ||
@@ -1227,6 +1235,7 @@ nvc0_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
1227 | nv_wr32(priv, 0x404154, 0x00000000); | 1235 | nv_wr32(priv, 0x404154, 0x00000000); |
1228 | 1236 | ||
1229 | oclass->bundle(info); | 1237 | oclass->bundle(info); |
1238 | oclass->pagepool(info); | ||
1230 | oclass->mods(priv, info); | 1239 | oclass->mods(priv, info); |
1231 | oclass->unkn(priv); | 1240 | oclass->unkn(priv); |
1232 | 1241 | ||
@@ -1365,4 +1374,6 @@ nvc0_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
1365 | .mthd = nvc0_grctx_pack_mthd, | 1374 | .mthd = nvc0_grctx_pack_mthd, |
1366 | .bundle = nvc0_grctx_generate_bundle, | 1375 | .bundle = nvc0_grctx_generate_bundle, |
1367 | .bundle_size = 0x1800, | 1376 | .bundle_size = 0x1800, |
1377 | .pagepool = nvc0_grctx_generate_pagepool, | ||
1378 | .pagepool_size = 0x8000, | ||
1368 | }.base; | 1379 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.h b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.h index 26744ac89fb7..6387a160ac18 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.h +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.h | |||
@@ -44,6 +44,9 @@ struct nvc0_grctx_oclass { | |||
44 | u32 bundle_size; | 44 | u32 bundle_size; |
45 | u32 bundle_min_gpm_fifo_depth; | 45 | u32 bundle_min_gpm_fifo_depth; |
46 | u32 bundle_token_limit; | 46 | u32 bundle_token_limit; |
47 | /* pagepool */ | ||
48 | void (*pagepool)(struct nvc0_grctx *); | ||
49 | u32 pagepool_size; | ||
47 | }; | 50 | }; |
48 | 51 | ||
49 | static inline const struct nvc0_grctx_oclass * | 52 | static inline const struct nvc0_grctx_oclass * |
@@ -56,6 +59,7 @@ extern struct nouveau_oclass *nvc0_grctx_oclass; | |||
56 | int nvc0_grctx_generate(struct nvc0_graph_priv *); | 59 | int nvc0_grctx_generate(struct nvc0_graph_priv *); |
57 | void nvc0_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); | 60 | void nvc0_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); |
58 | void nvc0_grctx_generate_bundle(struct nvc0_grctx *); | 61 | void nvc0_grctx_generate_bundle(struct nvc0_grctx *); |
62 | void nvc0_grctx_generate_pagepool(struct nvc0_grctx *); | ||
59 | void nvc0_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); | 63 | void nvc0_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); |
60 | void nvc0_grctx_generate_unkn(struct nvc0_graph_priv *); | 64 | void nvc0_grctx_generate_unkn(struct nvc0_graph_priv *); |
61 | void nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *); | 65 | void nvc0_grctx_generate_tpcid(struct nvc0_graph_priv *); |
@@ -77,6 +81,7 @@ extern struct nouveau_oclass *nve4_grctx_oclass; | |||
77 | extern struct nouveau_oclass *gk20a_grctx_oclass; | 81 | extern struct nouveau_oclass *gk20a_grctx_oclass; |
78 | void nve4_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); | 82 | void nve4_grctx_generate_main(struct nvc0_graph_priv *, struct nvc0_grctx *); |
79 | void nve4_grctx_generate_bundle(struct nvc0_grctx *); | 83 | void nve4_grctx_generate_bundle(struct nvc0_grctx *); |
84 | void nve4_grctx_generate_pagepool(struct nvc0_grctx *); | ||
80 | void nve4_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); | 85 | void nve4_grctx_generate_mods(struct nvc0_graph_priv *, struct nvc0_grctx *); |
81 | void nve4_grctx_generate_unkn(struct nvc0_graph_priv *); | 86 | void nve4_grctx_generate_unkn(struct nvc0_graph_priv *); |
82 | void nve4_grctx_generate_r418bb8(struct nvc0_graph_priv *); | 87 | void nve4_grctx_generate_r418bb8(struct nvc0_graph_priv *); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c index 9043965c27a4..f174204c18ab 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc1.c | |||
@@ -732,14 +732,9 @@ nvc1_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
732 | int gpc, tpc; | 732 | int gpc, tpc; |
733 | u32 offset; | 733 | u32 offset; |
734 | 734 | ||
735 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
736 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); | 735 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
737 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
738 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
739 | mmio_list(0x418810, 0x80000000, 12, 2); | 736 | mmio_list(0x418810, 0x80000000, 12, 2); |
740 | mmio_list(0x419848, 0x10000000, 12, 2); | 737 | mmio_list(0x419848, 0x10000000, 12, 2); |
741 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
742 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
743 | 738 | ||
744 | mmio_list(0x405830, 0x02180218, 0, 0); | 739 | mmio_list(0x405830, 0x02180218, 0, 0); |
745 | mmio_list(0x4064c4, 0x0086ffff, 0, 0); | 740 | mmio_list(0x4064c4, 0x0086ffff, 0, 0); |
@@ -791,4 +786,6 @@ nvc1_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
791 | .mthd = nvc1_grctx_pack_mthd, | 786 | .mthd = nvc1_grctx_pack_mthd, |
792 | .bundle = nvc0_grctx_generate_bundle, | 787 | .bundle = nvc0_grctx_generate_bundle, |
793 | .bundle_size = 0x1800, | 788 | .bundle_size = 0x1800, |
789 | .pagepool = nvc0_grctx_generate_pagepool, | ||
790 | .pagepool_size = 0x8000, | ||
794 | }.base; | 791 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc4.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc4.c index e96606a57432..ec7f32a6a0f9 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc4.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc4.c | |||
@@ -102,4 +102,6 @@ nvc4_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
102 | .mthd = nvc0_grctx_pack_mthd, | 102 | .mthd = nvc0_grctx_pack_mthd, |
103 | .bundle = nvc0_grctx_generate_bundle, | 103 | .bundle = nvc0_grctx_generate_bundle, |
104 | .bundle_size = 0x1800, | 104 | .bundle_size = 0x1800, |
105 | .pagepool = nvc0_grctx_generate_pagepool, | ||
106 | .pagepool_size = 0x8000, | ||
105 | }.base; | 107 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c index cc4646e514fc..de0586829ce1 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc8.c | |||
@@ -353,4 +353,6 @@ nvc8_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
353 | .mthd = nvc8_grctx_pack_mthd, | 353 | .mthd = nvc8_grctx_pack_mthd, |
354 | .bundle = nvc0_grctx_generate_bundle, | 354 | .bundle = nvc0_grctx_generate_bundle, |
355 | .bundle_size = 0x1800, | 355 | .bundle_size = 0x1800, |
356 | .pagepool = nvc0_grctx_generate_pagepool, | ||
357 | .pagepool_size = 0x8000, | ||
356 | }.base; | 358 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c index 930a205111b2..ce016ac225a9 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c | |||
@@ -184,12 +184,7 @@ nvd7_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
184 | u32 offset; | 184 | u32 offset; |
185 | int gpc; | 185 | int gpc; |
186 | 186 | ||
187 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
188 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); | 187 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
189 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
190 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
191 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
192 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
193 | mmio_list(0x418810, 0x80000000, 12, 2); | 188 | mmio_list(0x418810, 0x80000000, 12, 2); |
194 | mmio_list(0x419848, 0x10000000, 12, 2); | 189 | mmio_list(0x419848, 0x10000000, 12, 2); |
195 | 190 | ||
@@ -229,6 +224,7 @@ nvd7_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
229 | nv_wr32(priv, 0x404154, 0x00000000); | 224 | nv_wr32(priv, 0x404154, 0x00000000); |
230 | 225 | ||
231 | oclass->bundle(info); | 226 | oclass->bundle(info); |
227 | oclass->pagepool(info); | ||
232 | oclass->mods(priv, info); | 228 | oclass->mods(priv, info); |
233 | oclass->unkn(priv); | 229 | oclass->unkn(priv); |
234 | 230 | ||
@@ -270,4 +266,6 @@ nvd7_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
270 | .mthd = nvd9_grctx_pack_mthd, | 266 | .mthd = nvd9_grctx_pack_mthd, |
271 | .bundle = nvc0_grctx_generate_bundle, | 267 | .bundle = nvc0_grctx_generate_bundle, |
272 | .bundle_size = 0x1800, | 268 | .bundle_size = 0x1800, |
269 | .pagepool = nvc0_grctx_generate_pagepool, | ||
270 | .pagepool_size = 0x8000, | ||
273 | }.base; | 271 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c index 8aa5e69aecc6..b2b0f7085ea7 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd9.c | |||
@@ -521,4 +521,6 @@ nvd9_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
521 | .mthd = nvd9_grctx_pack_mthd, | 521 | .mthd = nvd9_grctx_pack_mthd, |
522 | .bundle = nvc0_grctx_generate_bundle, | 522 | .bundle = nvc0_grctx_generate_bundle, |
523 | .bundle_size = 0x1800, | 523 | .bundle_size = 0x1800, |
524 | .pagepool = nvc0_grctx_generate_pagepool, | ||
525 | .pagepool_size = 0x8000, | ||
524 | }.base; | 526 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c index 678708e15718..9dfb60d8e5a8 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnve4.c | |||
@@ -856,19 +856,27 @@ nve4_grctx_generate_bundle(struct nvc0_grctx *info) | |||
856 | } | 856 | } |
857 | 857 | ||
858 | void | 858 | void |
859 | nve4_grctx_generate_pagepool(struct nvc0_grctx *info) | ||
860 | { | ||
861 | const struct nvc0_grctx_oclass *impl = nvc0_grctx_impl(info->priv); | ||
862 | const u32 access = NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS; | ||
863 | const int s = 8; | ||
864 | const int b = mmio_vram(info, impl->pagepool_size, (1 << s), access); | ||
865 | mmio_refn(info, 0x40800c, 0x00000000, s, b); | ||
866 | mmio_wr32(info, 0x408010, 0x80000000); | ||
867 | mmio_refn(info, 0x419004, 0x00000000, s, b); | ||
868 | mmio_wr32(info, 0x419008, 0x00000000); | ||
869 | mmio_wr32(info, 0x4064cc, 0x80000000); | ||
870 | } | ||
871 | |||
872 | void | ||
859 | nve4_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | 873 | nve4_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) |
860 | { | 874 | { |
861 | u32 magic[GPC_MAX][2]; | 875 | u32 magic[GPC_MAX][2]; |
862 | u32 offset; | 876 | u32 offset; |
863 | int gpc; | 877 | int gpc; |
864 | 878 | ||
865 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
866 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); | 879 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
867 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
868 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
869 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
870 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
871 | mmio_list(0x4064cc, 0x80000000, 0, 0); | ||
872 | mmio_list(0x418810, 0x80000000, 12, 2); | 880 | mmio_list(0x418810, 0x80000000, 12, 2); |
873 | mmio_list(0x419848, 0x10000000, 12, 2); | 881 | mmio_list(0x419848, 0x10000000, 12, 2); |
874 | 882 | ||
@@ -979,6 +987,7 @@ nve4_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
979 | nv_wr32(priv, 0x404154, 0x00000000); | 987 | nv_wr32(priv, 0x404154, 0x00000000); |
980 | 988 | ||
981 | oclass->bundle(info); | 989 | oclass->bundle(info); |
990 | oclass->pagepool(info); | ||
982 | oclass->mods(priv, info); | 991 | oclass->mods(priv, info); |
983 | oclass->unkn(priv); | 992 | oclass->unkn(priv); |
984 | 993 | ||
@@ -1034,4 +1043,6 @@ nve4_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
1034 | .bundle_size = 0x3000, | 1043 | .bundle_size = 0x3000, |
1035 | .bundle_min_gpm_fifo_depth = 0x180, | 1044 | .bundle_min_gpm_fifo_depth = 0x180, |
1036 | .bundle_token_limit = 0x600, | 1045 | .bundle_token_limit = 0x600, |
1046 | .pagepool = nve4_grctx_generate_pagepool, | ||
1047 | .pagepool_size = 0x8000, | ||
1037 | }.base; | 1048 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c index 89a77a2788ba..e25ec47defa8 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvf0.c | |||
@@ -816,13 +816,7 @@ nvf0_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info) | |||
816 | u32 offset; | 816 | u32 offset; |
817 | int gpc; | 817 | int gpc; |
818 | 818 | ||
819 | mmio_data(0x008000, 0x0100, NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS); | ||
820 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); | 819 | mmio_data(0x060000, 0x1000, NV_MEM_ACCESS_RW); |
821 | mmio_list(0x40800c, 0x00000000, 8, 1); | ||
822 | mmio_list(0x408010, 0x80000000, 0, 0); | ||
823 | mmio_list(0x419004, 0x00000000, 8, 1); | ||
824 | mmio_list(0x419008, 0x00000000, 0, 0); | ||
825 | mmio_list(0x4064cc, 0x80000000, 0, 0); | ||
826 | mmio_list(0x418810, 0x80000000, 12, 2); | 820 | mmio_list(0x418810, 0x80000000, 12, 2); |
827 | mmio_list(0x419848, 0x10000000, 12, 2); | 821 | mmio_list(0x419848, 0x10000000, 12, 2); |
828 | 822 | ||
@@ -880,4 +874,6 @@ nvf0_grctx_oclass = &(struct nvc0_grctx_oclass) { | |||
880 | .bundle_size = 0x3000, | 874 | .bundle_size = 0x3000, |
881 | .bundle_min_gpm_fifo_depth = 0x180, | 875 | .bundle_min_gpm_fifo_depth = 0x180, |
882 | .bundle_token_limit = 0x7c0, | 876 | .bundle_token_limit = 0x7c0, |
877 | .pagepool = nve4_grctx_generate_pagepool, | ||
878 | .pagepool_size = 0x8000, | ||
883 | }.base; | 879 | }.base; |