Skip to contentSkip to conversation

drm_fb_helper: Reduce duplicated execution of the drm_fb_helper_hotplug_event()

PATCH New JaeJoon Jung 1 participant 1 message Mar 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm_fb_helper: Reduce duplicated execution of the drm_fb_helper_hotplug_event()

If drm_fb_helper->fb_info is already set,
Add an if condition as below to execute the hotplug event only when the system_state is SYSTEM_RUNNING.
This will reduce duplicate execution.
In particular, It can prevent drm_fb_helper_hotplug_event() from being executed repeatedly at booting time.

---
 drivers/gpu/drm/drm_fb_helper.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +3 -0
index fb3614a7ba44..c042e5a2e046 100644
@@ -1939,6 +1939,9 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
 	if (!drm_fbdev_emulation || !fb_helper)
 		return 0;
 
+	if (fb_helper->info && system_state != SYSTEM_RUNNING)
+		return 0;
+
 	mutex_lock(&fb_helper->lock);
 	if (fb_helper->deferred_setup) {
 		err = __drm_fb_helper_initial_config_and_unlock(fb_helper);
Signature · 1 line
2.43.0