diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2023-04-05 14:27:33 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-11 14:02:41 +0200 |
commit | 3002b31da23f9022fd8704fb9f520de9f1485e8d (patch) | |
tree | 00332a32d2dfd24eb91213e9c4a01a753390c305 /lib | |
parent | aaaae2cfbbb905b0c4ea8db6bd57ed94cf7840b8 (diff) | |
download | barebox-3002b31da23f9022fd8704fb9f520de9f1485e8d.tar.gz |
graphic_utils: add optional damage tracking
Annotate framebuffer updates with damage rectangles so drivers may
implement partial updates for displays with an integrated framebuffer.
This can speed up fbconsole.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.barebox.org/20230405122734.2348025-2-p.zabel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gui/graphic_utils.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 92f249e722..d91a7f3550 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -313,6 +313,12 @@ void gu_screen_blit_area(struct screen *sc, int startx, int starty, int width, { struct fb_info *info = sc->info; int bpp = info->bits_per_pixel >> 3; + struct fb_rect rect = { + .x1 = startx, + .y1 = starty, + .x2 = startx + width, + .y2 = starty + height, + }; if (info->screen_base_shadow) { int y; @@ -325,14 +331,24 @@ void gu_screen_blit_area(struct screen *sc, int startx, int starty, int width, fboff += sc->info->line_length; } } + + fb_damage(info, &rect); } void gu_screen_blit(struct screen *sc) { struct fb_info *info = sc->info; + struct fb_rect rect = { + .x1 = 0, + .y1 = 0, + .x2 = info->xres, + .y2 = info->yres, + }; if (info->screen_base_shadow) memcpy(info->screen_base, info->screen_base_shadow, sc->fbsize); + + fb_damage(info, &rect); } void gu_fill_rectangle(struct screen *sc, |