diff --git a/examples/fb/fb_main.c b/examples/fb/fb_main.c index 3d7205286..480ede648 100644 --- a/examples/fb/fb_main.c +++ b/examples/fb/fb_main.c @@ -67,6 +67,9 @@ struct fb_state_s int fd; struct fb_videoinfo_s vinfo; struct fb_planeinfo_s pinfo; +#ifdef CONFIG_FB_OVERLAY + struct fb_overlayinfo_s oinfo; +#endif FAR void *fbmem; }; @@ -347,6 +350,50 @@ int fb_main(int argc, char *argv[]) printf(" yres: %u\n", state.vinfo.yres); printf(" nplanes: %u\n", state.vinfo.nplanes); +#ifdef CONFIG_FB_OVERLAY + printf("noverlays: %u\n", state.vinfo.noverlays); + + /* Select the first overlay, which should be the composed framebuffer */ + + ret = ioctl(state.fd, FBIO_SELECT_OVERLAY, 0); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: ioctl(FBIO_SELECT_OVERLAY) failed: %d\n", + errcode); + close(state.fd); + return EXIT_FAILURE; + } + + ret = ioctl(state.fd, FBIOGET_OVERLAYINFO, + (unsigned long)((uintptr_t)&state.oinfo)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: ioctl(FBIOGET_OVERLAYINFO) failed: %d\n", + errcode); + close(state.fd); + return EXIT_FAILURE; + } + + printf("OverlayInfo (overlay 0):\n"); + printf(" fbmem: %p\n", state.oinfo.fbmem); + printf(" fblen: %lu\n", (unsigned long)state.oinfo.fblen); + printf(" stride: %u\n", state.oinfo.stride); + printf(" overlay: %u\n", state.oinfo.overlay); + printf(" bpp: %u\n", state.oinfo.bpp); + printf(" blank: %u\n", state.oinfo.blank); + printf("chromakey: 0x%08x\n", state.oinfo.chromakey); + printf(" color: 0x%08x\n", state.oinfo.color); + printf(" transp: 0x%02x\n", state.oinfo.transp.transp); + printf(" mode: %u\n", state.oinfo.transp.transp_mode); + printf(" area: (%u,%u) => (%u,%u)\n", + state.oinfo.sarea.x, state.oinfo.sarea.y, + state.oinfo.sarea.w, state.oinfo.sarea.h); + printf(" accl: %u\n", state.oinfo.accl); + +#endif + ret = ioctl(state.fd, FBIOGET_PLANEINFO, (unsigned long)((uintptr_t)&state.pinfo)); if (ret < 0)