diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2017-02-03 16:12:23 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@gnugeneration.com> | 2017-02-03 16:12:23 -0800 |
commit | e0619c5dfa3bc90c2c241f8e330bf4a76a5a003d (patch) | |
tree | 2ec39d62822f7bc445a12b573046af71abac3dde /src/fb.h | |
parent | a7c44b6146e306b13b63b8bececa6b7bc8ed59fb (diff) |
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.
Diffstat (limited to 'src/fb.h')
-rw-r--r-- | src/fb.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2,6 +2,7 @@ #define _FB_H #include <stdint.h> +#include <string.h> #include <sys/types.h> #include <xf86drmMode.h> /* 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 |