21#ifndef __INCLUDE_NUTTX_VIDEO_FB_H
22#define __INCLUDE_NUTTX_VIDEO_FB_H
28#include <nuttx/config.h>
33#include <nuttx/fs/ioctl.h>
50#define FB_FMT_GREY FB_FMT_Y8
51#define FB_FMT_Y800 FB_FMT_Y8
53#define FB_ISMONO(f) (((f) >= FB_FMT_Y1) && (f) <= FB_FMT_Y16)
61#define FB_FMT_RGB8_222 7
62#define FB_FMT_RGB8_332 8
63#define FB_FMT_RGB12_444 9
64#define FB_FMT_RGB16_555 10
65#define FB_FMT_RGB16_565 11
66#define FB_FMT_RGB24 12
67#define FB_FMT_RGB32 13
71#define FB_FMT_RGBRLE4 14
72#define FB_FMT_RGBRLE8 15
76#define FB_FMT_RGBRAW 16
82#define FB_FMT_RGBBTFLD16 17
83#define FB_FMT_RGBBTFLD24 18
84#define FB_FMT_RGBBTFLD32 19
85#define FB_FMT_RGBA16 20
86#define FB_FMT_RGBA32 21
93#define FB_FMT_RGBT16 22
94#define FB_FMT_RGBT32 23
96#define FB_ISRGB(f) (((f) >= FB_FMT_RGB4) && (f) <= FB_FMT_RGBT32)
100#define FB_FMT_AYUV 24
101#define FB_FMT_CLJR 25
104#define FB_FMT_CYUV 26
106#define FB_FMT_IRAW 27
107#define FB_FMT_IUYV 28
109#define FB_FMT_IY41 29
111#define FB_FMT_IYU2 30
112#define FB_FMT_HDYC 31
114#define FB_FMT_UYVP 32
116#define FB_FMT_UYVY 33
117#define FB_FMT_UYNV FB_FMT_UYVY
118#define FB_FMT_Y422 FB_FMT_UYVY
119#define FB_FMT_V210 34
120#define FB_FMT_V422 35
121#define FB_FMT_V655 36
122#define FB_FMT_VYUY 37
123#define FB_FMT_YUYV 38
124#define FB_FMT_YUY2 FB_FMT_YUYV
125#define FB_FMT_YUNV FB_FMT_YUYV
126#define FB_FMT_YVYU 39
127#define FB_FMT_Y41P 40
128#define FB_FMT_Y411 41
129#define FB_FMT_Y211 42
130#define FB_FMT_Y41T 43
131#define FB_FMT_Y42T 44
132#define FB_FMT_YUVP 45
134#define FB_ISYUVPACKED(f) (((f) >= FB_FMT_AYUV) && (f) <= FB_FMT_YUVP)
138#define FB_FMT_YVU9 46
140#define FB_FMT_YUV9 47
141#define FB_FMT_IF09 48
143#define FB_FMT_YV16 49
145#define FB_FMT_YV12 50
147#define FB_FMT_I420 51
149#define FB_FMT_IYUV FB_FMT_I420
150#define FB_FMT_NV12 52
152#define FB_FMT_NV21 53
153#define FB_FMT_IMC1 54
155#define FB_FMT_IMC2 55
158#define FB_FMT_IMC3 56
160#define FB_FMT_IMC4 57
162#define FB_FMT_CLPL 58
164#define FB_FMT_Y41B 59
165#define FB_FMT_Y42B 60
166#define FB_FMT_CXY1 61
167#define FB_FMT_CXY2 62
169#define FB_ISYUVPLANAR(f) (((f) >= FB_FMT_YVU9) && (f) <= FB_FMT_CXY2)
170#define FB_ISYUV(f) (FB_ISYUVPACKED(f) || FB_ISYUVPLANAR(f))
174#ifdef CONFIG_FB_HWCURSOR
175# define FB_CUR_ENABLE 0x01
176# define FB_CUR_SETIMAGE 0x02
177# define FB_CUR_SETPOSITION 0x04
178# define FB_CUR_SETSIZE 0x08
179# define FB_CUR_XOR 0x10
184#define FB_NO_OVERLAY -1
186#ifdef CONFIG_FB_OVERLAY
187# define FB_ACCL_TRANSP 0x01
188# define FB_ACCL_CHROMA 0x02
189# define FB_ACCL_COLOR 0x04
190# define FB_ACCL_AREA 0x08
192#ifdef CONFIG_FB_OVERLAY_BLIT
193# define FB_ACCL_BLIT 0x10
194# define FB_ACCL_BLEND 0x20
199# define FB_CONST_ALPHA 0x00
200# define FB_PIXEL_ALPHA 0x01
208#define FBIOGET_VIDEOINFO _FBIOC(0x0001)
211#define FBIOGET_PLANEINFO _FBIOC(0x0002)
216# define FBIOGET_CMAP _FBIOC(0x0003)
219# define FBIOPUT_CMAP _FBIOC(0x0004)
224#ifdef CONFIG_FB_HWCURSOR
225# define FBIOGET_CURSOR _FBIOC(0x0005)
228# define FBIOPUT_CURSOR _FBIOC(0x0006)
233#ifdef CONFIG_FB_UPDATE
234# define FBIO_UPDATE _FBIOC(0x0007)
241# define FBIO_WAITFORVSYNC _FBIOC(0x0008)
244#ifdef CONFIG_FB_OVERLAY
245# define FBIOGET_OVERLAYINFO _FBIOC(0x0009)
248# define FBIO_SELECT_OVERLAY _FBIOC(0x000a)
251# define FBIOSET_TRANSP _FBIOC(0x000b)
254# define FBIOSET_CHROMAKEY _FBIOC(0x000c)
257# define FBIOSET_COLOR _FBIOC(0x000d)
260# define FBIOSET_BLANK _FBIOC(0x000e)
263# define FBIOSET_AREA _FBIOC(0x000f)
266# define FBIOSET_DESTAREA _FBIOC(0x0010)
271#ifdef CONFIG_FB_OVERLAY_BLIT
272# define FBIOSET_BLIT _FBIOC(0x0011)
275# define FBIOSET_BLEND _FBIOC(0x0012)
280#define FBIOPAN_OVERLAY _FBIOC(0x0013)
288#define FBIOSET_POWER _FBIOC(0x0014)
290#define FBIOGET_POWER _FBIOC(0x0015)
292#define FBIOSET_FRAMERATE _FBIOC(0x0016)
294#define FBIOGET_FRAMERATE _FBIOC(0x0017)
297#define FBIOPAN_DISPLAY _FBIOC(0x0018)
301#define FBIOSET_VSYNCOFFSET _FBIOC(0x0019)
306#define FBIOGET_VSCREENINFO _FBIOC(0x001a)
309#define FBIOGET_FSCREENINFO _FBIOC(0x001b)
313#define FB_TYPE_PACKED_PIXELS 0
314#define FB_TYPE_PLANES 1
315#define FB_TYPE_INTERLEAVED_PLANES 2
316#define FB_TYPE_TEXT 3
317#define FB_TYPE_VGA_PLANES 4
318#define FB_TYPE_FOURCC 5
320#define FB_AUX_TEXT_MDA 0
321#define FB_AUX_TEXT_CGA 1
322#define FB_AUX_TEXT_S3_MMIO 2
323#define FB_AUX_TEXT_MGA_STEP16 3
325#define FB_AUX_TEXT_MGA_STEP8 4
327#define FB_AUX_TEXT_SVGA_GROUP 8
329#define FB_AUX_TEXT_SVGA_MASK 7
330#define FB_AUX_TEXT_SVGA_STEP2 8
331#define FB_AUX_TEXT_SVGA_STEP4 9
333#define FB_AUX_TEXT_SVGA_STEP8 10
335#define FB_AUX_TEXT_SVGA_STEP16 11
337#define FB_AUX_TEXT_SVGA_LAST 15
339#define FB_AUX_VGA_PLANES_VGA4 0
340#define FB_AUX_VGA_PLANES_CFB4 1
341#define FB_AUX_VGA_PLANES_CFB8 2
343#define FB_VISUAL_MONO01 0
344#define FB_VISUAL_MONO10 1
345#define FB_VISUAL_TRUECOLOR 2
346#define FB_VISUAL_PSEUDOCOLOR 3
347#define FB_VISUAL_DIRECTCOLOR 4
348#define FB_VISUAL_STATIC_PSEUDOCOLOR 5
349#define FB_VISUAL_FOURCC 6
352#define FB_ACCEL_NONE 0
353#define FB_ACCEL_ATARIBLITT 1
354#define FB_ACCEL_AMIGABLITT 2
355#define FB_ACCEL_S3_TRIO64 3
356#define FB_ACCEL_NCR_77C32BLT 4
357#define FB_ACCEL_S3_VIRGE 5
358#define FB_ACCEL_ATI_MACH64GX 6
359#define FB_ACCEL_DEC_TGA 7
360#define FB_ACCEL_ATI_MACH64CT 8
361#define FB_ACCEL_ATI_MACH64VT 9
362#define FB_ACCEL_ATI_MACH64GT 10
363#define FB_ACCEL_SUN_CREATOR 11
364#define FB_ACCEL_SUN_CGSIX 12
365#define FB_ACCEL_SUN_LEO 13
366#define FB_ACCEL_IMS_TWINTURBO 14
367#define FB_ACCEL_3DLABS_PERMEDIA2 15
368#define FB_ACCEL_MATROX_MGA2064W 16
369#define FB_ACCEL_MATROX_MGA1064SG 17
370#define FB_ACCEL_MATROX_MGA2164W 18
371#define FB_ACCEL_MATROX_MGA2164W_AGP 19
372#define FB_ACCEL_MATROX_MGAG100 20
373#define FB_ACCEL_MATROX_MGAG200 21
374#define FB_ACCEL_SUN_CG14 22
375#define FB_ACCEL_SUN_BWTWO 23
376#define FB_ACCEL_SUN_CGTHREE 24
377#define FB_ACCEL_SUN_TCX 25
378#define FB_ACCEL_MATROX_MGAG400 26
379#define FB_ACCEL_NV3 27
380#define FB_ACCEL_NV4 28
381#define FB_ACCEL_NV5 29
382#define FB_ACCEL_CT_6555x 30
383#define FB_ACCEL_3DFX_BANSHEE 31
384#define FB_ACCEL_ATI_RAGE128 32
385#define FB_ACCEL_IGS_CYBER2000 33
386#define FB_ACCEL_IGS_CYBER2010 34
387#define FB_ACCEL_IGS_CYBER5000 35
388#define FB_ACCEL_SIS_GLAMOUR 36
389#define FB_ACCEL_3DLABS_PERMEDIA3 37
390#define FB_ACCEL_ATI_RADEON 38
391#define FB_ACCEL_I810 39
392#define FB_ACCEL_SIS_GLAMOUR_2 40
393#define FB_ACCEL_SIS_XABRE 41
394#define FB_ACCEL_I830 42
395#define FB_ACCEL_NV_10 43
396#define FB_ACCEL_NV_20 44
397#define FB_ACCEL_NV_30 45
398#define FB_ACCEL_NV_40 46
399#define FB_ACCEL_XGI_VOLARI_V 47
400#define FB_ACCEL_XGI_VOLARI_Z 48
401#define FB_ACCEL_OMAP1610 49
402#define FB_ACCEL_TRIDENT_TGUI 50
403#define FB_ACCEL_TRIDENT_3DIMAGE 51
404#define FB_ACCEL_TRIDENT_BLADE3D 52
405#define FB_ACCEL_TRIDENT_BLADEXP 53
406#define FB_ACCEL_CIRRUS_ALPINE 53
407#define FB_ACCEL_NEOMAGIC_NM2070 90
408#define FB_ACCEL_NEOMAGIC_NM2090 91
409#define FB_ACCEL_NEOMAGIC_NM2093 92
410#define FB_ACCEL_NEOMAGIC_NM2097 93
411#define FB_ACCEL_NEOMAGIC_NM2160 94
412#define FB_ACCEL_NEOMAGIC_NM2200 95
413#define FB_ACCEL_NEOMAGIC_NM2230 96
414#define FB_ACCEL_NEOMAGIC_NM2360 97
415#define FB_ACCEL_NEOMAGIC_NM2380 98
416#define FB_ACCEL_PXA3XX 99
418#define FB_ACCEL_SAVAGE4 0x80
419#define FB_ACCEL_SAVAGE3D 0x81
420#define FB_ACCEL_SAVAGE3D_MV 0x82
421#define FB_ACCEL_SAVAGE2000 0x83
422#define FB_ACCEL_SAVAGE_MX_MV 0x84
423#define FB_ACCEL_SAVAGE_MX 0x85
424#define FB_ACCEL_SAVAGE_IX_MV 0x86
425#define FB_ACCEL_SAVAGE_IX 0x87
426#define FB_ACCEL_PROSAVAGE_PM 0x88
427#define FB_ACCEL_PROSAVAGE_KM 0x89
428#define FB_ACCEL_S3TWISTER_P 0x8a
429#define FB_ACCEL_S3TWISTER_K 0x8b
430#define FB_ACCEL_SUPERSAVAGE 0x8c
431#define FB_ACCEL_PROSAVAGE_DDR 0x8d
432#define FB_ACCEL_PROSAVAGE_DDRK 0x8e
434#define FB_ACCEL_PUV3_UNIGFX 0xa0
436#define FB_NONSTD_HAM 1
437#define FB_NONSTD_REV_PIX_IN_B 2
440#define FB_ACTIVATE_NOW 0
441#define FB_ACTIVATE_NXTOPEN 1
442#define FB_ACTIVATE_TEST 2
443#define FB_ACTIVATE_MASK 15
444#define FB_ACTIVATE_VBL 16
445#define FB_CHANGE_CMAP_VBL 32
446#define FB_ACTIVATE_ALL 64
447#define FB_ACTIVATE_FORCE 128
448#define FB_ACTIVATE_INV_MODE 256
450#define FB_ACCELF_TEXT 1
453#define FB_SYNC_HOR_HIGH_ACT 1
454#define FB_SYNC_VERT_HIGH_ACT 2
456#define FB_SYNC_COMP_HIGH_ACT 8
457#define FB_SYNC_BROADCAST 16
460#define FB_SYNC_ON_GREEN 32
462#define FB_VMODE_NONINTERLACED 0
463#define FB_VMODE_INTERLACED 1
464#define FB_VMODE_DOUBLE 2
465#define FB_VMODE_ODD_FLD_FIRST 4
466#define FB_VMODE_MASK 255
468#define FB_VMODE_YWRAP 256
469#define FB_VMODE_SMOOTH_XPAN 512
471#define FB_VMODE_CONUPDATE 512
473#define FB_ROTATE_UR 0
474#define FB_ROTATE_CW 1
475#define FB_ROTATE_UD 2
476#define FB_ROTATE_CCW 3
486typedef uint16_t fb_coord_t;
496#ifdef CONFIG_FB_OVERLAY
499#ifdef CONFIG_FB_MODULEINFO
500 uint8_t moduleinfo[128];
515 uint32_t xres_virtual;
516 uint32_t yres_virtual;
531#ifdef CONFIG_FB_OVERLAY
542struct fb_overlayinfo_s
551 uint32_t xres_virtual;
552 uint32_t yres_virtual;
558 struct fb_transp_s transp;
564#ifdef CONFIG_FB_OVERLAY_BLIT
567struct fb_overlayarea_s
575struct fb_overlayblit_s
577 struct fb_overlayarea_s dest;
578 struct fb_overlayarea_s src;
583struct fb_overlayblend_s
585 struct fb_overlayarea_s dest;
586 struct fb_overlayarea_s foreground;
587 struct fb_overlayarea_s background;
608#ifdef CONFIG_FB_TRANSPARENCY
614#ifdef CONFIG_FB_HWCURSOR
615#ifdef CONFIG_FB_HWCURSORIMAGE
621struct fb_cursorimage_s
625 const uint8_t *image;
641#ifdef CONFIG_FB_HWCURSORSIZE
642struct fb_cursorsize_s
653struct fb_cursorattrib_s
655#ifdef CONFIG_FB_HWCURSORIMAGE
658 struct fb_cursorpos_s pos;
659#ifdef CONFIG_FB_HWCURSORSIZE
660 struct fb_cursorsize_s mxsize;
661 struct fb_cursorsize_s size;
668 struct fb_cursorpos_s pos;
669#ifdef CONFIG_FB_HWCURSORSIZE
670 struct fb_cursorsize_s size;
672#ifdef CONFIG_FB_HWCURSORIMAGE
673 struct fb_cursorimage_s img;
681#ifdef CONFIG_FB_OVERLAY
682 struct fb_overlayinfo_s overlayinfo;
696 int (*getvideoinfo)(FAR
struct fb_vtable_s *vtable,
698 int (*getplaneinfo)(FAR
struct fb_vtable_s *vtable,
int planeno,
712 FAR
struct fb_cmap_s *cmap);
714 FAR
const struct fb_cmap_s *cmap);
717#ifdef CONFIG_FB_HWCURSOR
723 FAR
struct fb_cursorattrib_s *attrib);
725 FAR
struct fb_setcursor_s *settings);
728#ifdef CONFIG_FB_UPDATE
742 int (*waitforvsync)(FAR
struct fb_vtable_s *vtable);
745#ifdef CONFIG_FB_OVERLAY
750 int (*getoverlayinfo)(FAR
struct fb_vtable_s *vtable,
int overlayno,
751 FAR
struct fb_overlayinfo_s *oinfo);
758 FAR
const struct fb_overlayinfo_s *oinfo);
764 int (*setchromakey)(FAR
struct fb_vtable_s *vtable,
765 FAR
const struct fb_overlayinfo_s *oinfo);
772 FAR
const struct fb_overlayinfo_s *oinfo);
777 FAR
const struct fb_overlayinfo_s *oinfo);
784 FAR
const struct fb_overlayinfo_s *oinfo);
791 FAR
const struct fb_overlayinfo_s *oinfo);
793# ifdef CONFIG_FB_OVERLAY_BLIT
799 FAR
const struct fb_overlayblit_s *blit);
806 FAR
const struct fb_overlayblend_s *blend);
813 FAR
const struct fb_overlayinfo_s *oinfo);
826 int (*setframerate)(FAR
struct fb_vtable_s *vtable,
int rate);
830 int (*getframerate)(FAR
struct fb_vtable_s *vtable);
838 int (*setpower)(FAR
struct fb_vtable_s *vtable,
int power);
842 int (*ioctl)(FAR
struct fb_vtable_s *vtable,
int cmd,
unsigned long arg);
854 unsigned long smem_start;
863 uint32_t line_length;
864 unsigned long mmio_start;
869 uint16_t capabilities;
870 uint16_t reserved[2];
895 uint32_t xres_virtual;
896 uint32_t yres_virtual;
899 uint32_t bits_per_pixel;
909 uint32_t accel_flags;
914 uint32_t left_margin;
915 uint32_t right_margin;
916 uint32_t upper_margin;
917 uint32_t lower_margin;
924 uint32_t reserved[4];
932#define EXTERN extern "C"
968int up_fbinitialize(
int display);
989FAR
struct fb_vtable_s *up_fbgetvplane(
int display,
int vplane);
1006void up_fbuninitialize(
int display);
1023int fb_peek_paninfo(FAR
struct fb_vtable_s *vtable,
1041int fb_remove_paninfo(FAR
struct fb_vtable_s *vtable,
int overlay);
1057int fb_paninfo_count(FAR
struct fb_vtable_s *vtable,
int overlay);
1082int fb_register(
int display,
int plane);