video: Add generic fixup handler to reserve fb memory
When a framebuffer is kept enabled when Linux starts its framebuffer memory should be reserved. Otherwise Linux may overwrite its contents. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
7be1519c69
commit
2f5f0d6aa1
|
@ -103,6 +103,27 @@ static int fb_setup_mode(struct fb_info *info)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int fb_of_reserve_fixup(struct device_node *root, void *context)
|
||||
{
|
||||
struct fb_info *info = context;
|
||||
|
||||
if (!info->enabled)
|
||||
return 0;
|
||||
|
||||
of_add_reserve_entry((unsigned long)info->screen_base,
|
||||
(unsigned long)info->screen_base + info->screen_size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fb_of_reserve_add_fixup(struct fb_info *info)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_OFDEVICE))
|
||||
return;
|
||||
|
||||
of_register_fixup(fb_of_reserve_fixup, info);
|
||||
}
|
||||
|
||||
static int fb_set_modename(struct param_d *param, void *priv)
|
||||
{
|
||||
struct fb_info *info = priv;
|
||||
|
|
|
@ -159,5 +159,6 @@ int fb_register_simplefb(struct fb_info *info);
|
|||
int edid_to_display_timings(struct display_timings *, unsigned char *edid);
|
||||
void *edid_read_i2c(struct i2c_adapter *adapter);
|
||||
void fb_edid_add_modes(struct fb_info *info);
|
||||
void fb_of_reserve_add_fixup(struct fb_info *info);
|
||||
|
||||
#endif /* __FB_H */
|
||||
|
|
Loading…
Reference in New Issue