Lines Matching full:encoder

97  * drm_helper_encoder_in_use - check if a given encoder is in use
98 * @encoder: encoder to check
100 * Checks whether @encoder is with the current mode setting output configuration
105 * True if @encoder is used, false otherwise.
107 bool drm_helper_encoder_in_use(struct drm_encoder *encoder) in drm_helper_encoder_in_use() argument
111 struct drm_device *dev = encoder->dev; in drm_helper_encoder_in_use()
127 if (connector->encoder == encoder) { in drm_helper_encoder_in_use()
150 struct drm_encoder *encoder; in drm_helper_crtc_in_use() local
162 drm_for_each_encoder(encoder, dev) in drm_helper_crtc_in_use()
163 if (encoder->crtc == crtc && drm_helper_encoder_in_use(encoder)) in drm_helper_crtc_in_use()
170 drm_encoder_disable(struct drm_encoder *encoder) in drm_encoder_disable() argument
172 const struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; in drm_encoder_disable()
178 (*encoder_funcs->disable)(encoder); in drm_encoder_disable()
180 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF); in drm_encoder_disable()
185 struct drm_encoder *encoder; in __drm_helper_disable_unused_functions() local
190 drm_for_each_encoder(encoder, dev) { in __drm_helper_disable_unused_functions()
191 if (!drm_helper_encoder_in_use(encoder)) { in __drm_helper_disable_unused_functions()
192 drm_encoder_disable(encoder); in __drm_helper_disable_unused_functions()
193 /* disconnect encoder from any connector */ in __drm_helper_disable_unused_functions()
194 encoder->crtc = NULL; in __drm_helper_disable_unused_functions()
217 * will remove any CRTC links of unused encoders and encoder links of
250 struct drm_encoder *encoder; in drm_crtc_prepare_encoders() local
252 drm_for_each_encoder(encoder, dev) { in drm_crtc_prepare_encoders()
253 encoder_funcs = encoder->helper_private; in drm_crtc_prepare_encoders()
258 if (encoder->crtc == NULL) in drm_crtc_prepare_encoders()
259 drm_encoder_disable(encoder); in drm_crtc_prepare_encoders()
294 struct drm_encoder *encoder; in drm_crtc_helper_set_mode() local
328 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
330 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
333 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
337 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
339 if (!(ret = encoder_funcs->mode_fixup(encoder, mode, in drm_crtc_helper_set_mode()
341 drm_dbg_kms(dev, "[ENCODER:%d:%s] mode fixup failed\n", in drm_crtc_helper_set_mode()
342 encoder->base.id, encoder->name); in drm_crtc_helper_set_mode()
361 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
363 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
366 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
372 encoder_funcs->prepare(encoder); in drm_crtc_helper_set_mode()
386 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
388 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
391 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
395 drm_dbg_kms(dev, "[ENCODER:%d:%s] set [MODE:%s]\n", in drm_crtc_helper_set_mode()
396 encoder->base.id, encoder->name, mode->name); in drm_crtc_helper_set_mode()
398 encoder_funcs->mode_set(encoder, mode, adjusted_mode); in drm_crtc_helper_set_mode()
404 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
406 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
409 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
414 encoder_funcs->commit(encoder); in drm_crtc_helper_set_mode()
466 struct drm_encoder *encoder; in drm_crtc_helper_disable() local
469 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_disable()
472 if (encoder->crtc != crtc) in drm_crtc_helper_disable()
477 if (connector->encoder != encoder) in drm_crtc_helper_disable()
480 connector->encoder = NULL; in drm_crtc_helper_disable()
484 * doing this, but since we've decoupled the encoder in drm_crtc_helper_disable()
490 /* we keep a reference while the encoder is bound */ in drm_crtc_helper_disable()
506 struct drm_encoder *encoder; in drm_connector_get_single_encoder() local
509 drm_connector_for_each_possible_encoder(connector, encoder) in drm_connector_get_single_encoder()
510 return encoder; in drm_connector_get_single_encoder()
524 * It first tries to locate the best encoder for each connector by calling the
528 * mode_fixup encoder and CRTC helper operations to adjust the requested mode,
541 * and ->commit() CRTC and encoder helper operations, in that order.
558 struct drm_encoder **save_connector_encoders, *new_encoder, *encoder; in drm_crtc_helper_set_config() local
603 * Allocate space for the backup of all (non-pointer) encoder and in drm_crtc_helper_set_config()
624 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_config()
625 save_encoder_crtcs[count++] = encoder->crtc; in drm_crtc_helper_set_config()
631 save_connector_encoders[count++] = connector->encoder; in drm_crtc_helper_set_config()
669 if (set->connectors[ro]->encoder) in drm_crtc_helper_set_config()
680 new_encoder = connector->encoder; in drm_crtc_helper_set_config()
688 /* if we can't get an encoder for a connector in drm_crtc_helper_set_config()
704 if (new_encoder != connector->encoder) { in drm_crtc_helper_set_config()
705 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] encoder changed, full mode switch\n", in drm_crtc_helper_set_config()
708 /* If the encoder is reused for another connector, then in drm_crtc_helper_set_config()
711 if (connector->encoder) in drm_crtc_helper_set_config()
712 connector->encoder->crtc = NULL; in drm_crtc_helper_set_config()
713 connector->encoder = new_encoder; in drm_crtc_helper_set_config()
726 if (!connector->encoder) in drm_crtc_helper_set_config()
729 if (connector->encoder->crtc == set->crtc) in drm_crtc_helper_set_config()
732 new_crtc = connector->encoder->crtc; in drm_crtc_helper_set_config()
739 /* Make sure the new CRTC will work with the encoder */ in drm_crtc_helper_set_config()
741 !drm_encoder_crtc_ok(connector->encoder, new_crtc)) { in drm_crtc_helper_set_config()
746 if (new_crtc != connector->encoder->crtc) { in drm_crtc_helper_set_config()
750 connector->encoder->crtc = new_crtc; in drm_crtc_helper_set_config()
811 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_config()
812 encoder->crtc = save_encoder_crtcs[count++]; in drm_crtc_helper_set_config()
818 connector->encoder = save_connector_encoders[count++]; in drm_crtc_helper_set_config()
825 if (set->connectors[ro]->encoder) in drm_crtc_helper_set_config()
842 static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder) in drm_helper_choose_encoder_dpms() argument
847 struct drm_device *dev = encoder->dev; in drm_helper_choose_encoder_dpms()
851 if (connector->encoder == encoder) in drm_helper_choose_encoder_dpms()
859 /* Helper which handles bridge ordering around encoder dpms */
860 static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode) in drm_helper_encoder_dpms() argument
864 encoder_funcs = encoder->helper_private; in drm_helper_encoder_dpms()
869 encoder_funcs->dpms(encoder, mode); in drm_helper_encoder_dpms()
881 if (connector->encoder && connector->encoder->crtc == crtc) in drm_helper_choose_crtc_dpms()
912 struct drm_encoder *encoder = connector->encoder; in drm_helper_connector_dpms() local
913 struct drm_crtc *crtc = encoder ? encoder->crtc : NULL; in drm_helper_connector_dpms()
924 if (encoder) in drm_helper_connector_dpms()
925 encoder_dpms = drm_helper_choose_encoder_dpms(encoder); in drm_helper_connector_dpms()
927 /* from off to on, do crtc then encoder */ in drm_helper_connector_dpms()
936 if (encoder) in drm_helper_connector_dpms()
937 drm_helper_encoder_dpms(encoder, encoder_dpms); in drm_helper_connector_dpms()
940 /* from on to off, do encoder then crtc */ in drm_helper_connector_dpms()
942 if (encoder) in drm_helper_connector_dpms()
943 drm_helper_encoder_dpms(encoder, encoder_dpms); in drm_helper_connector_dpms()
986 struct drm_encoder *encoder; in drm_helper_resume_force_mode() local
1008 drm_for_each_encoder(encoder, dev) { in drm_helper_resume_force_mode()
1010 if(encoder->crtc != crtc) in drm_helper_resume_force_mode()
1014 encoder); in drm_helper_resume_force_mode()
1016 drm_helper_encoder_dpms(encoder, encoder_dpms); in drm_helper_resume_force_mode()