summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2023-04-05 14:27:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-04-11 14:02:41 +0200
commitaaaae2cfbbb905b0c4ea8db6bd57ed94cf7840b8 (patch)
tree9225dc36f7b0c2fcd41b742d5e6db989c47ea166
parent1c8f8141b9009fdb37d947cee7c401bcd2cba9c6 (diff)
downloadbarebox-aaaae2cfbbb905b0c4ea8db6bd57ed94cf7840b8.tar.gz
video: fb: add optional damage tracking
Add an optional fb_damage operation that drivers may use to accumulate damage on the framebuffer until fb_flush is called. The accumulated damage can be used to support partial updates for displays with an integrated framebuffer. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.barebox.org/20230405122734.2348025-1-p.zabel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/video/fb.c6
-rw-r--r--include/fb.h9
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 44754065e7..6f412d62c4 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -43,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;
diff --git a/include/fb.h b/include/fb.h
index 15bb74b995..88e6c0e458 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -80,6 +80,13 @@ struct fb_bitfield {
struct fb_info;
+struct fb_rect {
+ u32 x1;
+ u32 y1;
+ u32 x2;
+ u32 y2;
+};
+
struct fb_ops {
/* set color register */
int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green,
@@ -87,6 +94,7 @@ struct fb_ops {
void (*fb_enable)(struct fb_info *info);
void (*fb_disable)(struct fb_info *info);
int (*fb_activate_var)(struct fb_info *info);
+ void (*fb_damage)(struct fb_info *info, const struct fb_rect *rect);
void (*fb_flush)(struct fb_info *info);
};
@@ -156,6 +164,7 @@ int register_framebuffer(struct fb_info *info);
int fb_enable(struct fb_info *info);
int fb_disable(struct fb_info *info);
+void fb_damage(struct fb_info *info, struct fb_rect *rect);
void fb_flush(struct fb_info *info);
#define FBIOGET_SCREENINFO _IOR('F', 1, loff_t)