2 * Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * @file uapi/linux/mxcfb.h
24 * @brief Global header file for the MXC frame buffer
26 * @ingroup Framebuffer
28 #ifndef __ASM_ARCH_MXCFB_H__
29 #define __ASM_ARCH_MXCFB_H__
33 #define FB_SYNC_OE_LOW_ACT 0x80000000
34 #define FB_SYNC_CLK_LAT_FALL 0x40000000
35 #define FB_SYNC_DATA_INVERT 0x20000000
36 #define FB_SYNC_CLK_IDLE_EN 0x10000000
37 #define FB_SYNC_SHARP_MODE 0x08000000
38 #define FB_SYNC_SWAP_RGB 0x04000000
39 #define FB_ACCEL_TRIPLE_FLAG 0x00000000
40 #define FB_ACCEL_DOUBLE_FLAG 0x00000001
42 struct mxcfb_gbl_alpha {
47 struct mxcfb_loc_alpha {
50 unsigned long alpha_phy_addr0;
51 unsigned long alpha_phy_addr1;
54 struct mxcfb_color_key {
77 #define GRAYSCALE_8BIT 0x1
78 #define GRAYSCALE_8BIT_INVERTED 0x2
79 #define GRAYSCALE_4BIT 0x3
80 #define GRAYSCALE_4BIT_INVERTED 0x4
82 #define AUTO_UPDATE_MODE_REGION_MODE 0
83 #define AUTO_UPDATE_MODE_AUTOMATIC_MODE 1
85 #define UPDATE_SCHEME_SNAPSHOT 0
86 #define UPDATE_SCHEME_QUEUE 1
87 #define UPDATE_SCHEME_QUEUE_AND_MERGE 2
89 #define UPDATE_MODE_PARTIAL 0x0
90 #define UPDATE_MODE_FULL 0x1
92 #define WAVEFORM_MODE_AUTO 257
94 #define TEMP_USE_AMBIENT 0x1000
96 #define EPDC_FLAG_ENABLE_INVERSION 0x01
97 #define EPDC_FLAG_FORCE_MONOCHROME 0x02
98 #define EPDC_FLAG_USE_CMAP 0x04
99 #define EPDC_FLAG_USE_ALT_BUFFER 0x100
100 #define EPDC_FLAG_TEST_COLLISION 0x200
101 #define EPDC_FLAG_GROUP_UPDATE 0x400
102 #define EPDC_FLAG_USE_DITHERING_Y1 0x2000
103 #define EPDC_FLAG_USE_DITHERING_Y4 0x4000
105 #define FB_POWERDOWN_DISABLE -1
107 struct mxcfb_alt_buffer_data {
109 __u32 width; /* width of entire buffer */
110 __u32 height; /* height of entire buffer */
111 struct mxcfb_rect alt_update_region; /* region within buffer to update */
114 struct mxcfb_update_data {
115 struct mxcfb_rect update_region;
121 struct mxcfb_alt_buffer_data alt_buffer_data;
124 struct mxcfb_update_marker_data {
126 __u32 collision_test;
130 * Structure used to define waveform modes for driver
131 * Needed for driver to perform auto-waveform selection
133 struct mxcfb_waveform_modes {
143 * Structure used to define a 5*3 matrix of parameters for
144 * setting IPU DP CSC module related to this framebuffer.
146 struct mxcfb_csc_matrix {
150 #define MXCFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t)
151 #define MXCFB_SET_GBL_ALPHA _IOW('F', 0x21, struct mxcfb_gbl_alpha)
152 #define MXCFB_SET_CLR_KEY _IOW('F', 0x22, struct mxcfb_color_key)
153 #define MXCFB_SET_OVERLAY_POS _IOWR('F', 0x24, struct mxcfb_pos)
154 #define MXCFB_GET_FB_IPU_CHAN _IOR('F', 0x25, u_int32_t)
155 #define MXCFB_SET_LOC_ALPHA _IOWR('F', 0x26, struct mxcfb_loc_alpha)
156 #define MXCFB_SET_LOC_ALP_BUF _IOW('F', 0x27, unsigned long)
157 #define MXCFB_SET_GAMMA _IOW('F', 0x28, struct mxcfb_gamma)
158 #define MXCFB_GET_FB_IPU_DI _IOR('F', 0x29, u_int32_t)
159 #define MXCFB_GET_DIFMT _IOR('F', 0x2A, u_int32_t)
160 #define MXCFB_GET_FB_BLANK _IOR('F', 0x2B, u_int32_t)
161 #define MXCFB_SET_DIFMT _IOW('F', 0x2C, u_int32_t)
162 #define MXCFB_CSC_UPDATE _IOW('F', 0x2D, struct mxcfb_csc_matrix)
164 /* IOCTLs for E-ink panel updates */
165 #define MXCFB_SET_WAVEFORM_MODES _IOW('F', 0x2B, struct mxcfb_waveform_modes)
166 #define MXCFB_SET_TEMPERATURE _IOW('F', 0x2C, int32_t)
167 #define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32)
168 #define MXCFB_SEND_UPDATE _IOW('F', 0x2E, struct mxcfb_update_data)
169 #define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOWR('F', 0x2F, struct mxcfb_update_marker_data)
170 #define MXCFB_SET_PWRDOWN_DELAY _IOW('F', 0x30, int32_t)
171 #define MXCFB_GET_PWRDOWN_DELAY _IOR('F', 0x31, int32_t)
172 #define MXCFB_SET_UPDATE_SCHEME _IOW('F', 0x32, __u32)
173 #define MXCFB_GET_WORK_BUFFER _IOWR('F', 0x34, unsigned long)