Merged in mjkoch/apps/fb (pull request #172)
Add some awareness of overlays to apps/examples/fb Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
parent
13eeff0ec3
commit
fab0ac6e82
@ -67,6 +67,9 @@ struct fb_state_s
|
|||||||
int fd;
|
int fd;
|
||||||
struct fb_videoinfo_s vinfo;
|
struct fb_videoinfo_s vinfo;
|
||||||
struct fb_planeinfo_s pinfo;
|
struct fb_planeinfo_s pinfo;
|
||||||
|
#ifdef CONFIG_FB_OVERLAY
|
||||||
|
struct fb_overlayinfo_s oinfo;
|
||||||
|
#endif
|
||||||
FAR void *fbmem;
|
FAR void *fbmem;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -347,6 +350,50 @@ int fb_main(int argc, char *argv[])
|
|||||||
printf(" yres: %u\n", state.vinfo.yres);
|
printf(" yres: %u\n", state.vinfo.yres);
|
||||||
printf(" nplanes: %u\n", state.vinfo.nplanes);
|
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,
|
ret = ioctl(state.fd, FBIOGET_PLANEINFO,
|
||||||
(unsigned long)((uintptr_t)&state.pinfo));
|
(unsigned long)((uintptr_t)&state.pinfo));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user