Lines Matching refs:encoder

209  * drm_helper_encoder_in_use - check if a given encoder is in use
210 * @encoder: encoder to check
218 * True if @encoder is part of the mode_config, false otherwise.
220 bool drm_helper_encoder_in_use(struct drm_encoder *encoder)
223 struct drm_device *dev = encoder->dev;
225 if (connector->encoder == encoder)
244 struct drm_encoder *encoder;
247 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head)
248 if (encoder->crtc == crtc && drm_helper_encoder_in_use(encoder))
253 drm_encoder_disable(struct drm_encoder *encoder)
255 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
258 (*encoder_funcs->disable)(encoder);
260 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
275 struct drm_encoder *encoder;
280 if (!connector->encoder)
283 connector->encoder = NULL;
286 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
287 if (!drm_helper_encoder_in_use(encoder)) {
288 drm_encoder_disable(encoder);
289 /* disconnector encoder from any connector */
290 encoder->crtc = NULL;
309 * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
310 * @encoder: encoder to test
313 * Return false if @encoder can't be driven by @crtc, true otherwise.
315 static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
333 if (encoder->possible_crtcs & crtc_mask)
347 struct drm_encoder *encoder;
349 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
350 encoder_funcs = encoder->helper_private;
352 if (encoder->crtc == NULL)
353 drm_encoder_disable(encoder);
356 encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
357 drm_encoder_disable(encoder);
394 struct drm_encoder *encoder;
421 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
423 if (encoder->crtc != crtc)
425 encoder_funcs = encoder->helper_private;
426 if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
440 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
442 if (encoder->crtc != crtc)
444 encoder_funcs = encoder->helper_private;
446 encoder_funcs->prepare(encoder);
460 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
462 if (encoder->crtc != crtc)
466 encoder->base.id, drm_get_encoder_name(encoder),
468 encoder_funcs = encoder->helper_private;
469 encoder_funcs->mode_set(encoder, mode, adjusted_mode);
475 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
477 if (encoder->crtc != crtc)
480 encoder_funcs = encoder->helper_private;
481 encoder_funcs->commit(encoder);
512 struct drm_encoder *encoder;
515 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
516 if (encoder->crtc != crtc)
520 if (connector->encoder != encoder)
523 connector->encoder = NULL;
551 struct drm_encoder *save_encoders, *new_encoder, *encoder;
588 /* Allocate space for the backup of all (non-pointer) crtc, encoder and
620 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
621 save_encoders[count++] = *encoder;
666 new_encoder = connector->encoder;
670 /* if we can't get an encoder for a connector
685 if (new_encoder != connector->encoder) {
686 DRM_DEBUG_KMS("encoder changed, full mode switch\n");
688 /* If the encoder is reused for another connector, then
691 if (connector->encoder)
692 connector->encoder->crtc = NULL;
693 connector->encoder = new_encoder;
704 if (!connector->encoder)
707 if (connector->encoder->crtc == set->crtc)
710 new_crtc = connector->encoder->crtc;
717 /* Make sure the new CRTC will work with the encoder */
719 !drm_encoder_crtc_ok(connector->encoder, new_crtc)) {
723 if (new_crtc != connector->encoder->crtc) {
726 connector->encoder->crtc = new_crtc;
795 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
796 *encoder = save_encoders[count++];
817 static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
821 struct drm_device *dev = encoder->dev;
824 if (connector->encoder == encoder)
837 if (connector->encoder && connector->encoder->crtc == crtc)
855 struct drm_encoder *encoder = connector->encoder;
856 struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
865 /* from off to on, do crtc then encoder */
873 if (encoder) {
874 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
876 (*encoder_funcs->dpms) (encoder,
877 drm_helper_choose_encoder_dpms(encoder));
881 /* from on to off, do encoder then crtc */
883 if (encoder) {
884 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
886 (*encoder_funcs->dpms) (encoder,
887 drm_helper_choose_encoder_dpms(encoder));
922 struct drm_encoder *encoder;
940 list_for_each_entry(encoder, struct drm_encoder, &dev->mode_config.encoder_list, head) {
942 if(encoder->crtc != crtc)
945 encoder_funcs = encoder->helper_private;
947 (*encoder_funcs->dpms) (encoder,
948 drm_helper_choose_encoder_dpms(encoder));