From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/4] video: stmfb: add screen base only once
Date: Wed, 21 Jan 2026 12:36:49 +0100 [thread overview]
Message-ID: <20260121113738.1485637-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260121113738.1485637-1-a.fatoum@pengutronix.de>
The stmfb driver is the only user of fb_of_reserve_add_fixup()
and apparently supports reserving its frame buffer when booting a kernel.
I am not sure this hand off actually works, but the very least we can
do is to avoid adding a duplicate entry repeatedly on every of_diff call.
Thus remove the old one if it exists and add a new one if the frame
buffer was enabled at fixup time.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/video/fb.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index bfc075039e9e..10d34a39e2b2 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -208,11 +208,12 @@ static int fb_of_reserve_fixup(struct device_node *root, void *context)
{
struct fb_info *info = context;
- if (!info->enabled)
- return 0;
+ of_del_reserve_entry((unsigned long)info->screen_base,
+ (unsigned long)info->screen_base + info->screen_size);
- of_add_reserve_entry((unsigned long)info->screen_base,
- (unsigned long)info->screen_base + info->screen_size);
+ if (info->enabled)
+ of_add_reserve_entry((unsigned long)info->screen_base,
+ (unsigned long)info->screen_base + info->screen_size);
return 0;
}
--
2.47.3
prev parent reply other threads:[~2026-01-21 11:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 11:36 [PATCH 1/4] of: fdt: implement of_del_reserve_entry Ahmad Fatoum
2026-01-21 11:36 ` [PATCH 2/4] ARM: sm: fix repeated call to of_add_reserve_entry on every fixup Ahmad Fatoum
2026-01-21 11:36 ` [PATCH 3/4] bootm: delete initrd reserve entry on bootm_boot return Ahmad Fatoum
2026-01-21 11:36 ` Ahmad Fatoum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260121113738.1485637-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox