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_DEBUG_KMS("Encoder fixup failed\n"); in drm_crtc_helper_set_mode()
359 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
361 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
364 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
370 encoder_funcs->prepare(encoder); in drm_crtc_helper_set_mode()
384 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
386 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
389 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
393 DRM_DEBUG_KMS("[ENCODER:%d:%s] set [MODE:%s]\n", in drm_crtc_helper_set_mode()
394 encoder->base.id, encoder->name, mode->name); in drm_crtc_helper_set_mode()
396 encoder_funcs->mode_set(encoder, mode, adjusted_mode); in drm_crtc_helper_set_mode()
402 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_mode()
404 if (encoder->crtc != crtc) in drm_crtc_helper_set_mode()
407 encoder_funcs = encoder->helper_private; in drm_crtc_helper_set_mode()
412 encoder_funcs->commit(encoder); in drm_crtc_helper_set_mode()
467 struct drm_encoder *encoder; in drm_crtc_helper_disable() local
470 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_disable()
473 if (encoder->crtc != crtc) in drm_crtc_helper_disable()
478 if (connector->encoder != encoder) in drm_crtc_helper_disable()
481 connector->encoder = NULL; in drm_crtc_helper_disable()
485 * doing this, but since we've decoupled the encoder in drm_crtc_helper_disable()
491 /* we keep a reference while the encoder is bound */ in drm_crtc_helper_disable()
507 struct drm_encoder *encoder; in drm_connector_get_single_encoder() local
510 drm_connector_for_each_possible_encoder(connector, encoder) in drm_connector_get_single_encoder()
511 return encoder; in drm_connector_get_single_encoder()
525 * It first tries to locate the best encoder for each connector by calling the
529 * mode_fixup encoder and CRTC helper operations to adjust the requested mode,
542 * and ->commit() CRTC and encoder helper operations, in that order.
559 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()
667 if (set->connectors[ro]->encoder) in drm_crtc_helper_set_config()
678 new_encoder = connector->encoder; in drm_crtc_helper_set_config()
686 /* if we can't get an encoder for a connector in drm_crtc_helper_set_config()
701 if (new_encoder != connector->encoder) { in drm_crtc_helper_set_config()
702 DRM_DEBUG_KMS("encoder changed, full mode switch\n"); in drm_crtc_helper_set_config()
704 /* If the encoder is reused for another connector, then in drm_crtc_helper_set_config()
707 if (connector->encoder) in drm_crtc_helper_set_config()
708 connector->encoder->crtc = NULL; in drm_crtc_helper_set_config()
709 connector->encoder = new_encoder; in drm_crtc_helper_set_config()
722 if (!connector->encoder) in drm_crtc_helper_set_config()
725 if (connector->encoder->crtc == set->crtc) in drm_crtc_helper_set_config()
728 new_crtc = connector->encoder->crtc; in drm_crtc_helper_set_config()
735 /* Make sure the new CRTC will work with the encoder */ in drm_crtc_helper_set_config()
737 !drm_encoder_crtc_ok(connector->encoder, new_crtc)) { in drm_crtc_helper_set_config()
742 if (new_crtc != connector->encoder->crtc) { in drm_crtc_helper_set_config()
745 connector->encoder->crtc = new_crtc; in drm_crtc_helper_set_config()
806 drm_for_each_encoder(encoder, dev) { in drm_crtc_helper_set_config()
807 encoder->crtc = save_encoder_crtcs[count++]; in drm_crtc_helper_set_config()
813 connector->encoder = save_connector_encoders[count++]; in drm_crtc_helper_set_config()
820 if (set->connectors[ro]->encoder) in drm_crtc_helper_set_config()
837 static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder) in drm_helper_choose_encoder_dpms() argument
842 struct drm_device *dev = encoder->dev; in drm_helper_choose_encoder_dpms()
846 if (connector->encoder == encoder) in drm_helper_choose_encoder_dpms()
854 /* Helper which handles bridge ordering around encoder dpms */
855 static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode) in drm_helper_encoder_dpms() argument
859 encoder_funcs = encoder->helper_private; in drm_helper_encoder_dpms()
864 encoder_funcs->dpms(encoder, mode); in drm_helper_encoder_dpms()
876 if (connector->encoder && connector->encoder->crtc == crtc) in drm_helper_choose_crtc_dpms()
907 struct drm_encoder *encoder = connector->encoder; in drm_helper_connector_dpms() local
908 struct drm_crtc *crtc = encoder ? encoder->crtc : NULL; in drm_helper_connector_dpms()
919 if (encoder) in drm_helper_connector_dpms()
920 encoder_dpms = drm_helper_choose_encoder_dpms(encoder); in drm_helper_connector_dpms()
922 /* from off to on, do crtc then encoder */ in drm_helper_connector_dpms()
931 if (encoder) in drm_helper_connector_dpms()
932 drm_helper_encoder_dpms(encoder, encoder_dpms); in drm_helper_connector_dpms()
935 /* from on to off, do encoder then crtc */ in drm_helper_connector_dpms()
937 if (encoder) in drm_helper_connector_dpms()
938 drm_helper_encoder_dpms(encoder, encoder_dpms); in drm_helper_connector_dpms()
981 struct drm_encoder *encoder; in drm_helper_resume_force_mode() local
1003 drm_for_each_encoder(encoder, dev) { in drm_helper_resume_force_mode()
1005 if(encoder->crtc != crtc) in drm_helper_resume_force_mode()
1009 encoder); in drm_helper_resume_force_mode()
1011 drm_helper_encoder_dpms(encoder, encoder_dpms); in drm_helper_resume_force_mode()