]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - drivers/staging/msm/msm_mdp.h
1 /* include/linux/msm_mdp.h
3 * Copyright (C) 2007 Google Incorporated
4 * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
18 #include <linux/types.h>
21 #define MSMFB_IOCTL_MAGIC 'm'
22 #define MSMFB_GRP_DISP _IOW(MSMFB_IOCTL_MAGIC, 1, unsigned int)
23 #define MSMFB_BLIT _IOW(MSMFB_IOCTL_MAGIC, 2, unsigned int)
24 #define MSMFB_SUSPEND_SW_REFRESHER _IOW(MSMFB_IOCTL_MAGIC, 128, unsigned int)
25 #define MSMFB_RESUME_SW_REFRESHER _IOW(MSMFB_IOCTL_MAGIC, 129, unsigned int)
26 #define MSMFB_CURSOR _IOW(MSMFB_IOCTL_MAGIC, 130, struct fb_cursor)
27 #define MSMFB_SET_LUT _IOW(MSMFB_IOCTL_MAGIC, 131, struct fb_cmap)
28 #define MSMFB_HISTOGRAM _IOWR(MSMFB_IOCTL_MAGIC, 132, struct mdp_histogram)
29 /* new ioctls's for set/get ccs matrix */
30 #define MSMFB_GET_CCS_MATRIX _IOWR(MSMFB_IOCTL_MAGIC, 133, struct mdp_ccs)
31 #define MSMFB_SET_CCS_MATRIX _IOW(MSMFB_IOCTL_MAGIC, 134, struct mdp_ccs)
32 #define MSMFB_OVERLAY_SET _IOWR(MSMFB_IOCTL_MAGIC, 135, \
34 #define MSMFB_OVERLAY_UNSET _IOW(MSMFB_IOCTL_MAGIC, 136, unsigned int)
35 #define MSMFB_OVERLAY_PLAY _IOW(MSMFB_IOCTL_MAGIC, 137, \
36 struct msmfb_overlay_data)
37 #define MSMFB_GET_PAGE_PROTECTION _IOR(MSMFB_IOCTL_MAGIC, 138, \
38 struct mdp_page_protection)
39 #define MSMFB_SET_PAGE_PROTECTION _IOW(MSMFB_IOCTL_MAGIC, 139, \
40 struct mdp_page_protection)
41 #define MSMFB_OVERLAY_GET _IOR(MSMFB_IOCTL_MAGIC, 140, \
44 /* new ioctls for async MDP ops */
45 #define MSMFB_ASYNC_BLIT _IOW(MSMFB_IOCTL_MAGIC, 141, unsigned int)
46 #define MSMFB_BLIT_FLUSH _IOR(MSMFB_IOCTL_MAGIC, 142, unsigned int)
48 #define MDP_IMGTYPE2_START 0x10000
51 MDP_RGB_565
, /* RGB 565 planer */
52 MDP_XRGB_8888
, /* RGB 888 padded */
53 MDP_Y_CBCR_H2V2
, /* Y and CbCr, pseudo planer w/ Cb is in MSB */
54 MDP_ARGB_8888
, /* ARGB 888 */
55 MDP_RGB_888
, /* RGB 888 planer */
56 MDP_Y_CRCB_H2V2
, /* Y and CrCb, pseudo planer w/ Cr is in MSB */
57 MDP_YCRYCB_H2V1
, /* YCrYCb interleave */
58 MDP_Y_CRCB_H2V1
, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
59 MDP_Y_CBCR_H2V1
, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
60 MDP_RGBA_8888
, /* ARGB 888 */
61 MDP_BGRA_8888
, /* ABGR 888 */
62 MDP_Y_CRCB_H2V2_TILE
, /* Y and CrCb, pseudo planer tile */
63 MDP_Y_CBCR_H2V2_TILE
, /* Y and CbCr, pseudo planer tile */
65 MDP_BGR_565
= MDP_IMGTYPE2_START
, /* BGR 565 planer */
66 MDP_FB_FORMAT
, /* framebuffer format */
67 MDP_IMGTYPE_LIMIT2
/* Non valid image type after this enum */
75 /* mdp_blit_req flag values */
77 #define MDP_FLIP_LR 0x1
78 #define MDP_FLIP_UD 0x2
79 #define MDP_ROT_90 0x4
80 #define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
81 #define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
82 #define MDP_DITHER 0x8
84 #define MDP_BLEND_FG_PREMULT 0x20000
86 #define MDP_DEINTERLACE 0x80000000
87 #define MDP_SHARPENING 0x40000000
89 #define MDP_NO_DMA_BARRIER_START 0x20000000
90 #define MDP_NO_DMA_BARRIER_END 0x10000000
91 #define MDP_NO_BLIT 0x08000000
92 #define MDP_BLIT_WITH_DMA_BARRIERS 0x000
93 #define MDP_BLIT_WITH_NO_DMA_BARRIERS \
94 (MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END)
95 #define MDP_TRANSP_NOP 0xffffffff
96 #define MDP_ALPHA_NOP 0xff
98 #define MDP_BLIT_SRC_GEM 0x02000000 /* set for GEM, clear for PMEM */
99 #define MDP_BLIT_DST_GEM 0x01000000 /* set for GEM, clear for PMEM */
101 #define MDP_FB_PAGE_PROTECTION_NONCACHED (0)
102 #define MDP_FB_PAGE_PROTECTION_WRITECOMBINE (1)
103 #define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2)
104 #define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE (3)
105 #define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE (4)
106 /* Sentinel: Don't use! */
107 #define MDP_FB_PAGE_PROTECTION_INVALID (5)
108 /* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */
109 #define MDP_NUM_FB_PAGE_PROTECTION_VALUES (5)
123 int memory_id
; /* the file descriptor */
128 * {3x3} + {3} ccs matrix
131 #define MDP_CCS_RGB2YUV 0
132 #define MDP_CCS_YUV2RGB 1
134 #define MDP_CCS_SIZE 9
135 #define MDP_BV_SIZE 3
138 int direction
; /* MDP_CCS_RGB2YUV or YUV2RGB */
139 uint16_t ccs
[MDP_CCS_SIZE
]; /* 3x3 color coefficients */
140 uint16_t bv
[MDP_BV_SIZE
]; /* 1x3 bias vector */
143 /* The version of the mdp_blit_req structure so that
144 * user applications can selectively decide which functionality
148 #define MDP_BLIT_REQ_VERSION 2
150 struct mdp_blit_req
{
153 struct mdp_rect src_rect
;
154 struct mdp_rect dst_rect
;
156 uint32_t transp_mask
;
158 int sharpening_strength
; /* -127 <--> 127, default 64 */
161 struct mdp_blit_req_list
{
163 struct mdp_blit_req req
[];
172 #define MSMFB_NEW_REQUEST -1
174 struct msmfb_overlay_data
{
176 struct msmfb_data data
;
186 struct msmfb_img src
;
187 struct mdp_rect src_rect
;
188 struct mdp_rect dst_rect
;
189 uint32_t z_order
; /* stage number */
190 uint32_t is_fg
; /* control alpha & transp */
192 uint32_t transp_mask
;
195 uint32_t user_data
[8];
198 struct mdp_histogram
{
206 struct mdp_page_protection
{
207 uint32_t page_protection
;
211 struct msm_panel_common_pdata
{
213 int (*backlight_level
)(int level
, int max
, int min
);
214 int (*pmic_backlight
)(int level
);
215 int (*panel_num
)(void);
216 void (*panel_config_gpio
)(int);
220 struct lcdc_platform_data
{
221 int (*lcdc_gpio_config
)(int on
);
222 void (*lcdc_power_save
)(int);
225 struct tvenc_platform_data
{
226 int (*pm_vid_en
)(int on
);
229 struct mddi_platform_data
{
230 void (*mddi_power_save
)(int on
);
231 int (*mddi_sel_clk
)(u32
*clk_rate
);
234 struct msm_fb_platform_data
{
235 int (*detect_client
)(const char *name
);
237 int (*allow_set_offset
)(void);
240 struct msm_hdmi_platform_data
{
242 int (*cable_detect
)(int insert
);
245 #endif /*_MSM_MDP_H_*/