blob: 866ead0ec719284609c1d6a21cbfd27382c40561 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stefano Babic92a98a42011-09-28 11:21:16 +02002/*
3 * (C) Copyright 2011
4 * Stefano Babic, DENX Software Engineering, sbabic@denx.de
5 *
6 * Based on Linux IPU driver for MX51 (ipu.h):
7 *
8 * (C) Copyright 2005-2010 Freescale Semiconductor, Inc.
Stefano Babic92a98a42011-09-28 11:21:16 +02009 */
10
11#ifndef __IPU_PIXFMT_H__
12#define __IPU_PIXFMT_H__
13
Marek Vasut02ae1a12011-10-06 00:25:03 +020014#include <linux/list.h>
15#include <linux/fb.h>
16
Stefano Babic92a98a42011-09-28 11:21:16 +020017/* IPU Pixel format definitions */
18#define fourcc(a, b, c, d)\
19 (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
20
21/*
22 * Pixel formats are defined with ASCII FOURCC code. The pixel format codes are
23 * the same used by V4L2 API.
24 */
25
26#define IPU_PIX_FMT_GENERIC fourcc('I', 'P', 'U', '0')
27#define IPU_PIX_FMT_GENERIC_32 fourcc('I', 'P', 'U', '1')
28#define IPU_PIX_FMT_LVDS666 fourcc('L', 'V', 'D', '6')
29#define IPU_PIX_FMT_LVDS888 fourcc('L', 'V', 'D', '8')
30
31#define IPU_PIX_FMT_RGB332 fourcc('R', 'G', 'B', '1') /*< 8 RGB-3-3-2 */
32#define IPU_PIX_FMT_RGB555 fourcc('R', 'G', 'B', 'O') /*< 16 RGB-5-5-5 */
33#define IPU_PIX_FMT_RGB565 fourcc('R', 'G', 'B', 'P') /*< 1 6 RGB-5-6-5 */
34#define IPU_PIX_FMT_RGB666 fourcc('R', 'G', 'B', '6') /*< 18 RGB-6-6-6 */
35#define IPU_PIX_FMT_BGR666 fourcc('B', 'G', 'R', '6') /*< 18 BGR-6-6-6 */
36#define IPU_PIX_FMT_BGR24 fourcc('B', 'G', 'R', '3') /*< 24 BGR-8-8-8 */
37#define IPU_PIX_FMT_RGB24 fourcc('R', 'G', 'B', '3') /*< 24 RGB-8-8-8 */
38#define IPU_PIX_FMT_BGR32 fourcc('B', 'G', 'R', '4') /*< 32 BGR-8-8-8-8 */
39#define IPU_PIX_FMT_BGRA32 fourcc('B', 'G', 'R', 'A') /*< 32 BGR-8-8-8-8 */
40#define IPU_PIX_FMT_RGB32 fourcc('R', 'G', 'B', '4') /*< 32 RGB-8-8-8-8 */
41#define IPU_PIX_FMT_RGBA32 fourcc('R', 'G', 'B', 'A') /*< 32 RGB-8-8-8-8 */
42#define IPU_PIX_FMT_ABGR32 fourcc('A', 'B', 'G', 'R') /*< 32 ABGR-8-8-8-8 */
43
44/* YUV Interleaved Formats */
45#define IPU_PIX_FMT_YUYV fourcc('Y', 'U', 'Y', 'V') /*< 16 YUV 4:2:2 */
46#define IPU_PIX_FMT_UYVY fourcc('U', 'Y', 'V', 'Y') /*< 16 YUV 4:2:2 */
47#define IPU_PIX_FMT_Y41P fourcc('Y', '4', '1', 'P') /*< 12 YUV 4:1:1 */
48#define IPU_PIX_FMT_YUV444 fourcc('Y', '4', '4', '4') /*< 24 YUV 4:4:4 */
49
50/* two planes -- one Y, one Cb + Cr interleaved */
51#define IPU_PIX_FMT_NV12 fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
52
53#define IPU_PIX_FMT_GREY fourcc('G', 'R', 'E', 'Y') /*< 8 Greyscale */
54#define IPU_PIX_FMT_YVU410P fourcc('Y', 'V', 'U', '9') /*< 9 YVU 4:1:0 */
55#define IPU_PIX_FMT_YUV410P fourcc('Y', 'U', 'V', '9') /*< 9 YUV 4:1:0 */
56#define IPU_PIX_FMT_YVU420P fourcc('Y', 'V', '1', '2') /*< 12 YVU 4:2:0 */
57#define IPU_PIX_FMT_YUV420P fourcc('I', '4', '2', '0') /*< 12 YUV 4:2:0 */
58#define IPU_PIX_FMT_YUV420P2 fourcc('Y', 'U', '1', '2') /*< 12 YUV 4:2:0 */
59#define IPU_PIX_FMT_YVU422P fourcc('Y', 'V', '1', '6') /*< 16 YVU 4:2:2 */
60#define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*< 16 YUV 4:2:2 */
61
Eric Nelson09c8bb22012-10-03 07:27:38 +000062int ipuv3_fb_init(struct fb_videomode const *mode,
63 uint8_t disp,
64 uint32_t pixfmt);
Eric Nelson5f8e17c2012-09-23 07:30:54 +000065void ipuv3_fb_shutdown(void);
Marek Vasut02ae1a12011-10-06 00:25:03 +020066
Stefano Babic92a98a42011-09-28 11:21:16 +020067#endif