1 /**************************************************************************
3 xserver-xorg-video-emulfb
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
7 Contact: Boram Park <boram1288.park@samsung.com>
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 **************************************************************************/
31 #ifndef __FBDEV_VIDEO_FOURCC_H__
32 #define __FBDEV_VIDEO_FOURCC_H__
36 #define B(c,s) ((((unsigned int)(c)) & 0xff) << (s))
37 #define FOURCC(a,b,c,d) (B(d,24) | B(c,16) | B(b,8) | B(a,0))
39 /* http://www.fourcc.org/yuv.php
40 * http://en.wikipedia.org/wiki/YUV
42 #define FOURCC_RGB565 FOURCC('R','G','B','P')
43 #define XVIMAGE_RGB565 \
49 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
53 16, 0x0000F800, 0x000007E0, 0x0000001F, \
54 0, 0, 0, 0, 0, 0, 0, 0, 0, \
56 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
60 #define FOURCC_RGB24 FOURCC('R','G','B','3')
61 #define XVIMAGE_RGB24 \
67 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
71 24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
72 0, 0, 0, 0, 0, 0, 0, 0, 0, \
74 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
78 #define FOURCC_RGB32 FOURCC('R','G','B','4')
79 #define XVIMAGE_RGB32 \
85 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
89 24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
90 0, 0, 0, 0, 0, 0, 0, 0, 0, \
92 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
96 #define FOURCC_ST12 FOURCC('S','T','1','2')
97 #define XVIMAGE_ST12 \
103 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
112 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
116 #define FOURCC_SN12 FOURCC('S','N','1','2')
117 #define XVIMAGE_SN12 \
123 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
132 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
136 #define FOURCC_NV12 FOURCC('N','V','1','2')
137 #define XVIMAGE_NV12 \
143 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
152 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
156 #define FOURCC_S420 FOURCC('S','4','2','0')
157 #define XVIMAGE_S420 \
163 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
172 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
175 #define FOURCC_SUYV FOURCC('S','U','Y','V')
176 #define XVIMAGE_SUYV \
182 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
191 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
196 #endif // __FBDEV_VIDEO_FOURCC_H__