PageRenderTime 40ms CodeModel.GetById 13ms app.highlight 21ms RepoModel.GetById 1ms app.codeStats 1ms

/libcopybit/msm_mdp.h

http://github.com/CyanogenMod/android_device_zte_blade
C Header | 243 lines | 183 code | 34 blank | 26 comment | 0 complexity | 674ee6dd989f278e2e211926c0bd69d0 MD5 | raw file
  1/* include/linux/msm_mdp.h
  2 *
  3 * Copyright (C) 2007 Google Incorporated
  4 * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
  5 *
  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.
  9 *
 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.
 14 */
 15#ifndef _MSM_MDP_H_
 16#define _MSM_MDP_H_
 17
 18#include <linux/types.h>
 19#include <linux/fb.h>
 20
 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, \
 33						struct mdp_overlay)
 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, \
 42						struct mdp_overlay)
 43#define MSMFB_OVERLAY_PLAY_ENABLE     _IOW(MSMFB_IOCTL_MAGIC, 141, unsigned int)
 44#define MSMFB_OVERLAY_BLT       _IOWR(MSMFB_IOCTL_MAGIC, 142, \
 45						struct msmfb_overlay_blt)
 46#define MSMFB_OVERLAY_BLT_OFFSET     _IOW(MSMFB_IOCTL_MAGIC, 143, unsigned int)
 47#define MSMFB_HISTOGRAM_START	_IO(MSMFB_IOCTL_MAGIC, 144)
 48#define MSMFB_HISTOGRAM_STOP	_IO(MSMFB_IOCTL_MAGIC, 145)
 49
 50#define MSMFB_OVERLAY_3D       _IOWR(MSMFB_IOCTL_MAGIC, 146, \
 51						struct msmfb_overlay_3d)
 52
 53#define MDP_IMGTYPE2_START 0x10000
 54
 55enum {
 56	MDP_RGB_565,      /* RGB 565 planer */
 57	MDP_XRGB_8888,    /* RGB 888 padded */
 58	MDP_Y_CBCR_H2V2,  /* Y and CbCr, pseudo planer w/ Cb is in MSB */
 59	MDP_ARGB_8888,    /* ARGB 888 */
 60	MDP_RGB_888,      /* RGB 888 planer */
 61	MDP_Y_CRCB_H2V2,  /* Y and CrCb, pseudo planer w/ Cr is in MSB */
 62	MDP_YCRYCB_H2V1,  /* YCrYCb interleave */
 63	MDP_Y_CRCB_H2V1,  /* Y and CrCb, pseduo planer w/ Cr is in MSB */
 64	MDP_Y_CBCR_H2V1,   /* Y and CrCb, pseduo planer w/ Cr is in MSB */
 65	MDP_RGBA_8888,    /* ARGB 888 */
 66	MDP_BGRA_8888,	  /* ABGR 888 */
 67	MDP_RGBX_8888,	  /* RGBX 888 */
 68	MDP_Y_CRCB_H2V2_TILE,  /* Y and CrCb, pseudo planer tile */
 69	MDP_Y_CBCR_H2V2_TILE,  /* Y and CbCr, pseudo planer tile */
 70	MDP_Y_CR_CB_H2V2,  /* Y, Cr and Cb, planar */
 71	MDP_Y_CB_CR_H2V2,  /* Y, Cb and Cr, planar */
 72	MDP_IMGTYPE_LIMIT,
 73	MDP_BGR_565 = MDP_IMGTYPE2_START,      /* BGR 565 planer */
 74	MDP_FB_FORMAT,    /* framebuffer format */
 75	MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */
 76};
 77
 78enum {
 79	PMEM_IMG,
 80	FB_IMG,
 81};
 82
 83/* mdp_blit_req flag values */
 84#define MDP_ROT_NOP 0
 85#define MDP_FLIP_LR 0x1
 86#define MDP_FLIP_UD 0x2
 87#define MDP_ROT_90 0x4
 88#define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
 89#define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
 90#define MDP_DITHER 0x8
 91#define MDP_BLUR 0x10
 92#define MDP_BLEND_FG_PREMULT 0x20000
 93#define MDP_DEINTERLACE 0x80000000
 94#define MDP_SHARPENING  0x40000000
 95#define MDP_NO_DMA_BARRIER_START	0x20000000
 96#define MDP_NO_DMA_BARRIER_END		0x10000000
 97#define MDP_NO_BLIT			0x08000000
 98#define MDP_BLIT_WITH_DMA_BARRIERS	0x000
 99#define MDP_BLIT_WITH_NO_DMA_BARRIERS    \
