Lines Matching +full:dcb +full:- +full:algorithm

49 	struct nvkm_device *device = pior->disp->engine.subdev.device;  in nv50_pior_clock()
58 int ret = nvkm_i2c_aux_lnk_ctl(aux, pior->dp.nr, pior->dp.bw, pior->dp.ef); in nv50_pior_dp_links()
82 struct nvkm_device *device = pior->disp->engine.subdev.device; in nv50_pior_power()
96 /* GF119 moves this information to per-head methods, which is in nv50_pior_depth()
99 if (state->head && state == &ior->asy) { in nv50_pior_depth()
100 struct nvkm_head *head = nvkm_head_find(ior->disp, __ffs(state->head)); in nv50_pior_depth()
103 struct nvkm_head_state *state = &head->asy; in nv50_pior_depth()
105 case 6: state->or.depth = 30; break; in nv50_pior_depth()
106 case 5: state->or.depth = 24; break; in nv50_pior_depth()
107 case 2: state->or.depth = 18; break; in nv50_pior_depth()
108 case 0: state->or.depth = 18; break; /*XXX*/ in nv50_pior_depth()
110 state->or.depth = 18; in nv50_pior_depth()
121 struct nvkm_device *device = pior->disp->engine.subdev.device; in nv50_pior_state()
122 const u32 coff = pior->id * 8 + (state == &pior->arm) * 4; in nv50_pior_state()
125 state->proto_evo = (ctrl & 0x00000f00) >> 8; in nv50_pior_state()
126 state->rgdiv = 1; in nv50_pior_state()
127 switch (state->proto_evo) { in nv50_pior_state()
128 case 0: state->proto = TMDS; break; in nv50_pior_state()
130 state->proto = UNKNOWN; in nv50_pior_state()
134 state->head = ctrl & 0x00000003; in nv50_pior_state()
155 struct nvkm_device *device = disp->engine.subdev.device; in nv50_pior_cnt()
164 struct nvkm_device *device = ior->disp->engine.subdev.device; in nv50_sor_bl_set()
176 struct nvkm_device *device = ior->disp->engine.subdev.device; in nv50_sor_bl_get()
195 struct nvkm_device *device = sor->disp->engine.subdev.device; in nv50_sor_clock()
196 const int div = sor->asy.link == 3; in nv50_sor_clock()
214 struct nvkm_device *device = sor->disp->engine.subdev.device; in nv50_sor_power()
233 struct nvkm_device *device = sor->disp->engine.subdev.device; in nv50_sor_state()
234 const u32 coff = sor->id * 8 + (state == &sor->arm) * 4; in nv50_sor_state()
237 state->proto_evo = (ctrl & 0x00000f00) >> 8; in nv50_sor_state()
238 switch (state->proto_evo) { in nv50_sor_state()
239 case 0: state->proto = LVDS; state->link = 1; break; in nv50_sor_state()
240 case 1: state->proto = TMDS; state->link = 1; break; in nv50_sor_state()
241 case 2: state->proto = TMDS; state->link = 2; break; in nv50_sor_state()
242 case 5: state->proto = TMDS; state->link = 3; break; in nv50_sor_state()
244 state->proto = UNKNOWN; in nv50_sor_state()
248 state->head = ctrl & 0x00000003; in nv50_sor_state()
268 struct nvkm_device *device = disp->engine.subdev.device; in nv50_sor_cnt()
277 struct nvkm_device *device = dac->disp->engine.subdev.device; in nv50_dac_clock()
286 struct nvkm_device *device = dac->disp->engine.subdev.device; in nv50_dac_sense()
289 dac->func->power(dac, false, true, false, false, false); in nv50_dac_sense()
296 dac->func->power(dac, false, false, false, false, false); in nv50_dac_sense()
298 return -ETIMEDOUT; in nv50_dac_sense()
315 struct nvkm_device *device = dac->disp->engine.subdev.device; in nv50_dac_power()
332 struct nvkm_device *device = dac->disp->engine.subdev.device; in nv50_dac_state()
333 const u32 coff = dac->id * 8 + (state == &dac->arm) * 4; in nv50_dac_state()
336 state->proto_evo = (ctrl & 0x00000f00) >> 8; in nv50_dac_state()
337 switch (state->proto_evo) { in nv50_dac_state()
338 case 0: state->proto = CRT; break; in nv50_dac_state()
340 state->proto = UNKNOWN; in nv50_dac_state()
344 state->head = ctrl & 0x00000003; in nv50_dac_state()
364 struct nvkm_device *device = disp->engine.subdev.device; in nv50_dac_cnt()
373 struct nvkm_device *device = head->disp->engine.subdev.device; in nv50_head_vblank_put()
375 nvkm_mask(device, 0x61002c, (4 << head->id), 0); in nv50_head_vblank_put()
381 struct nvkm_device *device = head->disp->engine.subdev.device; in nv50_head_vblank_get()
383 nvkm_mask(device, 0x61002c, (4 << head->id), (4 << head->id)); in nv50_head_vblank_get()
389 struct nvkm_device *device = head->disp->engine.subdev.device; in nv50_head_rgclk()
391 nvkm_mask(device, 0x614200 + (head->id * 0x800), 0x0000000f, div); in nv50_head_rgclk()
397 struct nvkm_device *device = head->disp->engine.subdev.device; in nv50_head_rgpos()
398 const u32 hoff = head->id * 0x800; in nv50_head_rgpos()
408 struct nvkm_device *device = head->disp->engine.subdev.device; in nv50_head_state()
409 const u32 hoff = head->id * 0x540 + (state == &head->arm) * 4; in nv50_head_state()
413 state->vblanke = (data & 0xffff0000) >> 16; in nv50_head_state()
414 state->hblanke = (data & 0x0000ffff); in nv50_head_state()
416 state->vblanks = (data & 0xffff0000) >> 16; in nv50_head_state()
417 state->hblanks = (data & 0x0000ffff); in nv50_head_state()
419 state->vtotal = (data & 0xffff0000) >> 16; in nv50_head_state()
420 state->htotal = (data & 0x0000ffff); in nv50_head_state()
422 state->vsynce = (data & 0xffff0000) >> 16; in nv50_head_state()
423 state->hsynce = (data & 0x0000ffff); in nv50_head_state()
424 state->hz = (nvkm_rd32(device, 0x610ad0 + hoff) & 0x003fffff) * 1000; in nv50_head_state()
454 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_mthd_list()
455 struct nvkm_device *device = subdev->device; in nv50_disp_mthd_list()
458 for (i = 0; list->data[i].mthd; i++) { in nv50_disp_mthd_list()
459 if (list->data[i].addr) { in nv50_disp_mthd_list()
460 u32 next = nvkm_rd32(device, list->data[i].addr + base + 0); in nv50_disp_mthd_list()
461 u32 prev = nvkm_rd32(device, list->data[i].addr + base + c); in nv50_disp_mthd_list()
462 u32 mthd = list->data[i].mthd + (list->mthd * inst); in nv50_disp_mthd_list()
463 const char *name = list->data[i].name; in nv50_disp_mthd_list()
467 snprintf(mods, sizeof(mods), "-> %08x", next); in nv50_disp_mthd_list()
482 struct nvkm_disp *disp = chan->disp; in nv50_disp_chan_mthd()
483 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_chan_mthd()
484 const struct nvkm_disp_chan_mthd *mthd = chan->mthd; in nv50_disp_chan_mthd()
488 if (debug > subdev->debug) in nv50_disp_chan_mthd()
493 for (i = 0; (list = mthd->data[i].mthd) != NULL; i++) { in nv50_disp_chan_mthd()
494 u32 base = chan->head * mthd->addr; in nv50_disp_chan_mthd()
495 for (j = 0; j < mthd->data[i].nr; j++, base += list->addr) { in nv50_disp_chan_mthd()
496 const char *cname = mthd->name; in nv50_disp_chan_mthd()
500 if (mthd->addr) { in nv50_disp_chan_mthd()
502 mthd->name, chan->chid.user); in nv50_disp_chan_mthd()
506 if (mthd->data[i].nr > 1) { in nv50_disp_chan_mthd()
507 snprintf(sname_, sizeof(sname_), " - %s %d", in nv50_disp_chan_mthd()
508 mthd->data[i].name, j); in nv50_disp_chan_mthd()
513 nv50_disp_mthd_list(disp, debug, base, mthd->prev, in nv50_disp_chan_mthd()
523 struct nvkm_device *device = disp->engine.subdev.device; in nv50_disp_chan_uevent_fini()
532 struct nvkm_device *device = disp->engine.subdev.device; in nv50_disp_chan_uevent_init()
540 nvkm_event_ntfy(&disp->uevent, chid, NVKM_DISP_EVENT_CHAN_AWAKEN); in nv50_disp_chan_uevent_send()
553 return 0x640000 + (chan->chid.user * 0x1000); in nv50_disp_chan_user()
559 struct nvkm_device *device = chan->disp->engine.subdev.device; in nv50_disp_chan_intr()
560 const u32 mask = 0x00010001 << chan->chid.user; in nv50_disp_chan_intr()
561 const u32 data = en ? 0x00010000 << chan->chid.user : 0x00000000; in nv50_disp_chan_intr()
568 struct nvkm_disp *disp = chan->disp; in nv50_disp_pioc_fini()
569 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_pioc_fini()
570 struct nvkm_device *device = subdev->device; in nv50_disp_pioc_fini()
571 int ctrl = chan->chid.ctrl; in nv50_disp_pioc_fini()
572 int user = chan->chid.user; in nv50_disp_pioc_fini()
587 struct nvkm_disp *disp = chan->disp; in nv50_disp_pioc_init()
588 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_pioc_init()
589 struct nvkm_device *device = subdev->device; in nv50_disp_pioc_init()
590 int ctrl = chan->chid.ctrl; in nv50_disp_pioc_init()
591 int user = chan->chid.user; in nv50_disp_pioc_init()
600 return -EBUSY; in nv50_disp_pioc_init()
611 return -EBUSY; in nv50_disp_pioc_init()
628 return nvkm_ramht_insert(chan->disp->ramht, object, chan->chid.user, -10, handle, in nv50_disp_dmac_bind()
629 chan->chid.user << 28 | chan->chid.user); in nv50_disp_dmac_bind()
635 struct nvkm_subdev *subdev = &chan->disp->engine.subdev; in nv50_disp_dmac_fini()
636 struct nvkm_device *device = subdev->device; in nv50_disp_dmac_fini()
637 int ctrl = chan->chid.ctrl; in nv50_disp_dmac_fini()
638 int user = chan->chid.user; in nv50_disp_dmac_fini()
651 chan->suspend_put = nvkm_rd32(device, 0x640000 + (ctrl * 0x1000)); in nv50_disp_dmac_fini()
657 struct nvkm_subdev *subdev = &chan->disp->engine.subdev; in nv50_disp_dmac_init()
658 struct nvkm_device *device = subdev->device; in nv50_disp_dmac_init()
659 int ctrl = chan->chid.ctrl; in nv50_disp_dmac_init()
660 int user = chan->chid.user; in nv50_disp_dmac_init()
663 nvkm_wr32(device, 0x610204 + (ctrl * 0x0010), chan->push); in nv50_disp_dmac_init()
667 nvkm_wr32(device, 0x640000 + (ctrl * 0x1000), chan->suspend_put); in nv50_disp_dmac_init()
677 return -EBUSY; in nv50_disp_dmac_init()
686 chan->memory = nvkm_umem_search(chan->object.client, object); in nv50_disp_dmac_push()
687 if (IS_ERR(chan->memory)) in nv50_disp_dmac_push()
688 return PTR_ERR(chan->memory); in nv50_disp_dmac_push()
690 if (nvkm_memory_size(chan->memory) < 0x1000) in nv50_disp_dmac_push()
691 return -EINVAL; in nv50_disp_dmac_push()
693 switch (nvkm_memory_target(chan->memory)) { in nv50_disp_dmac_push()
694 case NVKM_MEM_TARGET_VRAM: chan->push = 0x00000001; break; in nv50_disp_dmac_push()
695 case NVKM_MEM_TARGET_NCOH: chan->push = 0x00000002; break; in nv50_disp_dmac_push()
696 case NVKM_MEM_TARGET_HOST: chan->push = 0x00000003; break; in nv50_disp_dmac_push()
698 return -EINVAL; in nv50_disp_dmac_push()
701 chan->push |= nvkm_memory_addr(chan->memory) >> 8; in nv50_disp_dmac_push()
945 struct nvkm_subdev *subdev = &chan->disp->engine.subdev; in nv50_disp_core_fini()
946 struct nvkm_device *device = subdev->device; in nv50_disp_core_fini()
959 chan->suspend_put = nvkm_rd32(device, 0x640000); in nv50_disp_core_fini()
965 struct nvkm_subdev *subdev = &chan->disp->engine.subdev; in nv50_disp_core_init()
966 struct nvkm_device *device = subdev->device; in nv50_disp_core_init()
975 nvkm_wr32(device, 0x610204, chan->push); in nv50_disp_core_init()
979 nvkm_wr32(device, 0x640000, chan->suspend_put); in nv50_disp_core_init()
989 return -EBUSY; in nv50_disp_core_init()
1018 struct nvkm_bios *bios = head->disp->engine.subdev.device->bios; in nv50_disp_super_iedt()
1019 const u8 l = ffs(outp->info.link); in nv50_disp_super_iedt()
1020 const u16 t = outp->info.hasht; in nv50_disp_super_iedt()
1021 const u16 m = (0x0100 << head->id) | (l << 6) | outp->info.or; in nv50_disp_super_iedt()
1032 struct nvkm_subdev *subdev = &head->disp->engine.subdev; in nv50_disp_super_ied_on()
1033 struct nvkm_bios *bios = subdev->device->bios; in nv50_disp_super_ied_on()
1034 struct nvkm_outp *outp = ior->asy.outp; in nv50_disp_super_ied_on()
1051 if (ior->type == SOR) { in nv50_disp_super_ied_on()
1052 if (ior->asy.proto == LVDS) { in nv50_disp_super_ied_on()
1053 if (head->asy.or.depth == 24) in nv50_disp_super_ied_on()
1056 if (ior->asy.link == 3) in nv50_disp_super_ied_on()
1060 data = nvbios_ocfg_match(bios, data, ior->asy.proto_evo, flags, in nv50_disp_super_ied_on()
1064 ior->asy.proto_evo, flags); in nv50_disp_super_ied_on()
1072 id, ior->asy.proto_evo, flags, khz); in nv50_disp_super_ied_on()
1077 init.outp = &outp->info; in nv50_disp_super_ied_on()
1078 init.or = ior->id; in nv50_disp_super_ied_on()
1079 init.link = ior->asy.link; in nv50_disp_super_ied_on()
1080 init.head = head->id; in nv50_disp_super_ied_on()
1087 struct nvkm_outp *outp = ior->arm.outp; in nv50_disp_super_ied_off()
1101 nvbios_init(&head->disp->engine.subdev, iedt.script[id], in nv50_disp_super_ied_off()
1102 init.outp = &outp->info; in nv50_disp_super_ied_off()
1103 init.or = ior->id; in nv50_disp_super_ied_off()
1104 init.link = ior->arm.link; in nv50_disp_super_ied_off()
1105 init.head = head->id; in nv50_disp_super_ied_off()
1113 list_for_each_entry(ior, &head->disp->iors, head) { in nv50_disp_super_ior_asy()
1114 if (ior->asy.head & (1 << head->id)) { in nv50_disp_super_ior_asy()
1115 HEAD_DBG(head, "to %s", ior->name); in nv50_disp_super_ior_asy()
1127 list_for_each_entry(ior, &head->disp->iors, head) { in nv50_disp_super_ior_arm()
1128 if (ior->arm.head & (1 << head->id)) { in nv50_disp_super_ior_arm()
1129 HEAD_DBG(head, "on %s", ior->name); in nv50_disp_super_ior_arm()
1149 nv50_disp_super_ied_on(head, ior, 1, head->asy.hz / 1000); in nv50_disp_super_3_0()
1151 /* OR-specific handling. */ in nv50_disp_super_3_0()
1152 if (ior->func->war_3) in nv50_disp_super_3_0()
1153 ior->func->war_3(ior); in nv50_disp_super_3_0()
1159 struct nvkm_subdev *subdev = &head->disp->engine.subdev; in nv50_disp_super_2_2_dp()
1160 const u32 khz = head->asy.hz / 1000; in nv50_disp_super_2_2_dp()
1161 const u32 linkKBps = ior->dp.bw * 27000; in nv50_disp_super_2_2_dp()
1169 /* symbols/hblank - algorithm taken from comments in tegra driver */ in nv50_disp_super_2_2_dp()
1170 h = head->asy.hblanke + head->asy.htotal - head->asy.hblanks - 7; in nv50_disp_super_2_2_dp()
1173 h = h - (3 * ior->dp.ef) - (12 / ior->dp.nr); in nv50_disp_super_2_2_dp()
1175 /* symbols/vblank - algorithm taken from comments in tegra driver */ in nv50_disp_super_2_2_dp()
1176 v = head->asy.vblanks - head->asy.vblanke - 25; in nv50_disp_super_2_2_dp()
1179 v = v - ((36 / ior->dp.nr) + 3) - 1; in nv50_disp_super_2_2_dp()
1181 ior->func->dp->audio_sym(ior, head->id, h, v); in nv50_disp_super_2_2_dp()
1184 link_data_rate = (khz * head->asy.or.depth / 8) / ior->dp.nr; in nv50_disp_super_2_2_dp()
1190 for (TU = 64; ior->func->dp->activesym && TU >= 32; TU--) { in nv50_disp_super_2_2_dp()
1198 diff = tu_valid - calc; in nv50_disp_super_2_2_dp()
1201 VTUf = symbol / (symbol - diff); in nv50_disp_super_2_2_dp()
1202 if (symbol - (VTUf * diff)) in nv50_disp_super_2_2_dp()
1207 calc += symbol - (symbol / VTUf); in nv50_disp_super_2_2_dp()
1219 diff = calc - tu_valid; in nv50_disp_super_2_2_dp()
1227 VTUi--; in nv50_disp_super_2_2_dp()
1241 if (ior->func->dp->activesym) { in nv50_disp_super_2_2_dp()
1247 ior->func->dp->activesym(ior, head->id, bestTU, bestVTUa, bestVTUf, bestVTUi); in nv50_disp_super_2_2_dp()
1253 unk = (symbol - link_ratio) * bestTU; in nv50_disp_super_2_2_dp()
1259 ior->func->dp->watermark(ior, head->id, unk); in nv50_disp_super_2_2_dp()
1265 const u32 khz = head->asy.hz / 1000; in nv50_disp_super_2_2()
1275 outp = ior->asy.outp; in nv50_disp_super_2_2()
1279 * A) Give dual-link LVDS a separate EVO protocol, like for TMDS. in nv50_disp_super_2_2()
1286 if (outp && ior->type == SOR && ior->asy.proto == LVDS) { in nv50_disp_super_2_2()
1287 head->asy.or.depth = outp->lvds.bpc8 ? 24 : 18; in nv50_disp_super_2_2()
1288 ior->asy.link = outp->lvds.dual ? 3 : 1; in nv50_disp_super_2_2()
1295 head->func->rgclk(head, ior->asy.rgdiv); in nv50_disp_super_2_2()
1297 /* Mode-specific internal DP configuration. */ in nv50_disp_super_2_2()
1298 if (ior->type == SOR && ior->asy.proto == DP) in nv50_disp_super_2_2()
1301 /* OR-specific handling. */ in nv50_disp_super_2_2()
1302 ior->func->clock(ior); in nv50_disp_super_2_2()
1303 if (ior->func->war_2) in nv50_disp_super_2_2()
1304 ior->func->war_2(ior); in nv50_disp_super_2_2()
1310 struct nvkm_devinit *devinit = disp->engine.subdev.device->devinit; in nv50_disp_super_2_1()
1311 const u32 khz = head->asy.hz / 1000; in nv50_disp_super_2_1()
1312 HEAD_DBG(head, "supervisor 2.1 - %d khz", khz); in nv50_disp_super_2_1()
1314 nvkm_devinit_pll_set(devinit, PLL_VPLL0 + head->id, khz); in nv50_disp_super_2_1()
1353 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_super_1()
1354 head->func->state(head, &head->arm); in nv50_disp_super_1()
1355 head->func->state(head, &head->asy); in nv50_disp_super_1()
1358 list_for_each_entry(ior, &disp->iors, head) { in nv50_disp_super_1()
1359 ior->func->state(ior, &ior->arm); in nv50_disp_super_1()
1360 ior->func->state(ior, &ior->asy); in nv50_disp_super_1()
1368 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_super()
1369 struct nvkm_device *device = subdev->device; in nv50_disp_super()
1373 mutex_lock(&disp->super.mutex); in nv50_disp_super()
1376 nvkm_debug(subdev, "supervisor %08x %08x\n", disp->super.pending, super); in nv50_disp_super()
1378 if (disp->super.pending & 0x00000010) { in nv50_disp_super()
1379 nv50_disp_chan_mthd(disp->chan[0], NV_DBG_DEBUG); in nv50_disp_super()
1381 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_super()
1382 if (!(super & (0x00000020 << head->id))) in nv50_disp_super()
1384 if (!(super & (0x00000080 << head->id))) in nv50_disp_super()
1389 if (disp->super.pending & 0x00000020) { in nv50_disp_super()
1390 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_super()
1391 if (!(super & (0x00000080 << head->id))) in nv50_disp_super()
1395 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_super()
1396 if (!(super & (0x00000200 << head->id))) in nv50_disp_super()
1400 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_super()
1401 if (!(super & (0x00000080 << head->id))) in nv50_disp_super()
1406 if (disp->super.pending & 0x00000040) { in nv50_disp_super()
1407 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_super()
1408 if (!(super & (0x00000080 << head->id))) in nv50_disp_super()
1415 mutex_unlock(&disp->super.mutex); in nv50_disp_super()
1439 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_intr_error()
1440 struct nvkm_device *device = subdev->device; in nv50_disp_intr_error()
1453 type, et ? et->name : "", code, ec ? ec->name : "", in nv50_disp_intr_error()
1456 if (chid < ARRAY_SIZE(disp->chan)) { in nv50_disp_intr_error()
1459 nv50_disp_chan_mthd(disp->chan[chid], NV_DBG_ERROR); in nv50_disp_intr_error()
1473 struct nvkm_device *device = disp->engine.subdev.device; in nv50_disp_intr()
1478 u32 chid = __ffs(intr0 & 0x001f0000) - 16; in nv50_disp_intr()
1500 disp->super.pending = (intr1 & 0x00000070); in nv50_disp_intr()
1501 queue_work(disp->super.wq, &disp->super.work); in nv50_disp_intr()
1502 nvkm_wr32(device, 0x610024, disp->super.pending); in nv50_disp_intr()
1509 struct nvkm_device *device = disp->engine.subdev.device; in nv50_disp_fini()
1518 struct nvkm_device *device = disp->engine.subdev.device; in nv50_disp_init()
1531 list_for_each_entry(head, &disp->heads, head) { in nv50_disp_init()
1532 tmp = nvkm_rd32(device, 0x616100 + (head->id * 0x800)); in nv50_disp_init()
1533 nvkm_wr32(device, 0x610190 + (head->id * 0x10), tmp); in nv50_disp_init()
1534 tmp = nvkm_rd32(device, 0x616104 + (head->id * 0x800)); in nv50_disp_init()
1535 nvkm_wr32(device, 0x610194 + (head->id * 0x10), tmp); in nv50_disp_init()
1536 tmp = nvkm_rd32(device, 0x616108 + (head->id * 0x800)); in nv50_disp_init()
1537 nvkm_wr32(device, 0x610198 + (head->id * 0x10), tmp); in nv50_disp_init()
1538 tmp = nvkm_rd32(device, 0x61610c + (head->id * 0x800)); in nv50_disp_init()
1539 nvkm_wr32(device, 0x61019c + (head->id * 0x10), tmp); in nv50_disp_init()
1543 for (i = 0; i < disp->dac.nr; i++) { in nv50_disp_init()
1549 for (i = 0; i < disp->sor.nr; i++) { in nv50_disp_init()
1555 for (i = 0; i < disp->pior.nr; i++) { in nv50_disp_init()
1568 return -EBUSY; in nv50_disp_init()
1572 nvkm_wr32(device, 0x610010, (disp->inst->addr >> 8) | 9); in nv50_disp_init()
1583 const struct nvkm_disp_func *func = disp->func; in nv50_disp_oneinit()
1584 struct nvkm_subdev *subdev = &disp->engine.subdev; in nv50_disp_oneinit()
1585 struct nvkm_device *device = subdev->device; in nv50_disp_oneinit()
1586 struct nvkm_bios *bios = device->bios; in nv50_disp_oneinit()
1596 if (func->wndw.cnt) { in nv50_disp_oneinit()
1597 disp->wndw.nr = func->wndw.cnt(disp, &disp->wndw.mask); in nv50_disp_oneinit()
1598 nvkm_debug(subdev, "Window(s): %d (%08lx)\n", disp->wndw.nr, disp->wndw.mask); in nv50_disp_oneinit()
1601 disp->head.nr = func->head.cnt(disp, &disp->head.mask); in nv50_disp_oneinit()
1602 nvkm_debug(subdev, " Head(s): %d (%02lx)\n", disp->head.nr, disp->head.mask); in nv50_disp_oneinit()
1603 for_each_set_bit(i, &disp->head.mask, disp->head.nr) { in nv50_disp_oneinit()
1604 ret = func->head.new(disp, i); in nv50_disp_oneinit()
1609 if (func->dac.cnt) { in nv50_disp_oneinit()
1610 disp->dac.nr = func->dac.cnt(disp, &disp->dac.mask); in nv50_disp_oneinit()
1611 nvkm_debug(subdev, " DAC(s): %d (%02lx)\n", disp->dac.nr, disp->dac.mask); in nv50_disp_oneinit()
1612 for_each_set_bit(i, &disp->dac.mask, disp->dac.nr) { in nv50_disp_oneinit()
1613 ret = func->dac.new(disp, i); in nv50_disp_oneinit()
1619 if (func->pior.cnt) { in nv50_disp_oneinit()
1620 disp->pior.nr = func->pior.cnt(disp, &disp->pior.mask); in nv50_disp_oneinit()
1621 nvkm_debug(subdev, " PIOR(s): %d (%02lx)\n", disp->pior.nr, disp->pior.mask); in nv50_disp_oneinit()
1622 for_each_set_bit(i, &disp->pior.mask, disp->pior.nr) { in nv50_disp_oneinit()
1623 ret = func->pior.new(disp, i); in nv50_disp_oneinit()
1629 disp->sor.nr = func->sor.cnt(disp, &disp->sor.mask); in nv50_disp_oneinit()
1630 nvkm_debug(subdev, " SOR(s): %d (%02lx)\n", disp->sor.nr, disp->sor.mask); in nv50_disp_oneinit()
1631 for_each_set_bit(i, &disp->sor.mask, disp->sor.nr) { in nv50_disp_oneinit()
1632 ret = func->sor.new(disp, i); in nv50_disp_oneinit()
1637 ret = nvkm_gpuobj_new(device, 0x10000, 0x10000, false, NULL, &disp->inst); in nv50_disp_oneinit()
1641 ret = nvkm_ramht_new(device, func->ramht_size ? func->ramht_size : 0x1000, 0, disp->inst, in nv50_disp_oneinit()
1642 &disp->ramht); in nv50_disp_oneinit()
1647 i = -1; in nv50_disp_oneinit()
1650 return -EINVAL; in nv50_disp_oneinit()
1669 ret = -ENODEV; in nv50_disp_oneinit()
1672 nvkm_warn(subdev, "dcb %d type %d unknown\n", in nv50_disp_oneinit()
1679 if (ret != -ENODEV) in nv50_disp_oneinit()
1690 list_add_tail(&outp->head, &disp->outps); in nv50_disp_oneinit()
1694 list_for_each_entry_safe(outp, outt, &disp->outps, head) { in nv50_disp_oneinit()
1696 data = nvbios_connEp(bios, outp->info.connector, &ver, &hdr, in nv50_disp_oneinit()
1706 int ccb_index = outp->info.i2c_index; in nv50_disp_oneinit()
1708 list_for_each_entry(pair, &disp->outps, head) { in nv50_disp_oneinit()
1709 if (pair->info.i2c_index == ccb_index) { in nv50_disp_oneinit()
1710 outp->conn = pair->conn; in nv50_disp_oneinit()
1717 if (outp->conn) in nv50_disp_oneinit()
1722 i = -1; in nv50_disp_oneinit()
1724 i = outp->info.connector; in nv50_disp_oneinit()
1728 list_for_each_entry(conn, &disp->conns, head) { in nv50_disp_oneinit()
1729 if (conn->index == outp->info.connector) { in nv50_disp_oneinit()
1730 outp->conn = conn; in nv50_disp_oneinit()
1735 if (outp->conn) in nv50_disp_oneinit()
1739 ret = nvkm_conn_new(disp, i, &connE, &outp->conn); in nv50_disp_oneinit()
1741 nvkm_error(subdev, "failed to create outp %d conn: %d\n", outp->index, ret); in nv50_disp_oneinit()
1742 nvkm_conn_del(&outp->conn); in nv50_disp_oneinit()
1743 list_del(&outp->head); in nv50_disp_oneinit()
1748 list_add_tail(&outp->conn->head, &disp->conns); in nv50_disp_oneinit()
1751 /* Enforce identity-mapped SOR assignment for panels, which have in nv50_disp_oneinit()
1754 list_for_each_entry(outp, &disp->outps, head) { in nv50_disp_oneinit()
1755 if (outp->conn->info.type == DCB_CONNECTOR_LVDS || in nv50_disp_oneinit()
1756 outp->conn->info.type == DCB_CONNECTOR_eDP) { in nv50_disp_oneinit()
1757 ior = nvkm_ior_find(disp, SOR, ffs(outp->info.or) - 1); in nv50_disp_oneinit()
1759 ior->identity = true; in nv50_disp_oneinit()
1760 outp->identity = true; in nv50_disp_oneinit()