mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm_fb_helper: Reduce duplicated execution of the drm_fb_helper_hotplug_event()
@ 2025-03-18  5:46 JaeJoon Jung
  0 siblings, 0 replies; only message in thread
From: JaeJoon Jung @ 2025-03-18  5:46 UTC (permalink / raw)
  To: David Airlie, Jesse Barnes, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Daniel Vetter, Bob Beckett
  Cc: JaeJoon Jung, linux-kernel

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.

Signed-off-by: JaeJoon Jung <rgbi3307@gmail.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index fb3614a7ba44..c042e5a2e046 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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);
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-18  5:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-18  5:46 [PATCH] drm_fb_helper: Reduce duplicated execution of the drm_fb_helper_hotplug_event() JaeJoon Jung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®