[PATCH 1/3] video: fb: add optional damage tracking

Philipp Zabel p.zabel at pengutronix.de
Wed Apr 5 05:26:45 PDT 2023


On Di, 2023-04-04 at 14:24 +0200, Ahmad Fatoum wrote:
> On 03.04.23 14:18, Philipp Zabel wrote:
> > 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 at pengutronix.de>
> > ---
> >  drivers/video/fb.c | 6 ++++++
> >  include/fb.h       | 9 +++++++++
> >  2 files changed, 15 insertions(+)
> > 
> > diff --git a/drivers/video/fb.c b/drivers/video/fb.c
> > index 44754065e7d9..6f412d62c434 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 15bb74b99576..4e3eb611db48 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, struct fb_rect *rect);
> 
> const struct fb_rect * ?

Yes, changed to const in v2.

regards
Philipp



More information about the barebox mailing list