#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>

#define DLFB_IOCTL_REPORT_DAMAGE 0xAA
struct dloarea {
	int x, y;
	int w, h;
	int x2, y2;
};


int main() {
  struct dloarea area;
  int fbfd=open("/dev/graphics/fb1", O_RDWR);
  if (!fbfd) {
          printf("Error: cannot open framebuffer device.\n");
          exit(1);
  }
  printf("The framebuffer device was opened successfully.\n");
  area.x=0;
  area.y=0;
  area.w=720;
  area.h=288;

  while(1) {
  	ioctl(fbfd, DLFB_IOCTL_REPORT_DAMAGE, &area);
  	usleep(40*1000);
  }
}

