Lines Matching refs:set
262 * drm_crtc_helper_set_mode - internal helper to set a mode
269 * Try to set @mode on @crtc. Give @crtc and its associated connectors a chance
270 * to fixup or reject the mode prior to trying to set it. This is an internal
279 * True if the mode was set successfully, false otherwise.
375 /* Set up the DPLL and any encoders state that needs to adjust or depend
391 DRM_DEBUG_KMS("[ENCODER:%d:%s] set [MODE:%s]\n",
397 /* Now enable the clocks, plane, pipe, and connectors that we set up. */
489 * drm_crtc_helper_set_config - set a new config from userspace
490 * @set: mode set configuration
513 * performs a full mode set sequence by calling the ->prepare(), ->mode_set()
526 int drm_crtc_helper_set_config(struct drm_mode_set *set,
532 bool mode_changed = false; /* if true do a full mode set */
544 BUG_ON(!set);
545 BUG_ON(!set->crtc);
546 BUG_ON(!set->crtc->helper_private);
549 BUG_ON(!set->mode && set->fb);
550 BUG_ON(set->fb && set->num_connectors == 0);
552 crtc_funcs = set->crtc->helper_private;
554 dev = set->crtc->dev;
557 if (!set->mode)
558 set->fb = NULL;
560 if (set->fb) {
562 set->crtc->base.id, set->crtc->name,
563 set->fb->base.id,
564 (int)set->num_connectors, set->x, set->y);
567 set->crtc->base.id, set->crtc->name);
568 drm_crtc_helper_disable(set->crtc);
606 save_set.crtc = set->crtc;
607 save_set.mode = &set->crtc->mode;
608 save_set.x = set->crtc->x;
609 save_set.y = set->crtc->y;
610 save_set.fb = set->crtc->primary->fb;
614 if (set->crtc->primary->fb != set->fb) {
615 /* If we have no fb then treat it as a full mode set */
616 if (set->crtc->primary->fb == NULL) {
617 DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
619 } else if (set->fb->format != set->crtc->primary->fb->format) {
625 if (set->x != set->crtc->x || set->y != set->crtc->y)
628 if (!drm_mode_equal(set->mode, &set->crtc->mode)) {
629 DRM_DEBUG_KMS("modes are different, full mode set\n");
630 drm_mode_debug_printmodeline(&set->crtc->mode);
631 drm_mode_debug_printmodeline(set->mode);
635 /* take a reference on all unbound connectors in set, reuse the
638 for (ro = 0; ro < set->num_connectors; ro++) {
639 if (set->connectors[ro]->encoder)
641 drm_connector_get(set->connectors[ro]);
651 for (ro = 0; ro < set->num_connectors; ro++) {
652 if (set->connectors[ro] == connector) {
677 * the appropriate crtc will be set later.
697 if (connector->encoder->crtc == set->crtc)
702 for (ro = 0; ro < set->num_connectors; ro++) {
703 if (set->connectors[ro] == connector)
704 new_crtc = set->crtc;
735 if (drm_helper_crtc_in_use(set->crtc)) {
736 DRM_DEBUG_KMS("attempting to set mode from"
738 drm_mode_debug_printmodeline(set->mode);
739 set->crtc->primary->fb = set->fb;
740 if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
741 set->x, set->y,
743 DRM_ERROR("failed to set mode on [CRTC:%d:%s]\n",
744 set->crtc->base.id, set->crtc->name);
745 set->crtc->primary->fb = save_set.fb;
750 for (i = 0; i < set->num_connectors; i++) {
751 DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
752 set->connectors[i]->name);
753 set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON);
758 set->crtc->x = set->x;
759 set->crtc->y = set->y;
760 set->crtc->primary->fb = set->fb;
761 ret = crtc_funcs->mode_set_base(set->crtc,
762 set->x, set->y, save_set.fb);
764 set->crtc->x = save_set.x;
765 set->crtc->y = save_set.y;
766 set->crtc->primary->fb = save_set.fb;
788 /* after fail drop reference on all unbound connectors in set, let
791 for (ro = 0; ro < set->num_connectors; ro++) {
792 if (set->connectors[ro]->encoder)
794 drm_connector_put(set->connectors[ro]);
933 * has successfully set the restored configuration already. Hence this should
939 * configuration is restored in a different order than when userspace set it up)
969 DRM_ERROR("failed to set mode on crtc %p\n", crtc);
1018 struct drm_mode_set set = {
1022 ret = drm_mode_set_config_internal(&set);