summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-02-03 16:12:23 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-02-03 16:12:23 -0800
commite0619c5dfa3bc90c2c241f8e330bf4a76a5a003d (patch)
tree2ec39d62822f7bc445a12b573046af71abac3dde
parenta7c44b6146e306b13b63b8bececa6b7bc8ed59fb (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.
-rw-r--r--src/fb.h8
1 files changed, 8 insertions, 0 deletions
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 <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
© All Rights Reserved