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 |
Pawan Kumar | ce25d14 | 2014-01-29 16:47:35 +0530 | [diff] [blame] | 4 | * Copyright (c) 2012-2014 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) |
Carl Vanderlip | 0d6ef4a | 2013-05-30 11:48:48 -0700 | [diff] [blame] | 53 | #define MSMFB_NOTIFY_UPDATE _IOWR(MSMFB_IOCTL_MAGIC, 146, unsigned int) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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) |
Deva Ramasubramanian | 166b098 | 2013-01-25 20:11:41 -0800 | [diff] [blame] | 79 | #define MSMFB_WRITEBACK_SET_MIRRORING_HINT _IOW(MSMFB_IOCTL_MAGIC, 167, \ |
| 80 | unsigned int) |
Terence Hampson | 3e636aa | 2013-05-08 19:01:51 -0400 | [diff] [blame] | 81 | #define MSMFB_ASYNC_BLIT _IOW(MSMFB_IOCTL_MAGIC, 168, unsigned int) |
Adrian Salido-Moreno | 6b15509 | 2014-01-07 17:29:20 -0800 | [diff] [blame] | 82 | #define MSMFB_OVERLAY_PREPARE _IOWR(MSMFB_IOCTL_MAGIC, 169, \ |
| 83 | struct mdp_overlay_list) |
Sandeep Panda | d87db9a | 2014-04-09 17:15:37 +0530 | [diff] [blame] | 84 | #define MSMFB_LPM_ENABLE _IOWR(MSMFB_IOCTL_MAGIC, 170, unsigned int) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 85 | #define FB_TYPE_3D_PANEL 0x10101010 |
| 86 | #define MDP_IMGTYPE2_START 0x10000 |
| 87 | #define MSMFB_DRIVER_VERSION 0xF9E8D701 |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 88 | |
Ujwal Patel | 999ee56 | 2013-12-05 13:35:51 -0800 | [diff] [blame] | 89 | /* HW Revisions for different MDSS targets */ |
| 90 | #define MDSS_GET_MAJOR(rev) ((rev) >> 28) |
| 91 | #define MDSS_GET_MINOR(rev) (((rev) >> 16) & 0xFFF) |
| 92 | #define MDSS_GET_STEP(rev) ((rev) & 0xFFFF) |
| 93 | #define MDSS_GET_MAJOR_MINOR(rev) ((rev) >> 16) |
| 94 | |
| 95 | #define IS_MDSS_MAJOR_MINOR_SAME(rev1, rev2) \ |
| 96 | (MDSS_GET_MAJOR_MINOR((rev1)) == MDSS_GET_MAJOR_MINOR((rev2))) |
| 97 | |
| 98 | #define MDSS_MDP_REV(major, minor, step) \ |
| 99 | ((((major) & 0x000F) << 28) | \ |
| 100 | (((minor) & 0x0FFF) << 16) | \ |
| 101 | ((step) & 0xFFFF)) |
| 102 | |
| 103 | #define MDSS_MDP_HW_REV_100 MDSS_MDP_REV(1, 0, 0) /* 8974 v1.0 */ |
| 104 | #define MDSS_MDP_HW_REV_101 MDSS_MDP_REV(1, 1, 0) /* 8x26 v1.0 */ |
| 105 | #define MDSS_MDP_HW_REV_101_1 MDSS_MDP_REV(1, 1, 1) /* 8x26 v2.0, 8926 v1.0 */ |
| 106 | #define MDSS_MDP_HW_REV_101_2 MDSS_MDP_REV(1, 1, 2) /* 8926 v2.0 */ |
| 107 | #define MDSS_MDP_HW_REV_102 MDSS_MDP_REV(1, 2, 0) /* 8974 v2.0 */ |
| 108 | #define MDSS_MDP_HW_REV_102_1 MDSS_MDP_REV(1, 2, 1) /* 8974 v3.0 (Pro) */ |
| 109 | #define MDSS_MDP_HW_REV_103 MDSS_MDP_REV(1, 3, 0) /* 8084 v1.0 */ |
| 110 | #define MDSS_MDP_HW_REV_103_1 MDSS_MDP_REV(1, 3, 1) /* 8084 v1.1 */ |
| 111 | #define MDSS_MDP_HW_REV_200 MDSS_MDP_REV(2, 0, 0) /* 8092 v1.0 */ |
| 112 | |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 113 | enum { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 114 | NOTIFY_UPDATE_START, |
| 115 | NOTIFY_UPDATE_STOP, |
Arpita Banerjee | a8b7fbf | 2013-06-11 19:24:20 -0700 | [diff] [blame] | 116 | NOTIFY_UPDATE_POWER_OFF, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 117 | }; |
| 118 | |
| 119 | enum { |
Carl Vanderlip | 0d6ef4a | 2013-05-30 11:48:48 -0700 | [diff] [blame] | 120 | NOTIFY_TYPE_NO_UPDATE, |
| 121 | NOTIFY_TYPE_SUSPEND, |
| 122 | NOTIFY_TYPE_UPDATE, |
Ping Li | aabff72 | 2014-03-17 10:06:47 -0700 | [diff] [blame] | 123 | NOTIFY_TYPE_BL_UPDATE, |
Carl Vanderlip | 0d6ef4a | 2013-05-30 11:48:48 -0700 | [diff] [blame] | 124 | }; |
| 125 | |
| 126 | enum { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 127 | MDP_RGB_565, /* RGB 565 planer */ |
| 128 | MDP_XRGB_8888, /* RGB 888 padded */ |
| 129 | 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] | 130 | MDP_Y_CBCR_H2V2_ADRENO, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 131 | MDP_ARGB_8888, /* ARGB 888 */ |
| 132 | MDP_RGB_888, /* RGB 888 planer */ |
| 133 | MDP_Y_CRCB_H2V2, /* Y and CrCb, pseudo planer w/ Cr is in MSB */ |
| 134 | MDP_YCRYCB_H2V1, /* YCrYCb interleave */ |
Pawan Kumar | 42acdef | 2013-03-21 19:55:49 +0530 | [diff] [blame] | 135 | MDP_CBYCRY_H2V1, /* CbYCrY interleave */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 136 | MDP_Y_CRCB_H2V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */ |
| 137 | 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] | 138 | MDP_Y_CRCB_H1V2, |
| 139 | MDP_Y_CBCR_H1V2, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 140 | MDP_RGBA_8888, /* ARGB 888 */ |
| 141 | MDP_BGRA_8888, /* ABGR 888 */ |
| 142 | MDP_RGBX_8888, /* RGBX 888 */ |
| 143 | MDP_Y_CRCB_H2V2_TILE, /* Y and CrCb, pseudo planer tile */ |
| 144 | MDP_Y_CBCR_H2V2_TILE, /* Y and CbCr, pseudo planer tile */ |
| 145 | MDP_Y_CR_CB_H2V2, /* Y, Cr and Cb, planar */ |
Pradeep Jilagam | 9b4a6be | 2011-10-03 17:19:20 +0530 | [diff] [blame] | 146 | 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] | 147 | MDP_Y_CB_CR_H2V2, /* Y, Cb and Cr, planar */ |
| 148 | MDP_Y_CRCB_H1V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */ |
| 149 | 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] | 150 | MDP_YCRCB_H1V1, /* YCrCb interleave */ |
| 151 | MDP_YCBCR_H1V1, /* YCbCr interleave */ |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 152 | MDP_BGR_565, /* BGR 565 planer */ |
Adrian Salido-Moreno | d559ef1 | 2012-07-12 20:16:14 -0700 | [diff] [blame] | 153 | MDP_BGR_888, /* BGR 888 */ |
Adrian Salido-Moreno | 330c0bf | 2012-08-22 14:15:33 -0700 | [diff] [blame] | 154 | MDP_Y_CBCR_H2V2_VENUS, |
Pawan Kumar | 7985438 | 2013-02-14 15:27:12 +0530 | [diff] [blame] | 155 | MDP_BGRX_8888, /* BGRX 8888 */ |
Shalabh Jain | bea586a | 2013-08-23 12:30:48 -0700 | [diff] [blame] | 156 | MDP_RGBA_8888_TILE, /* RGBA 8888 in tile format */ |
| 157 | MDP_ARGB_8888_TILE, /* ARGB 8888 in tile format */ |
| 158 | MDP_ABGR_8888_TILE, /* ABGR 8888 in tile format */ |
| 159 | MDP_BGRA_8888_TILE, /* BGRA 8888 in tile format */ |
| 160 | MDP_RGBX_8888_TILE, /* RGBX 8888 in tile format */ |
| 161 | MDP_XRGB_8888_TILE, /* XRGB 8888 in tile format */ |
| 162 | MDP_XBGR_8888_TILE, /* XBGR 8888 in tile format */ |
| 163 | MDP_BGRX_8888_TILE, /* BGRX 8888 in tile format */ |
Ramkumar Radhakrishnan | 97180fa | 2013-08-06 20:50:52 -0700 | [diff] [blame] | 164 | MDP_YCBYCR_H2V1, /* YCbYCr interleave */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 165 | MDP_IMGTYPE_LIMIT, |
kuogee hsieh | 1ce7e4c | 2012-01-13 14:05:54 -0800 | [diff] [blame] | 166 | MDP_RGB_BORDERFILL, /* border fill pipe */ |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 167 | MDP_FB_FORMAT = MDP_IMGTYPE2_START, /* framebuffer format */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 168 | MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */ |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 169 | }; |
| 170 | |
| 171 | enum { |
| 172 | PMEM_IMG, |
| 173 | FB_IMG, |
| 174 | }; |
| 175 | |
Liyuan Li | d973663 | 2011-11-11 13:47:59 -0800 | [diff] [blame] | 176 | enum { |
| 177 | HSIC_HUE = 0, |
| 178 | HSIC_SAT, |
| 179 | HSIC_INT, |
| 180 | HSIC_CON, |
| 181 | NUM_HSIC_PARAM, |
| 182 | }; |
| 183 | |
Adrian Salido-Moreno | 1857f06 | 2012-05-29 17:57:28 -0700 | [diff] [blame] | 184 | #define MDSS_MDP_ROT_ONLY 0x80 |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 185 | #define MDSS_MDP_RIGHT_MIXER 0x100 |
Adrian Salido-Moreno | 6afd780 | 2013-08-05 14:03:25 -0700 | [diff] [blame] | 186 | #define MDSS_MDP_DUAL_PIPE 0x200 |
Adrian Salido-Moreno | e55fa12 | 2012-05-29 15:36:08 -0700 | [diff] [blame] | 187 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 188 | /* mdp_blit_req flag values */ |
| 189 | #define MDP_ROT_NOP 0 |
| 190 | #define MDP_FLIP_LR 0x1 |
| 191 | #define MDP_FLIP_UD 0x2 |
| 192 | #define MDP_ROT_90 0x4 |
| 193 | #define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR) |
| 194 | #define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR) |
| 195 | #define MDP_DITHER 0x8 |
| 196 | #define MDP_BLUR 0x10 |
| 197 | #define MDP_BLEND_FG_PREMULT 0x20000 |
Padmanabhan Komanduru | dd10bf1 | 2012-10-17 20:27:33 +0530 | [diff] [blame] | 198 | #define MDP_IS_FG 0x40000 |
Mayank Chopra | 1d91e09 | 2013-12-19 10:46:04 +0530 | [diff] [blame] | 199 | #define MDP_SOLID_FILL 0x00000020 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 200 | #define MDP_DEINTERLACE 0x80000000 |
| 201 | #define MDP_SHARPENING 0x40000000 |
| 202 | #define MDP_NO_DMA_BARRIER_START 0x20000000 |
| 203 | #define MDP_NO_DMA_BARRIER_END 0x10000000 |
| 204 | #define MDP_NO_BLIT 0x08000000 |
| 205 | #define MDP_BLIT_WITH_DMA_BARRIERS 0x000 |
| 206 | #define MDP_BLIT_WITH_NO_DMA_BARRIERS \ |
| 207 | (MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END) |
| 208 | #define MDP_BLIT_SRC_GEM 0x04000000 |
| 209 | #define MDP_BLIT_DST_GEM 0x02000000 |
| 210 | #define MDP_BLIT_NON_CACHED 0x01000000 |
| 211 | #define MDP_OV_PIPE_SHARE 0x00800000 |
| 212 | #define MDP_DEINTERLACE_ODD 0x00400000 |
| 213 | #define MDP_OV_PLAY_NOWAIT 0x00200000 |
| 214 | #define MDP_SOURCE_ROTATED_90 0x00100000 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 215 | #define MDP_OVERLAY_PP_CFG_EN 0x00080000 |
Ajay Singh Parmar | 4c7ccb3 | 2012-02-21 12:56:04 +0530 | [diff] [blame] | 216 | #define MDP_BACKEND_COMPOSITION 0x00040000 |
Nagamalleswararao Ganji | 880f847 | 2011-12-14 03:52:28 -0800 | [diff] [blame] | 217 | #define MDP_BORDERFILL_SUPPORTED 0x00010000 |
| 218 | #define MDP_SECURE_OVERLAY_SESSION 0x00008000 |
Arun Kumar K.R | 9ce1fd6 | 2013-09-24 11:35:08 -0700 | [diff] [blame] | 219 | #define MDP_SECURE_DISPLAY_OVERLAY_SESSION 0x00002000 |
Adrian Salido-Moreno | 9a8485c | 2013-02-06 14:08:28 -0800 | [diff] [blame] | 220 | #define MDP_OV_PIPE_FORCE_DMA 0x00004000 |
Nagamalleswararao Ganji | 880f847 | 2011-12-14 03:52:28 -0800 | [diff] [blame] | 221 | #define MDP_MEMORY_ID_TYPE_FB 0x00001000 |
Sree Sesha Aravind Vadrevu | 3514313 | 2013-03-12 02:32:06 -0700 | [diff] [blame] | 222 | #define MDP_BWC_EN 0x00000400 |
Sree Sesha Aravind Vadrevu | 05d4d22 | 2013-04-01 14:31:28 -0700 | [diff] [blame] | 223 | #define MDP_DECIMATION_EN 0x00000800 |
Justin Philip | 8960a7a | 2014-08-12 13:46:54 +0530 | [diff] [blame] | 224 | #define MDP_SMP_FORCE_ALLOC 0x00200000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 225 | #define MDP_TRANSP_NOP 0xffffffff |
| 226 | #define MDP_ALPHA_NOP 0xff |
| 227 | |
| 228 | #define MDP_FB_PAGE_PROTECTION_NONCACHED (0) |
| 229 | #define MDP_FB_PAGE_PROTECTION_WRITECOMBINE (1) |
| 230 | #define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2) |
| 231 | #define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE (3) |
| 232 | #define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE (4) |
| 233 | /* Sentinel: Don't use! */ |
| 234 | #define MDP_FB_PAGE_PROTECTION_INVALID (5) |
| 235 | /* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */ |
| 236 | #define MDP_NUM_FB_PAGE_PROTECTION_VALUES (5) |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 237 | |
| 238 | struct mdp_rect { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 239 | uint32_t x; |
| 240 | uint32_t y; |
| 241 | uint32_t w; |
| 242 | uint32_t h; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 243 | }; |
| 244 | |
| 245 | struct mdp_img { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 246 | uint32_t width; |
| 247 | uint32_t height; |
| 248 | uint32_t format; |
| 249 | uint32_t offset; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 250 | int memory_id; /* the file descriptor */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 251 | uint32_t priv; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 252 | }; |
| 253 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 254 | /* |
| 255 | * {3x3} + {3} ccs matrix |
| 256 | */ |
| 257 | |
| 258 | #define MDP_CCS_RGB2YUV 0 |
| 259 | #define MDP_CCS_YUV2RGB 1 |
| 260 | |
| 261 | #define MDP_CCS_SIZE 9 |
| 262 | #define MDP_BV_SIZE 3 |
| 263 | |
| 264 | struct mdp_ccs { |
| 265 | int direction; /* MDP_CCS_RGB2YUV or YUV2RGB */ |
| 266 | uint16_t ccs[MDP_CCS_SIZE]; /* 3x3 color coefficients */ |
| 267 | uint16_t bv[MDP_BV_SIZE]; /* 1x3 bias vector */ |
| 268 | }; |
| 269 | |
Nagamalleswararao Ganji | 4b99172 | 2011-01-28 13:24:34 -0800 | [diff] [blame] | 270 | struct mdp_csc { |
| 271 | int id; |
| 272 | uint32_t csc_mv[9]; |
| 273 | uint32_t csc_pre_bv[3]; |
| 274 | uint32_t csc_post_bv[3]; |
| 275 | uint32_t csc_pre_lv[6]; |
| 276 | uint32_t csc_post_lv[6]; |
| 277 | }; |
| 278 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 279 | /* The version of the mdp_blit_req structure so that |
| 280 | * user applications can selectively decide which functionality |
| 281 | * to include |
| 282 | */ |
| 283 | |
| 284 | #define MDP_BLIT_REQ_VERSION 2 |
| 285 | |
Shivaraj Shetty | 1bbb383 | 2013-10-22 18:43:17 +0530 | [diff] [blame] | 286 | struct color { |
| 287 | uint32_t r; |
| 288 | uint32_t g; |
| 289 | uint32_t b; |
| 290 | uint32_t alpha; |
| 291 | }; |
| 292 | |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 293 | struct mdp_blit_req { |
| 294 | struct mdp_img src; |
| 295 | struct mdp_img dst; |
| 296 | struct mdp_rect src_rect; |
| 297 | struct mdp_rect dst_rect; |
Shivaraj Shetty | 1bbb383 | 2013-10-22 18:43:17 +0530 | [diff] [blame] | 298 | struct color const_color; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 299 | uint32_t alpha; |
| 300 | uint32_t transp_mask; |
| 301 | uint32_t flags; |
| 302 | int sharpening_strength; /* -127 <--> 127, default 64 */ |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 303 | }; |
| 304 | |
| 305 | struct mdp_blit_req_list { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 306 | uint32_t count; |
Daniel Walker | da6df07 | 2010-04-23 16:04:20 -0700 | [diff] [blame] | 307 | struct mdp_blit_req req[]; |
| 308 | }; |
| 309 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 310 | #define MSMFB_DATA_VERSION 2 |
| 311 | |
| 312 | struct msmfb_data { |
| 313 | uint32_t offset; |
| 314 | int memory_id; |
| 315 | int id; |
| 316 | uint32_t flags; |
| 317 | uint32_t priv; |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 318 | uint32_t iova; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 319 | }; |
| 320 | |
| 321 | #define MSMFB_NEW_REQUEST -1 |
| 322 | |
| 323 | struct msmfb_overlay_data { |
| 324 | uint32_t id; |
| 325 | struct msmfb_data data; |
| 326 | uint32_t version_key; |
| 327 | struct msmfb_data plane1_data; |
| 328 | struct msmfb_data plane2_data; |
Adrian Salido-Moreno | 1857f06 | 2012-05-29 17:57:28 -0700 | [diff] [blame] | 329 | struct msmfb_data dst_data; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 330 | }; |
| 331 | |
| 332 | struct msmfb_img { |
| 333 | uint32_t width; |
| 334 | uint32_t height; |
| 335 | uint32_t format; |
| 336 | }; |
| 337 | |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 338 | #define MSMFB_WRITEBACK_DEQUEUE_BLOCKING 0x1 |
| 339 | struct msmfb_writeback_data { |
| 340 | struct msmfb_data buf_info; |
| 341 | struct msmfb_img img; |
| 342 | }; |
| 343 | |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 344 | #define MDP_PP_OPS_ENABLE 0x1 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 345 | #define MDP_PP_OPS_READ 0x2 |
| 346 | #define MDP_PP_OPS_WRITE 0x4 |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 347 | #define MDP_PP_OPS_DISABLE 0x8 |
Ken Zhang | 824758e | 2012-08-15 11:02:21 -0400 | [diff] [blame] | 348 | #define MDP_PP_IGC_FLAG_ROM0 0x10 |
| 349 | #define MDP_PP_IGC_FLAG_ROM1 0x20 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 350 | |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 351 | #define MDP_PP_PA_HUE_ENABLE 0x10 |
| 352 | #define MDP_PP_PA_SAT_ENABLE 0x20 |
| 353 | #define MDP_PP_PA_VAL_ENABLE 0x40 |
| 354 | #define MDP_PP_PA_CONT_ENABLE 0x80 |
| 355 | #define MDP_PP_PA_SIX_ZONE_ENABLE 0x100 |
| 356 | #define MDP_PP_PA_SKIN_ENABLE 0x200 |
| 357 | #define MDP_PP_PA_SKY_ENABLE 0x400 |
| 358 | #define MDP_PP_PA_FOL_ENABLE 0x800 |
| 359 | #define MDP_PP_PA_HUE_MASK 0x1000 |
| 360 | #define MDP_PP_PA_SAT_MASK 0x2000 |
| 361 | #define MDP_PP_PA_VAL_MASK 0x4000 |
| 362 | #define MDP_PP_PA_CONT_MASK 0x8000 |
| 363 | #define MDP_PP_PA_SIX_ZONE_HUE_MASK 0x10000 |
| 364 | #define MDP_PP_PA_SIX_ZONE_SAT_MASK 0x20000 |
| 365 | #define MDP_PP_PA_SIX_ZONE_VAL_MASK 0x40000 |
| 366 | #define MDP_PP_PA_MEM_COL_SKIN_MASK 0x80000 |
| 367 | #define MDP_PP_PA_MEM_COL_SKY_MASK 0x100000 |
| 368 | #define MDP_PP_PA_MEM_COL_FOL_MASK 0x200000 |
| 369 | #define MDP_PP_PA_MEM_PROTECT_EN 0x400000 |
| 370 | #define MDP_PP_PA_SAT_ZERO_EXP_EN 0x800000 |
| 371 | |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 372 | #define MDSS_PP_DSPP_CFG 0x000 |
| 373 | #define MDSS_PP_SSPP_CFG 0x100 |
| 374 | #define MDSS_PP_LM_CFG 0x200 |
| 375 | #define MDSS_PP_WB_CFG 0x300 |
Ping Li | 8231ae4 | 2013-01-09 20:39:25 -0500 | [diff] [blame] | 376 | |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 377 | #define MDSS_PP_ARG_MASK 0x3C00 |
| 378 | #define MDSS_PP_ARG_NUM 4 |
Carl Vanderlip | 793aa58 | 2013-03-18 10:18:47 -0700 | [diff] [blame] | 379 | #define MDSS_PP_ARG_SHIFT 10 |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 380 | #define MDSS_PP_LOCATION_MASK 0x0300 |
| 381 | #define MDSS_PP_LOGICAL_MASK 0x00FF |
Ping Li | 8231ae4 | 2013-01-09 20:39:25 -0500 | [diff] [blame] | 382 | |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 383 | #define MDSS_PP_ADD_ARG(var, arg) ((var) | (0x1 << (MDSS_PP_ARG_SHIFT + (arg)))) |
| 384 | #define PP_ARG(x, var) ((var) & (0x1 << (MDSS_PP_ARG_SHIFT + (x)))) |
Ping Li | 8231ae4 | 2013-01-09 20:39:25 -0500 | [diff] [blame] | 385 | #define PP_LOCAT(var) ((var) & MDSS_PP_LOCATION_MASK) |
| 386 | #define PP_BLOCK(var) ((var) & MDSS_PP_LOGICAL_MASK) |
| 387 | |
| 388 | |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 389 | struct mdp_qseed_cfg { |
| 390 | uint32_t table_num; |
| 391 | uint32_t ops; |
| 392 | uint32_t len; |
| 393 | uint32_t *data; |
| 394 | }; |
| 395 | |
Ping Li | 87cca83 | 2013-01-30 18:27:52 -0500 | [diff] [blame] | 396 | struct mdp_sharp_cfg { |
| 397 | uint32_t flags; |
| 398 | uint32_t strength; |
| 399 | uint32_t edge_thr; |
| 400 | uint32_t smooth_thr; |
| 401 | uint32_t noise_thr; |
| 402 | }; |
| 403 | |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 404 | struct mdp_qseed_cfg_data { |
| 405 | uint32_t block; |
| 406 | struct mdp_qseed_cfg qseed_data; |
| 407 | }; |
| 408 | |
Carl Vanderlip | 94d9b78 | 2013-01-16 12:13:52 -0800 | [diff] [blame] | 409 | #define MDP_OVERLAY_PP_CSC_CFG 0x1 |
| 410 | #define MDP_OVERLAY_PP_QSEED_CFG 0x2 |
| 411 | #define MDP_OVERLAY_PP_PA_CFG 0x4 |
| 412 | #define MDP_OVERLAY_PP_IGC_CFG 0x8 |
Ping Li | 87cca83 | 2013-01-30 18:27:52 -0500 | [diff] [blame] | 413 | #define MDP_OVERLAY_PP_SHARP_CFG 0x10 |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 414 | #define MDP_OVERLAY_PP_HIST_CFG 0x20 |
Carl Vanderlip | 5702713 | 2013-03-18 13:53:16 -0700 | [diff] [blame] | 415 | #define MDP_OVERLAY_PP_HIST_LUT_CFG 0x40 |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 416 | #define MDP_OVERLAY_PP_PA_V2_CFG 0x80 |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 417 | |
| 418 | #define MDP_CSC_FLAG_ENABLE 0x1 |
| 419 | #define MDP_CSC_FLAG_YUV_IN 0x2 |
| 420 | #define MDP_CSC_FLAG_YUV_OUT 0x4 |
| 421 | |
| 422 | struct mdp_csc_cfg { |
| 423 | /* flags for enable CSC, toggling RGB,YUV input/output */ |
| 424 | uint32_t flags; |
| 425 | uint32_t csc_mv[9]; |
| 426 | uint32_t csc_pre_bv[3]; |
| 427 | uint32_t csc_post_bv[3]; |
| 428 | uint32_t csc_pre_lv[6]; |
| 429 | uint32_t csc_post_lv[6]; |
| 430 | }; |
| 431 | |
| 432 | struct mdp_csc_cfg_data { |
| 433 | uint32_t block; |
| 434 | struct mdp_csc_cfg csc_data; |
| 435 | }; |
| 436 | |
Ping Li | 5822924 | 2012-11-30 14:05:43 -0500 | [diff] [blame] | 437 | struct mdp_pa_cfg { |
| 438 | uint32_t flags; |
| 439 | uint32_t hue_adj; |
| 440 | uint32_t sat_adj; |
| 441 | uint32_t val_adj; |
| 442 | uint32_t cont_adj; |
| 443 | }; |
| 444 | |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 445 | struct mdp_pa_mem_col_cfg { |
| 446 | uint32_t color_adjust_p0; |
| 447 | uint32_t color_adjust_p1; |
| 448 | uint32_t hue_region; |
| 449 | uint32_t sat_region; |
| 450 | uint32_t val_region; |
| 451 | }; |
| 452 | |
Benet Clark | 93577da | 2013-11-19 17:17:01 -0800 | [diff] [blame] | 453 | #define MDP_SIX_ZONE_LUT_SIZE 384 |
Carl Vanderlip | 4ac3a13 | 2013-11-19 16:52:52 -0800 | [diff] [blame] | 454 | |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 455 | struct mdp_pa_v2_data { |
| 456 | /* Mask bits for PA features */ |
| 457 | uint32_t flags; |
| 458 | uint32_t global_hue_adj; |
| 459 | uint32_t global_sat_adj; |
| 460 | uint32_t global_val_adj; |
| 461 | uint32_t global_cont_adj; |
| 462 | struct mdp_pa_mem_col_cfg skin_cfg; |
| 463 | struct mdp_pa_mem_col_cfg sky_cfg; |
| 464 | struct mdp_pa_mem_col_cfg fol_cfg; |
Benet Clark | 6695511 | 2013-12-04 12:52:22 -0800 | [diff] [blame] | 465 | uint32_t six_zone_len; |
| 466 | uint32_t six_zone_thresh; |
| 467 | uint32_t *six_zone_curve_p0; |
| 468 | uint32_t *six_zone_curve_p1; |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 469 | }; |
| 470 | |
Carl Vanderlip | 94d9b78 | 2013-01-16 12:13:52 -0800 | [diff] [blame] | 471 | struct mdp_igc_lut_data { |
| 472 | uint32_t block; |
| 473 | uint32_t len, ops; |
| 474 | uint32_t *c0_c1_data; |
| 475 | uint32_t *c2_data; |
| 476 | }; |
| 477 | |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 478 | struct mdp_histogram_cfg { |
| 479 | uint32_t ops; |
| 480 | uint32_t block; |
| 481 | uint8_t frame_cnt; |
| 482 | uint8_t bit_mask; |
| 483 | uint16_t num_bins; |
| 484 | }; |
| 485 | |
Carl Vanderlip | 5702713 | 2013-03-18 13:53:16 -0700 | [diff] [blame] | 486 | struct mdp_hist_lut_data { |
| 487 | uint32_t block; |
| 488 | uint32_t ops; |
| 489 | uint32_t len; |
| 490 | uint32_t *data; |
| 491 | }; |
| 492 | |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 493 | struct mdp_overlay_pp_params { |
| 494 | uint32_t config_ops; |
| 495 | struct mdp_csc_cfg csc_cfg; |
| 496 | struct mdp_qseed_cfg qseed_cfg[2]; |
Ping Li | 5822924 | 2012-11-30 14:05:43 -0500 | [diff] [blame] | 497 | struct mdp_pa_cfg pa_cfg; |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 498 | struct mdp_pa_v2_data pa_v2_cfg; |
Carl Vanderlip | 94d9b78 | 2013-01-16 12:13:52 -0800 | [diff] [blame] | 499 | struct mdp_igc_lut_data igc_cfg; |
Ping Li | 87cca83 | 2013-01-30 18:27:52 -0500 | [diff] [blame] | 500 | struct mdp_sharp_cfg sharp_cfg; |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 501 | struct mdp_histogram_cfg hist_cfg; |
Carl Vanderlip | 5702713 | 2013-03-18 13:53:16 -0700 | [diff] [blame] | 502 | struct mdp_hist_lut_data hist_lut_cfg; |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 503 | }; |
| 504 | |
Mayank Chopra | 29c4ee5 | 2013-07-24 12:31:01 +0530 | [diff] [blame] | 505 | /** |
| 506 | * enum mdss_mdp_blend_op - Different blend operations set by userspace |
| 507 | * |
| 508 | * @BLEND_OP_NOT_DEFINED: No blend operation defined for the layer. |
| 509 | * @BLEND_OP_OPAQUE: Apply a constant blend operation. The layer |
| 510 | * would appear opaque in case fg plane alpha is |
| 511 | * 0xff. |
| 512 | * @BLEND_OP_PREMULTIPLIED: Apply source over blend rule. Layer already has |
| 513 | * alpha pre-multiplication done. If fg plane alpha |
| 514 | * is less than 0xff, apply modulation as well. This |
| 515 | * operation is intended on layers having alpha |
| 516 | * channel. |
| 517 | * @BLEND_OP_COVERAGE: Apply source over blend rule. Layer is not alpha |
| 518 | * pre-multiplied. Apply pre-multiplication. If fg |
| 519 | * plane alpha is less than 0xff, apply modulation as |
| 520 | * well. |
| 521 | * @BLEND_OP_MAX: Used to track maximum blend operation possible by |
| 522 | * mdp. |
| 523 | */ |
| 524 | enum mdss_mdp_blend_op { |
| 525 | BLEND_OP_NOT_DEFINED = 0, |
| 526 | BLEND_OP_OPAQUE, |
| 527 | BLEND_OP_PREMULTIPLIED, |
| 528 | BLEND_OP_COVERAGE, |
| 529 | BLEND_OP_MAX, |
| 530 | }; |
| 531 | |
Jeevan Shriram | 4f187f7 | 2015-01-21 17:54:33 -0800 | [diff] [blame^] | 532 | #define DECIMATED_DIMENSION(dim, deci) (((dim) + ((1 << (deci)) - 1)) >> (deci)) |
Sree Sesha Aravind Vadrevu | 494961d | 2013-10-03 12:51:03 -0700 | [diff] [blame] | 533 | #define MAX_PLANES 4 |
| 534 | struct mdp_scale_data { |
| 535 | uint8_t enable_pxl_ext; |
| 536 | |
| 537 | int init_phase_x[MAX_PLANES]; |
| 538 | int phase_step_x[MAX_PLANES]; |
| 539 | int init_phase_y[MAX_PLANES]; |
| 540 | int phase_step_y[MAX_PLANES]; |
| 541 | |
| 542 | int num_ext_pxls_left[MAX_PLANES]; |
| 543 | int num_ext_pxls_right[MAX_PLANES]; |
| 544 | int num_ext_pxls_top[MAX_PLANES]; |
| 545 | int num_ext_pxls_btm[MAX_PLANES]; |
| 546 | |
| 547 | int left_ftch[MAX_PLANES]; |
| 548 | int left_rpt[MAX_PLANES]; |
| 549 | int right_ftch[MAX_PLANES]; |
| 550 | int right_rpt[MAX_PLANES]; |
| 551 | |
| 552 | int top_rpt[MAX_PLANES]; |
| 553 | int btm_rpt[MAX_PLANES]; |
| 554 | int top_ftch[MAX_PLANES]; |
| 555 | int btm_ftch[MAX_PLANES]; |
| 556 | |
| 557 | uint32_t roi_w[MAX_PLANES]; |
| 558 | }; |
| 559 | |
Adrian Salido-Moreno | f8da392 | 2013-07-03 15:19:25 -0700 | [diff] [blame] | 560 | /** |
Vineet Bajaj | 297ae49 | 2014-06-10 21:10:24 +0530 | [diff] [blame] | 561 | * enum mdp_overlay_pipe_type - Different pipe type set by userspace |
| 562 | * |
| 563 | * @PIPE_TYPE_AUTO: Not specified, pipe will be selected according to flags. |
| 564 | * @PIPE_TYPE_VIG: VIG pipe. |
| 565 | * @PIPE_TYPE_RGB: RGB pipe. |
| 566 | * @PIPE_TYPE_DMA: DMA pipe. |
| 567 | * @PIPE_TYPE_MAX: Used to track maximum number of pipe type. |
| 568 | */ |
| 569 | enum mdp_overlay_pipe_type { |
| 570 | PIPE_TYPE_AUTO = 0, |
| 571 | PIPE_TYPE_VIG, |
| 572 | PIPE_TYPE_RGB, |
| 573 | PIPE_TYPE_DMA, |
| 574 | PIPE_TYPE_MAX, |
| 575 | }; |
| 576 | |
| 577 | /** |
Adrian Salido-Moreno | f8da392 | 2013-07-03 15:19:25 -0700 | [diff] [blame] | 578 | * struct mdp_overlay - overlay surface structure |
| 579 | * @src: Source image information (width, height, format). |
| 580 | * @src_rect: Source crop rectangle, portion of image that will be fetched. |
| 581 | * This should always be within boundaries of source image. |
| 582 | * @dst_rect: Destination rectangle, the position and size of image on screen. |
| 583 | * This should always be within panel boundaries. |
| 584 | * @z_order: Blending stage to occupy in display, if multiple layers are |
| 585 | * present, highest z_order usually means the top most visible |
| 586 | * layer. The range acceptable is from 0-3 to support blending |
| 587 | * up to 4 layers. |
| 588 | * @is_fg: This flag is used to disable blending of any layers with z_order |
| 589 | * less than this overlay. It means that any layers with z_order |
| 590 | * less than this layer will not be blended and will be replaced |
| 591 | * by the background border color. |
| 592 | * @alpha: Used to set plane opacity. The range can be from 0-255, where |
| 593 | * 0 means completely transparent and 255 means fully opaque. |
| 594 | * @transp_mask: Color used as color key for transparency. Any pixel in fetched |
| 595 | * image matching this color will be transparent when blending. |
| 596 | * The color should be in same format as the source image format. |
| 597 | * @flags: This is used to customize operation of overlay. See MDP flags |
| 598 | * for more information. |
Vineet Bajaj | 297ae49 | 2014-06-10 21:10:24 +0530 | [diff] [blame] | 599 | * @pipe_type: Used to specify the type of overlay pipe. |
Adrian Salido-Moreno | f8da392 | 2013-07-03 15:19:25 -0700 | [diff] [blame] | 600 | * @user_data: DEPRECATED* Used to store user application specific information. |
Adrian Salido-Moreno | e21074d | 2013-07-03 15:41:33 -0700 | [diff] [blame] | 601 | * @bg_color: Solid color used to fill the overlay surface when no source |
| 602 | * buffer is provided. |
Adrian Salido-Moreno | f8da392 | 2013-07-03 15:19:25 -0700 | [diff] [blame] | 603 | * @horz_deci: Horizontal decimation value, this indicates the amount of pixels |
| 604 | * dropped for each pixel that is fetched from a line. The value |
| 605 | * given should be power of two of decimation amount. |
| 606 | * 0: no decimation |
| 607 | * 1: decimate by 2 (drop 1 pixel for each pixel fetched) |
| 608 | * 2: decimate by 4 (drop 3 pixels for each pixel fetched) |
| 609 | * 3: decimate by 8 (drop 7 pixels for each pixel fetched) |
| 610 | * 4: decimate by 16 (drop 15 pixels for each pixel fetched) |
| 611 | * @vert_deci: Vertical decimation value, this indicates the amount of lines |
| 612 | * dropped for each line that is fetched from overlay. The value |
| 613 | * given should be power of two of decimation amount. |
| 614 | * 0: no decimation |
| 615 | * 1: decimation by 2 (drop 1 line for each line fetched) |
| 616 | * 2: decimation by 4 (drop 3 lines for each line fetched) |
| 617 | * 3: decimation by 8 (drop 7 lines for each line fetched) |
| 618 | * 4: decimation by 16 (drop 15 lines for each line fetched) |
| 619 | * @overlay_pp_cfg: Overlay post processing configuration, for more information |
| 620 | * see struct mdp_overlay_pp_params. |
| 621 | */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 622 | struct mdp_overlay { |
| 623 | struct msmfb_img src; |
| 624 | struct mdp_rect src_rect; |
| 625 | struct mdp_rect dst_rect; |
| 626 | uint32_t z_order; /* stage number */ |
| 627 | uint32_t is_fg; /* control alpha & transp */ |
| 628 | uint32_t alpha; |
Mayank Chopra | 29c4ee5 | 2013-07-24 12:31:01 +0530 | [diff] [blame] | 629 | uint32_t blend_op; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 630 | uint32_t transp_mask; |
| 631 | uint32_t flags; |
Vineet Bajaj | 297ae49 | 2014-06-10 21:10:24 +0530 | [diff] [blame] | 632 | uint32_t pipe_type; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 633 | uint32_t id; |
Adrian Salido-Moreno | e21074d | 2013-07-03 15:41:33 -0700 | [diff] [blame] | 634 | uint32_t user_data[6]; |
| 635 | uint32_t bg_color; |
Sree Sesha Aravind Vadrevu | 05d4d22 | 2013-04-01 14:31:28 -0700 | [diff] [blame] | 636 | uint8_t horz_deci; |
| 637 | uint8_t vert_deci; |
Carl Vanderlip | dfe5751 | 2012-07-23 12:34:47 -0700 | [diff] [blame] | 638 | struct mdp_overlay_pp_params overlay_pp_cfg; |
Sree Sesha Aravind Vadrevu | 494961d | 2013-10-03 12:51:03 -0700 | [diff] [blame] | 639 | struct mdp_scale_data scale; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 640 | }; |
| 641 | |
| 642 | struct msmfb_overlay_3d { |
| 643 | uint32_t is_3d; |
| 644 | uint32_t width; |
| 645 | uint32_t height; |
| 646 | }; |
| 647 | |
| 648 | |
| 649 | struct msmfb_overlay_blt { |
| 650 | uint32_t enable; |
| 651 | uint32_t offset; |
| 652 | uint32_t width; |
| 653 | uint32_t height; |
| 654 | uint32_t bpp; |
| 655 | }; |
| 656 | |
| 657 | struct mdp_histogram { |
| 658 | uint32_t frame_cnt; |
| 659 | uint32_t bin_cnt; |
| 660 | uint32_t *r; |
| 661 | uint32_t *g; |
| 662 | uint32_t *b; |
| 663 | }; |
| 664 | |
Mayank Chopra | 0a8c476 | 2013-07-12 18:19:36 +0530 | [diff] [blame] | 665 | #define MISR_CRC_BATCH_SIZE 32 |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 666 | enum { |
Mayank Chopra | 0a8c476 | 2013-07-12 18:19:36 +0530 | [diff] [blame] | 667 | DISPLAY_MISR_EDP = 0, |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 668 | DISPLAY_MISR_DSI0, |
| 669 | DISPLAY_MISR_DSI1, |
| 670 | DISPLAY_MISR_HDMI, |
| 671 | DISPLAY_MISR_LCDC, |
Mayank Chopra | 0a8c476 | 2013-07-12 18:19:36 +0530 | [diff] [blame] | 672 | DISPLAY_MISR_MDP, |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 673 | DISPLAY_MISR_ATV, |
| 674 | DISPLAY_MISR_DSI_CMD, |
| 675 | DISPLAY_MISR_MAX |
| 676 | }; |
| 677 | |
| 678 | enum { |
Mayank Chopra | 0a8c476 | 2013-07-12 18:19:36 +0530 | [diff] [blame] | 679 | MISR_OP_NONE = 0, |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 680 | MISR_OP_SFM, |
| 681 | MISR_OP_MFM, |
| 682 | MISR_OP_BM, |
| 683 | MISR_OP_MAX |
| 684 | }; |
| 685 | |
| 686 | struct mdp_misr { |
| 687 | uint32_t block_id; |
| 688 | uint32_t frame_count; |
| 689 | uint32_t crc_op_mode; |
Mayank Chopra | 0a8c476 | 2013-07-12 18:19:36 +0530 | [diff] [blame] | 690 | uint32_t crc_value[MISR_CRC_BATCH_SIZE]; |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 691 | }; |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 692 | |
| 693 | /* |
| 694 | |
Ken Zhang | 6a43163 | 2012-08-08 16:46:22 -0400 | [diff] [blame] | 695 | 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] | 696 | |
| 697 | MDP_BLOCK_RESERVED is provided for backward compatibility and is |
| 698 | deprecated. It corresponds to DMA_P. So MDP_BLOCK_DMA_P should be used |
| 699 | instead. |
| 700 | |
Ken Zhang | 6a43163 | 2012-08-08 16:46:22 -0400 | [diff] [blame] | 701 | MDP_LOGICAL_BLOCK_DISP_0 identifies the display pipe which fb0 uses, |
| 702 | same for others. |
| 703 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 704 | */ |
| 705 | |
| 706 | enum { |
| 707 | MDP_BLOCK_RESERVED = 0, |
| 708 | MDP_BLOCK_OVERLAY_0, |
| 709 | MDP_BLOCK_OVERLAY_1, |
| 710 | MDP_BLOCK_VG_1, |
| 711 | MDP_BLOCK_VG_2, |
| 712 | MDP_BLOCK_RGB_1, |
| 713 | MDP_BLOCK_RGB_2, |
| 714 | MDP_BLOCK_DMA_P, |
| 715 | MDP_BLOCK_DMA_S, |
| 716 | MDP_BLOCK_DMA_E, |
Pravin Tamkhane | b18c9e2 | 2012-04-13 18:29:34 -0700 | [diff] [blame] | 717 | MDP_BLOCK_OVERLAY_2, |
Carl Vanderlip | bf16fdf6 | 2013-03-11 13:45:45 -0700 | [diff] [blame] | 718 | MDP_LOGICAL_BLOCK_DISP_0 = 0x10, |
Ken Zhang | 6a43163 | 2012-08-08 16:46:22 -0400 | [diff] [blame] | 719 | MDP_LOGICAL_BLOCK_DISP_1, |
| 720 | MDP_LOGICAL_BLOCK_DISP_2, |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 721 | MDP_BLOCK_MAX, |
| 722 | }; |
| 723 | |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 724 | /* |
| 725 | * mdp_histogram_start_req is used to provide the parameters for |
| 726 | * histogram start request |
| 727 | */ |
| 728 | |
| 729 | struct mdp_histogram_start_req { |
| 730 | uint32_t block; |
| 731 | uint8_t frame_cnt; |
| 732 | uint8_t bit_mask; |
Carl Vanderlip | 1631632 | 2012-10-08 16:47:34 -0700 | [diff] [blame] | 733 | uint16_t num_bins; |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 734 | }; |
| 735 | |
| 736 | /* |
| 737 | * mdp_histogram_data is used to return the histogram data, once |
| 738 | * the histogram is done/stopped/cance |
| 739 | */ |
| 740 | |
| 741 | struct mdp_histogram_data { |
| 742 | uint32_t block; |
Ken Zhang | 0f523bd | 2012-08-23 11:14:03 -0400 | [diff] [blame] | 743 | uint32_t bin_cnt; |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 744 | uint32_t *c0; |
| 745 | uint32_t *c1; |
| 746 | uint32_t *c2; |
Carl Vanderlip | 7b8b640 | 2012-03-01 10:58:03 -0800 | [diff] [blame] | 747 | uint32_t *extra_info; |
Carl Vanderlip | ba093a2 | 2011-11-22 13:59:59 -0800 | [diff] [blame] | 748 | }; |
| 749 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 750 | struct mdp_pcc_coeff { |
| 751 | uint32_t c, r, g, b, rr, gg, bb, rg, gb, rb, rgb_0, rgb_1; |
| 752 | }; |
| 753 | |
| 754 | struct mdp_pcc_cfg_data { |
| 755 | uint32_t block; |
| 756 | uint32_t ops; |
| 757 | struct mdp_pcc_coeff r, g, b; |
| 758 | }; |
| 759 | |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 760 | #define MDP_GAMUT_TABLE_NUM 8 |
| 761 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 762 | enum { |
| 763 | mdp_lut_igc, |
| 764 | mdp_lut_pgc, |
| 765 | mdp_lut_hist, |
| 766 | mdp_lut_max, |
| 767 | }; |
| 768 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 769 | struct mdp_ar_gc_lut_data { |
| 770 | uint32_t x_start; |
| 771 | uint32_t slope; |
| 772 | uint32_t offset; |
| 773 | }; |
| 774 | |
| 775 | struct mdp_pgc_lut_data { |
| 776 | uint32_t block; |
| 777 | uint32_t flags; |
| 778 | uint8_t num_r_stages; |
| 779 | uint8_t num_g_stages; |
| 780 | uint8_t num_b_stages; |
| 781 | struct mdp_ar_gc_lut_data *r_data; |
| 782 | struct mdp_ar_gc_lut_data *g_data; |
| 783 | struct mdp_ar_gc_lut_data *b_data; |
| 784 | }; |
| 785 | |
| 786 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 787 | struct mdp_lut_cfg_data { |
| 788 | uint32_t lut_type; |
| 789 | union { |
| 790 | struct mdp_igc_lut_data igc_lut_data; |
| 791 | struct mdp_pgc_lut_data pgc_lut_data; |
| 792 | struct mdp_hist_lut_data hist_lut_data; |
| 793 | } data; |
| 794 | }; |
| 795 | |
Carl Vanderlip | f0fd8e7 | 2012-05-03 15:08:20 -0700 | [diff] [blame] | 796 | struct mdp_bl_scale_data { |
| 797 | uint32_t min_lvl; |
| 798 | uint32_t scale; |
| 799 | }; |
Pravin Tamkhane | 67726da | 2012-04-13 11:59:11 -0700 | [diff] [blame] | 800 | |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 801 | struct mdp_pa_cfg_data { |
| 802 | uint32_t block; |
Ping Li | 5822924 | 2012-11-30 14:05:43 -0500 | [diff] [blame] | 803 | struct mdp_pa_cfg pa_data; |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 804 | }; |
| 805 | |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 806 | struct mdp_pa_v2_cfg_data { |
| 807 | uint32_t block; |
| 808 | struct mdp_pa_v2_data pa_v2_data; |
| 809 | }; |
| 810 | |
Ken Zhang | 7fb8577 | 2012-08-18 14:51:33 -0400 | [diff] [blame] | 811 | struct mdp_dither_cfg_data { |
| 812 | uint32_t block; |
| 813 | uint32_t flags; |
| 814 | uint32_t g_y_depth; |
| 815 | uint32_t r_cr_depth; |
| 816 | uint32_t b_cb_depth; |
| 817 | }; |
| 818 | |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 819 | struct mdp_gamut_cfg_data { |
| 820 | uint32_t block; |
| 821 | uint32_t flags; |
| 822 | uint32_t gamut_first; |
| 823 | uint32_t tbl_size[MDP_GAMUT_TABLE_NUM]; |
| 824 | uint16_t *r_tbl[MDP_GAMUT_TABLE_NUM]; |
| 825 | uint16_t *g_tbl[MDP_GAMUT_TABLE_NUM]; |
| 826 | uint16_t *b_tbl[MDP_GAMUT_TABLE_NUM]; |
| 827 | }; |
| 828 | |
Carl Vanderlip | e8ed5ec | 2012-09-28 16:04:10 -0700 | [diff] [blame] | 829 | struct mdp_calib_config_data { |
| 830 | uint32_t ops; |
| 831 | uint32_t addr; |
| 832 | uint32_t data; |
| 833 | }; |
| 834 | |
Arpita Banerjee | 676eea2 | 2013-06-04 19:43:24 -0700 | [diff] [blame] | 835 | struct mdp_calib_config_buffer { |
| 836 | uint32_t ops; |
| 837 | uint32_t size; |
| 838 | uint32_t *buffer; |
| 839 | }; |
| 840 | |
Arpita Banerjee | a8b7fbf | 2013-06-11 19:24:20 -0700 | [diff] [blame] | 841 | struct mdp_calib_dcm_state { |
| 842 | uint32_t ops; |
| 843 | uint32_t dcm_state; |
| 844 | }; |
| 845 | |
| 846 | enum { |
| 847 | DCM_UNINIT, |
| 848 | DCM_UNBLANK, |
| 849 | DCM_ENTER, |
| 850 | DCM_EXIT, |
| 851 | DCM_BLANK, |
Dhaval Patel | 3909053 | 2013-12-04 12:11:32 -0800 | [diff] [blame] | 852 | DTM_ENTER, |
| 853 | DTM_EXIT, |
Arpita Banerjee | a8b7fbf | 2013-06-11 19:24:20 -0700 | [diff] [blame] | 854 | }; |
| 855 | |
Carl Vanderlip | 45e042b | 2013-12-11 13:27:00 -0800 | [diff] [blame] | 856 | #define MDSS_PP_SPLIT_LEFT_ONLY 0x10000000 |
| 857 | #define MDSS_PP_SPLIT_RIGHT_ONLY 0x20000000 |
| 858 | #define MDSS_PP_SPLIT_MASK 0x30000000 |
| 859 | |
Carl Vanderlip | e5592b6 | 2013-05-16 21:00:03 -0700 | [diff] [blame] | 860 | #define MDSS_MAX_BL_BRIGHTNESS 255 |
Benet Clark | c5982d5 | 2013-11-08 16:05:58 -0800 | [diff] [blame] | 861 | #define AD_BL_LIN_LEN 256 |
Ping Li | d69888a | 2014-01-22 16:55:35 -0800 | [diff] [blame] | 862 | #define AD_BL_ATT_LUT_LEN 33 |
Carl Vanderlip | e5592b6 | 2013-05-16 21:00:03 -0700 | [diff] [blame] | 863 | |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 864 | #define MDSS_AD_MODE_AUTO_BL 0x0 |
| 865 | #define MDSS_AD_MODE_AUTO_STR 0x1 |
| 866 | #define MDSS_AD_MODE_TARG_STR 0x3 |
| 867 | #define MDSS_AD_MODE_MAN_STR 0x7 |
Carl Vanderlip | 819c509 | 2013-05-19 12:08:33 -0700 | [diff] [blame] | 868 | #define MDSS_AD_MODE_CALIB 0xF |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 869 | |
| 870 | #define MDP_PP_AD_INIT 0x10 |
| 871 | #define MDP_PP_AD_CFG 0x20 |
| 872 | |
| 873 | struct mdss_ad_init { |
| 874 | uint32_t asym_lut[33]; |
| 875 | uint32_t color_corr_lut[33]; |
| 876 | uint8_t i_control[2]; |
| 877 | uint16_t black_lvl; |
| 878 | uint16_t white_lvl; |
| 879 | uint8_t var; |
| 880 | uint8_t limit_ampl; |
| 881 | uint8_t i_dither; |
| 882 | uint8_t slope_max; |
| 883 | uint8_t slope_min; |
| 884 | uint8_t dither_ctl; |
| 885 | uint8_t format; |
| 886 | uint8_t auto_size; |
| 887 | uint16_t frame_w; |
| 888 | uint16_t frame_h; |
| 889 | uint8_t logo_v; |
| 890 | uint8_t logo_h; |
Ping Li | d69888a | 2014-01-22 16:55:35 -0800 | [diff] [blame] | 891 | uint32_t alpha; |
| 892 | uint32_t alpha_base; |
Carl Vanderlip | e5592b6 | 2013-05-16 21:00:03 -0700 | [diff] [blame] | 893 | uint32_t bl_lin_len; |
Ping Li | d69888a | 2014-01-22 16:55:35 -0800 | [diff] [blame] | 894 | uint32_t bl_att_len; |
Carl Vanderlip | e5592b6 | 2013-05-16 21:00:03 -0700 | [diff] [blame] | 895 | uint32_t *bl_lin; |
| 896 | uint32_t *bl_lin_inv; |
Ping Li | d69888a | 2014-01-22 16:55:35 -0800 | [diff] [blame] | 897 | uint32_t *bl_att_lut; |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 898 | }; |
| 899 | |
Carl Vanderlip | 5e81ced | 2013-05-23 20:02:14 -0700 | [diff] [blame] | 900 | #define MDSS_AD_BL_CTRL_MODE_EN 1 |
| 901 | #define MDSS_AD_BL_CTRL_MODE_DIS 0 |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 902 | struct mdss_ad_cfg { |
| 903 | uint32_t mode; |
| 904 | uint32_t al_calib_lut[33]; |
| 905 | uint16_t backlight_min; |
| 906 | uint16_t backlight_max; |
| 907 | uint16_t backlight_scale; |
| 908 | uint16_t amb_light_min; |
| 909 | uint16_t filter[2]; |
| 910 | uint16_t calib[4]; |
| 911 | uint8_t strength_limit; |
| 912 | uint8_t t_filter_recursion; |
Carl Vanderlip | 956360e | 2013-04-04 20:57:17 -0700 | [diff] [blame] | 913 | uint16_t stab_itr; |
Carl Vanderlip | 5e81ced | 2013-05-23 20:02:14 -0700 | [diff] [blame] | 914 | uint32_t bl_ctrl_mode; |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 915 | }; |
| 916 | |
| 917 | /* ops uses standard MDP_PP_* flags */ |
| 918 | struct mdss_ad_init_cfg { |
| 919 | uint32_t ops; |
| 920 | union { |
| 921 | struct mdss_ad_init init; |
| 922 | struct mdss_ad_cfg cfg; |
| 923 | } params; |
| 924 | }; |
| 925 | |
| 926 | /* mode uses MDSS_AD_MODE_* flags */ |
| 927 | struct mdss_ad_input { |
| 928 | uint32_t mode; |
| 929 | union { |
| 930 | uint32_t amb_light; |
| 931 | uint32_t strength; |
Carl Vanderlip | 819c509 | 2013-05-19 12:08:33 -0700 | [diff] [blame] | 932 | uint32_t calib_bl; |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 933 | } in; |
Carl Vanderlip | 16e7953 | 2013-04-02 11:12:16 -0700 | [diff] [blame] | 934 | uint32_t output; |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 935 | }; |
| 936 | |
Carl Vanderlip | a088b7c | 2013-05-17 13:52:53 -0700 | [diff] [blame] | 937 | #define MDSS_CALIB_MODE_BL 0x1 |
Carl Vanderlip | 95a07e1 | 2013-05-17 13:51:38 -0700 | [diff] [blame] | 938 | struct mdss_calib_cfg { |
| 939 | uint32_t ops; |
| 940 | uint32_t calib_mask; |
| 941 | }; |
| 942 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 943 | enum { |
| 944 | mdp_op_pcc_cfg, |
| 945 | mdp_op_csc_cfg, |
| 946 | mdp_op_lut_cfg, |
Pravin Tamkhane | 67726da | 2012-04-13 11:59:11 -0700 | [diff] [blame] | 947 | mdp_op_qseed_cfg, |
Carl Vanderlip | f0fd8e7 | 2012-05-03 15:08:20 -0700 | [diff] [blame] | 948 | mdp_bl_scale_cfg, |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 949 | mdp_op_pa_cfg, |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 950 | mdp_op_pa_v2_cfg, |
Ken Zhang | 7fb8577 | 2012-08-18 14:51:33 -0400 | [diff] [blame] | 951 | mdp_op_dither_cfg, |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 952 | mdp_op_gamut_cfg, |
Carl Vanderlip | e8ed5ec | 2012-09-28 16:04:10 -0700 | [diff] [blame] | 953 | mdp_op_calib_cfg, |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 954 | mdp_op_ad_cfg, |
| 955 | mdp_op_ad_input, |
Carl Vanderlip | 95a07e1 | 2013-05-17 13:51:38 -0700 | [diff] [blame] | 956 | mdp_op_calib_mode, |
Arpita Banerjee | 676eea2 | 2013-06-04 19:43:24 -0700 | [diff] [blame] | 957 | mdp_op_calib_buffer, |
Arpita Banerjee | a8b7fbf | 2013-06-11 19:24:20 -0700 | [diff] [blame] | 958 | mdp_op_calib_dcm_state, |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 959 | mdp_op_max, |
| 960 | }; |
| 961 | |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 962 | enum { |
| 963 | WB_FORMAT_NV12, |
| 964 | WB_FORMAT_RGB_565, |
| 965 | WB_FORMAT_RGB_888, |
| 966 | WB_FORMAT_xRGB_8888, |
| 967 | WB_FORMAT_ARGB_8888, |
Pawan Kumar | ee81193 | 2013-07-09 15:45:01 +0530 | [diff] [blame] | 968 | WB_FORMAT_BGRA_8888, |
| 969 | WB_FORMAT_BGRX_8888, |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 970 | WB_FORMAT_ARGB_8888_INPUT_ALPHA /* Need to support */ |
| 971 | }; |
| 972 | |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 973 | struct msmfb_mdp_pp { |
| 974 | uint32_t op; |
| 975 | union { |
| 976 | struct mdp_pcc_cfg_data pcc_cfg_data; |
| 977 | struct mdp_csc_cfg_data csc_cfg_data; |
| 978 | struct mdp_lut_cfg_data lut_cfg_data; |
Pravin Tamkhane | 67726da | 2012-04-13 11:59:11 -0700 | [diff] [blame] | 979 | struct mdp_qseed_cfg_data qseed_cfg_data; |
Carl Vanderlip | f0fd8e7 | 2012-05-03 15:08:20 -0700 | [diff] [blame] | 980 | struct mdp_bl_scale_data bl_scale_data; |
Ken Zhang | 77ce019 | 2012-08-10 11:27:19 -0400 | [diff] [blame] | 981 | struct mdp_pa_cfg_data pa_cfg_data; |
Benet Clark | 477baa0 | 2013-10-04 17:21:45 -0700 | [diff] [blame] | 982 | struct mdp_pa_v2_cfg_data pa_v2_cfg_data; |
Ken Zhang | 7fb8577 | 2012-08-18 14:51:33 -0400 | [diff] [blame] | 983 | struct mdp_dither_cfg_data dither_cfg_data; |
Ken Zhang | bf5fb4c | 2012-08-19 14:41:01 -0400 | [diff] [blame] | 984 | struct mdp_gamut_cfg_data gamut_cfg_data; |
Carl Vanderlip | e8ed5ec | 2012-09-28 16:04:10 -0700 | [diff] [blame] | 985 | struct mdp_calib_config_data calib_cfg; |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 986 | struct mdss_ad_init_cfg ad_init_cfg; |
Carl Vanderlip | 95a07e1 | 2013-05-17 13:51:38 -0700 | [diff] [blame] | 987 | struct mdss_calib_cfg mdss_calib_cfg; |
Carl Vanderlip | 8b493b0 | 2013-03-22 13:40:02 -0700 | [diff] [blame] | 988 | struct mdss_ad_input ad_input; |
Arpita Banerjee | 676eea2 | 2013-06-04 19:43:24 -0700 | [diff] [blame] | 989 | struct mdp_calib_config_buffer calib_buffer; |
Arpita Banerjee | a8b7fbf | 2013-06-11 19:24:20 -0700 | [diff] [blame] | 990 | struct mdp_calib_dcm_state calib_dcm; |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 991 | } data; |
| 992 | }; |
| 993 | |
Manoj Rao | a8e39d9 | 2013-02-16 08:47:21 -0800 | [diff] [blame] | 994 | #define FB_METADATA_VIDEO_INFO_CODE_SUPPORT 1 |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 995 | enum { |
| 996 | metadata_op_none, |
| 997 | metadata_op_base_blend, |
Ken Zhang | 420dd20 | 2013-01-08 14:28:20 -0500 | [diff] [blame] | 998 | metadata_op_frame_rate, |
Manoj Rao | a8e39d9 | 2013-02-16 08:47:21 -0800 | [diff] [blame] | 999 | metadata_op_vic, |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 1000 | metadata_op_wb_format, |
Tatenda Chipeperekwa | 5dc8c48 | 2013-10-25 17:44:37 -0700 | [diff] [blame] | 1001 | metadata_op_wb_secure, |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 1002 | metadata_op_get_caps, |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 1003 | metadata_op_crc, |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 1004 | metadata_op_max |
| 1005 | }; |
Pravin Tamkhane | 02a4068 | 2011-11-29 14:17:01 -0800 | [diff] [blame] | 1006 | |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 1007 | struct mdp_blend_cfg { |
| 1008 | uint32_t is_premultiplied; |
| 1009 | }; |
| 1010 | |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 1011 | struct mdp_mixer_cfg { |
| 1012 | uint32_t writeback_format; |
| 1013 | uint32_t alpha; |
| 1014 | }; |
| 1015 | |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 1016 | struct mdss_hw_caps { |
| 1017 | uint32_t mdp_rev; |
| 1018 | uint8_t rgb_pipes; |
| 1019 | uint8_t vig_pipes; |
| 1020 | uint8_t dma_pipes; |
Mayank Chopra | fc77ef1 | 2013-11-20 19:31:14 +0530 | [diff] [blame] | 1021 | uint8_t max_smp_cnt; |
| 1022 | uint8_t smp_per_pipe; |
Sree Sesha Aravind Vadrevu | 10c4d77 | 2013-03-28 13:11:12 -0700 | [diff] [blame] | 1023 | uint32_t features; |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 1024 | }; |
| 1025 | |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 1026 | struct msmfb_metadata { |
| 1027 | uint32_t op; |
| 1028 | uint32_t flags; |
| 1029 | union { |
Sree Sesha Aravind Vadrevu | 7bacaaa | 2013-03-20 11:50:25 -0700 | [diff] [blame] | 1030 | struct mdp_misr misr_request; |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 1031 | struct mdp_blend_cfg blend_cfg; |
Pawan Kumar | 9807ea1 | 2013-02-14 18:12:02 +0530 | [diff] [blame] | 1032 | struct mdp_mixer_cfg mixer_cfg; |
Ken Zhang | 420dd20 | 2013-01-08 14:28:20 -0500 | [diff] [blame] | 1033 | uint32_t panel_frame_rate; |
Manoj Rao | a8e39d9 | 2013-02-16 08:47:21 -0800 | [diff] [blame] | 1034 | uint32_t video_info_code; |
Adrian Salido-Moreno | 9bf71f3 | 2013-03-05 19:23:44 -0800 | [diff] [blame] | 1035 | struct mdss_hw_caps caps; |
Tatenda Chipeperekwa | 5dc8c48 | 2013-10-25 17:44:37 -0700 | [diff] [blame] | 1036 | uint8_t secure_en; |
Ken Zhang | 5cf85c0 | 2012-08-23 19:32:52 -0700 | [diff] [blame] | 1037 | } data; |
| 1038 | }; |
Ken Zhang | 5295d80 | 2012-11-07 18:33:16 -0500 | [diff] [blame] | 1039 | |
Adrian Salido-Moreno | 1a74a49 | 2013-05-11 21:24:43 -0700 | [diff] [blame] | 1040 | #define MDP_MAX_FENCE_FD 32 |
Ken Zhang | 5295d80 | 2012-11-07 18:33:16 -0500 | [diff] [blame] | 1041 | #define MDP_BUF_SYNC_FLAG_WAIT 1 |
Adrian Salido-Moreno | 1017e94 | 2014-01-10 15:39:49 -0800 | [diff] [blame] | 1042 | #define MDP_BUF_SYNC_FLAG_RETIRE_FENCE 0x10 |
Ken Zhang | 5295d80 | 2012-11-07 18:33:16 -0500 | [diff] [blame] | 1043 | |
| 1044 | struct mdp_buf_sync { |
| 1045 | uint32_t flags; |
| 1046 | uint32_t acq_fen_fd_cnt; |
Jayant Shekhar | f399699 | 2013-08-22 14:28:10 +0530 | [diff] [blame] | 1047 | uint32_t session_id; |
Ken Zhang | 5295d80 | 2012-11-07 18:33:16 -0500 | [diff] [blame] | 1048 | int *acq_fen_fd; |
| 1049 | int *rel_fen_fd; |
Adrian Salido-Moreno | 1017e94 | 2014-01-10 15:39:49 -0800 | [diff] [blame] | 1050 | int *retire_fen_fd; |
Ken Zhang | 5295d80 | 2012-11-07 18:33:16 -0500 | [diff] [blame] | 1051 | }; |
| 1052 | |
Terence Hampson | 3e636aa | 2013-05-08 19:01:51 -0400 | [diff] [blame] | 1053 | struct mdp_async_blit_req_list { |
| 1054 | struct mdp_buf_sync sync; |
| 1055 | uint32_t count; |
| 1056 | struct mdp_blit_req req[]; |
| 1057 | }; |
| 1058 | |
Ken Zhang | 4e83b93 | 2012-12-02 21:15:47 -0500 | [diff] [blame] | 1059 | #define MDP_DISPLAY_COMMIT_OVERLAY 1 |
| 1060 | |
| 1061 | struct mdp_display_commit { |
| 1062 | uint32_t flags; |
| 1063 | uint32_t wait_for_finish; |
| 1064 | struct fb_var_screeninfo var; |
Jeykumar Sankaran | b826f33 | 2013-09-07 00:58:43 -0700 | [diff] [blame] | 1065 | struct mdp_rect roi; |
Ken Zhang | 4e83b93 | 2012-12-02 21:15:47 -0500 | [diff] [blame] | 1066 | }; |
| 1067 | |
Adrian Salido-Moreno | 6b15509 | 2014-01-07 17:29:20 -0800 | [diff] [blame] | 1068 | /** |
| 1069 | * struct mdp_overlay_list - argument for ioctl MSMFB_OVERLAY_PREPARE |
| 1070 | * @num_overlays: Number of overlay layers as part of the frame. |
| 1071 | * @overlay_list: Pointer to a list of overlay structures identifying |
| 1072 | * the layers as part of the frame |
| 1073 | * @flags: Flags can be used to extend behavior. |
| 1074 | * @processed_overlays: Output parameter indicating how many pipes were |
| 1075 | * successful. If there are no errors this number should |
| 1076 | * match num_overlays. Otherwise it will indicate the last |
| 1077 | * successful index for overlay that couldn't be set. |
| 1078 | */ |
| 1079 | struct mdp_overlay_list { |
| 1080 | uint32_t num_overlays; |
| 1081 | struct mdp_overlay **overlay_list; |
| 1082 | uint32_t flags; |
| 1083 | uint32_t processed_overlays; |
| 1084 | }; |
| 1085 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1086 | struct mdp_page_protection { |
| 1087 | uint32_t page_protection; |
| 1088 | }; |
| 1089 | |
kuogee hsieh | 405dc30 | 2011-07-21 15:06:59 -0700 | [diff] [blame] | 1090 | |
| 1091 | struct mdp_mixer_info { |
| 1092 | int pndx; |
| 1093 | int pnum; |
| 1094 | int ptype; |
| 1095 | int mixer_num; |
| 1096 | int z_order; |
| 1097 | }; |
| 1098 | |
| 1099 | #define MAX_PIPE_PER_MIXER 4 |
| 1100 | |
| 1101 | struct msmfb_mixer_info_req { |
| 1102 | int mixer_num; |
| 1103 | int cnt; |
| 1104 | struct mdp_mixer_info info[MAX_PIPE_PER_MIXER]; |
| 1105 | }; |
| 1106 | |
Ravishangar Kalyanam | 6bc448a | 2012-03-14 11:31:52 -0700 | [diff] [blame] | 1107 | enum { |
| 1108 | DISPLAY_SUBSYSTEM_ID, |
| 1109 | ROTATOR_SUBSYSTEM_ID, |
| 1110 | }; |
kuogee hsieh | 405dc30 | 2011-07-21 15:06:59 -0700 | [diff] [blame] | 1111 | |
Adrian Salido-Moreno | 96d88d4 | 2012-12-20 13:01:39 -0800 | [diff] [blame] | 1112 | enum { |
| 1113 | MDP_IOMMU_DOMAIN_CP, |
| 1114 | MDP_IOMMU_DOMAIN_NS, |
| 1115 | }; |
| 1116 | |
Deva Ramasubramanian | 166b098 | 2013-01-25 20:11:41 -0800 | [diff] [blame] | 1117 | enum { |
| 1118 | MDP_WRITEBACK_MIRROR_OFF, |
| 1119 | MDP_WRITEBACK_MIRROR_ON, |
| 1120 | MDP_WRITEBACK_MIRROR_PAUSE, |
| 1121 | MDP_WRITEBACK_MIRROR_RESUME, |
| 1122 | }; |
| 1123 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1124 | #ifdef __KERNEL__ |
Adrian Salido-Moreno | 96d88d4 | 2012-12-20 13:01:39 -0800 | [diff] [blame] | 1125 | int msm_fb_get_iommu_domain(struct fb_info *info, int domain); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1126 | /* get the framebuffer physical address information */ |
Ravishangar Kalyanam | 6bc448a | 2012-03-14 11:31:52 -0700 | [diff] [blame] | 1127 | int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num, |
| 1128 | int subsys_id); |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 1129 | struct fb_info *msm_fb_get_writeback_fb(void); |
| 1130 | int msm_fb_writeback_init(struct fb_info *info); |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 1131 | int msm_fb_writeback_start(struct fb_info *info); |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 1132 | int msm_fb_writeback_queue_buffer(struct fb_info *info, |
| 1133 | struct msmfb_data *data); |
| 1134 | int msm_fb_writeback_dequeue_buffer(struct fb_info *info, |
| 1135 | struct msmfb_data *data); |
Vinay Kalia | e1ba270 | 2011-12-21 16:24:52 -0800 | [diff] [blame] | 1136 | int msm_fb_writeback_stop(struct fb_info *info); |
Vinay Kalia | 27020d1 | 2011-10-14 17:50:29 -0700 | [diff] [blame] | 1137 | int msm_fb_writeback_terminate(struct fb_info *info); |
Adrian Salido-Moreno | 96d88d4 | 2012-12-20 13:01:39 -0800 | [diff] [blame] | 1138 | int msm_fb_writeback_set_secure(struct fb_info *info, int enable); |
Pawan Kumar | ce25d14 | 2014-01-29 16:47:35 +0530 | [diff] [blame] | 1139 | int msm_fb_writeback_iommu_ref(struct fb_info *info, int enable); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1140 | #endif |
| 1141 | |
| 1142 | #endif /*_MSM_MDP_H_*/ |