@@ -463,6 +463,45 @@ void intel_panel_fini(struct intel_connector *connector)
463
463
}
464
464
}
465
465
466
+ /*
467
+ * If the panel was already enabled at probe, and we took over the state, the
468
+ * panel prepared state is out of sync, and the panel followers won't be
469
+ * notified. We need to call drm_panel_prepare() on enabled panels.
470
+ *
471
+ * It would be natural to handle this e.g. in the connector ->sync_state hook at
472
+ * intel_modeset_readout_hw_state(), but that's unfortunately too early. We
473
+ * don't have drm_connector::kdev at that time. For now, figure out the state at
474
+ * ->late_register, and sync there.
475
+ */
476
+ static void intel_panel_sync_state (struct intel_connector * connector )
477
+ {
478
+ struct intel_display * display = to_intel_display (connector );
479
+ struct drm_connector_state * conn_state ;
480
+ struct intel_crtc * crtc ;
481
+ int ret ;
482
+
483
+ ret = drm_modeset_lock (& display -> drm -> mode_config .connection_mutex , NULL );
484
+ if (ret )
485
+ return ;
486
+
487
+ conn_state = connector -> base .state ;
488
+
489
+ crtc = to_intel_crtc (conn_state -> crtc );
490
+ if (crtc ) {
491
+ struct intel_crtc_state * crtc_state ;
492
+
493
+ crtc_state = to_intel_crtc_state (crtc -> base .state );
494
+
495
+ if (crtc_state -> hw .active ) {
496
+ drm_dbg_kms (display -> drm , "[CONNECTOR:%d:%s] Panel prepare\n" ,
497
+ connector -> base .base .id , connector -> base .name );
498
+ intel_panel_prepare (crtc_state , conn_state );
499
+ }
500
+ }
501
+
502
+ drm_modeset_unlock (& display -> drm -> mode_config .connection_mutex );
503
+ }
504
+
466
505
const struct drm_panel_funcs dummy_panel_funcs = {
467
506
};
468
507
@@ -513,6 +552,8 @@ int intel_panel_register(struct intel_connector *connector)
513
552
drm_dbg_kms (display -> drm , "[CONNECTOR:%d:%s] Registered panel device '%s', has fwnode: %s\n" ,
514
553
connector -> base .base .id , connector -> base .name ,
515
554
dev_name (dev ), str_yes_no (dev_fwnode (dev )));
555
+
556
+ intel_panel_sync_state (connector );
516
557
}
517
558
518
559
out :
0 commit comments