Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 1 | /* include/linux/msm_mdp.h |
| 2 | * |
| 3 | * Copyright (C) 2007 Google Incorporated |
Ken Zhang | 420dd20 | 2013-01-08 14:28:20 -0500 | [diff] [blame] | 4 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 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> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | #include <linux/fb.h> |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 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) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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) |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 28 | #define MSMFB_HISTOGRAM _IOWR(MSMFB_IOCTL_MAGIC, 132, struct mdp_histogram_data) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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) |
Kuogee Hsieh | 586fd16 | 2012-02-14 15:24:16 -0800 | [diff] [blame] | 35 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 36 | #define MSMFB_OVERLAY_PLAY _IOW(MSMFB_IOCTL_MAGIC, 137, \ |
| 37 | struct msmfb_overlay_data) |
Kuogee Hsieh | 586fd16 | 2012-02-14 15:24:16 -0800 | [diff] [blame] | 38 | #define MSMFB_OVERLAY_QUEUE MSMFB_OVERLAY_PLAY |
| 39 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 40 | #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 Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 50 | #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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 53 | #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 hsieh | 405dc30 | 2011-07-21 15:06:59 -0700 | [diff] [blame] | 58 | #define MSMFB_MIXER_INFO _IOWR(MSMFB_IOCTL_MAGIC, 148, \ |
| 59 | struct msmfb_mixer_info_req) |
Nagamalleswararao Ganji | 0737d65 | 2011-10-14 02:02:33 -0700 | [diff] [blame] | 60 | #define MSMFB_OVERLAY_PLAY_WAIT _IOWR(MSMFB_IOCTL_MAGIC, 149, \ |
| 61 | struct msmfb_overlay_data) |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 62 | #define MSMFB_WRITEBACK_INIT _IO(MSMFB_IOCTL_MAGIC, 150) |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 63 | #define MSMFB_WRITEBACK_START _IO(MSMFB_IOCTL_MAGIC, 151) |
| 64 | #define MSMFB_WRITEBACK_STOP _IO(MSMFB_IOCTL_MAGIC, 152) |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 65 | #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 Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 70 | #define MSMFB_MDP_PP _IOWR(MSMFB_IOCTL_MAGIC, 156, struct msmfb_mdp_pp) |
Padmanabhan Komanduru | f3b0c23 | 2012-07-27 20:46:06 +0530 | [diff] [blame] | 71 | #define MSMFB_OVERLAY_VSYNC_CTRL _IOW(MSMFB_IOCTL_MAGIC, 160, unsigned int) |
| 72 | #define MSMFB_VSYNC_CTRL _IOW(MSMFB_IOCTL_MAGIC, 161, unsigned int) |
Vishnuvardhan Prodduturi | feb2629 | 2013-02-06 18:23:35 +0530 | [diff] [blame] | 73 | #define MSMFB_BUFFER_SYNC _IOW(MSMFB_IOCTL_MAGIC, 162, struct mdp_buf_sync) |
Kalyan Thota | 9284a27 | 2012-11-02 20:55:30 +0530 | [diff] [blame] | 74 | #define MSMFB_OVERLAY_COMMIT _IO(MSMFB_IOCTL_MAGIC, 163) |
Vishnuvardhan Prodduturi | feb2629 | 2013-02-06 18:23:35 +0530 | [diff] [blame] | 75 | #define MSMFB_DISPLAY_COMMIT _IOW(MSMFB_IOCTL_MAGIC, 164, \ |
Ken Zhang | 4e83b93 | 2012-12-02 21:15:47 -0500 | [diff] [blame] | 76 | struct mdp_display_commit) |
Vishnuvardhan Prodduturi | feb2629 | 2013-02-06 18:23:35 +0530 | [diff] [blame] | 77 | #define MSMFB_METADATA_SET _IOW(MSMFB_IOCTL_MAGIC, 165, struct msmfb_metadata) |
Ken Zhang | 420dd20 | 2013-01-08 14:28:20 -0500 | [diff] [blame] | 78 | #define MSMFB_METADATA_GET _IOW(MSMFB_IOCTL_MAGIC, 166, struct msmfb_metadata) |
Kuogee Hsieh | a77eca6 | 2012-09-13 13:22:04 -0700 | [diff] [blame] | 79 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 80 | #define FB_TYPE_3D_PANEL 0x10101010 |
| 81 | #define MDP_IMGTYPE2_START 0x10000 |
| 82 | #define MSMFB_DRIVER_VERSION 0xF9E8D701 |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 83 | |
| 84 | enum { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 85 | NOTIFY_UPDATE_START, |
| 86 | NOTIFY_UPDATE_STOP, |
| 87 | }; |
| 88 | |
| 89 | enum { |
| 90 | MDP_RGB_565, /* RGB 565 planer */ |
| 91 | MDP_XRGB_8888, /* RGB 888 padded */ |
| 92 | MDP_Y_CBCR_H2V2, /* Y and CbCr, pseudo planer w/ Cb is in MSB */ |
Padmanabhan Komanduru | d9f38b0 | 2012-02-02 18:57:03 +0530 | [diff] [blame] | 93 | MDP_Y_CBCR_H2V2_ADRENO, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 94 | MDP_ARGB_8888, /* ARGB 888 */ |
| 95 | MDP_RGB_888, /* RGB 888 planer */ |
| 96 | MDP_Y_CRCB_H2V2, /* Y and CrCb, pseudo planer w/ Cr is in MSB */ |
| 97 | MDP_YCRYCB_H2V1, /* YCrYCb interleave */ |
Pawan Kumar | 42acdef | 2013-03-21 19:55:49 +0530 | [diff] [blame] | 98 | MDP_CBYCRY_H2V1, /* CbYCrY interleave */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 99 | MDP_Y_CRCB_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */ |
| 100 | MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */ |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 101 | MDP_Y_CRCB_H1V2, |
| 102 | MDP_Y_CBCR_H1V2, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 103 | MDP_RGBA_8888, /* ARGB 888 */ |
| 104 | MDP_BGRA_8888, /* ABGR 888 */ |
| 105 | MDP_RGBX_8888, /* RGBX 888 */ |
| 106 | MDP_Y_CRCB_H2V2_TILE, /* Y and CrCb, pseudo planer tile */ |
| 107 | MDP_Y_CBCR_H2V2_TILE, /* Y and CbCr, pseudo planer tile */ |
| 108 | MDP_Y_CR_CB_H2V2, /* Y, Cr and Cb, planar */ |
Pradeep Jilagam | 9b4a6be | 2011-10-03 17:19:20 +0530 | [diff] [blame] | 109 | MDP_Y_CR_CB_GH2V2, /* Y, Cr and Cb, planar aligned to Android YV12 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 110 | MDP_Y_CB_CR_H2V2, /* Y, Cb and Cr, planar */ |
| 111 | MDP_Y_CRCB_H1V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */ |
| 112 | MDP_Y_CBCR_H1V1, /* Y and CbCr, pseduo planer w/ Cb is in MSB */ |
Adrian Salido-Moreno | 2b41048 | 2011-08-15 10:40:40 -0700 | [diff] [blame] | 113 | MDP_YCRCB_H1V1, /* YCrCb interleave */ |
| 114 | MDP_YCBCR_H1V1, /* YCbCr interleave */ |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 115 | MDP_BGR_565, /* BGR 565 planer */ |
Adrian Salido-Moreno | d559ef1 | 2012-07-12 20:16:14 -0700 | [diff] [blame] | 116 | MDP_BGR_888, /* BGR 888 */ |
Adrian Salido-Moreno | 330c0bf | 2012-08-22 14:15:33 -0700 | [diff] [blame] | 117 | MDP_Y_CBCR_H2V2_VENUS, |
Pawan Kumar | 7985438 | 2013-02-14 15:27:12 +0530 | [diff] [blame] | 118 | MDP_BGRX_8888, /* BGRX 8888 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 119 | MDP_IMGTYPE_LIMIT, |
kuogee hsieh | 1ce7e4c | 2012-01-13 14:05:54 -0800 | [diff] [blame] | 120 | MDP_RGB_BORDERFILL, /* border fill pipe */ |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 121 | MDP_FB_FORMAT = MDP_IMGTYPE2_START, /* framebuffer format */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 122 | MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */ |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 123 | }; |
| 124 | |
| 125 | enum { |
| 126 | PMEM_IMG, |
| 127 | FB_IMG, |
| 128 | }; |
| 129 | |
Liyuan Li | d973663 | 2011-11-11 13:47:59 -0800 | [diff] [blame] | 130 | enum { |
| 131 | HSIC_HUE = 0, |
| 132 | HSIC_SAT, |
| 133 | HSIC_INT, |
| 134 | HSIC_CON, |
| 135 | NUM_HSIC_PARAM, |
| 136 | }; |
| 137 | |
Adrian Salido-Moreno | 1857f06 | 2012-05-29 17:57:28 -0700 | [diff] [blame] | 138 | #define MDSS_MDP_ROT_ONLY 0x80 |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 139 | #define MDSS_MDP_RIGHT_MIXER 0x100 |
| 140 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 141 | /* mdp_blit_req flag values */ |
| 142 | #define MDP_ROT_NOP 0 |
| 143 | #define MDP_FLIP_LR 0x1 |
| 144 | #define MDP_FLIP_UD 0x2 |
| 145 | #define MDP_ROT_90 0x4 |
| 146 | #define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR) |
| 147 | #define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR) |
| 148 | #define MDP_DITHER 0x8 |
| 149 | #define MDP_BLUR 0x10 |
| 150 | #define MDP_BLEND_FG_PREMULT 0x20000 |
Padmanabhan Komanduru | dd10bf1 | 2012-10-17 20:27:33 +0530 | [diff] [blame] | 151 | #define MDP_IS_FG 0x40000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 152 | #define MDP_DEINTERLACE 0x80000000 |
| 153 | #define MDP_SHARPENING 0x40000000 |
| 154 | #define MDP_NO_DMA_BARRIER_START 0x20000000 |
| 155 | #define MDP_NO_DMA_BARRIER_END 0x10000000 |
| 156 | #define MDP_NO_BLIT 0x08000000 |
| 157 | #define MDP_BLIT_WITH_DMA_BARRIERS 0x000 |
| 158 | #define MDP_BLIT_WITH_NO_DMA_BARRIERS \ |
| 159 | (MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END) |
| 160 | #define MDP_BLIT_SRC_GEM 0x04000000 |
| 161 | #define MDP_BLIT_DST_GEM 0x02000000 |
| 162 | #define MDP_BLIT_NON_CACHED 0x01000000 |
| 163 | #define MDP_OV_PIPE_SHARE 0x00800000 |
| 164 | #define MDP_DEINTERLACE_ODD 0x00400000 |
| 165 | #define MDP_OV_PLAY_NOWAIT 0x00200000 |
| 166 | #define MDP_SOURCE_ROTATED_90 0x00100000 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 167 | #define MDP_OVERLAY_PP_CFG_EN 0x00080000 |
Ajay Singh Parmar | 4c7ccb3 | 2012-02-21 12:56:04 +0530 | [diff] [blame] | 168 | #define MDP_BACKEND_COMPOSITION 0x00040000 |
Nagamalleswararao Ganji | 880f847 | 2011-12-14 03:52:28 -0800 | [diff] [blame] | 169 | #define MDP_BORDERFILL_SUPPORTED 0x00010000 |
| 170 | #define MDP_SECURE_OVERLAY_SESSION 0x00008000 |
Adrian Salido-Moreno | 9a8485c | 2013-02-06 14:08:28 -0800 | [diff] [blame] | 171 | #define MDP_OV_PIPE_FORCE_DMA 0x00004000 |
Nagamalleswararao Ganji | 880f847 | 2011-12-14 03:52:28 -0800 | [diff] [blame] | 172 | #define MDP_MEMORY_ID_TYPE_FB 0x00001000 |
Sree Sesha Aravind Vadrevu | 3514313 | 2013-03-12 02:32:06 -0700 | [diff] [blame] | 173 | #define MDP_BWC_EN 0x00000400 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 174 | #define MDP_TRANSP_NOP 0xffffffff |
| 175 | #define MDP_ALPHA_NOP 0xff |
| 176 | |
| 177 | #define MDP_FB_PAGE_PROTECTION_NONCACHED (0) |
| 178 | #define MDP_FB_PAGE_PROTECTION_WRITECOMBINE (1) |
| 179 | #define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2) |
| 180 | #define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE (3) |
| 181 | #define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE (4) |
| 182 | /* Sentinel: Don't use! */ |
| 183 | #define MDP_FB_PAGE_PROTECTION_INVALID (5) |
| 184 | /* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */ |
| 185 | #define MDP_NUM_FB_PAGE_PROTECTION_VALUES (5) |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 186 | |
| 187 | struct mdp_rect { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 188 | uint32_t x; |
| 189 | uint32_t y; |
| 190 | uint32_t w; |
| 191 | uint32_t h; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 192 | }; |
| 193 | |
| 194 | struct mdp_img { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 195 | uint32_t width; |
| 196 | uint32_t height; |
| 197 | uint32_t format; |
| 198 | uint32_t offset; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 199 | int memory_id; /* the file descriptor */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 200 | uint32_t priv; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 201 | }; |
| 202 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 203 | /* |
| 204 | * {3x3} + {3} ccs matrix |
| 205 | */ |
| 206 | |
| 207 | #define MDP_CCS_RGB2YUV 0 |
| 208 | #define MDP_CCS_YUV2RGB 1 |
| 209 | |
| 210 | #define MDP_CCS_SIZE 9 |
| 211 | #define MDP_BV_SIZE 3 |
| 212 | |
| 213 | struct mdp_ccs { |
| 214 | int direction; /* MDP_CCS_RGB2YUV or YUV2RGB */ |
| 215 | uint16_t ccs[MDP_CCS_SIZE]; /* 3x3 color coefficients */ |
| 216 | uint16_t bv[MDP_BV_SIZE]; /* 1x3 bias vector */ |
| 217 | }; |
| 218 | |
Nagamalleswararao Ganji | 4b99172 | 2011-01-28 13:24:34 -0800 | [diff] [blame] | 219 | struct mdp_csc { |
| 220 | int id; |
| 221 | uint32_t csc_mv[9]; |
| 222 | uint32_t csc_pre_bv[3]; |
| 223 | uint32_t csc_post_bv[3]; |
| 224 | uint32_t csc_pre_lv[6]; |
| 225 | uint32_t csc_post_lv[6]; |
| 226 | }; |
| 227 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 228 | /* The version of the mdp_blit_req structure so that |
| 229 | * user applications can selectively decide which functionality |
| 230 | * to include |
| 231 | */ |
| 232 | |
| 233 | #define MDP_BLIT_REQ_VERSION 2 |
| 234 | |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 235 | struct mdp_blit_req { |
| 236 | struct mdp_img src; |
| 237 | struct mdp_img dst; |
| 238 | struct mdp_rect src_rect; |
| 239 | struct mdp_rect dst_rect; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 240 | uint32_t alpha; |
| 241 | uint32_t transp_mask; |
| 242 | uint32_t flags; |
| 243 | int sharpening_strength; /* -127 <--> 127, default 64 */ |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 244 | }; |
| 245 | |
| 246 | struct mdp_blit_req_list { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 247 | uint32_t count; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 248 | struct mdp_blit_req req[]; |
| 249 | }; |
| 250 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 251 | #define MSMFB_DATA_VERSION 2 |
| 252 | |
| 253 | struct msmfb_data { |
| 254 | uint32_t offset; |
| 255 | int memory_id; |
| 256 | int id; |
| 257 | uint32_t flags; |
| 258 | uint32_t priv; |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 259 | uint32_t iova; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 260 | }; |
| 261 | |
| 262 | #define MSMFB_NEW_REQUEST -1 |
| 263 | |
| 264 | struct msmfb_overlay_data { |
| 265 | uint32_t id; |
| 266 | struct msmfb_data data; |
| 267 | uint32_t version_key; |
| 268 | struct msmfb_data plane1_data; |
| 269 | struct msmfb_data plane2_data; |
Adrian Salido-Moreno | 1857f06 | 2012-05-29 17:57:28 -0700 | [diff] [blame] | 270 | struct msmfb_data dst_data; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 271 | }; |
| 272 | |
| 273 | struct msmfb_img { |
| 274 | uint32_t width; |
| 275 | uint32_t height; |
| 276 | uint32_t format; |
| 277 | }; |
| 278 | |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 279 | #define MSMFB_WRITEBACK_DEQUEUE_BLOCKING 0x1 |
| 280 | struct msmfb_writeback_data { |
| 281 | struct msmfb_data buf_info; |
| 282 | struct msmfb_img img; |
| 283 | }; |
| 284 | |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 285 | #define MDP_PP_OPS_ENABLE 0x1 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 286 | #define MDP_PP_OPS_READ 0x2 |
| 287 | #define MDP_PP_OPS_WRITE 0x4 |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 288 | #define MDP_PP_OPS_DISABLE 0x8 |
Ken Zhang | 824758e | 2012-08-15 11:02:21 -0400 | [diff] [blame] | 289 | #define MDP_PP_IGC_FLAG_ROM0 0x10 |
| 290 | #define MDP_PP_IGC_FLAG_ROM1 0x20 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 291 | |
Ping Li | 8231ae4 | 2013-01-09 20:39:25 -0500 | [diff] [blame] | 292 | #define MDSS_PP_DSPP_CFG 0x0000 |
| 293 | #define MDSS_PP_SSPP_CFG 0x4000 |
| 294 | #define MDSS_PP_LM_CFG 0x8000 |
| 295 | #define MDSS_PP_WB_CFG 0xC000 |
| 296 | |
| 297 | #define MDSS_PP_LOCATION_MASK 0xC000 |
| 298 | #define MDSS_PP_LOGICAL_MASK 0x3FFF |
| 299 | |
| 300 | #define PP_LOCAT(var) ((var) & MDSS_PP_LOCATION_MASK) |
| 301 | #define PP_BLOCK(var) ((var) & MDSS_PP_LOGICAL_MASK) |
| 302 | |
| 303 | |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 304 | struct mdp_qseed_cfg { |
| 305 | uint32_t table_num; |
| 306 | uint32_t ops; |
| 307 | uint32_t len; |
| 308 | uint32_t *data; |
| 309 | }; |
| 310 | |
Ping Li | 87cca83 | 2013-01-30 18:27:52 -0500 | [diff] [blame] | 311 | struct mdp_sharp_cfg { |
| 312 | uint32_t flags; |
| 313 | uint32_t strength; |
| 314 | uint32_t edge_thr; |
| 315 | uint32_t smooth_thr; |
| 316 | uint32_t noise_thr; |
| 317 | }; |
| 318 | |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 319 | struct mdp_qseed_cfg_data { |
| 320 | uint32_t block; |
| 321 | struct mdp_qseed_cfg qseed_data; |
| 322 | }; |
| 323 | |
Carl Vanderlip | 94d9b78 | 2013-01-16 12:13:52 -0800 | [diff] [blame] | 324 | #define MDP_OVERLAY_PP_CSC_CFG 0x1 |
| 325 | #define MDP_OVERLAY_PP_QSEED_CFG 0x2 |
| 326 | #define MDP_OVERLAY_PP_PA_CFG 0x4 |
| 327 | #define MDP_OVERLAY_PP_IGC_CFG 0x8 |
Ping Li | 87cca83 | 2013-01-30 18:27:52 -0500 | [diff] [blame] | 328 | #define MDP_OVERLAY_PP_SHARP_CFG 0x10 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 329 | |
| 330 | #define MDP_CSC_FLAG_ENABLE 0x1 |
| 331 | #define MDP_CSC_FLAG_YUV_IN 0x2 |
| 332 | #define MDP_CSC_FLAG_YUV_OUT 0x4 |
| 333 | |
| 334 | struct mdp_csc_cfg { |
| 335 | /* flags for enable CSC, toggling RGB,YUV input/output */ |
| 336 | uint32_t flags; |
| 337 | uint32_t csc_mv[9]; |
| 338 | uint32_t csc_pre_bv[3]; |
| 339 | uint32_t csc_post_bv[3]; |
| 340 | uint32_t csc_pre_lv[6]; |
| 341 | uint32_t csc_post_lv[6]; |
| 342 | }; |
| 343 | |
| 344 | struct mdp_csc_cfg_data { |
| 345 | uint32_t block; |
| 346 | struct mdp_csc_cfg csc_data; |
| 347 | }; |
| 348 | |
Ping Li | 5822924 | 2012-11-30 14:05:43 -0500 | [diff] [blame] | 349 | struct mdp_pa_cfg { |
| 350 | uint32_t flags; |
| 351 | uint32_t hue_adj; |
| 352 | uint32_t sat_adj; |
| 353 | uint32_t val_adj; |
| 354 | uint32_t cont_adj; |
| 355 | }; |
| 356 | |
Carl Vanderlip | 94d9b78 | 2013-01-16 12:13:52 -0800 | [diff] [blame] | 357 | struct mdp_igc_lut_data { |
| 358 | uint32_t block; |
| 359 | uint32_t len, ops; |
| 360 | uint32_t *c0_c1_data; |
| 361 | uint32_t *c2_data; |
| 362 | }; |
| 363 | |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 364 | struct mdp_overlay_pp_params { |
| 365 | uint32_t config_ops; |
| 366 | struct mdp_csc_cfg csc_cfg; |
| 367 | struct mdp_qseed_cfg qseed_cfg[2]; |
Ping Li | 5822924 | 2012-11-30 14:05:43 -0500 | [diff] [blame] | 368 | struct mdp_pa_cfg pa_cfg; |
Carl Vanderlip | 94d9b78 | 2013-01-16 12:13:52 -0800 | [diff] [blame] | 369 | struct mdp_igc_lut_data igc_cfg; |
Ping Li | 87cca83 | 2013-01-30 18:27:52 -0500 | [diff] [blame] | 370 | struct mdp_sharp_cfg sharp_cfg; |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 371 | }; |
| 372 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 373 | struct mdp_overlay { |
| 374 | struct msmfb_img src; |
| 375 | struct mdp_rect src_rect; |
| 376 | struct mdp_rect dst_rect; |
| 377 | uint32_t z_order; /* stage number */ |
| 378 | uint32_t is_fg; /* control alpha & transp */ |
| 379 | uint32_t alpha; |
| 380 | uint32_t transp_mask; |
| 381 | uint32_t flags; |
| 382 | uint32_t id; |
| 383 | uint32_t user_data[8]; |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 384 | struct mdp_overlay_pp_params overlay_pp_cfg; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 385 | }; |
| 386 | |
| 387 | struct msmfb_overlay_3d { |
| 388 | uint32_t is_3d; |
| 389 | uint32_t width; |
| 390 | uint32_t height; |
| 391 | }; |
| 392 | |
| 393 | |
| 394 | struct msmfb_overlay_blt { |
| 395 | uint32_t enable; |
| 396 | uint32_t offset; |
| 397 | uint32_t width; |
| 398 | uint32_t height; |
| 399 | uint32_t bpp; |
| 400 | }; |
| 401 | |
| 402 | struct mdp_histogram { |
| 403 | uint32_t frame_cnt; |
| 404 | uint32_t bin_cnt; |
| 405 | uint32_t *r; |
| 406 | uint32_t *g; |
| 407 | uint32_t *b; |
| 408 | }; |
| 409 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 410 | |
| 411 | /* |
| 412 | |
Ken Zhang | 6a43163 | 2012-08-08 16:46:22 -0400 | [diff] [blame] | 413 | mdp_block_type defines the identifiers for pipes in MDP 4.3 and up |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 414 | |
| 415 | MDP_BLOCK_RESERVED is provided for backward compatibility and is |
| 416 | deprecated. It corresponds to DMA_P. So MDP_BLOCK_DMA_P should be used |
| 417 | instead. |
| 418 | |
Ken Zhang | 6a43163 | 2012-08-08 16:46:22 -0400 | [diff] [blame] | 419 | MDP_LOGICAL_BLOCK_DISP_0 identifies the display pipe which fb0 uses, |
| 420 | same for others. |
| 421 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 422 | */ |
| 423 | |
| 424 | enum { |
| 425 | MDP_BLOCK_RESERVED = 0, |
| 426 | MDP_BLOCK_OVERLAY_0, |
| 427 | MDP_BLOCK_OVERLAY_1, |
| 428 | MDP_BLOCK_VG_1, |
| 429 | MDP_BLOCK_VG_2, |
| 430 | MDP_BLOCK_RGB_1, |
| 431 | MDP_BLOCK_RGB_2, |
| 432 | MDP_BLOCK_DMA_P, |
| 433 | MDP_BLOCK_DMA_S, |
| 434 | MDP_BLOCK_DMA_E, |
Pravin Tamkhane | b18c9e2 | 2012-04-13 18:29:34 -0700 | [diff] [blame] | 435 | MDP_BLOCK_OVERLAY_2, |
Ken Zhang | 6a43163 | 2012-08-08 16:46:22 -0400 | [diff] [blame] | 436 | MDP_LOGICAL_BLOCK_DISP_0 = 0x1000, |
| 437 | MDP_LOGICAL_BLOCK_DISP_1, |
| 438 | MDP_LOGICAL_BLOCK_DISP_2, |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 439 | MDP_BLOCK_MAX, |
| 440 | }; |
| 441 | |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 442 | /* |
| 443 | * mdp_histogram_start_req is used to provide the parameters for |
| 444 | * histogram start request |
| 445 | */ |
| 446 | |
| 447 | struct mdp_histogram_start_req { |
| 448 | uint32_t block; |
| 449 | uint8_t frame_cnt; |
| 450 | uint8_t bit_mask; |
Carl Vanderlip | 1631632 | 2012-10-08 16:47:34 -0700 | [diff] [blame] | 451 | uint16_t num_bins; |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 452 | }; |
| 453 | |
| 454 | /* |
| 455 | * mdp_histogram_data is used to return the histogram data, once |
| 456 | * the histogram is done/stopped/cance |
| 457 | */ |
| 458 | |
| 459 | struct mdp_histogram_data { |
| 460 | uint32_t block; |
Ken Zhang | 0f523bd | 2012-08-23 11:14:03 -0400 | [diff] [blame] | 461 | uint32_t bin_cnt; |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 462 | uint32_t *c0; |
| 463 | uint32_t *c1; |
| 464 | uint32_t *c2; |
Carl Vanderlip | 7b8b640 | 2012-03-01 10:58:03 -0800 | [diff] [blame] | 465 | uint32_t *extra_info; |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 466 | }; |
| 467 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 468 | struct mdp_pcc_coeff { |
| 469 | uint32_t c, r, g, b, rr, gg, bb, rg, gb, rb, rgb_0, rgb_1; |
| 470 | }; |
| 471 | |
| 472 | struct mdp_pcc_cfg_data { |
| 473 | uint32_t block; |
| 474 | uint32_t ops; |
| 475 | struct mdp_pcc_coeff r, g, b; |
| 476 | }; |
| 477 | |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 478 | #define MDP_GAMUT_TABLE_NUM 8 |
| 479 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 480 | enum { |
| 481 | mdp_lut_igc, |
| 482 | mdp_lut_pgc, |
| 483 | mdp_lut_hist, |
| 484 | mdp_lut_max, |
| 485 | }; |
| 486 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 487 | struct mdp_ar_gc_lut_data { |
| 488 | uint32_t x_start; |
| 489 | uint32_t slope; |
| 490 | uint32_t offset; |
| 491 | }; |
| 492 | |
| 493 | struct mdp_pgc_lut_data { |
| 494 | uint32_t block; |
| 495 | uint32_t flags; |
| 496 | uint8_t num_r_stages; |
| 497 | uint8_t num_g_stages; |
| 498 | uint8_t num_b_stages; |
| 499 | struct mdp_ar_gc_lut_data *r_data; |
| 500 | struct mdp_ar_gc_lut_data *g_data; |
| 501 | struct mdp_ar_gc_lut_data *b_data; |
| 502 | }; |
| 503 | |
| 504 | |
| 505 | struct mdp_hist_lut_data { |
| 506 | uint32_t block; |
| 507 | uint32_t ops; |
| 508 | uint32_t len; |
| 509 | uint32_t *data; |
| 510 | }; |
| 511 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 512 | struct mdp_lut_cfg_data { |
| 513 | uint32_t lut_type; |
| 514 | union { |
| 515 | struct mdp_igc_lut_data igc_lut_data; |
| 516 | struct mdp_pgc_lut_data pgc_lut_data; |
| 517 | struct mdp_hist_lut_data hist_lut_data; |
| 518 | } data; |
| 519 | }; |
| 520 | |
Carl Vanderlip | f0fd8e7 | 2012-05-03 15:08:20 -0700 | [diff] [blame] | 521 | struct mdp_bl_scale_data { |
| 522 | uint32_t min_lvl; |
| 523 | uint32_t scale; |
| 524 | }; |
Pravin Tamkhane | 67726da | 2012-04-13 11:59:11 -0700 | [diff] [blame] | 525 | |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 526 | struct mdp_pa_cfg_data { |
| 527 | uint32_t block; |
Ping Li | 5822924 | 2012-11-30 14:05:43 -0500 | [diff] [blame] | 528 | struct mdp_pa_cfg pa_data; |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 529 | }; |
| 530 | |
Ken Zhang | 7fb8577 | 2012-08-18 14:51:33 -0400 | [diff] [blame] | 531 | struct mdp_dither_cfg_data { |
| 532 | uint32_t block; |
| 533 | uint32_t flags; |
| 534 | uint32_t g_y_depth; |
| 535 | uint32_t r_cr_depth; |
| 536 | uint32_t b_cb_depth; |
| 537 | }; |
| 538 | |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 539 | struct mdp_gamut_cfg_data { |
| 540 | uint32_t block; |
| 541 | uint32_t flags; |
| 542 | uint32_t gamut_first; |
| 543 | uint32_t tbl_size[MDP_GAMUT_TABLE_NUM]; |
| 544 | uint16_t *r_tbl[MDP_GAMUT_TABLE_NUM]; |
| 545 | uint16_t *g_tbl[MDP_GAMUT_TABLE_NUM]; |
| 546 | uint16_t *b_tbl[MDP_GAMUT_TABLE_NUM]; |
| 547 | }; |
| 548 | |
Carl Vanderlip | e8ed5ec | 2012-09-28 16:04:10 -0700 | [diff] [blame] | 549 | struct mdp_calib_config_data { |
| 550 | uint32_t ops; |
| 551 | uint32_t addr; |
| 552 | uint32_t data; |
| 553 | }; |
| 554 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 555 | enum { |
| 556 | mdp_op_pcc_cfg, |
| 557 | mdp_op_csc_cfg, |
| 558 | mdp_op_lut_cfg, |
Pravin Tamkhane | 67726da | 2012-04-13 11:59:11 -0700 | [diff] [blame] | 559 | mdp_op_qseed_cfg, |
Carl Vanderlip | f0fd8e7 | 2012-05-03 15:08:20 -0700 | [diff] [blame] | 560 | mdp_bl_scale_cfg, |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 561 | mdp_op_pa_cfg, |
Ken Zhang | 7fb8577 | 2012-08-18 14:51:33 -0400 | [diff] [blame] | 562 | mdp_op_dither_cfg, |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 563 | mdp_op_gamut_cfg, |
Carl Vanderlip | e8ed5ec | 2012-09-28 16:04:10 -0700 | [diff] [blame] | 564 | mdp_op_calib_cfg, |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 565 | mdp_op_max, |
| 566 | }; |
| 567 | |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 568 | enum { |
| 569 | WB_FORMAT_NV12, |
| 570 | WB_FORMAT_RGB_565, |
| 571 | WB_FORMAT_RGB_888, |
| 572 | WB_FORMAT_xRGB_8888, |
| 573 | WB_FORMAT_ARGB_8888, |
| 574 | WB_FORMAT_ARGB_8888_INPUT_ALPHA /* Need to support */ |
| 575 | }; |
| 576 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 577 | struct msmfb_mdp_pp { |
| 578 | uint32_t op; |
| 579 | union { |
| 580 | struct mdp_pcc_cfg_data pcc_cfg_data; |
| 581 | struct mdp_csc_cfg_data csc_cfg_data; |
| 582 | struct mdp_lut_cfg_data lut_cfg_data; |
Pravin Tamkhane | 67726da | 2012-04-13 11:59:11 -0700 | [diff] [blame] | 583 | struct mdp_qseed_cfg_data qseed_cfg_data; |
Carl Vanderlip | f0fd8e7 | 2012-05-03 15:08:20 -0700 | [diff] [blame] | 584 | struct mdp_bl_scale_data bl_scale_data; |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 585 | struct mdp_pa_cfg_data pa_cfg_data; |
Ken Zhang | 7fb8577 | 2012-08-18 14:51:33 -0400 | [diff] [blame] | 586 | struct mdp_dither_cfg_data dither_cfg_data; |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 587 | struct mdp_gamut_cfg_data gamut_cfg_data; |
Carl Vanderlip | e8ed5ec | 2012-09-28 16:04:10 -0700 | [diff] [blame] | 588 | struct mdp_calib_config_data calib_cfg; |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 589 | } data; |
| 590 | }; |
| 591 | |
Manoj Rao | a8e39d9 | 2013-02-16 08:47:21 -0800 | [diff] [blame] | 592 | #define FB_METADATA_VIDEO_INFO_CODE_SUPPORT 1 |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 593 | enum { |
| 594 | metadata_op_none, |
| 595 | metadata_op_base_blend, |
Ken Zhang | 420dd20 | 2013-01-08 14:28:20 -0500 | [diff] [blame] | 596 | metadata_op_frame_rate, |
Manoj Rao | a8e39d9 | 2013-02-16 08:47:21 -0800 | [diff] [blame] | 597 | metadata_op_vic, |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 598 | metadata_op_wb_format, |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 599 | metadata_op_get_caps, |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 600 | metadata_op_max |
| 601 | }; |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 602 | |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 603 | struct mdp_blend_cfg { |
| 604 | uint32_t is_premultiplied; |
| 605 | }; |
| 606 | |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 607 | struct mdp_mixer_cfg { |
| 608 | uint32_t writeback_format; |
| 609 | uint32_t alpha; |
| 610 | }; |
| 611 | |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 612 | struct mdss_hw_caps { |
| 613 | uint32_t mdp_rev; |
| 614 | uint8_t rgb_pipes; |
| 615 | uint8_t vig_pipes; |
| 616 | uint8_t dma_pipes; |
| 617 | }; |
| 618 | |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 619 | struct msmfb_metadata { |
| 620 | uint32_t op; |
| 621 | uint32_t flags; |
| 622 | union { |
| 623 | struct mdp_blend_cfg blend_cfg; |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 624 | struct mdp_mixer_cfg mixer_cfg; |
Ken Zhang | 420dd20 | 2013-01-08 14:28:20 -0500 | [diff] [blame] | 625 | uint32_t panel_frame_rate; |
Manoj Rao | a8e39d9 | 2013-02-16 08:47:21 -0800 | [diff] [blame] | 626 | uint32_t video_info_code; |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 627 | struct mdss_hw_caps caps; |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 628 | } data; |
| 629 | }; |
Ken Zhang | 5295d80 | 2012-11-07 18:33:16 -0500 | [diff] [blame] | 630 | |
| 631 | #define MDP_MAX_FENCE_FD 10 |
| 632 | #define MDP_BUF_SYNC_FLAG_WAIT 1 |
| 633 | |
| 634 | struct mdp_buf_sync { |
| 635 | uint32_t flags; |
| 636 | uint32_t acq_fen_fd_cnt; |
| 637 | int *acq_fen_fd; |
| 638 | int *rel_fen_fd; |
| 639 | }; |
| 640 | |
Ken Zhang | 4e83b93 | 2012-12-02 21:15:47 -0500 | [diff] [blame] | 641 | #define MDP_DISPLAY_COMMIT_OVERLAY 1 |
Ken Zhang | 5e8588d | 2012-10-01 11:46:42 -0700 | [diff] [blame] | 642 | struct mdp_buf_fence { |
| 643 | uint32_t flags; |
| 644 | uint32_t acq_fen_fd_cnt; |
| 645 | int acq_fen_fd[MDP_MAX_FENCE_FD]; |
| 646 | int rel_fen_fd[MDP_MAX_FENCE_FD]; |
| 647 | }; |
| 648 | |
Ken Zhang | 4e83b93 | 2012-12-02 21:15:47 -0500 | [diff] [blame] | 649 | |
| 650 | struct mdp_display_commit { |
| 651 | uint32_t flags; |
| 652 | uint32_t wait_for_finish; |
| 653 | struct fb_var_screeninfo var; |
Ken Zhang | 5e8588d | 2012-10-01 11:46:42 -0700 | [diff] [blame] | 654 | struct mdp_buf_fence buf_fence; |
Ken Zhang | 4e83b93 | 2012-12-02 21:15:47 -0500 | [diff] [blame] | 655 | }; |
| 656 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 657 | struct mdp_page_protection { |
| 658 | uint32_t page_protection; |
| 659 | }; |
| 660 | |
kuogee hsieh | 405dc30 | 2011-07-21 15:06:59 -0700 | [diff] [blame] | 661 | |
| 662 | struct mdp_mixer_info { |
| 663 | int pndx; |
| 664 | int pnum; |
| 665 | int ptype; |
| 666 | int mixer_num; |
| 667 | int z_order; |
| 668 | }; |
| 669 | |
| 670 | #define MAX_PIPE_PER_MIXER 4 |
| 671 | |
| 672 | struct msmfb_mixer_info_req { |
| 673 | int mixer_num; |
| 674 | int cnt; |
| 675 | struct mdp_mixer_info info[MAX_PIPE_PER_MIXER]; |
| 676 | }; |
| 677 | |
Ravishangar Kalyanam | 6bc448a | 2012-03-14 11:31:52 -0700 | [diff] [blame] | 678 | enum { |
| 679 | DISPLAY_SUBSYSTEM_ID, |
| 680 | ROTATOR_SUBSYSTEM_ID, |
| 681 | }; |
kuogee hsieh | 405dc30 | 2011-07-21 15:06:59 -0700 | [diff] [blame] | 682 | |
Adrian Salido-Moreno | 96d88d4 | 2012-12-20 13:01:39 -0800 | [diff] [blame] | 683 | enum { |
| 684 | MDP_IOMMU_DOMAIN_CP, |
| 685 | MDP_IOMMU_DOMAIN_NS, |
| 686 | }; |
| 687 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 688 | #ifdef __KERNEL__ |
Adrian Salido-Moreno | 96d88d4 | 2012-12-20 13:01:39 -0800 | [diff] [blame] | 689 | int msm_fb_get_iommu_domain(struct fb_info *info, int domain); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 690 | /* get the framebuffer physical address information */ |
Ravishangar Kalyanam | 6bc448a | 2012-03-14 11:31:52 -0700 | [diff] [blame] | 691 | int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num, |
| 692 | int subsys_id); |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 693 | struct fb_info *msm_fb_get_writeback_fb(void); |
| 694 | int msm_fb_writeback_init(struct fb_info *info); |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 695 | int msm_fb_writeback_start(struct fb_info *info); |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 696 | int msm_fb_writeback_queue_buffer(struct fb_info *info, |
| 697 | struct msmfb_data *data); |
| 698 | int msm_fb_writeback_dequeue_buffer(struct fb_info *info, |
| 699 | struct msmfb_data *data); |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 700 | int msm_fb_writeback_stop(struct fb_info *info); |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 701 | int msm_fb_writeback_terminate(struct fb_info *info); |
Adrian Salido-Moreno | 96d88d4 | 2012-12-20 13:01:39 -0800 | [diff] [blame] | 702 | int msm_fb_writeback_set_secure(struct fb_info *info, int enable); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 703 | #endif |
| 704 | |
| 705 | #endif /*_MSM_MDP_H_*/ |