aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-05-19 09:59:35 -0400
committerBen Skeggs <bskeggs@redhat.com>2017-06-16 00:05:00 -0400
commit1f0c9eaf31bba3e1cac5534ba17602c115b76cf8 (patch)
tree4617b2545e24ed2447b15e0532694c7f40d996af
parentd52e948c67b263d0ceb71d734673ff8b1d4b10ce (diff)
drm/nouveau/disp/nv50-: implement a common supervisor 2.1
This makes use of all the additional routing and state added in previous commits, making it possible to deal with GM20x macro link routing, while also sharing code between the NV50 and GF119 implementations. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c15
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c16
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h1
3 files changed, 11 insertions, 21 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c
index 986069f82d24..d25b3b7f4fb8 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c
@@ -139,17 +139,6 @@ exec_clkcmp(struct nv50_disp *disp, int head, int id, u32 pclk, u32 *conf)
139} 139}
140 140
141static void 141static void
142gf119_disp_intr_unk2_1(struct nv50_disp *disp, int head)
143{
144 struct nvkm_device *device = disp->base.engine.subdev.device;
145 struct nvkm_devinit *devinit = device->devinit;
146 u32 pclk = nvkm_rd32(device, 0x660450 + (head * 0x300)) / 1000;
147 if (pclk)
148 nvkm_devinit_pll_set(devinit, PLL_VPLL0 + head, pclk);
149 nvkm_wr32(device, 0x612200 + (head * 0x800), 0x00000000);
150}
151
152static void
153gf119_disp_intr_unk2_2_tu(struct nv50_disp *disp, int head, 142gf119_disp_intr_unk2_2_tu(struct nv50_disp *disp, int head,
154 struct dcb_output *outp) 143 struct dcb_output *outp)
155{ 144{
@@ -260,6 +249,7 @@ gf119_disp_intr_unk2_2(struct nv50_disp *disp, int head)
260 } 249 }
261 250
262 nvkm_mask(device, addr, 0x00000707, data); 251 nvkm_mask(device, addr, 0x00000707, data);
252 nvkm_wr32(device, 0x612200 + (head * 0x800), 0x00000000);
263} 253}
264 254
265static void 255static void
@@ -307,8 +297,7 @@ gf119_disp_super(struct work_struct *work)
307 list_for_each_entry(head, &disp->base.head, head) { 297 list_for_each_entry(head, &disp->base.head, head) {
308 if (!(mask[head->id] & 0x00010000)) 298 if (!(mask[head->id] & 0x00010000))
309 continue; 299 continue;
310 nvkm_debug(subdev, "supervisor 2.1 - head %d\n", head->id); 300 nv50_disp_super_2_1(disp, head);
311 gf119_disp_intr_unk2_1(disp, head->id);
312 } 301 }
313 list_for_each_entry(head, &disp->base.head, head) { 302 list_for_each_entry(head, &disp->base.head, head) {
314 if (!(mask[head->id] & 0x00001000)) 303 if (!(mask[head->id] & 0x00001000))
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
index 6c51045e284a..ebe7657bf2af 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
@@ -532,14 +532,14 @@ nv50_disp_intr_unk20_2(struct nv50_disp *disp, int head)
532 nv50_disp_dptmds_war_2(disp, &outp->info); 532 nv50_disp_dptmds_war_2(disp, &outp->info);
533} 533}
534 534
535static void 535void
536nv50_disp_intr_unk20_1(struct nv50_disp *disp, int head) 536nv50_disp_super_2_1(struct nv50_disp *disp, struct nvkm_head *head)
537{ 537{
538 struct nvkm_device *device = disp->base.engine.subdev.device; 538 struct nvkm_devinit *devinit = disp->base.engine.subdev.device->devinit;
539 struct nvkm_devinit *devinit = device->devinit; 539 u32 khz = head->asy.hz / 1000;
540 u32 pclk = nvkm_rd32(device, 0x610ad0 + (head * 0x540)) & 0x3fffff; 540 HEAD_DBG(head, "supervisor 2.1 - %d khz", khz);
541 if (pclk) 541 if (khz)
542 nvkm_devinit_pll_set(devinit, PLL_VPLL0 + head, pclk); 542 nvkm_devinit_pll_set(devinit, PLL_VPLL0 + head->id, khz);
543} 543}
544 544
545void 545void
@@ -631,7 +631,7 @@ nv50_disp_super(struct work_struct *work)
631 list_for_each_entry(head, &disp->base.head, head) { 631 list_for_each_entry(head, &disp->base.head, head) {
632 if (!(super & (0x00000200 << head->id))) 632 if (!(super & (0x00000200 << head->id)))
633 continue; 633 continue;
634 nv50_disp_intr_unk20_1(disp, head->id); 634 nv50_disp_super_2_1(disp, head);
635 } 635 }
636 list_for_each_entry(head, &disp->base.head, head) { 636 list_for_each_entry(head, &disp->base.head, head) {
637 if (!(super & (0x00000080 << head->id))) 637 if (!(super & (0x00000080 << head->id)))
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
index f6bafe6dcaa4..310a568c3fdb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
@@ -29,6 +29,7 @@ struct nv50_disp {
29void nv50_disp_super_1(struct nv50_disp *); 29void nv50_disp_super_1(struct nv50_disp *);
30void nv50_disp_super_1_0(struct nv50_disp *, struct nvkm_head *); 30void nv50_disp_super_1_0(struct nv50_disp *, struct nvkm_head *);
31void nv50_disp_super_2_0(struct nv50_disp *, struct nvkm_head *); 31void nv50_disp_super_2_0(struct nv50_disp *, struct nvkm_head *);
32void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *);
32 33
33int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, 34int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
34 int index, int heads, struct nvkm_disp **); 35 int index, int heads, struct nvkm_disp **);