diff options
Diffstat (limited to 'drivers/video/fb.c')
-rw-r--r-- | drivers/video/fb.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/video/fb.c b/drivers/video/fb.c index 2d82bc01fa..6f412d62c4 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include <common.h> #include <malloc.h> #include <fb.h> @@ -42,6 +43,12 @@ static int fb_close(struct cdev *cdev) return 0; } +void fb_damage(struct fb_info *info, struct fb_rect *rect) +{ + if (info->fbops->fb_damage) + info->fbops->fb_damage(info, rect); +} + static int fb_op_flush(struct cdev *cdev) { struct fb_info *info = cdev->priv; @@ -119,22 +126,25 @@ int fb_disable(struct fb_info *info) return 0; } +static int fb_enable_get(struct param_d *param, void *priv) +{ + struct fb_info *info = priv; + + info->p_enable = info->enabled; + return 0; +} + static int fb_enable_set(struct param_d *param, void *priv) { struct fb_info *info = priv; - int enable; if (!info->mode) return -EINVAL; - enable = info->p_enable; - - if (enable) - fb_enable(info); + if (info->p_enable) + return fb_enable(info); else - fb_disable(info); - - return 0; + return fb_disable(info); } static struct fb_videomode *fb_num_to_mode(struct fb_info *info, int num) @@ -154,7 +164,7 @@ static struct fb_videomode *fb_num_to_mode(struct fb_info *info, int num) static int fb_setup_mode(struct fb_info *info) { - struct device_d *dev = &info->dev; + struct device *dev = &info->dev; int ret; struct fb_videomode *mode; @@ -247,7 +257,7 @@ static void fb_print_modes(struct display_timings *modes) fb_print_mode(&modes->modes[i]); } -static void fb_info(struct device_d *dev) +static void fb_info(struct device *dev) { struct fb_info *info = dev->priv; @@ -275,7 +285,7 @@ static int fb_set_shadowfb(struct param_d *p, void *priv) int register_framebuffer(struct fb_info *info) { int id = get_free_deviceid("fb"); - struct device_d *dev; + struct device *dev; int ret, num_modes, i; const char **names; @@ -314,7 +324,7 @@ int register_framebuffer(struct fb_info *info) if (ret) goto err_free; - dev_add_param_bool(dev, "enable", fb_enable_set, NULL, + dev_add_param_bool(dev, "enable", fb_enable_set, fb_enable_get, &info->p_enable, info); if (IS_ENABLED(CONFIG_DRIVER_VIDEO_EDID)) |