summaryrefslogtreecommitdiff
path: root/tests/ttmtest/NEWS
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-05 10:51:49 -0700
committerKeith Packard <keithp@keithp.com>2008-05-05 10:51:49 -0700
commitb6f173c430#include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/mman.h> #include <linux/fb.h> #include <kms++util/kms++util.h> using namespace kms; int main(int argc, char** argv) { const char* fbdev = "/dev/fb0"; int r; int fd
0 files changed, 0 insertions, 0 deletions
pan>", fbdev); struct fb_var_screeninfo var; r = ioctl(fd, FBIOGET_VSCREENINFO, &var); FAIL_IF(r, "FBIOGET_VSCREENINFO failed"); struct fb_fix_screeninfo fix; r = ioctl(fd, FBIOGET_FSCREENINFO, &fix); FAIL_IF(r, "FBIOGET_FSCREENINFO failed"); uint8_t* ptr = (uint8_t*)mmap(NULL, var.yres_virtual * fix.line_length, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); FAIL_IF(ptr == MAP_FAILED, "mmap failed"); ExtCPUFramebuffer buf(var.xres, var.yres, PixelFormat::XRGB8888, ptr, var.yres_virtual * fix.line_length, fix.line_length, 0); printf("%s: res %dx%d, virtual %dx%d, line_len %d\n", fbdev, var.xres, var.yres, var.xres_virtual, var.yres_virtual, fix.line_length); draw_test_pattern(buf);