aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2009-08-03 08:06:36 -0400
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2009-12-09 05:04:06 -0500
commit91773a00f8235e4b697217867529f73e298298df (patch)
treec0156ddc17e4bb966642b050d57ee85c1171bfe2 /include
parentb90f8e7296c39a13225fb0c0dfde1922fcf47ba7 (diff)
OMAP: OMAPFB: split omapfb.h
Split arch/arm/plat-omap/include/mach/omapfb.h into two files: include/linux/omapfb.h - ioctls etc for userspace and some kernel stuff for board files drivers/video/omap/omapfb.h - for omapfb internal use This cleans up omapfb.h and also makes it easier for the upcoming new DSS driver to co-exist with the old driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/omapfb.h197
1 files changed, 197 insertions, 0 deletions
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
new file mode 100644
index 000000000000..a8efa92c6c35
--- /dev/null
+++ b/include/linux/omapfb.h
@@ -0,0 +1,197 @@
1/*
2 * File: include/linux/omapfb.h
3 *
4 * Framebuffer driver for TI OMAP boards
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __LINUX_OMAPFB_H__
25#define __LINUX_OMAPFB_H__
26
27#include <linux/ioctl.h>
28#include <linux/types.h>
29
30/* IOCTL commands. */
31
32#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
33#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
34#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
35#define OMAP_IO(num) _IO('O', num)
36
37#define OMAPFB_MIRROR OMAP_IOW(31, int)
38#define OMAPFB_SYNC_GFX OMAP_IO(37)
39#define OMAPFB_VSYNC OMAP_IO(38)
40#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
41#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
42#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
43#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
44#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
45#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
46#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
47#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
48#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
49#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
50#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
51#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
52#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
53
54#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
55#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
56#define OMAPFB_CAPS_PANEL_MASK 0xff000000
57
58#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
59#define OMAPFB_CAPS_TEARSYNC 0x00002000
60#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
61#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
62#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
63#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
64#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
65#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
66#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
67
68/* Values from DSP must map to lower 16-bits */
69#define OMAPFB_FORMAT_MASK 0x00ff
70#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
71#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
72#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
73#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
74#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
75
76#define OMAPFB_MEMTYPE_SDRAM 0
77#define OMAPFB_MEMTYPE_SRAM 1
78#define OMAPFB_MEMTYPE_MAX 1
79
80enum omapfb_color_format {
81 OMAPFB_COLOR_RGB565 = 0,
82 OMAPFB_COLOR_YUV422,
83 OMAPFB_COLOR_YUV420,
84 OMAPFB_COLOR_CLUT_8BPP,
85 OMAPFB_COLOR_CLUT_4BPP,
86 OMAPFB_COLOR_CLUT_2BPP,
87 OMAPFB_COLOR_CLUT_1BPP,
88 OMAPFB_COLOR_RGB444,
89 OMAPFB_COLOR_YUY422,
90};
91
92struct omapfb_update_window {
93 __u32 x, y;
94 __u32 width, height;
95 __u32 format;
96 __u32 out_x, out_y;
97 __u32 out_width, out_height;
98 __u32 reserved[8];
99};
100
101struct omapfb_update_window_old {
102 __u32 x, y;
103 __u32 width, height;
104 __u32 format;
105};
106
107enum omapfb_plane {
108 OMAPFB_PLANE_GFX = 0,
109 OMAPFB_PLANE_VID1,
110 OMAPFB_PLANE_VID2,
111};
112
113enum omapfb_channel_out {
114 OMAPFB_CHANNEL_OUT_LCD = 0,
115 OMAPFB_CHANNEL_OUT_DIGIT,
116};
117
118struct omapfb_plane_info {
119 __u32 pos_x;
120 __u32 pos_y;
121 __u8 enabled;
122 __u8 channel_out;
123 __u8 mirror;
124 __u8 reserved1;
125 __u32 out_width;
126 __u32 out_height;
127 __u32 reserved2[12];
128};
129
130struct omapfb_mem_info {
131 __u32 size;
132 __u8 type;
133 __u8 reserved[3];
134};
135
136struct omapfb_caps {
137 __u32 ctrl;
138 __u32 plane_color;
139 __u32 wnd_color;
140};
141
142enum omapfb_color_key_type {
143 OMAPFB_COLOR_KEY_DISABLED = 0,
144 OMAPFB_COLOR_KEY_GFX_DST,
145 OMAPFB_COLOR_KEY_VID_SRC,
146};
147
148struct omapfb_color_key {
149 __u8 channel_out;
150 __u32 background;
151 __u32 trans_key;
152 __u8 key_type;
153};
154
155enum omapfb_update_mode {
156 OMAPFB_UPDATE_DISABLED = 0,
157 OMAPFB_AUTO_UPDATE,
158 OMAPFB_MANUAL_UPDATE
159};
160
161#ifdef __KERNEL__
162
163#include <plat/board.h>
164
165#ifdef CONFIG_ARCH_OMAP1
166#define OMAPFB_PLANE_NUM 1
167#else
168#define OMAPFB_PLANE_NUM 3
169#endif
170
171struct omapfb_mem_region {
172 u32 paddr;
173 void __iomem *vaddr;
174 unsigned long size;
175 u8 type; /* OMAPFB_PLANE_MEM_* */
176 unsigned alloc:1; /* allocated by the driver */
177 unsigned map:1; /* kernel mapped by the driver */
178};
179
180struct omapfb_mem_desc {
181 int region_cnt;
182 struct omapfb_mem_region region[OMAPFB_PLANE_NUM];
183};
184
185struct omapfb_platform_data {
186 struct omap_lcd_config lcd;
187 struct omapfb_mem_desc mem_desc;
188 void *ctrl_platform_data;
189};
190
191/* in arch/arm/plat-omap/fb.c */
192extern void omapfb_set_ctrl_platform_data(void *pdata);
193extern void omapfb_reserve_sdram(void);
194
195#endif
196
197#endif /* __OMAPFB_H */