1d6aed566Sopenharmony_ci/****************************************************************************
2d6aed566Sopenharmony_ci * video/fb.h
3d6aed566Sopenharmony_ci *
4d6aed566Sopenharmony_ci *   Copyright (C) 2008-2011, 2013, 2016-2018 Gregory Nutt. All rights
5d6aed566Sopenharmony_ci *     reserved.
6d6aed566Sopenharmony_ci *   Author: Gregory Nutt <gnutt@nuttx.org>
7d6aed566Sopenharmony_ci *
8d6aed566Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
9d6aed566Sopenharmony_ci * modification, are permitted provided that the following conditions
10d6aed566Sopenharmony_ci * are met:
11d6aed566Sopenharmony_ci *
12d6aed566Sopenharmony_ci * 1. Redistributions of source code must retain the above copyright
13d6aed566Sopenharmony_ci *    notice, this list of conditions and the following disclaimer.
14d6aed566Sopenharmony_ci * 2. Redistributions in binary form must reproduce the above copyright
15d6aed566Sopenharmony_ci *    notice, this list of conditions and the following disclaimer in
16d6aed566Sopenharmony_ci *    the documentation and/or other materials provided with the
17d6aed566Sopenharmony_ci *    distribution.
18d6aed566Sopenharmony_ci * 3. Neither the name NuttX nor the names of its contributors may be
19d6aed566Sopenharmony_ci *    used to endorse or promote products derived from this software
20d6aed566Sopenharmony_ci *    without specific prior written permission.
21d6aed566Sopenharmony_ci *
22d6aed566Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23d6aed566Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24d6aed566Sopenharmony_ci * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25d6aed566Sopenharmony_ci * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26d6aed566Sopenharmony_ci * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27d6aed566Sopenharmony_ci * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28d6aed566Sopenharmony_ci * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
29d6aed566Sopenharmony_ci * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30d6aed566Sopenharmony_ci * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31d6aed566Sopenharmony_ci * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32d6aed566Sopenharmony_ci * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33d6aed566Sopenharmony_ci * POSSIBILITY OF SUCH DAMAGE.
34d6aed566Sopenharmony_ci *
35d6aed566Sopenharmony_ci ****************************************************************************/
36d6aed566Sopenharmony_ci
37d6aed566Sopenharmony_ci#ifndef __INCLUDE_NUTTX_VIDEO_FB_H
38d6aed566Sopenharmony_ci#define __INCLUDE_NUTTX_VIDEO_FB_H
39d6aed566Sopenharmony_ci
40d6aed566Sopenharmony_ci/****************************************************************************
41d6aed566Sopenharmony_ci * Included Files
42d6aed566Sopenharmony_ci ****************************************************************************/
43d6aed566Sopenharmony_ci#include "fb_mem.h"
44d6aed566Sopenharmony_ci
45d6aed566Sopenharmony_ci#define CONFIG_FB_CMAP
46d6aed566Sopenharmony_ci#define CONFIG_FB_OVERLAY_BLIT
47d6aed566Sopenharmony_ci#define CONFIG_FB_OVERLAY
48d6aed566Sopenharmony_ci#define CONFIG_FB_TRANSPARENCY
49d6aed566Sopenharmony_ci
50d6aed566Sopenharmony_ci
51d6aed566Sopenharmony_ci/****************************************************************************
52d6aed566Sopenharmony_ci * Pre-processor definitions
53d6aed566Sopenharmony_ci ****************************************************************************/
54d6aed566Sopenharmony_ci
55d6aed566Sopenharmony_ci/* Color format definitions.  The pretty much define the color pixel processing
56d6aed566Sopenharmony_ci * organization of the video controller.
57d6aed566Sopenharmony_ci */
58d6aed566Sopenharmony_ci
59d6aed566Sopenharmony_ci/* Monochrome Formats *******************************************************/
60d6aed566Sopenharmony_ci
61d6aed566Sopenharmony_ci#define FB_FMT_Y1             0         /* BPP=1, monochrome */
62d6aed566Sopenharmony_ci#define FB_FMT_Y2             1         /* BPP=2, 2-bit uncompressed greyscale */
63d6aed566Sopenharmony_ci#define FB_FMT_Y4             2         /* BPP=4, 4-bit uncompressed greyscale */
64d6aed566Sopenharmony_ci#define FB_FMT_Y8             3         /* BPP=8, 8-bit uncompressed greyscale */
65d6aed566Sopenharmony_ci#define FB_FMT_Y16            4         /* BPP=16, 16-bit uncompressed greyscale */
66d6aed566Sopenharmony_ci#define FB_FMT_GREY           FB_FMT_Y8 /* BPP=8 */
67d6aed566Sopenharmony_ci#define FB_FMT_Y800           FB_FMT_Y8 /* BPP=8 */
68d6aed566Sopenharmony_ci
69d6aed566Sopenharmony_ci#define FB_ISMONO(f)          ((f) >= FB_FMT_Y4 && (f) <= FB_FMT_Y16)
70d6aed566Sopenharmony_ci
71d6aed566Sopenharmony_ci/* RGB video formats ********************************************************/
72d6aed566Sopenharmony_ci
73d6aed566Sopenharmony_ci/* Standard RGB */
74d6aed566Sopenharmony_ci
75d6aed566Sopenharmony_ci#define FB_FMT_RGB1           FB_FMT_Y1   /* BPP=1 */
76d6aed566Sopenharmony_ci#define FB_FMT_RGB4           5           /* BPP=4 */
77d6aed566Sopenharmony_ci#define FB_FMT_RGB8           6           /* BPP=8 RGB palette index */
78d6aed566Sopenharmony_ci#define FB_FMT_RGB8_222       7           /* BPP=8  R=2, G=2, B=2 */
79d6aed566Sopenharmony_ci#define FB_FMT_RGB8_332       8           /* BPP=8  R=3, G=3, B=2 */
80d6aed566Sopenharmony_ci#define FB_FMT_RGB12_444      9           /* BPP=12 R=4, G=4, B=4 */
81d6aed566Sopenharmony_ci#define FB_FMT_RGB16_555      10          /* BPP=16 R=5, G=5, B=5 (1 unused bit) */
82d6aed566Sopenharmony_ci#define FB_FMT_RGB16_565      11          /* BPP=16 R=6, G=6, B=5 */
83d6aed566Sopenharmony_ci#define FB_FMT_RGB24          12          /* BPP=24 */
84d6aed566Sopenharmony_ci#define FB_FMT_RGB32          13          /* BPP=32 */
85d6aed566Sopenharmony_ci
86d6aed566Sopenharmony_ci/* Run length encoded RGB */
87d6aed566Sopenharmony_ci
88d6aed566Sopenharmony_ci#define FB_FMT_RGBRLE4        14          /* BPP=4 */
89d6aed566Sopenharmony_ci#define FB_FMT_RGBRLE8        15          /* BPP=8 */
90d6aed566Sopenharmony_ci
91d6aed566Sopenharmony_ci/* Raw RGB */
92d6aed566Sopenharmony_ci
93d6aed566Sopenharmony_ci#define FB_FMT_RGBRAW         16          /* BPP=? */
94d6aed566Sopenharmony_ci
95d6aed566Sopenharmony_ci/* Raw RGB with arbitrary sample packing within a pixel. Packing and precision
96d6aed566Sopenharmony_ci * of R, G and B components is determined by bit masks for each.
97d6aed566Sopenharmony_ci */
98d6aed566Sopenharmony_ci
99d6aed566Sopenharmony_ci#define FB_FMT_RGBBTFLD16     17          /* BPP=16 */
100d6aed566Sopenharmony_ci#define FB_FMT_RGBBTFLD24     18          /* BPP=24 */
101d6aed566Sopenharmony_ci#define FB_FMT_RGBBTFLD32     19          /* BPP=32 */
102d6aed566Sopenharmony_ci#define FB_FMT_RGBA16         20          /* BPP=16 Raw RGB with alpha */
103d6aed566Sopenharmony_ci#define FB_FMT_RGBA32         21          /* BPP=32 Raw RGB with alpha */
104d6aed566Sopenharmony_ci
105d6aed566Sopenharmony_ci/* Raw RGB with a transparency field. Layout is as for standard RGB at 16 and
106d6aed566Sopenharmony_ci * 32 bits per pixel but the msb in each pixel indicates whether the pixel is
107d6aed566Sopenharmony_ci * transparent or not.
108d6aed566Sopenharmony_ci */
109d6aed566Sopenharmony_ci
110d6aed566Sopenharmony_ci#define FB_FMT_RGBT16         22          /* BPP=16 */
111d6aed566Sopenharmony_ci#define FB_FMT_RGBT32         23          /* BPP=32 */
112d6aed566Sopenharmony_ci
113d6aed566Sopenharmony_ci#define FB_ISRGB(f)           ((f) >= FB_FMT_RGB1 && (f) <= FB_FMT_RGBT32)
114d6aed566Sopenharmony_ci
115d6aed566Sopenharmony_ci/* Packed YUV Formats *******************************************************/
116d6aed566Sopenharmony_ci
117d6aed566Sopenharmony_ci#define FB_FMT_AYUV           24          /* BPP=32  Combined YUV and alpha */
118d6aed566Sopenharmony_ci#define FB_FMT_CLJR           25          /* BPP=8   4 pixels packed into a uint32_t.
119d6aed566Sopenharmony_ci                                           *         YUV 4:1:1 with l< 8 bits
120d6aed566Sopenharmony_ci                                           *         per YUV sample */
121d6aed566Sopenharmony_ci#define FB_FMT_CYUV           26          /* BPP=16  UYVY except that height is
122d6aed566Sopenharmony_ci                                           *         reversed */
123d6aed566Sopenharmony_ci#define FB_FMT_IRAW           27          /* BPP=?   Intel uncompressed YUV */
124d6aed566Sopenharmony_ci#define FB_FMT_IUYV           28          /* BPP=16  Interlaced UYVY (line order
125d6aed566Sopenharmony_ci                                           *         0,2,4,.., 1,3,5...) */
126d6aed566Sopenharmony_ci#define FB_FMT_IY41           29          /* BPP=12  Interlaced Y41P (line order
127d6aed566Sopenharmony_ci                                           *         0,2,4,.., 1,3,5...) */
128d6aed566Sopenharmony_ci#define FB_FMT_IYU2           30          /* BPP=24 */
129d6aed566Sopenharmony_ci#define FB_FMT_HDYC           31          /* BPP=16  UYVY except uses the BT709
130d6aed566Sopenharmony_ci                                           *         color space  */
131d6aed566Sopenharmony_ci#define FB_FMT_UYVP           32          /* BPP=24? YCbCr 4:2:2, 10-bits per
132d6aed566Sopenharmony_ci                                           *         component in U0Y0V0Y1 order */
133d6aed566Sopenharmony_ci#define FB_FMT_UYVY           33          /* BPP=16  YUV 4:2:2 */
134d6aed566Sopenharmony_ci#define FB_FMT_UYNV           FB_FMT_UYVY /* BPP=16  */
135d6aed566Sopenharmony_ci#define FB_FMT_Y422           FB_FMT_UYVY /* BPP=16  */
136d6aed566Sopenharmony_ci#define FB_FMT_V210           34          /* BPP=32  10-bit 4:2:2 YCrCb */
137d6aed566Sopenharmony_ci#define FB_FMT_V422           35          /* BPP=16  Upside down version of UYVY */
138d6aed566Sopenharmony_ci#define FB_FMT_V655           36          /* BPP=16? 16-bit YUV 4:2:2 */
139d6aed566Sopenharmony_ci#define FB_FMT_VYUY           37          /* BPP=?   ATI Packed YUV Data */
140d6aed566Sopenharmony_ci#define FB_FMT_YUYV           38          /* BPP=16  YUV 4:2:2 */
141d6aed566Sopenharmony_ci#define FB_FMT_YUY2           FB_FMT_YUYV /* BPP=16  YUV 4:2:2 */
142d6aed566Sopenharmony_ci#define FB_FMT_YUNV           FB_FMT_YUYV /* BPP=16  YUV 4:2:2 */
143d6aed566Sopenharmony_ci#define FB_FMT_YVYU           39          /* BPP=16  YUV 4:2:2 */
144d6aed566Sopenharmony_ci#define FB_FMT_Y41P           40          /* BPP=12  YUV 4:1:1 */
145d6aed566Sopenharmony_ci#define FB_FMT_Y411           41          /* BPP=12  YUV 4:1:1 */
146d6aed566Sopenharmony_ci#define FB_FMT_Y211           42          /* BPP=8  */
147d6aed566Sopenharmony_ci#define FB_FMT_Y41T           43          /* BPP=12  Y41P LSB for transparency */
148d6aed566Sopenharmony_ci#define FB_FMT_Y42T           44          /* BPP=16  UYVY LSB for transparency */
149d6aed566Sopenharmony_ci#define FB_FMT_YUVP           45          /* BPP=24? YCbCr 4:2:2 Y0U0Y1V0 order */
150d6aed566Sopenharmony_ci
151d6aed566Sopenharmony_ci#define FB_ISYUVPACKED(f)     ((f) >= FB_FMT_AYUV && (f) <= FB_FMT_YUVP)
152d6aed566Sopenharmony_ci
153d6aed566Sopenharmony_ci/* Packed Planar YUV Formats ************************************************/
154d6aed566Sopenharmony_ci
155d6aed566Sopenharmony_ci#define FB_FMT_YVU9           46          /* BPP=9   8-bit Y followed by 8-bit
156d6aed566Sopenharmony_ci                                           *         4x4 VU */
157d6aed566Sopenharmony_ci#define FB_FMT_YUV9           47          /* BPP=9? */
158d6aed566Sopenharmony_ci#define FB_FMT_IF09           48          /* BPP=9.5 YVU9 + 4x4 plane of delta
159d6aed566Sopenharmony_ci                                           *         relative to tframe. */
160d6aed566Sopenharmony_ci#define FB_FMT_YV16           49          /* BPP=16  8-bit Y followed by 8-bit
161d6aed566Sopenharmony_ci                                           *         2x1 VU */
162d6aed566Sopenharmony_ci#define FB_FMT_YV12           50          /* BPP=12  8-bit Y followed by 8-bit
163d6aed566Sopenharmony_ci                                           *         2x2 VU */
164d6aed566Sopenharmony_ci#define FB_FMT_I420           51          /* BPP=12  8-bit Y followed by 8-bit
165d6aed566Sopenharmony_ci                                           *         2x2 UV */
166d6aed566Sopenharmony_ci#define FB_FMT_IYUV           FB_FMT_I420 /* BPP=12 */
167d6aed566Sopenharmony_ci#define FB_FMT_NV12           52          /* BPP=12  8-bit Y followed by an
168d6aed566Sopenharmony_ci                                           *         interleaved 2x2 UV */
169d6aed566Sopenharmony_ci#define FB_FMT_NV21           53          /* BPP=12  NV12 with UV reversed */
170d6aed566Sopenharmony_ci#define FB_FMT_IMC1           54          /* BPP=12  YV12 except UV planes same
171d6aed566Sopenharmony_ci                                           *         stride as Y */
172d6aed566Sopenharmony_ci#define FB_FMT_IMC2           55          /* BPP=12  IMC1 except UV lines
173d6aed566Sopenharmony_ci                                           *         interleaved at half stride
174d6aed566Sopenharmony_ci                                           *         boundaries */
175d6aed566Sopenharmony_ci#define FB_FMT_IMC3           56          /* BPP=12  As IMC1 except that UV
176d6aed566Sopenharmony_ci                                           *         swapped */
177d6aed566Sopenharmony_ci#define FB_FMT_IMC4           57          /* BPP=12  As IMC2  except that UV
178d6aed566Sopenharmony_ci                                           *         swapped */
179d6aed566Sopenharmony_ci#define FB_FMT_CLPL           58          /* BPP=12  YV12 but including a level
180d6aed566Sopenharmony_ci                                           *         of indirection. */
181d6aed566Sopenharmony_ci#define FB_FMT_Y41B           59          /* BPP=12?  4:1:1 planar. */
182d6aed566Sopenharmony_ci#define FB_FMT_Y42B           60          /* BPP=16?  YUV 4:2:2 planar. */
183d6aed566Sopenharmony_ci#define FB_FMT_CXY1           61          /* BPP=12 */
184d6aed566Sopenharmony_ci#define FB_FMT_CXY2           62          /* BPP=16 */
185d6aed566Sopenharmony_ci
186d6aed566Sopenharmony_ci#define FB_ISYUVPLANAR(f)     (((f) >= FB_FMT_AYUV) && (f) <= FB_FMT_YUVP)
187d6aed566Sopenharmony_ci#define FB_ISYUV(f)           (FB_ISYUVPACKED(f) || FB_ISYUVPLANAR(f))
188d6aed566Sopenharmony_ci
189d6aed566Sopenharmony_ci/* Hardware cursor control **************************************************/
190d6aed566Sopenharmony_ci
191d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSOR
192d6aed566Sopenharmony_ci#  define FB_CUR_ENABLE       0x01        /* Enable the cursor */
193d6aed566Sopenharmony_ci#  define FB_CUR_SETIMAGE     0x02        /* Set the cursor image */
194d6aed566Sopenharmony_ci#  define FB_CUR_SETPOSITION  0x04        /* Set the position of the cursor */
195d6aed566Sopenharmony_ci#  define FB_CUR_SETSIZE      0x08        /* Set the size of the cursor */
196d6aed566Sopenharmony_ci#  define FB_CUR_XOR          0x10        /* Use XOR vs COPY ROP on image */
197d6aed566Sopenharmony_ci#endif
198d6aed566Sopenharmony_ci
199d6aed566Sopenharmony_ci/* Hardware overlay acceleration *******************************************/
200d6aed566Sopenharmony_ci
201d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY
202d6aed566Sopenharmony_ci#  define FB_ACCL_TRANSP      0x01        /* Hardware tranparency support */
203d6aed566Sopenharmony_ci#  define FB_ACCL_CHROMA      0x02        /* Hardware chromakey support */
204d6aed566Sopenharmony_ci#  define FB_ACCL_COLOR       0x04        /* Hardware color support */
205d6aed566Sopenharmony_ci#  define FB_ACCL_AREA        0x08        /* Hardware support area selection */
206d6aed566Sopenharmony_ci
207d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY_BLIT
208d6aed566Sopenharmony_ci#  define FB_ACCL_BLIT        0x10        /* Hardware blit support */
209d6aed566Sopenharmony_ci#  define FB_ACCL_BLEND       0x20        /* Hardware blend support */
210d6aed566Sopenharmony_ci#endif
211d6aed566Sopenharmony_ci
212d6aed566Sopenharmony_ci/* Overlay transparency mode ************************************************/
213d6aed566Sopenharmony_ci
214d6aed566Sopenharmony_ci#  define FB_CONST_ALPHA      0x00         /* Transparency by alpha value */
215d6aed566Sopenharmony_ci#  define FB_PIXEL_ALPHA      0x01         /* Transparency by pixel alpha value */
216d6aed566Sopenharmony_ci
217d6aed566Sopenharmony_ci#endif /* CONFIG_FB_OVERLAY */
218d6aed566Sopenharmony_ci
219d6aed566Sopenharmony_ci/* FB character driver IOCTL commands ***************************************/
220d6aed566Sopenharmony_ci#define _FBIOCBASE      (0x2800) /* Frame buffer character driver ioctl commands */
221d6aed566Sopenharmony_ci#define _IOC_X(type,nr)   ((type)|(nr))
222d6aed566Sopenharmony_ci#define _FBIOC(nr)       _IOC_X(_FBIOCBASE,nr)
223d6aed566Sopenharmony_ci
224d6aed566Sopenharmony_ci/* ioctls */
225d6aed566Sopenharmony_ci
226d6aed566Sopenharmony_ci#define FBIOGET_VIDEOINFO     _FBIOC(0x0001)  /* Get color plane info */
227d6aed566Sopenharmony_ci                                              /* Argument: writable struct
228d6aed566Sopenharmony_ci                                               *           fb_videoinfo_s */
229d6aed566Sopenharmony_ci#define FBIOGET_PLANEINFO     _FBIOC(0x0002)  /* Get video plane info */
230d6aed566Sopenharmony_ci                                              /* Argument: writable struct
231d6aed566Sopenharmony_ci                                               *           fb_planeinfo_s */
232d6aed566Sopenharmony_ci
233d6aed566Sopenharmony_ci#ifdef CONFIG_FB_CMAP
234d6aed566Sopenharmony_ci#  define FBIOGET_CMAP        _FBIOC(0x0003)  /* Get RGB color mapping */
235d6aed566Sopenharmony_ci                                              /* Argument: writable struct
236d6aed566Sopenharmony_ci                                               *           fb_cmap_s */
237d6aed566Sopenharmony_ci#  define FBIOPUT_CMAP        _FBIOC(0x0004)  /* Put RGB color mapping */
238d6aed566Sopenharmony_ci                                              /* Argument: read-only struct
239d6aed566Sopenharmony_ci                                               *           fb_cmap_s */
240d6aed566Sopenharmony_ci#endif
241d6aed566Sopenharmony_ci
242d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSOR
243d6aed566Sopenharmony_ci#  define FBIOGET_CURSOR      _FBIOC(0x0005)  /* Get cursor attributes */
244d6aed566Sopenharmony_ci                                              /* Argument: writable struct
245d6aed566Sopenharmony_ci                                               *           fb_cursorattrib_s */
246d6aed566Sopenharmony_ci#  define FBIOPUT_CURSOR      _FBIOC(0x0006)  /* Set cursor attributes */
247d6aed566Sopenharmony_ci                                              /* Argument: read-only struct
248d6aed566Sopenharmony_ci                                               *           fb_setcursor_s */
249d6aed566Sopenharmony_ci#endif
250d6aed566Sopenharmony_ci
251d6aed566Sopenharmony_ci#ifdef CONFIG_LCD_UPDATE
252d6aed566Sopenharmony_ci#  define FBIO_UPDATE         _FBIOC(0x0007)  /* Update a rectangular region in
253d6aed566Sopenharmony_ci                                               * the framebuffer
254d6aed566Sopenharmony_ci                                               * Argument: read-only struct
255d6aed566Sopenharmony_ci                                               *           nxgl_rect_s */
256d6aed566Sopenharmony_ci#endif
257d6aed566Sopenharmony_ci
258d6aed566Sopenharmony_ci#ifdef CONFIG_FB_SYNC
259d6aed566Sopenharmony_ci#  define FBIO_WAITFORVSYNC   _FBIOC(0x0008)  /* Wait for vertical sync */
260d6aed566Sopenharmony_ci#endif
261d6aed566Sopenharmony_ci
262d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY
263d6aed566Sopenharmony_ci#  define FBIOGET_OVERLAYINFO _FBIOC(0x0009)  /* Get video overlay info */
264d6aed566Sopenharmony_ci                                              /* Argument: writable struct
265d6aed566Sopenharmony_ci                                               *           fb_overlayinfo_s */
266d6aed566Sopenharmony_ci#  define FBIO_SELECT_OVERLAY _FBIOC(0x000a)  /* Select overlay */
267d6aed566Sopenharmony_ci                                              /* Argument: read-only
268d6aed566Sopenharmony_ci                                               *           unsigned long */
269d6aed566Sopenharmony_ci#  define FBIOSET_TRANSP      _FBIOC(0x000b)  /* Set opacity or transparency
270d6aed566Sopenharmony_ci                                               * Argument: read-only struct
271d6aed566Sopenharmony_ci                                               *           fb_overlayinfo_s */
272d6aed566Sopenharmony_ci#  define FBIOSET_CHROMAKEY   _FBIOC(0x000c)  /* Set chroma key
273d6aed566Sopenharmony_ci                                               * Argument: read-only struct
274d6aed566Sopenharmony_ci                                               *           fb_overlayinfo_s */
275d6aed566Sopenharmony_ci#  define FBIOSET_COLOR       _FBIOC(0x000d)  /* Set color
276d6aed566Sopenharmony_ci                                               * Argument: read-only struct
277d6aed566Sopenharmony_ci                                               *           fb_overlayinfo_s */
278d6aed566Sopenharmony_ci#  define FBIOSET_BLANK       _FBIOC(0x000e)  /* Blank or unblank
279d6aed566Sopenharmony_ci                                               * Argument: read-only struct
280d6aed566Sopenharmony_ci                                               *           fb_overlayinfo_s */
281d6aed566Sopenharmony_ci#  define FBIOSET_AREA        _FBIOC(0x000f)  /* Set active overlay area
282d6aed566Sopenharmony_ci                                               * Argument: read-only struct
283d6aed566Sopenharmony_ci                                               *           fb_overlayinfo_s */
284d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY_BLIT
285d6aed566Sopenharmony_ci#  define FBIOSET_BLIT        _FBIOC(0x0010)  /* Blit area between overlays
286d6aed566Sopenharmony_ci                                               * Argument: read-only struct
287d6aed566Sopenharmony_ci                                               *           fb_overlayblit_s */
288d6aed566Sopenharmony_ci#  define FBIOSET_BLEND       _FBIOC(0x0011)  /* Blend area between overlays
289d6aed566Sopenharmony_ci                                               * Argument: read-only struct
290d6aed566Sopenharmony_ci                                               *           fb_overlayblend_s */
291d6aed566Sopenharmony_ci#endif
292d6aed566Sopenharmony_ci#endif /* CONFIG_FB_OVERLAY */
293d6aed566Sopenharmony_ci
294d6aed566Sopenharmony_ci#define FIOC_MMAP               _FBIOC(0x0012)
295d6aed566Sopenharmony_ci
296d6aed566Sopenharmony_ci/****************************************************************************
297d6aed566Sopenharmony_ci * Public Types
298d6aed566Sopenharmony_ci ****************************************************************************/
299d6aed566Sopenharmony_ci
300d6aed566Sopenharmony_ci/* If any dimension of the display exceeds 65,536 pixels, then the following
301d6aed566Sopenharmony_ci * type will need to change:
302d6aed566Sopenharmony_ci */
303d6aed566Sopenharmony_ci
304d6aed566Sopenharmony_citypedef uint16_t fb_coord_t;
305d6aed566Sopenharmony_ci
306d6aed566Sopenharmony_ci/* This structure describes the overall video controller */
307d6aed566Sopenharmony_ci
308d6aed566Sopenharmony_cistruct fb_videoinfo_s {
309d6aed566Sopenharmony_ci    uint8_t fmt;     /* see FB_FMT_*  */
310d6aed566Sopenharmony_ci    fb_coord_t xres; /* Horizontal resolution in pixel columns */
311d6aed566Sopenharmony_ci    fb_coord_t yres; /* Vertical resolution in pixel rows */
312d6aed566Sopenharmony_ci    uint8_t nplanes; /* Number of color planes supported */
313d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY
314d6aed566Sopenharmony_ci    uint8_t noverlays; /* Number of overlays supported */
315d6aed566Sopenharmony_ci#endif
316d6aed566Sopenharmony_ci};
317d6aed566Sopenharmony_ci
318d6aed566Sopenharmony_ci/* This structure describes one color plane.  Some YUV formats may support
319d6aed566Sopenharmony_ci * up to 4 planes
320d6aed566Sopenharmony_ci */
321d6aed566Sopenharmony_ci
322d6aed566Sopenharmony_cistruct fb_planeinfo_s {
323d6aed566Sopenharmony_ci    void *fbmem;       /* Start of frame buffer memory */
324d6aed566Sopenharmony_ci    size_t fblen;      /* Length of frame buffer memory in bytes */
325d6aed566Sopenharmony_ci    fb_coord_t stride; /* Length of a line in bytes */
326d6aed566Sopenharmony_ci    uint8_t display;   /* Display number */
327d6aed566Sopenharmony_ci    uint8_t bpp;       /* Bits per pixel */
328d6aed566Sopenharmony_ci};
329d6aed566Sopenharmony_ci
330d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY
331d6aed566Sopenharmony_ci/* This structure describes the transparency. */
332d6aed566Sopenharmony_ci
333d6aed566Sopenharmony_cistruct fb_transp_s {
334d6aed566Sopenharmony_ci    uint8_t transp;      /* Transparency */
335d6aed566Sopenharmony_ci    uint8_t transp_mode; /* Transparency mode */
336d6aed566Sopenharmony_ci};
337d6aed566Sopenharmony_ci
338d6aed566Sopenharmony_ci/* This structure describes an area. */
339d6aed566Sopenharmony_ci
340d6aed566Sopenharmony_cistruct fb_area_s {
341d6aed566Sopenharmony_ci    fb_coord_t x; /* x-offset of the area */
342d6aed566Sopenharmony_ci    fb_coord_t y; /* y-offset of the area */
343d6aed566Sopenharmony_ci    fb_coord_t w; /* Width of the area */
344d6aed566Sopenharmony_ci    fb_coord_t h; /* Height of the area */
345d6aed566Sopenharmony_ci};
346d6aed566Sopenharmony_ci
347d6aed566Sopenharmony_ci/* This structure describes one overlay. */
348d6aed566Sopenharmony_ci
349d6aed566Sopenharmony_cistruct fb_overlayinfo_s {
350d6aed566Sopenharmony_ci    void *fbmem;               /* Start of frame buffer virtual memory */
351d6aed566Sopenharmony_ci    void *memphys;             /* Start of frame buffer physical memory */
352d6aed566Sopenharmony_ci    size_t fblen;              /* Length of frame buffer memory in bytes */
353d6aed566Sopenharmony_ci    fb_coord_t stride;         /* Length of a line in bytes */
354d6aed566Sopenharmony_ci    uint8_t overlay;           /* Overlay number */
355d6aed566Sopenharmony_ci    uint8_t bpp;               /* Bits per pixel */
356d6aed566Sopenharmony_ci    uint8_t blank;             /* Blank or unblank */
357d6aed566Sopenharmony_ci    uint32_t chromakey;        /* Chroma key argb8888 formatted */
358d6aed566Sopenharmony_ci    uint32_t color;            /* Color argb8888 formatted */
359d6aed566Sopenharmony_ci    struct fb_transp_s transp; /* Transparency */
360d6aed566Sopenharmony_ci    struct fb_area_s sarea;    /* Selected area within the overlay */
361d6aed566Sopenharmony_ci    uint32_t accl;             /* Supported hardware acceleration */
362d6aed566Sopenharmony_ci};
363d6aed566Sopenharmony_ci
364d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY_BLIT
365d6aed566Sopenharmony_ci/* This structure describes an overlay area within a whole overlay */
366d6aed566Sopenharmony_ci
367d6aed566Sopenharmony_cistruct fb_overlayarea_s {
368d6aed566Sopenharmony_ci    uint8_t overlay;       /* Number overlay */
369d6aed566Sopenharmony_ci    struct fb_area_s area; /* Overlay area */
370d6aed566Sopenharmony_ci};
371d6aed566Sopenharmony_ci
372d6aed566Sopenharmony_ci/* This structure describes blit operation */
373d6aed566Sopenharmony_ci
374d6aed566Sopenharmony_cistruct fb_overlayblit_s {
375d6aed566Sopenharmony_ci    struct fb_overlayarea_s dest; /* The destination overlay area */
376d6aed566Sopenharmony_ci    struct fb_overlayarea_s src;  /* The source overlay area */
377d6aed566Sopenharmony_ci};
378d6aed566Sopenharmony_ci
379d6aed566Sopenharmony_ci/* This structure describes blend operation */
380d6aed566Sopenharmony_ci
381d6aed566Sopenharmony_cistruct fb_overlayblend_s {
382d6aed566Sopenharmony_ci    struct fb_overlayarea_s dest;       /* The destination overlay area */
383d6aed566Sopenharmony_ci    struct fb_overlayarea_s foreground; /* The foreground overlay area */
384d6aed566Sopenharmony_ci    struct fb_overlayarea_s background; /* The background overlay area */
385d6aed566Sopenharmony_ci};
386d6aed566Sopenharmony_ci#endif
387d6aed566Sopenharmony_ci#endif /* CONFIG_FB_OVERLAY */
388d6aed566Sopenharmony_ci
389d6aed566Sopenharmony_ci/* On video controllers that support mapping of a pixel palette value
390d6aed566Sopenharmony_ci * to an RGB encoding, the following structure may be used to define
391d6aed566Sopenharmony_ci * that mapping.
392d6aed566Sopenharmony_ci */
393d6aed566Sopenharmony_ci
394d6aed566Sopenharmony_ci#ifdef CONFIG_FB_CMAP
395d6aed566Sopenharmony_cistruct fb_cmap_s {
396d6aed566Sopenharmony_ci    uint16_t first; /* Offset offset first color entry in tables */
397d6aed566Sopenharmony_ci    uint16_t len;   /* Number of color entries  in tables */
398d6aed566Sopenharmony_ci
399d6aed566Sopenharmony_ci    /* Tables of  color component.  Any may be NULL if not used */
400d6aed566Sopenharmony_ci
401d6aed566Sopenharmony_ci    uint8_t *red;   /* Table of 8-bit red values */
402d6aed566Sopenharmony_ci    uint8_t *green; /* Table of 8-bit green values */
403d6aed566Sopenharmony_ci    uint8_t *blue;  /* Table of 8-bit blue values */
404d6aed566Sopenharmony_ci#ifdef CONFIG_FB_TRANSPARENCY
405d6aed566Sopenharmony_ci    uint8_t *transp; /* Table of 8-bit transparency */
406d6aed566Sopenharmony_ci#endif
407d6aed566Sopenharmony_ci};
408d6aed566Sopenharmony_ci#endif
409d6aed566Sopenharmony_ci
410d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSOR
411d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSORIMAGE
412d6aed566Sopenharmony_ci/* If the video controller hardware supports a hardware cursor and
413d6aed566Sopenharmony_ci * that hardware cursor supports user-provided images, then the
414d6aed566Sopenharmony_ci * following structure may be used to provide the cursor image
415d6aed566Sopenharmony_ci */
416d6aed566Sopenharmony_ci
417d6aed566Sopenharmony_cistruct fb_cursorimage_s {
418d6aed566Sopenharmony_ci    fb_coord_t width;     /* Width of the cursor image in pixels */
419d6aed566Sopenharmony_ci    fb_coord_t height;    /* Height of the cursor image in pixels */
420d6aed566Sopenharmony_ci    const uint8_t *image; /* Pointer to image data */
421d6aed566Sopenharmony_ci};
422d6aed566Sopenharmony_ci#endif
423d6aed566Sopenharmony_ci
424d6aed566Sopenharmony_ci/* The following structure defines the cursor position/size */
425d6aed566Sopenharmony_ci
426d6aed566Sopenharmony_cistruct fb_cursorpos_s {
427d6aed566Sopenharmony_ci    fb_coord_t x; /* X position in pixels */
428d6aed566Sopenharmony_ci    fb_coord_t y; /* Y position in rows */
429d6aed566Sopenharmony_ci};
430d6aed566Sopenharmony_ci
431d6aed566Sopenharmony_ci/* If the hardware supports setting the cursor size, then this structure
432d6aed566Sopenharmony_ci * is used to provide the size.
433d6aed566Sopenharmony_ci */
434d6aed566Sopenharmony_ci
435d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSORSIZE
436d6aed566Sopenharmony_cistruct fb_cursorsize_s {
437d6aed566Sopenharmony_ci    fb_coord_t h; /* Height in rows */
438d6aed566Sopenharmony_ci    fb_coord_t w; /* Width in pixels */
439d6aed566Sopenharmony_ci};
440d6aed566Sopenharmony_ci#endif
441d6aed566Sopenharmony_ci
442d6aed566Sopenharmony_ci/* The following is used to get the cursor attributes */
443d6aed566Sopenharmony_ci
444d6aed566Sopenharmony_cistruct fb_cursorattrib_s {
445d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSORIMAGE
446d6aed566Sopenharmony_ci    uint8_t fmt; /* Video format of cursor */
447d6aed566Sopenharmony_ci#endif
448d6aed566Sopenharmony_ci    struct fb_cursorpos_s pos; /* Current cursor position */
449d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSORSIZE
450d6aed566Sopenharmony_ci    struct fb_cursorsize_s mxsize; /* Maximum cursor size */
451d6aed566Sopenharmony_ci    struct fb_cursorsize_s size;   /* Current size */
452d6aed566Sopenharmony_ci#endif
453d6aed566Sopenharmony_ci};
454d6aed566Sopenharmony_ci
455d6aed566Sopenharmony_cistruct fb_setcursor_s {
456d6aed566Sopenharmony_ci    uint8_t flags;             /* See FB_CUR_* definitions */
457d6aed566Sopenharmony_ci    struct fb_cursorpos_s pos; /* Cursor position */
458d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSORSIZE
459d6aed566Sopenharmony_ci    struct fb_cursorsize_s size; /* Cursor size */
460d6aed566Sopenharmony_ci#endif
461d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSORIMAGE
462d6aed566Sopenharmony_ci    struct fb_cursorimage_s img; /* Cursor image */
463d6aed566Sopenharmony_ci#endif
464d6aed566Sopenharmony_ci};
465d6aed566Sopenharmony_ci#endif
466d6aed566Sopenharmony_ci
467d6aed566Sopenharmony_ci/* The framebuffer "object" is accessed through within the OS via
468d6aed566Sopenharmony_ci * the following vtable:
469d6aed566Sopenharmony_ci */
470d6aed566Sopenharmony_ci
471d6aed566Sopenharmony_cistruct fb_vtable_s {
472d6aed566Sopenharmony_ci    /* Get information about the video controller configuration and the
473d6aed566Sopenharmony_ci     * configuration of each color plane.
474d6aed566Sopenharmony_ci     */
475d6aed566Sopenharmony_ci
476d6aed566Sopenharmony_ci    int (*getvideoinfo)(struct fb_vtable_s *vtable, struct fb_videoinfo_s *vinfo);
477d6aed566Sopenharmony_ci    int (*getplaneinfo)(struct fb_vtable_s *vtable, int planeno, struct fb_planeinfo_s *pinfo);
478d6aed566Sopenharmony_ci
479d6aed566Sopenharmony_ci#ifdef CONFIG_FB_CMAP
480d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports RGB
481d6aed566Sopenharmony_ci     * color mapping
482d6aed566Sopenharmony_ci     */
483d6aed566Sopenharmony_ci
484d6aed566Sopenharmony_ci    int (*getcmap)(struct fb_vtable_s *vtable, struct fb_cmap_s *cmap);
485d6aed566Sopenharmony_ci    int (*putcmap)(struct fb_vtable_s *vtable, const struct fb_cmap_s *cmap);
486d6aed566Sopenharmony_ci#endif
487d6aed566Sopenharmony_ci
488d6aed566Sopenharmony_ci#ifdef CONFIG_FB_HWCURSOR
489d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports a
490d6aed566Sopenharmony_ci     * hardware cursor.
491d6aed566Sopenharmony_ci     */
492d6aed566Sopenharmony_ci
493d6aed566Sopenharmony_ci    int (*getcursor)(struct fb_vtable_s *vtable, struct fb_cursorattrib_s *attrib);
494d6aed566Sopenharmony_ci    int (*setcursor)(struct fb_vtable_s *vtable, struct fb_setcursor_s *settings);
495d6aed566Sopenharmony_ci#endif
496d6aed566Sopenharmony_ci
497d6aed566Sopenharmony_ci#ifdef CONFIG_FB_SYNC
498d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware signals
499d6aed566Sopenharmony_ci     * vertical sync.
500d6aed566Sopenharmony_ci     */
501d6aed566Sopenharmony_ci
502d6aed566Sopenharmony_ci    int (*waitforvsync)(struct fb_vtable_s *vtable);
503d6aed566Sopenharmony_ci#endif
504d6aed566Sopenharmony_ci
505d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY
506d6aed566Sopenharmony_ci    /* Get information about the video controller configuration and the
507d6aed566Sopenharmony_ci     * configuration of each overlay.
508d6aed566Sopenharmony_ci     */
509d6aed566Sopenharmony_ci
510d6aed566Sopenharmony_ci    int (*getoverlayinfo)(struct fb_vtable_s *vtable, int overlayno, struct fb_overlayinfo_s *oinfo);
511d6aed566Sopenharmony_ci
512d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports
513d6aed566Sopenharmony_ci     * transparency
514d6aed566Sopenharmony_ci     */
515d6aed566Sopenharmony_ci
516d6aed566Sopenharmony_ci    int (*settransp)(struct fb_vtable_s *vtable, const struct fb_overlayinfo_s *oinfo);
517d6aed566Sopenharmony_ci
518d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports
519d6aed566Sopenharmony_ci     * chromakey
520d6aed566Sopenharmony_ci     */
521d6aed566Sopenharmony_ci
522d6aed566Sopenharmony_ci    int (*setchromakey)(struct fb_vtable_s *vtable, const struct fb_overlayinfo_s *oinfo);
523d6aed566Sopenharmony_ci
524d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports
525d6aed566Sopenharmony_ci     * filling the overlay with a color.
526d6aed566Sopenharmony_ci     */
527d6aed566Sopenharmony_ci
528d6aed566Sopenharmony_ci    int (*setcolor)(struct fb_vtable_s *vtable, const struct fb_overlayinfo_s *oinfo);
529d6aed566Sopenharmony_ci
530d6aed566Sopenharmony_ci    /* The following allows to switch the overlay on or off */
531d6aed566Sopenharmony_ci
532d6aed566Sopenharmony_ci    int (*setblank)(struct fb_vtable_s *vtable, const struct fb_overlayinfo_s *oinfo);
533d6aed566Sopenharmony_ci
534d6aed566Sopenharmony_ci    /* The following allows to set the active area for subsequently overlay
535d6aed566Sopenharmony_ci     * operations.
536d6aed566Sopenharmony_ci     */
537d6aed566Sopenharmony_ci
538d6aed566Sopenharmony_ci    int (*setarea)(struct fb_vtable_s *vtable, const struct fb_overlayinfo_s *oinfo);
539d6aed566Sopenharmony_ci
540d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY_BLIT
541d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports
542d6aed566Sopenharmony_ci     * blit operation between overlays.
543d6aed566Sopenharmony_ci     */
544d6aed566Sopenharmony_ci
545d6aed566Sopenharmony_ci    int (*blit)(struct fb_vtable_s *vtable, const struct fb_overlayblit_s *blit);
546d6aed566Sopenharmony_ci
547d6aed566Sopenharmony_ci    /* The following are provided only if the video hardware supports
548d6aed566Sopenharmony_ci     * blend operation between overlays.
549d6aed566Sopenharmony_ci     */
550d6aed566Sopenharmony_ci
551d6aed566Sopenharmony_ci    int (*blend)(struct fb_vtable_s *vtable, const struct fb_overlayblend_s *blend);
552d6aed566Sopenharmony_ci#endif
553d6aed566Sopenharmony_ci#endif
554d6aed566Sopenharmony_ci    int (*fb_open)(struct fb_vtable_s *vtable);
555d6aed566Sopenharmony_ci    int (*fb_release)(struct fb_vtable_s *vtable);
556d6aed566Sopenharmony_ci#ifdef CONFIG_FB_OVERLAY
557d6aed566Sopenharmony_ci    int (*fb_pan_display)(struct fb_vtable_s *vtable, struct fb_overlayinfo_s *oinfo);
558d6aed566Sopenharmony_ci#endif
559d6aed566Sopenharmony_ci    int (*fb_ioctl)(struct fb_vtable_s *vtable, int cmd, unsigned long arg);
560d6aed566Sopenharmony_ci    int (*fb_check_var)(struct fb_vtable_s *vtable, unsigned long arg);
561d6aed566Sopenharmony_ci    int (*fb_set_par)(struct fb_vtable_s *vtable);
562d6aed566Sopenharmony_ci};
563d6aed566Sopenharmony_ci
564d6aed566Sopenharmony_ci/****************************************************************************
565d6aed566Sopenharmony_ci * Public Data
566d6aed566Sopenharmony_ci ****************************************************************************/
567d6aed566Sopenharmony_ci
568d6aed566Sopenharmony_ci#ifdef __cplusplus
569d6aed566Sopenharmony_ci#define EXTERN extern "C"
570d6aed566Sopenharmony_ciextern "C" {
571d6aed566Sopenharmony_ci#else
572d6aed566Sopenharmony_ci#define EXTERN extern
573d6aed566Sopenharmony_ci#endif
574d6aed566Sopenharmony_ci
575d6aed566Sopenharmony_ci/****************************************************************************
576d6aed566Sopenharmony_ci * Public Function Prototypes
577d6aed566Sopenharmony_ci ****************************************************************************/
578d6aed566Sopenharmony_ci
579d6aed566Sopenharmony_ci/****************************************************************************
580d6aed566Sopenharmony_ci * If an architecture supports a framebuffer, then it must provide the
581d6aed566Sopenharmony_ci * following APIs to access the framebuffer.
582d6aed566Sopenharmony_ci ****************************************************************************/
583d6aed566Sopenharmony_ci
584d6aed566Sopenharmony_ci/****************************************************************************
585d6aed566Sopenharmony_ci * Name: up_fbinitialize
586d6aed566Sopenharmony_ci *
587d6aed566Sopenharmony_ci * Description:
588d6aed566Sopenharmony_ci *   Initialize the framebuffer video hardware associated with the display.
589d6aed566Sopenharmony_ci *
590d6aed566Sopenharmony_ci *   There are multiple logic paths that may call up_fbinitialize() so any
591d6aed566Sopenharmony_ci *   implementation of up_fbinitialize() should be tolerant of being called
592d6aed566Sopenharmony_ci *   multiple times.
593d6aed566Sopenharmony_ci *
594d6aed566Sopenharmony_ci * Input Parameters:
595d6aed566Sopenharmony_ci *   display - In the case of hardware with multiple displays, this
596d6aed566Sopenharmony_ci *             specifies the display.  Normally this is zero.
597d6aed566Sopenharmony_ci *
598d6aed566Sopenharmony_ci * Returned Value:
599d6aed566Sopenharmony_ci *   Zero is returned on success; a negated errno value is returned on any
600d6aed566Sopenharmony_ci *   failure.
601d6aed566Sopenharmony_ci *
602d6aed566Sopenharmony_ci ****************************************************************************/
603d6aed566Sopenharmony_ci
604d6aed566Sopenharmony_ciint up_fbinitialize(int display);
605d6aed566Sopenharmony_ci
606d6aed566Sopenharmony_ci/****************************************************************************
607d6aed566Sopenharmony_ci * Name: up_fbgetvplane
608d6aed566Sopenharmony_ci *
609d6aed566Sopenharmony_ci * Description:
610d6aed566Sopenharmony_ci *   Return a a reference to the framebuffer object for the specified video
611d6aed566Sopenharmony_ci *   plane of the specified plane.  Many OSDs support multiple planes of video.
612d6aed566Sopenharmony_ci *
613d6aed566Sopenharmony_ci * Input Parameters:
614d6aed566Sopenharmony_ci *   display - In the case of hardware with multiple displays, this
615d6aed566Sopenharmony_ci *             specifies the display.  Normally this is zero.
616d6aed566Sopenharmony_ci *   vplane  - Identifies the plane being queried.
617d6aed566Sopenharmony_ci *
618d6aed566Sopenharmony_ci * Returned Value:
619d6aed566Sopenharmony_ci *   A non-NULL pointer to the frame buffer access structure is returned on
620d6aed566Sopenharmony_ci *   success; NULL is returned on any failure.
621d6aed566Sopenharmony_ci *
622d6aed566Sopenharmony_ci ****************************************************************************/
623d6aed566Sopenharmony_ci
624d6aed566Sopenharmony_cistruct fb_vtable_s *up_fbgetvplane(int display, int vplane);
625d6aed566Sopenharmony_ci
626d6aed566Sopenharmony_ci/****************************************************************************
627d6aed566Sopenharmony_ci * Name: up_fbuninitialize
628d6aed566Sopenharmony_ci *
629d6aed566Sopenharmony_ci * Description:
630d6aed566Sopenharmony_ci *   Uninitialize the framebuffer support for the specified display.
631d6aed566Sopenharmony_ci *
632d6aed566Sopenharmony_ci * Input Parameters:
633d6aed566Sopenharmony_ci *   display - In the case of hardware with multiple displays, this
634d6aed566Sopenharmony_ci *             specifies the display.  Normally this is zero.
635d6aed566Sopenharmony_ci *
636d6aed566Sopenharmony_ci * Returned Value:
637d6aed566Sopenharmony_ci *   None
638d6aed566Sopenharmony_ci *
639d6aed566Sopenharmony_ci ****************************************************************************/
640d6aed566Sopenharmony_ci
641d6aed566Sopenharmony_civoid up_fbuninitialize(int display);
642d6aed566Sopenharmony_ci
643d6aed566Sopenharmony_ci/****************************************************************************
644d6aed566Sopenharmony_ci * Name: fb_register
645d6aed566Sopenharmony_ci *
646d6aed566Sopenharmony_ci * Description:
647d6aed566Sopenharmony_ci *   Register the framebuffer character device at /dev/fbN where N is the
648d6aed566Sopenharmony_ci *   display number if the devices supports only a single plane.  If the
649d6aed566Sopenharmony_ci *   hardware supports multiple color planes, then the device will be
650d6aed566Sopenharmony_ci *   registered at /dev/fbN.M where N is the again display number but M
651d6aed566Sopenharmony_ci *   is the display plane.
652d6aed566Sopenharmony_ci *
653d6aed566Sopenharmony_ci * Input Parameters:
654d6aed566Sopenharmony_ci *   display - The display number for the case of boards supporting multiple
655d6aed566Sopenharmony_ci *             displays or for hardware that supports multiple
656d6aed566Sopenharmony_ci *             layers (each layer is consider a display).  Typically zero.
657d6aed566Sopenharmony_ci *   plane   - Identifies the color plane on hardware that supports separate
658d6aed566Sopenharmony_ci *             framebuffer "planes" for each color component.
659d6aed566Sopenharmony_ci *
660d6aed566Sopenharmony_ci * Returned Value:
661d6aed566Sopenharmony_ci *   Zero (OK) is returned success; a negated errno value is returned on any
662d6aed566Sopenharmony_ci *   failure.
663d6aed566Sopenharmony_ci *
664d6aed566Sopenharmony_ci ****************************************************************************/
665d6aed566Sopenharmony_ciint fb_register(int display, int plane);
666d6aed566Sopenharmony_ci
667d6aed566Sopenharmony_ciint fb_unregister(int display);
668d6aed566Sopenharmony_ci
669d6aed566Sopenharmony_ciint fb_open(const char *key, struct fb_mem **result);
670d6aed566Sopenharmony_ciint fb_close(struct fb_mem *fbmem);
671d6aed566Sopenharmony_ciint fb_ioctl(struct fb_mem *fbmem, int cmd, unsigned long arg);
672d6aed566Sopenharmony_ciint getplaneinfo(struct fb_mem *fbmem, struct fb_planeinfo_s **result);
673d6aed566Sopenharmony_ci
674d6aed566Sopenharmony_ci#undef EXTERN
675d6aed566Sopenharmony_ci#ifdef __cplusplus
676d6aed566Sopenharmony_ci}
677d6aed566Sopenharmony_ci#endif
678d6aed566Sopenharmony_ci
679d6aed566Sopenharmony_ci#endif /* __INCLUDE_NUTTX_VIDEO_FB_H */
680