* Enabling transparency on overlay surface @ 2014-11-07 19:11 Jason Anderson 2014-11-07 20:03 ` Eric Nelson 0 siblings, 1 reply; 3+ messages in thread From: Jason Anderson @ 2014-11-07 19:11 UTC (permalink / raw) To: meta-freescale [-- Attachment #1: Type: text/plain, Size: 418 bytes --] HI, I am working on an OpenGL ES application and trying to use /dev/fb1 as an overlay on my i.MX6 (Boundary Devices BD-SL-i.MX6) . My current image is Yocto 1.6 , 3.10.17 kernel. I have my app rendering my background to /dev/fb0 and my overlay to /dev/fb1, but I can't get fb1 transparency enabled. Does any have have an example of how to use the overlay with OpenGL ES/EGL? Regards, Jason Anderson [-- Attachment #2: Type: text/html, Size: 2715 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Enabling transparency on overlay surface 2014-11-07 19:11 Enabling transparency on overlay surface Jason Anderson @ 2014-11-07 20:03 ` Eric Nelson 2014-11-10 14:30 ` Jason Anderson 0 siblings, 1 reply; 3+ messages in thread From: Eric Nelson @ 2014-11-07 20:03 UTC (permalink / raw) To: Jason Anderson, meta-freescale Hi Jason, On 11/07/2014 12:11 PM, Jason Anderson wrote: > HI, > > I am working on an OpenGL ES application and trying to use /dev/fb1 as > an overlay on my i.MX6 (Boundary Devices BD-SL-i.MX6) . My current > image is Yocto 1.6 , 3.10.17 kernel. > > I have my app rendering my background to /dev/fb0 and my overlay to > /dev/fb1, but I can’t get fb1 transparency enabled. Does any have have > an example of how to use the overlay with OpenGL ES/EGL? > The fb1 transparency doesn't have anything to do with OpenGL, but is available using a set of custom ioctls on the frame-buffer device. In particular, look at MXCFB_SET_GBL_ALPHA and MXCFB_SET_CLR_KEY: https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.17_1.0.2_ga/drivers/video/mxc/mxc_ipuv3_fb.c#L1029 The MXCFB_SET_OVERLAY_POS ioctl is also very useful for placing fb1 on top of fb0. Regards, Eric ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Enabling transparency on overlay surface 2014-11-07 20:03 ` Eric Nelson @ 2014-11-10 14:30 ` Jason Anderson 0 siblings, 0 replies; 3+ messages in thread From: Jason Anderson @ 2014-11-10 14:30 UTC (permalink / raw) To: eric.nelson, meta-freescale Hi Eric, >Hi Jason, > >On 11/07/2014 12:11 PM, Jason Anderson wrote: >> HI, >> >> I am working on an OpenGL ES application and trying to use /dev/fb1 as >> an overlay on my i.MX6 (Boundary Devices BD-SL-i.MX6) . My current >> image is Yocto 1.6 , 3.10.17 kernel. >> >> I have my app rendering my background to /dev/fb0 and my overlay to >> /dev/fb1, but I can’t get fb1 transparency enabled. Does any have have >> an example of how to use the overlay with OpenGL ES/EGL? >> > >The fb1 transparency doesn't have anything to do with OpenGL, >but is available using a set of custom ioctls on the frame-buffer >device. > >In particular, look at MXCFB_SET_GBL_ALPHA and MXCFB_SET_CLR_KEY: > > https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.17_1.0.2_ga/drivers/video/mxc/mxc_ipuv3_fb.c#L1029 > >The MXCFB_SET_OVERLAY_POS ioctl is also very useful for placing >fb1 on top of fb0. Thanks for your response, I tried the following code and still not getting any transparency on the overlay: #define MXCFB_SET_GBL_ALPHA _IOW('F', 0x21, struct mxcfb_gbl_alpha) #define MXCFB_SET_CLR_KEY _IOW('F', 0x22, struct mxcfb_color_key) struct mxcfb_gbl_alpha { int enable; int alpha; }; struct mxcfb_color_key { int enable; unsigned int color_key; }; void setFB() { int fd_fb = open("/dev/fb1", O_RDWR, 0); if (fd_fb < 0) { printf("unable to open fb0\n"); return ; } struct mxcfb_gbl_alpha a; a.enable = 1; a.alpha = 0; int err = ioctl(fd_fb,MXCFB_SET_GBL_ALPHA,&a); if ( err ) { perror( "MXCFB_SET_GBL_ALPHA"); return; } struct mxcfb_color_key c; c.enable = 1; c.color_key = 0x0; err = ioctl(fd_fb,MXCFB_SET_CLR_KEY,&c); if ( err ) { perror( "MXCFB_SET_CLR_KEY"); return; } close (fd_fb); } I make sure to clear the frame buffers correctly when drawing to them. Am I missing something here? Are there any "gotchas" I should be looking out for. Also, does the video parameter in the bootargs for u-boot play any part in the availability in the alpha buffer for the fb device? I noticed the default u-boot script does not explicitly set bpp and uses RGB24 for hdmi output. Should I be setting this to bpp=32, is there any RGBA format? Also, when I run cat /sys/class/graphics/f1/ Thanks again! ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-10 14:31 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-11-07 19:11 Enabling transparency on overlay surface Jason Anderson 2014-11-07 20:03 ` Eric Nelson 2014-11-10 14:30 ` Jason Anderson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.