blob: f6229b53d0ebfd6fad03f112d8a8b3a2ba14253b [file] [log] [blame]
Daniel Walkerda6df072010-04-23 16:04:20 -07001/* include/linux/msm_mdp.h
2 *
3 * Copyright (C) 2007 Google Incorporated
Padmanabhan Komandurud9f38b02012-02-02 18:57:03 +05304 * Copyright (c) 2012 Code Aurora Forum. All rights reserved.
Daniel Walkerda6df072010-04-23 16:04:20 -07005 *
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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/fb.h>
Daniel Walkerda6df072010-04-23 16:04:20 -070020
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)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070024#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)
Carl Vanderlipba093a22011-11-22 13:59:59 -080028#define MSMFB_HISTOGRAM _IOWR(MSMFB_IOCTL_MAGIC, 132, struct mdp_histogram_data)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070029/* 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)
Kuogee Hsieh586fd162012-02-14 15:24:16 -080035
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036#define MSMFB_OVERLAY_PLAY _IOW(MSMFB_IOCTL_MAGIC, 137, \
37 struct msmfb_overlay_data)
Kuogee Hsieh586fd162012-02-14 15:24:16 -080038#define MSMFB_OVERLAY_QUEUE MSMFB_OVERLAY_PLAY
39
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#define MSMFB_GET_PAGE_PROTECTION _IOR(MSMFB_IOCTL_MAGIC, 138, \
41 struct mdp_page_protection)
42#define MSMFB_SET_PAGE_PROTECTION _IOW(MSMFB_IOCTL_MAGIC, 139, \
43 struct mdp_page_protection)
44#define MSMFB_OVERLAY_GET _IOR(MSMFB_IOCTL_MAGIC, 140, \
45 struct mdp_overlay)
46#define MSMFB_OVERLAY_PLAY_ENABLE _IOW(MSMFB_IOCTL_MAGIC, 141, unsigned int)
47#define MSMFB_OVERLAY_BLT _IOWR(MSMFB_IOCTL_MAGIC, 142, \
48 struct msmfb_overlay_blt)
49#define MSMFB_OVERLAY_BLT_OFFSET _IOW(MSMFB_IOCTL_MAGIC, 143, unsigned int)
Carl Vanderlipba093a22011-11-22 13:59:59 -080050#define MSMFB_HISTOGRAM_START _IOR(MSMFB_IOCTL_MAGIC, 144, \
51 struct mdp_histogram_start_req)
52#define MSMFB_HISTOGRAM_STOP _IOR(MSMFB_IOCTL_MAGIC, 145, unsigned int)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053#define MSMFB_NOTIFY_UPDATE _IOW(MSMFB_IOCTL_MAGIC, 146, unsigned int)
54
55#define MSMFB_OVERLAY_3D _IOWR(MSMFB_IOCTL_MAGIC, 147, \
56 struct msmfb_overlay_3d)
57
kuogee hsieh405dc302011-07-21 15:06:59 -070058#define MSMFB_MIXER_INFO _IOWR(MSMFB_IOCTL_MAGIC, 148, \
59 struct msmfb_mixer_info_req)
Nagamalleswararao Ganji0737d652011-10-14 02:02:33 -070060#define MSMFB_OVERLAY_PLAY_WAIT _IOWR(MSMFB_IOCTL_MAGIC, 149, \
61 struct msmfb_overlay_data)
Vinay Kalia27020d12011-10-14 17:50:29 -070062#define MSMFB_WRITEBACK_INIT _IO(MSMFB_IOCTL_MAGIC, 150)
Vinay Kaliae1ba2702011-12-21 16:24:52 -080063#define MSMFB_WRITEBACK_START _IO(MSMFB_IOCTL_MAGIC, 151)
64#define MSMFB_WRITEBACK_STOP _IO(MSMFB_IOCTL_MAGIC, 152)
Vinay Kalia27020d12011-10-14 17:50:29 -070065#define MSMFB_WRITEBACK_QUEUE_BUFFER _IOW(MSMFB_IOCTL_MAGIC, 153, \
66 struct msmfb_data)
67#define MSMFB_WRITEBACK_DEQUEUE_BUFFER _IOW(MSMFB_IOCTL_MAGIC, 154, \
68 struct msmfb_data)
69#define MSMFB_WRITEBACK_TERMINATE _IO(MSMFB_IOCTL_MAGIC, 155)
Pravin Tamkhane02a40682011-11-29 14:17:01 -080070#define MSMFB_MDP_PP _IOWR(MSMFB_IOCTL_MAGIC, 156, struct msmfb_mdp_pp)
Padmanabhan Komanduruf3b0c232012-07-27 20:46:06 +053071#define MSMFB_OVERLAY_VSYNC_CTRL _IOW(MSMFB_IOCTL_MAGIC, 160, unsigned int)
72#define MSMFB_VSYNC_CTRL _IOW(MSMFB_IOCTL_MAGIC, 161, unsigned int)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070073#define FB_TYPE_3D_PANEL 0x10101010
74#define MDP_IMGTYPE2_START 0x10000
75#define MSMFB_DRIVER_VERSION 0xF9E8D701
Daniel Walkerda6df072010-04-23 16:04:20 -070076
77enum {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070078 NOTIFY_UPDATE_START,
79 NOTIFY_UPDATE_STOP,
80};
81
82enum {
83 MDP_RGB_565, /* RGB 565 planer */
84 MDP_XRGB_8888, /* RGB 888 padded */
85 MDP_Y_CBCR_H2V2, /* Y and CbCr, pseudo planer w/ Cb is in MSB */
Padmanabhan Komandurud9f38b02012-02-02 18:57:03 +053086 MDP_Y_CBCR_H2V2_ADRENO,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070087 MDP_ARGB_8888, /* ARGB 888 */
88 MDP_RGB_888, /* RGB 888 planer */
89 MDP_Y_CRCB_H2V2, /* Y and CrCb, pseudo planer w/ Cr is in MSB */
90 MDP_YCRYCB_H2V1, /* YCrYCb interleave */
91 MDP_Y_CRCB_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
92 MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
Adrian Salido-Morenoe55fa122012-05-29 15:36:08 -070093 MDP_Y_CRCB_H1V2,
94 MDP_Y_CBCR_H1V2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070095 MDP_RGBA_8888, /* ARGB 888 */
96 MDP_BGRA_8888, /* ABGR 888 */
97 MDP_RGBX_8888, /* RGBX 888 */
98 MDP_Y_CRCB_H2V2_TILE, /* Y and CrCb, pseudo planer tile */
99 MDP_Y_CBCR_H2V2_TILE, /* Y and CbCr, pseudo planer tile */
100 MDP_Y_CR_CB_H2V2, /* Y, Cr and Cb, planar */
Pradeep Jilagam9b4a6be2011-10-03 17:19:20 +0530101 MDP_Y_CR_CB_GH2V2, /* Y, Cr and Cb, planar aligned to Android YV12 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700102 MDP_Y_CB_CR_H2V2, /* Y, Cb and Cr, planar */
103 MDP_Y_CRCB_H1V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
104 MDP_Y_CBCR_H1V1, /* Y and CbCr, pseduo planer w/ Cb is in MSB */
Adrian Salido-Moreno2b410482011-08-15 10:40:40 -0700105 MDP_YCRCB_H1V1, /* YCrCb interleave */
106 MDP_YCBCR_H1V1, /* YCbCr interleave */
Adrian Salido-Morenoe55fa122012-05-29 15:36:08 -0700107 MDP_BGR_565, /* BGR 565 planer */
Adrian Salido-Morenod559ef12012-07-12 20:16:14 -0700108 MDP_BGR_888, /* BGR 888 */
Adrian Salido-Moreno330c0bf2012-08-22 14:15:33 -0700109 MDP_Y_CBCR_H2V2_VENUS,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700110 MDP_IMGTYPE_LIMIT,
kuogee hsieh1ce7e4c2012-01-13 14:05:54 -0800111 MDP_RGB_BORDERFILL, /* border fill pipe */
Adrian Salido-Morenoe55fa122012-05-29 15:36:08 -0700112 MDP_FB_FORMAT = MDP_IMGTYPE2_START, /* framebuffer format */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700113 MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */
Daniel Walkerda6df072010-04-23 16:04:20 -0700114};
115
116enum {
117 PMEM_IMG,
118 FB_IMG,
119};
120
Liyuan Lid9736632011-11-11 13:47:59 -0800121enum {
122 HSIC_HUE = 0,
123 HSIC_SAT,
124 HSIC_INT,
125 HSIC_CON,
126 NUM_HSIC_PARAM,
127};
128
Adrian Salido-Moreno1857f062012-05-29 17:57:28 -0700129#define MDSS_MDP_ROT_ONLY 0x80
Adrian Salido-Morenoe55fa122012-05-29 15:36:08 -0700130#define MDSS_MDP_RIGHT_MIXER 0x100
131
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700132/* mdp_blit_req flag values */
133#define MDP_ROT_NOP 0
134#define MDP_FLIP_LR 0x1
135#define MDP_FLIP_UD 0x2
136#define MDP_ROT_90 0x4
137#define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
138#define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
139#define MDP_DITHER 0x8
140#define MDP_BLUR 0x10
141#define MDP_BLEND_FG_PREMULT 0x20000
142#define MDP_DEINTERLACE 0x80000000
143#define MDP_SHARPENING 0x40000000
144#define MDP_NO_DMA_BARRIER_START 0x20000000
145#define MDP_NO_DMA_BARRIER_END 0x10000000
146#define MDP_NO_BLIT 0x08000000
147#define MDP_BLIT_WITH_DMA_BARRIERS 0x000
148#define MDP_BLIT_WITH_NO_DMA_BARRIERS \
149 (MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END)
150#define MDP_BLIT_SRC_GEM 0x04000000
151#define MDP_BLIT_DST_GEM 0x02000000
152#define MDP_BLIT_NON_CACHED 0x01000000
153#define MDP_OV_PIPE_SHARE 0x00800000
154#define MDP_DEINTERLACE_ODD 0x00400000
155#define MDP_OV_PLAY_NOWAIT 0x00200000
156#define MDP_SOURCE_ROTATED_90 0x00100000
Carl Vanderlipdfe57512012-07-23 12:34:47 -0700157#define MDP_OVERLAY_PP_CFG_EN 0x00080000
Ajay Singh Parmar4c7ccb32012-02-21 12:56:04 +0530158#define MDP_BACKEND_COMPOSITION 0x00040000
Nagamalleswararao Ganji880f8472011-12-14 03:52:28 -0800159#define MDP_BORDERFILL_SUPPORTED 0x00010000
160#define MDP_SECURE_OVERLAY_SESSION 0x00008000
161#define MDP_MEMORY_ID_TYPE_FB 0x00001000
Daniel Walkerda6df072010-04-23 16:04:20 -0700162
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700163#define MDP_TRANSP_NOP 0xffffffff
164#define MDP_ALPHA_NOP 0xff
165
166#define MDP_FB_PAGE_PROTECTION_NONCACHED (0)
167#define MDP_FB_PAGE_PROTECTION_WRITECOMBINE (1)
168#define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2)
169#define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE (3)
170#define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE (4)
171/* Sentinel: Don't use! */
172#define MDP_FB_PAGE_PROTECTION_INVALID (5)
173/* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */
174#define MDP_NUM_FB_PAGE_PROTECTION_VALUES (5)
Daniel Walkerda6df072010-04-23 16:04:20 -0700175
176struct mdp_rect {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700177 uint32_t x;
178 uint32_t y;
179 uint32_t w;
180 uint32_t h;
Daniel Walkerda6df072010-04-23 16:04:20 -0700181};
182
183struct mdp_img {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700184 uint32_t width;
185 uint32_t height;
186 uint32_t format;
187 uint32_t offset;
Daniel Walkerda6df072010-04-23 16:04:20 -0700188 int memory_id; /* the file descriptor */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700189 uint32_t priv;
Daniel Walkerda6df072010-04-23 16:04:20 -0700190};
191
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700192/*
193 * {3x3} + {3} ccs matrix
194 */
195
196#define MDP_CCS_RGB2YUV 0
197#define MDP_CCS_YUV2RGB 1
198
199#define MDP_CCS_SIZE 9
200#define MDP_BV_SIZE 3
201
202struct mdp_ccs {
203 int direction; /* MDP_CCS_RGB2YUV or YUV2RGB */
204 uint16_t ccs[MDP_CCS_SIZE]; /* 3x3 color coefficients */
205 uint16_t bv[MDP_BV_SIZE]; /* 1x3 bias vector */
206};
207
Nagamalleswararao Ganji4b991722011-01-28 13:24:34 -0800208struct mdp_csc {
209 int id;
210 uint32_t csc_mv[9];
211 uint32_t csc_pre_bv[3];
212 uint32_t csc_post_bv[3];
213 uint32_t csc_pre_lv[6];
214 uint32_t csc_post_lv[6];
215};
216
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700217/* The version of the mdp_blit_req structure so that
218 * user applications can selectively decide which functionality
219 * to include
220 */
221
222#define MDP_BLIT_REQ_VERSION 2
223
Daniel Walkerda6df072010-04-23 16:04:20 -0700224struct mdp_blit_req {
225 struct mdp_img src;
226 struct mdp_img dst;
227 struct mdp_rect src_rect;
228 struct mdp_rect dst_rect;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700229 uint32_t alpha;
230 uint32_t transp_mask;
231 uint32_t flags;
232 int sharpening_strength; /* -127 <--> 127, default 64 */
Daniel Walkerda6df072010-04-23 16:04:20 -0700233};
234
235struct mdp_blit_req_list {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700236 uint32_t count;
Daniel Walkerda6df072010-04-23 16:04:20 -0700237 struct mdp_blit_req req[];
238};
239
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700240#define MSMFB_DATA_VERSION 2
241
242struct msmfb_data {
243 uint32_t offset;
244 int memory_id;
245 int id;
246 uint32_t flags;
247 uint32_t priv;
Vinay Kaliae1ba2702011-12-21 16:24:52 -0800248 uint32_t iova;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700249};
250
251#define MSMFB_NEW_REQUEST -1
252
253struct msmfb_overlay_data {
254 uint32_t id;
255 struct msmfb_data data;
256 uint32_t version_key;
257 struct msmfb_data plane1_data;
258 struct msmfb_data plane2_data;
Adrian Salido-Moreno1857f062012-05-29 17:57:28 -0700259 struct msmfb_data dst_data;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700260};
261
262struct msmfb_img {
263 uint32_t width;
264 uint32_t height;
265 uint32_t format;
266};
267
Vinay Kalia27020d12011-10-14 17:50:29 -0700268#define MSMFB_WRITEBACK_DEQUEUE_BLOCKING 0x1
269struct msmfb_writeback_data {
270 struct msmfb_data buf_info;
271 struct msmfb_img img;
272};
273
Carl Vanderlipdfe57512012-07-23 12:34:47 -0700274#define MDP_PP_OPS_READ 0x2
275#define MDP_PP_OPS_WRITE 0x4
276
277struct mdp_qseed_cfg {
278 uint32_t table_num;
279 uint32_t ops;
280 uint32_t len;
281 uint32_t *data;
282};
283
284struct mdp_qseed_cfg_data {
285 uint32_t block;
286 struct mdp_qseed_cfg qseed_data;
287};
288
289#define MDP_OVERLAY_PP_CSC_CFG 0x1
290#define MDP_OVERLAY_PP_QSEED_CFG 0x2
291
292#define MDP_CSC_FLAG_ENABLE 0x1
293#define MDP_CSC_FLAG_YUV_IN 0x2
294#define MDP_CSC_FLAG_YUV_OUT 0x4
295
296struct mdp_csc_cfg {
297 /* flags for enable CSC, toggling RGB,YUV input/output */
298 uint32_t flags;
299 uint32_t csc_mv[9];
300 uint32_t csc_pre_bv[3];
301 uint32_t csc_post_bv[3];
302 uint32_t csc_pre_lv[6];
303 uint32_t csc_post_lv[6];
304};
305
306struct mdp_csc_cfg_data {
307 uint32_t block;
308 struct mdp_csc_cfg csc_data;
309};
310
311struct mdp_overlay_pp_params {
312 uint32_t config_ops;
313 struct mdp_csc_cfg csc_cfg;
314 struct mdp_qseed_cfg qseed_cfg[2];
315};
316
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700317struct mdp_overlay {
318 struct msmfb_img src;
319 struct mdp_rect src_rect;
320 struct mdp_rect dst_rect;
321 uint32_t z_order; /* stage number */
322 uint32_t is_fg; /* control alpha & transp */
323 uint32_t alpha;
324 uint32_t transp_mask;
325 uint32_t flags;
326 uint32_t id;
327 uint32_t user_data[8];
Carl Vanderlipdfe57512012-07-23 12:34:47 -0700328 struct mdp_overlay_pp_params overlay_pp_cfg;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700329};
330
331struct msmfb_overlay_3d {
332 uint32_t is_3d;
333 uint32_t width;
334 uint32_t height;
335};
336
337
338struct msmfb_overlay_blt {
339 uint32_t enable;
340 uint32_t offset;
341 uint32_t width;
342 uint32_t height;
343 uint32_t bpp;
344};
345
346struct mdp_histogram {
347 uint32_t frame_cnt;
348 uint32_t bin_cnt;
349 uint32_t *r;
350 uint32_t *g;
351 uint32_t *b;
352};
353
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800354
355/*
356
Ken Zhang6a431632012-08-08 16:46:22 -0400357 mdp_block_type defines the identifiers for pipes in MDP 4.3 and up
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800358
359 MDP_BLOCK_RESERVED is provided for backward compatibility and is
360 deprecated. It corresponds to DMA_P. So MDP_BLOCK_DMA_P should be used
361 instead.
362
Ken Zhang6a431632012-08-08 16:46:22 -0400363 MDP_LOGICAL_BLOCK_DISP_0 identifies the display pipe which fb0 uses,
364 same for others.
365
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800366*/
367
368enum {
369 MDP_BLOCK_RESERVED = 0,
370 MDP_BLOCK_OVERLAY_0,
371 MDP_BLOCK_OVERLAY_1,
372 MDP_BLOCK_VG_1,
373 MDP_BLOCK_VG_2,
374 MDP_BLOCK_RGB_1,
375 MDP_BLOCK_RGB_2,
376 MDP_BLOCK_DMA_P,
377 MDP_BLOCK_DMA_S,
378 MDP_BLOCK_DMA_E,
Pravin Tamkhaneb18c9e22012-04-13 18:29:34 -0700379 MDP_BLOCK_OVERLAY_2,
Ken Zhang6a431632012-08-08 16:46:22 -0400380 MDP_LOGICAL_BLOCK_DISP_0 = 0x1000,
381 MDP_LOGICAL_BLOCK_DISP_1,
382 MDP_LOGICAL_BLOCK_DISP_2,
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800383 MDP_BLOCK_MAX,
384};
385
Carl Vanderlipba093a22011-11-22 13:59:59 -0800386/*
387 * mdp_histogram_start_req is used to provide the parameters for
388 * histogram start request
389 */
390
391struct mdp_histogram_start_req {
392 uint32_t block;
393 uint8_t frame_cnt;
394 uint8_t bit_mask;
395 uint8_t num_bins;
396};
397
398/*
399 * mdp_histogram_data is used to return the histogram data, once
400 * the histogram is done/stopped/cance
401 */
402
403struct mdp_histogram_data {
404 uint32_t block;
405 uint8_t bin_cnt;
406 uint32_t *c0;
407 uint32_t *c1;
408 uint32_t *c2;
Carl Vanderlip7b8b6402012-03-01 10:58:03 -0800409 uint32_t *extra_info;
Carl Vanderlipba093a22011-11-22 13:59:59 -0800410};
411
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800412struct mdp_pcc_coeff {
413 uint32_t c, r, g, b, rr, gg, bb, rg, gb, rb, rgb_0, rgb_1;
414};
415
416struct mdp_pcc_cfg_data {
417 uint32_t block;
418 uint32_t ops;
419 struct mdp_pcc_coeff r, g, b;
420};
421
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800422enum {
423 mdp_lut_igc,
424 mdp_lut_pgc,
425 mdp_lut_hist,
426 mdp_lut_max,
427};
428
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800429struct mdp_igc_lut_data {
430 uint32_t block;
431 uint32_t len, ops;
432 uint32_t *c0_c1_data;
433 uint32_t *c2_data;
434};
435
436struct mdp_ar_gc_lut_data {
437 uint32_t x_start;
438 uint32_t slope;
439 uint32_t offset;
440};
441
442struct mdp_pgc_lut_data {
443 uint32_t block;
444 uint32_t flags;
445 uint8_t num_r_stages;
446 uint8_t num_g_stages;
447 uint8_t num_b_stages;
448 struct mdp_ar_gc_lut_data *r_data;
449 struct mdp_ar_gc_lut_data *g_data;
450 struct mdp_ar_gc_lut_data *b_data;
451};
452
453
454struct mdp_hist_lut_data {
455 uint32_t block;
456 uint32_t ops;
457 uint32_t len;
458 uint32_t *data;
459};
460
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800461struct mdp_lut_cfg_data {
462 uint32_t lut_type;
463 union {
464 struct mdp_igc_lut_data igc_lut_data;
465 struct mdp_pgc_lut_data pgc_lut_data;
466 struct mdp_hist_lut_data hist_lut_data;
467 } data;
468};
469
Carl Vanderlipf0fd8e72012-05-03 15:08:20 -0700470struct mdp_bl_scale_data {
471 uint32_t min_lvl;
472 uint32_t scale;
473};
Pravin Tamkhane67726da2012-04-13 11:59:11 -0700474
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800475enum {
476 mdp_op_pcc_cfg,
477 mdp_op_csc_cfg,
478 mdp_op_lut_cfg,
Pravin Tamkhane67726da2012-04-13 11:59:11 -0700479 mdp_op_qseed_cfg,
Carl Vanderlipf0fd8e72012-05-03 15:08:20 -0700480 mdp_bl_scale_cfg,
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800481 mdp_op_max,
482};
483
484struct msmfb_mdp_pp {
485 uint32_t op;
486 union {
487 struct mdp_pcc_cfg_data pcc_cfg_data;
488 struct mdp_csc_cfg_data csc_cfg_data;
489 struct mdp_lut_cfg_data lut_cfg_data;
Pravin Tamkhane67726da2012-04-13 11:59:11 -0700490 struct mdp_qseed_cfg_data qseed_cfg_data;
Carl Vanderlipf0fd8e72012-05-03 15:08:20 -0700491 struct mdp_bl_scale_data bl_scale_data;
Pravin Tamkhane02a40682011-11-29 14:17:01 -0800492 } data;
493};
494
495
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700496struct mdp_page_protection {
497 uint32_t page_protection;
498};
499
kuogee hsieh405dc302011-07-21 15:06:59 -0700500
501struct mdp_mixer_info {
502 int pndx;
503 int pnum;
504 int ptype;
505 int mixer_num;
506 int z_order;
507};
508
509#define MAX_PIPE_PER_MIXER 4
510
511struct msmfb_mixer_info_req {
512 int mixer_num;
513 int cnt;
514 struct mdp_mixer_info info[MAX_PIPE_PER_MIXER];
515};
516
Ravishangar Kalyanam6bc448a2012-03-14 11:31:52 -0700517enum {
518 DISPLAY_SUBSYSTEM_ID,
519 ROTATOR_SUBSYSTEM_ID,
520};
kuogee hsieh405dc302011-07-21 15:06:59 -0700521
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700522#ifdef __KERNEL__
523
524/* get the framebuffer physical address information */
Ravishangar Kalyanam6bc448a2012-03-14 11:31:52 -0700525int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num,
526 int subsys_id);
Vinay Kalia27020d12011-10-14 17:50:29 -0700527struct fb_info *msm_fb_get_writeback_fb(void);
528int msm_fb_writeback_init(struct fb_info *info);
Vinay Kaliae1ba2702011-12-21 16:24:52 -0800529int msm_fb_writeback_start(struct fb_info *info);
Vinay Kalia27020d12011-10-14 17:50:29 -0700530int msm_fb_writeback_queue_buffer(struct fb_info *info,
531 struct msmfb_data *data);
532int msm_fb_writeback_dequeue_buffer(struct fb_info *info,
533 struct msmfb_data *data);
Vinay Kaliae1ba2702011-12-21 16:24:52 -0800534int msm_fb_writeback_stop(struct fb_info *info);
Vinay Kalia27020d12011-10-14 17:50:29 -0700535int msm_fb_writeback_terminate(struct fb_info *info);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700536#endif
537
538#endif /*_MSM_MDP_H_*/