Lines Matching refs:fb
50 #define fb_width(fb) ((fb)->vi.xres) argument
51 #define fb_height(fb) ((fb)->vi.yres) argument
52 #define fb_size(fb) ((fb)->vi.xres * (fb)->vi.yres * 2) argument
54 static int fb_open(struct FB *fb) in fb_open() argument
56 fb->fd = open("/dev/graphics/fb0", O_RDWR); in fb_open()
57 if (fb->fd < 0) in fb_open()
60 if (ioctl(fb->fd, FBIOGET_FSCREENINFO, &fb->fi) < 0) in fb_open()
62 if (ioctl(fb->fd, FBIOGET_VSCREENINFO, &fb->vi) < 0) in fb_open()
65 fb->bits = mmap(0, fb_size(fb), PROT_READ | PROT_WRITE, in fb_open()
66 MAP_SHARED, fb->fd, 0); in fb_open()
67 if (fb->bits == MAP_FAILED) in fb_open()
73 close(fb->fd); in fb_open()
77 static void fb_close(struct FB *fb) in fb_close() argument
79 munmap(fb->bits, fb_size(fb)); in fb_close()
80 close(fb->fd); in fb_close()
84 static void fb_update(struct FB *fb) in fb_update() argument
86 fb->vi.yoffset = 1; in fb_update()
87 ioctl(fb->fd, FBIOPUT_VSCREENINFO, &fb->vi); in fb_update()
88 fb->vi.yoffset = 0; in fb_update()
89 ioctl(fb->fd, FBIOPUT_VSCREENINFO, &fb->vi); in fb_update()
107 struct FB fb; in load_565rle_image() local
130 if (fb_open(&fb)) in load_565rle_image()
133 max = fb_width(&fb) * fb_height(&fb); in load_565rle_image()
136 bits = fb.bits; in load_565rle_image()
149 fb_update(&fb); in load_565rle_image()
150 fb_close(&fb); in load_565rle_image()