From e0619c5dfa3bc90c2c241f8e330bf4a76a5a003d Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 3 Feb 2017 16:12:23 -0800 Subject: fb: add fb_fragment_zero() helper Currently just a memset wrapper... but maybe could get noop'd if the flipper thread started supporting pre-zeroing pages in its thread, just need a zeroed state in the fb page. --- src/fb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fb.h b/src/fb.h index b990ae6..e8d818f 100644 --- a/src/fb.h +++ b/src/fb.h @@ -2,6 +2,7 @@ #define _FB_H #include +#include #include #include /* for drmModeModeInfoPtr */ @@ -67,4 +68,11 @@ static inline int fb_fragment_put_pixel_checked(fb_fragment_t *fragment, int x, return 1; } + +/* zero a fragment */ +static inline void fb_fragment_zero(fb_fragment_t *fragment) +{ + memset(fragment->buf, 0, ((fragment->width << 2) + fragment->stride) * fragment->height); +} + #endif -- cgit v1.2.3