100	(MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END)
101#define MDP_BLIT_SRC_GEM                0x04000000
102#define MDP_BLIT_DST_GEM                0x02000000
103#define MDP_BLIT_NON_CACHED		0x01000000
104#define MDP_OV_PIPE_SHARE		0x00800000
105#define MDP_DEINTERLACE_ODD		0x00400000
106#define MDP_OV_PLAY_NOWAIT		0x00200000
107
108#define MDP_TRANSP_NOP 0xffffffff
109#define MDP_ALPHA_NOP 0xff
110
111#define MDP_FB_PAGE_PROTECTION_NONCACHED         (0)
112#define MDP_FB_PAGE_PROTECTION_WRITECOMBINE      (1)
113#define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2)
114#define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE    (3)
115#define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE  (4)
116/* Sentinel: Don't use! */
117#define MDP_FB_PAGE_PROTECTION_INVALID           (5)
118/* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */
119#define MDP_NUM_FB_PAGE_PROTECTION_VALUES        (5)
120
121struct mdp_rect {
122	uint32_t x;
123	uint32_t y;
124	uint32_t w;
125	uint32_t h;
126};
127
128struct mdp_img {
129	uint32_t width;
130	uint32_t height;
131	uint32_t format;
132	uint32_t offset;
133	int memory_id;		/* the file descriptor */
134	uint32_t priv;
135};
136
137/*
138 * {3x3} + {3} ccs matrix
139 */
140
141#define MDP_CCS_RGB2YUV 	0
142#define MDP_CCS_YUV2RGB 	1
143
144#define MDP_CCS_SIZE	9
145#define MDP_BV_SIZE	3
146
147struct mdp_ccs {
148	int direction;			/* MDP_CCS_RGB2YUV or YUV2RGB */
149	uint16_t ccs[MDP_CCS_SIZE];	/* 3x3 color coefficients */
150	uint16_t bv[MDP_BV_SIZE];	/* 1x3 bias vector */
151};
152
153/* The version of the mdp_blit_req structure so that
154 * user applications can selectively decide which functionality
155 * to include
156 */
157
158#define MDP_BLIT_REQ_VERSION 2
159
160struct mdp_blit_req {
161	struct mdp_img src;
162	struct mdp_img dst;
163	struct mdp_rect src_rect;
164	struct mdp_rect dst_rect;
165	uint32_t alpha;
166	uint32_t transp_mask;
167	uint32_t flags;
168	int sharpening_strength;  /* -127 <--> 127, default 64 */
169};
170
171struct mdp_blit_req_list {
172	uint32_t count;
173	struct mdp_blit_req req[];
174};
175
176#define MSMFB_DATA_VERSION 2
177
178struct msmfb_data {
179	uint32_t offset;
180	int memory_id;
181	int id;
182	uint32_t flags;
183	uint32_t priv;
184};
185
186#define MSMFB_NEW_REQUEST -1
187
188struct msmfb_overlay_data {
189	uint32_t id;
190	struct msmfb_data data;
191};
192
193struct msmfb_img {
194	uint32_t width;
195	uint32_t height;
196	uint32_t format;
197};
198
199struct mdp_overlay {
200	struct msmfb_img src;
201	struct mdp_rect src_rect;
202	struct mdp_rect dst_rect;
203	uint32_t z_order;	/* stage number */
204	uint32_t is_fg;		/* control alpha & transp */
205	uint32_t alpha;
206	uint32_t transp_mask;
207	uint32_t flags;
208	uint32_t id;
209	uint32_t user_data[8];
210};
211
212struct msmfb_overlay_3d {
213	uint32_t is_3d;
214	uint32_t width;
215	uint32_t height;
216};
217
218
219struct msmfb_overlay_blt {
220	uint32_t enable;
221	struct msmfb_data data;
222};
223
224struct mdp_histogram {
225	uint32_t frame_cnt;
226	uint32_t bin_cnt;
227	uint32_t *r;
228	uint32_t *g;
229	uint32_t *b;
230};
231
232struct mdp_page_protection {
233	uint32_t page_protection;
234};
235
236#ifdef __KERNEL__
237
238/* get the framebuffer physical address information */
239int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num);
240
241#endif
242
243#endif /*_MSM_MDP_H_*/