core: add support for the autoverbose feature
[fbsplash.git] / core / misc / blittest.c
blobf72d0fddfd4abf3e2c924182491ee6fcc34fd014
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <sys/mman.h>
4 #include <sys/types.h>
5 #include <fcntl.h>
6 #include <string.h>
8 #define xres 1280
9 #define yres 800
10 #define cnt 1000
12 int main(int argc, char **argv)
14 int fd = open("/dev/fb0", O_RDWR);
15 char *fb;
16 char buf[xres*4];
17 int i, j;
19 fb = mmap(NULL, xres*yres*4, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
21 for (i = 0; i < xres; i++) {
22 buf[i] = rand();
25 printf("performing %d full-screen blits\n", cnt);
26 for (j = 0; j < cnt; j++) {
27 for (i = 0; i < yres; i++) {
28 memcpy(fb + xres*4*i, buf, xres*4);
32 munmap(fb, xres*yres*4);
33 close(fd);
35 return 0;