Lines Matching defs:crtc
152 name_t crtc;
171 name_t crtc;
371 crtc_t *crtc = NULL;
377 crtc = &crtcs[c];
378 common = name->kind & crtc->crtc.kind;
380 if ((common & name_xid) && name->xid == crtc->crtc.xid)
382 if ((common & name_string) && !strcmp (name->string, crtc->crtc.string))
384 if ((common & name_index) && name->index == crtc->crtc.index)
386 crtc = NULL;
388 return crtc;
392 find_crtc_by_xid (RRCrtc crtc)
397 set_name_xid (&crtc_name, crtc);
432 crtc_t *crtc;
446 crtc = find_crtc_by_xid (output->output_info->crtc);
448 if (crtc && crtc->crtc_info) {
449 output->x = crtc->crtc_info->x;
450 output->y = crtc->crtc_info->y;
455 if (crtc && crtc->crtc_info)
456 output->rotation |= (crtc->crtc_info->rotation & 0xf);
485 set_name_xid (&crtcs[c].crtc, res->crtcs[c]);
486 set_name_index (&crtcs[c].crtc, c);
487 if (!crtc_info) fatal ("could not get crtc 0x%x information", res->crtcs[c]);
500 crtc_add_output (crtc_t *crtc, output_t *output)
502 if (crtc->outputs)
503 crtc->outputs = realloc (crtc->outputs, (crtc->noutput + 1) * sizeof (output_t *));
506 crtc->outputs = calloc (1, sizeof (output_t *));
507 crtc->x = output->x;
508 crtc->y = output->y;
509 crtc->rotation = output->rotation;
510 crtc->mode_info = output->mode_info;
512 if (!crtc->outputs) fatal ("out of memory");
513 crtc->outputs[crtc->noutput++] = output;
545 crtc_disable (crtc_t *crtc)
548 fprintf (stderr, "crtc %d (0x%lx) : disable\n", crtc->crtc.index, crtc->crtc.xid);
553 return XRRSetCrtcConfig (dpy, res, crtc->crtc.xid, CurrentTime,
558 crtc_revert (crtc_t *crtc)
560 XRRCrtcInfo *crtc_info = crtc->crtc_info;
563 fprintf (stderr, "crtc %d: revert\n", crtc->crtc.index);
567 return XRRSetCrtcConfig (dpy, res, crtc->crtc.xid, CurrentTime,
574 crtc_apply (crtc_t *crtc)
581 if (!crtc->mode_info)
584 rr_outputs = calloc (crtc->noutput, sizeof (RROutput));
587 for (o = 0; o < crtc->noutput; o++)
588 rr_outputs[o] = crtc->outputs[o]->output.xid;
589 mode = crtc->mode_info->id;
591 fprintf (stderr, "crtc %d (0x%lx) : %12s %6.1f +%d+%d", crtc->crtc.index,
592 crtc->crtc.xid,
593 crtc->mode_info->name, mode_refresh (crtc->mode_info),
594 crtc->x, crtc->y);
595 for (o = 0; o < crtc->noutput; o++)
596 fprintf (stderr, " \"%s\"", crtc->outputs[o]->output.string);
602 s = XRRSetCrtcConfig (dpy, res, crtc->crtc.xid, CurrentTime,
603 crtc->x, crtc->y, mode, crtc->rotation,
604 rr_outputs, crtc->noutput);
672 panic (Status s, crtc_t *crtc)
674 int c = crtc->crtc.index;
686 fprintf (stderr, "%s: Configure crtc %d %s\n", program_name, c, message);
703 crtc_t *crtc = &crtcs[c];
704 XRRCrtcInfo *crtc_info = crtc->crtc_info;
707 * if this crtc is already disabled, skip it
714 * If this crtc is to be left enabled, make
716 * When crtc->mode_info is null, the crtc is to be
717 * disabled. Note set_crtcs () sets crtc->mode_info for
720 if (crtc->mode_info)
726 panic (RRSetConfigFailed, crtc);
743 s = crtc_disable (crtc);
745 panic (s, crtc);
767 crtc_t *crtc = &crtcs[c];
769 s = crtc_apply (crtc);
771 panic (s, crtc);
811 * Test whether 'crtc' can be used for 'output'
814 check_crtc_for_output (crtc_t *crtc, output_t *output)
830 if (other->crtc_info != crtc)
833 /* see if the output connected to the crtc can clone to this output */
842 if (crtc->noutput)
844 for (i = 0; i < crtc->noutput; i++)
846 if (crtc->outputs[i]->mode_info) {
848 if (crtc->mode_info != output->mode_info)
850 if (crtc->x != output->x)
852 if (crtc->y != output->y)
854 if (crtc->rotation != output->rotation)
868 crtc_t *crtc;
870 crtc = find_crtc_by_xid (output->output_info->crtcs[c]);
871 if (!crtc) fatal ("cannot find crtc 0x%x\n", output->output_info->crtcs[c]);
873 if (check_crtc_for_output (crtc, output))
874 return crtc;
1028 * find the best mapping from output to crtc available
1055 * Now score with this output any valid crtc
1059 crtc_t *crtc;
1061 crtc = find_crtc_by_xid (output->output_info->crtcs[c]);
1062 if (!crtc)
1063 fatal ("cannot find crtc 0x%x\n", output->output_info->crtcs[c]);
1065 /* reset crtc allocation for following outputs */
1067 if (!check_crtc_for_output (crtc, output))
1072 if (crtc == output->current_crtc_info)
1075 output->crtc_info = crtc;
1079 best_crtc = crtc;
1086 * Reset other outputs based on this one using the best crtc
1122 fprintf(stderr, "picked crtc 0x%lx for output %d (%s)\n",
1123 output->crtc_info->crtc.xid, i, output->output_info->name);
1145 fprintf (stderr, "cannot find crtc for output %s\n",
1179 crtc_t *crtc = NULL; /* old */
1182 crtc = find_crtc_by_xid (res->crtcs[i]);
1186 if (!crtc || !crtc_info) {
1190 if (!crtc->mode_info && !find_mode_by_xid (crtc_info->mode))
1192 if ((crtc_info->x != crtc->x) ||
1193 (crtc_info->y != crtc->y) ||
1194 (find_mode_by_xid (crtc_info->mode) != crtc->mode_info) ||
1195 (crtc_info->rotation != crtc->rotation)) {
1431 if (output_info->crtc) {
1432 crtc_t *crtc;
1436 if (output_info->crtcs[j] == output_info->crtc)
1440 fatal ("crtc does not match for output\n");
1444 crtc = find_crtc_by_xid (output_info->crtc);
1445 if (crtc)
1447 find_mode_by_xid (crtc->crtc_info->mode);
1470 fprintf(stderr, ", using 0x%lx", con_outputs[j].output->output_info->crtc);
1480 fprintf(stderr, ", using 0x%lx", dis_con_outputs[j].output->output_info->crtc);
1730 crtc_t *crtc;
1740 crtc = output->crtc_info;
1741 s = crtc_disable (crtc);
1743 panic (s, crtc);