Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1 | /* |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 2 | * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved. |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 3 | * Not a Contribution, Apache license notifications and license are retained |
| 4 | * for attribution purposes only. |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 19 | #include <math.h> |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 20 | #include "hwc_mdpcomp.h" |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 21 | #include <sys/ioctl.h> |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 22 | #include "external.h" |
Ramkumar Radhakrishnan | 47573e2 | 2012-11-07 11:36:41 -0800 | [diff] [blame] | 23 | #include "qdMetaData.h" |
Ramkumar Radhakrishnan | 288f8c7 | 2013-01-15 11:37:54 -0800 | [diff] [blame] | 24 | #include "mdp_version.h" |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 25 | #include <overlayRotator.h> |
| 26 | |
Saurabh Shah | 85234ec | 2013-04-12 17:09:00 -0700 | [diff] [blame] | 27 | using namespace overlay; |
Saurabh Shah | bd2d083 | 2013-04-04 14:33:08 -0700 | [diff] [blame] | 28 | using namespace qdutils; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 29 | using namespace overlay::utils; |
| 30 | namespace ovutils = overlay::utils; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 31 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 32 | namespace qhwc { |
| 33 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 34 | //==============MDPComp======================================================== |
| 35 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 36 | IdleInvalidator *MDPComp::idleInvalidator = NULL; |
| 37 | bool MDPComp::sIdleFallBack = false; |
| 38 | bool MDPComp::sDebugLogs = false; |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 39 | bool MDPComp::sEnabled = false; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 40 | int MDPComp::sMaxPipesPerMixer = MAX_PIPES_PER_MIXER; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 41 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 42 | MDPComp* MDPComp::getObject(const int& width, int dpy) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 43 | if(width <= MAX_DISPLAY_DIM) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 44 | return new MDPCompLowRes(dpy); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 45 | } else { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 46 | return new MDPCompHighRes(dpy); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 47 | } |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 48 | } |
| 49 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 50 | MDPComp::MDPComp(int dpy):mDpy(dpy){}; |
| 51 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 52 | void MDPComp::dump(android::String8& buf) |
| 53 | { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 54 | dumpsys_log(buf,"HWC Map for Dpy: %s \n", |
| 55 | mDpy ? "\"EXTERNAL\"" : "\"PRIMARY\""); |
| 56 | dumpsys_log(buf,"PREV_FRAME: layerCount:%2d mdpCount:%2d \ |
| 57 | cacheCount:%2d \n", mCachedFrame.layerCount, |
| 58 | mCachedFrame.mdpCount, mCachedFrame.cacheCount); |
| 59 | dumpsys_log(buf,"CURR_FRAME: layerCount:%2d mdpCount:%2d \ |
| 60 | fbCount:%2d \n", mCurrentFrame.layerCount, |
| 61 | mCurrentFrame.mdpCount, mCurrentFrame.fbCount); |
| 62 | dumpsys_log(buf,"needsFBRedraw:%3s pipesUsed:%2d MaxPipesPerMixer: %d \n", |
| 63 | (mCurrentFrame.needsRedraw? "YES" : "NO"), |
| 64 | mCurrentFrame.mdpCount, sMaxPipesPerMixer); |
| 65 | dumpsys_log(buf," --------------------------------------------- \n"); |
| 66 | dumpsys_log(buf," listIdx | cached? | mdpIndex | comptype | Z \n"); |
| 67 | dumpsys_log(buf," --------------------------------------------- \n"); |
| 68 | for(int index = 0; index < mCurrentFrame.layerCount; index++ ) |
| 69 | dumpsys_log(buf," %7d | %7s | %8d | %9s | %2d \n", |
| 70 | index, |
| 71 | (mCurrentFrame.isFBComposed[index] ? "YES" : "NO"), |
| 72 | mCurrentFrame.layerToMDP[index], |
| 73 | (mCurrentFrame.isFBComposed[index] ? |
| 74 | (mCurrentFrame.needsRedraw ? "GLES" : "CACHE") : "MDP"), |
| 75 | (mCurrentFrame.isFBComposed[index] ? mCurrentFrame.fbZ : |
| 76 | mCurrentFrame.mdpToLayer[mCurrentFrame.layerToMDP[index]].pipeInfo->zOrder)); |
| 77 | dumpsys_log(buf,"\n"); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | bool MDPComp::init(hwc_context_t *ctx) { |
| 81 | |
| 82 | if(!ctx) { |
| 83 | ALOGE("%s: Invalid hwc context!!",__FUNCTION__); |
| 84 | return false; |
| 85 | } |
| 86 | |
| 87 | if(!setupBasePipe(ctx)) { |
| 88 | ALOGE("%s: Failed to setup primary base pipe", __FUNCTION__); |
| 89 | return false; |
| 90 | } |
| 91 | |
| 92 | char property[PROPERTY_VALUE_MAX]; |
| 93 | |
| 94 | sEnabled = false; |
| 95 | if((property_get("persist.hwc.mdpcomp.enable", property, NULL) > 0) && |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 96 | (!strncmp(property, "1", PROPERTY_VALUE_MAX ) || |
| 97 | (!strncasecmp(property,"true", PROPERTY_VALUE_MAX )))) { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 98 | sEnabled = true; |
| 99 | } |
| 100 | |
| 101 | sDebugLogs = false; |
| 102 | if(property_get("debug.mdpcomp.logs", property, NULL) > 0) { |
| 103 | if(atoi(property) != 0) |
| 104 | sDebugLogs = true; |
| 105 | } |
| 106 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 107 | sMaxPipesPerMixer = MAX_PIPES_PER_MIXER; |
Saurabh Shah | 85234ec | 2013-04-12 17:09:00 -0700 | [diff] [blame] | 108 | if(property_get("debug.mdpcomp.maxpermixer", property, "-1") > 0) { |
| 109 | int val = atoi(property); |
| 110 | if(val >= 0) |
| 111 | sMaxPipesPerMixer = min(val, MAX_PIPES_PER_MIXER); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 112 | } |
| 113 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 114 | unsigned long idle_timeout = DEFAULT_IDLE_TIME; |
| 115 | if(property_get("debug.mdpcomp.idletime", property, NULL) > 0) { |
| 116 | if(atoi(property) != 0) |
| 117 | idle_timeout = atoi(property); |
| 118 | } |
| 119 | |
| 120 | //create Idle Invalidator |
| 121 | idleInvalidator = IdleInvalidator::getInstance(); |
| 122 | |
| 123 | if(idleInvalidator == NULL) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 124 | ALOGE("%s: failed to instantiate idleInvalidator object", __FUNCTION__); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 125 | } else { |
| 126 | idleInvalidator->init(timeout_handler, ctx, idle_timeout); |
| 127 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 128 | return true; |
| 129 | } |
| 130 | |
| 131 | void MDPComp::timeout_handler(void *udata) { |
| 132 | struct hwc_context_t* ctx = (struct hwc_context_t*)(udata); |
| 133 | |
| 134 | if(!ctx) { |
| 135 | ALOGE("%s: received empty data in timer callback", __FUNCTION__); |
| 136 | return; |
| 137 | } |
| 138 | |
Jesse Hall | 3be78d9 | 2012-08-21 15:12:23 -0700 | [diff] [blame] | 139 | if(!ctx->proc) { |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 140 | ALOGE("%s: HWC proc not registered", __FUNCTION__); |
| 141 | return; |
| 142 | } |
| 143 | sIdleFallBack = true; |
| 144 | /* Trigger SF to redraw the current frame */ |
Jesse Hall | 3be78d9 | 2012-08-21 15:12:23 -0700 | [diff] [blame] | 145 | ctx->proc->invalidate(ctx->proc); |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 146 | } |
| 147 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 148 | void MDPComp::setMDPCompLayerFlags(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 149 | hwc_display_contents_1_t* list) { |
| 150 | LayerProp *layerProp = ctx->layerProp[mDpy]; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 151 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 152 | for(int index = 0; index < ctx->listStats[mDpy].numAppLayers; index++) { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 153 | hwc_layer_1_t* layer = &(list->hwLayers[index]); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 154 | if(!mCurrentFrame.isFBComposed[index]) { |
| 155 | layerProp[index].mFlags |= HWC_MDPCOMP; |
| 156 | layer->compositionType = HWC_OVERLAY; |
| 157 | layer->hints |= HWC_HINT_CLEAR_FB; |
| 158 | mCachedFrame.hnd[index] = NULL; |
| 159 | } else { |
| 160 | if(!mCurrentFrame.needsRedraw) |
| 161 | layer->compositionType = HWC_OVERLAY; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 162 | } |
| 163 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 164 | } |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 165 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 166 | /* |
| 167 | * Sets up BORDERFILL as default base pipe and detaches RGB0. |
| 168 | * Framebuffer is always updated using PLAY ioctl. |
| 169 | */ |
| 170 | bool MDPComp::setupBasePipe(hwc_context_t *ctx) { |
| 171 | const int dpy = HWC_DISPLAY_PRIMARY; |
| 172 | int fb_stride = ctx->dpyAttr[dpy].stride; |
| 173 | int fb_width = ctx->dpyAttr[dpy].xres; |
| 174 | int fb_height = ctx->dpyAttr[dpy].yres; |
| 175 | int fb_fd = ctx->dpyAttr[dpy].fd; |
| 176 | |
| 177 | mdp_overlay ovInfo; |
| 178 | msmfb_overlay_data ovData; |
| 179 | memset(&ovInfo, 0, sizeof(mdp_overlay)); |
| 180 | memset(&ovData, 0, sizeof(msmfb_overlay_data)); |
| 181 | |
| 182 | ovInfo.src.format = MDP_RGB_BORDERFILL; |
| 183 | ovInfo.src.width = fb_width; |
| 184 | ovInfo.src.height = fb_height; |
| 185 | ovInfo.src_rect.w = fb_width; |
| 186 | ovInfo.src_rect.h = fb_height; |
| 187 | ovInfo.dst_rect.w = fb_width; |
| 188 | ovInfo.dst_rect.h = fb_height; |
| 189 | ovInfo.id = MSMFB_NEW_REQUEST; |
| 190 | |
| 191 | if (ioctl(fb_fd, MSMFB_OVERLAY_SET, &ovInfo) < 0) { |
| 192 | ALOGE("Failed to call ioctl MSMFB_OVERLAY_SET err=%s", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 193 | strerror(errno)); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 194 | return false; |
| 195 | } |
| 196 | |
| 197 | ovData.id = ovInfo.id; |
| 198 | if (ioctl(fb_fd, MSMFB_OVERLAY_PLAY, &ovData) < 0) { |
| 199 | ALOGE("Failed to call ioctl MSMFB_OVERLAY_PLAY err=%s", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 200 | strerror(errno)); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 201 | return false; |
| 202 | } |
| 203 | return true; |
| 204 | } |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 205 | MDPComp::FrameInfo::FrameInfo() { |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 206 | reset(0); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 207 | } |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 208 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 209 | void MDPComp::FrameInfo::reset(const int& numLayers) { |
| 210 | for(int i = 0 ; i < MAX_PIPES_PER_MIXER && numLayers; i++ ) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 211 | if(mdpToLayer[i].pipeInfo) { |
| 212 | delete mdpToLayer[i].pipeInfo; |
| 213 | mdpToLayer[i].pipeInfo = NULL; |
| 214 | //We dont own the rotator |
| 215 | mdpToLayer[i].rot = NULL; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 216 | } |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 217 | } |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 218 | |
| 219 | memset(&mdpToLayer, 0, sizeof(mdpToLayer)); |
| 220 | memset(&layerToMDP, -1, sizeof(layerToMDP)); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 221 | memset(&isFBComposed, 1, sizeof(isFBComposed)); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 222 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 223 | layerCount = numLayers; |
| 224 | fbCount = numLayers; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 225 | mdpCount = 0; |
Saurabh Shah | 2f3895f | 2013-05-02 10:13:31 -0700 | [diff] [blame] | 226 | needsRedraw = true; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 227 | fbZ = 0; |
| 228 | } |
| 229 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 230 | void MDPComp::FrameInfo::map() { |
| 231 | // populate layer and MDP maps |
| 232 | int mdpIdx = 0; |
| 233 | for(int idx = 0; idx < layerCount; idx++) { |
| 234 | if(!isFBComposed[idx]) { |
| 235 | mdpToLayer[mdpIdx].listIndex = idx; |
| 236 | layerToMDP[idx] = mdpIdx++; |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 241 | MDPComp::LayerCache::LayerCache() { |
| 242 | reset(); |
| 243 | } |
| 244 | |
| 245 | void MDPComp::LayerCache::reset() { |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 246 | memset(&hnd, 0, sizeof(hnd)); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 247 | mdpCount = 0; |
| 248 | cacheCount = 0; |
| 249 | layerCount = 0; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 250 | fbZ = -1; |
| 251 | } |
| 252 | |
| 253 | void MDPComp::LayerCache::cacheAll(hwc_display_contents_1_t* list) { |
| 254 | const int numAppLayers = list->numHwLayers - 1; |
| 255 | for(int i = 0; i < numAppLayers; i++) { |
| 256 | hnd[i] = list->hwLayers[i].handle; |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | void MDPComp::LayerCache::updateCounts(const FrameInfo& curFrame) { |
| 261 | mdpCount = curFrame.mdpCount; |
| 262 | cacheCount = curFrame.fbCount; |
| 263 | layerCount = curFrame.layerCount; |
| 264 | fbZ = curFrame.fbZ; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 265 | } |
| 266 | |
Sravan Kumar D.V.N | ad5d929 | 2013-04-24 14:23:04 +0530 | [diff] [blame] | 267 | bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) { |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 268 | const int dpy = HWC_DISPLAY_PRIMARY; |
Jeykumar Sankaran | c18dbc2 | 2013-02-08 14:29:44 -0800 | [diff] [blame] | 269 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 270 | |
| 271 | if(!hnd) { |
| 272 | ALOGE("%s: layer handle is NULL", __FUNCTION__); |
| 273 | return false; |
| 274 | } |
| 275 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 276 | int hw_w = ctx->dpyAttr[mDpy].xres; |
| 277 | int hw_h = ctx->dpyAttr[mDpy].yres; |
Jeykumar Sankaran | c18dbc2 | 2013-02-08 14:29:44 -0800 | [diff] [blame] | 278 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 279 | hwc_rect_t crop = layer->sourceCrop; |
| 280 | hwc_rect_t dst = layer->displayFrame; |
Jeykumar Sankaran | c18dbc2 | 2013-02-08 14:29:44 -0800 | [diff] [blame] | 281 | |
| 282 | if(dst.left < 0 || dst.top < 0 || dst.right > hw_w || dst.bottom > hw_h) { |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 283 | hwc_rect_t scissor = {0, 0, hw_w, hw_h }; |
| 284 | qhwc::calculate_crop_rects(crop, dst, scissor, layer->transform); |
Jeykumar Sankaran | c18dbc2 | 2013-02-08 14:29:44 -0800 | [diff] [blame] | 285 | } |
| 286 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 287 | int crop_w = crop.right - crop.left; |
| 288 | int crop_h = crop.bottom - crop.top; |
| 289 | int dst_w = dst.right - dst.left; |
| 290 | int dst_h = dst.bottom - dst.top; |
| 291 | float w_dscale = ceilf((float)crop_w / (float)dst_w); |
| 292 | float h_dscale = ceilf((float)crop_h / (float)dst_h); |
| 293 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 294 | /* Workaround for MDP HW limitation in DSI command mode panels where |
| 295 | * FPS will not go beyond 30 if buffers on RGB pipes are of width or height |
| 296 | * less than 5 pixels |
Sravan Kumar D.V.N | ad5d929 | 2013-04-24 14:23:04 +0530 | [diff] [blame] | 297 | * There also is a HW limilation in MDP, minimum block size is 2x2 |
| 298 | * Fallback to GPU if height is less than 2. |
| 299 | */ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 300 | if((crop_w < 5)||(crop_h < 5)) |
Jeykumar Sankaran | c18dbc2 | 2013-02-08 14:29:44 -0800 | [diff] [blame] | 301 | return false; |
| 302 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 303 | const uint32_t downscale = |
| 304 | qdutils::MDPVersion::getInstance().getMaxMDPDownscale(); |
| 305 | if(ctx->mMDP.version >= qdutils::MDSS_V5) { |
| 306 | /* Workaround for downscales larger than 4x. |
| 307 | * Will be removed once decimator block is enabled for MDSS |
| 308 | */ |
| 309 | if(!qdutils::MDPVersion::getInstance().supportsDecimation()) { |
| 310 | if(crop_w > MAX_DISPLAY_DIM || w_dscale > downscale || |
| 311 | h_dscale > downscale) |
| 312 | return false; |
| 313 | } else { |
| 314 | if(w_dscale > 64 || h_dscale > 64) |
| 315 | return false; |
| 316 | } |
| 317 | } else { //A-family |
| 318 | if(w_dscale > downscale || h_dscale > downscale) |
| 319 | return false; |
| 320 | } |
| 321 | |
Jeykumar Sankaran | c18dbc2 | 2013-02-08 14:29:44 -0800 | [diff] [blame] | 322 | return true; |
| 323 | } |
| 324 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 325 | ovutils::eDest MDPComp::getMdpPipe(hwc_context_t *ctx, ePipeType type) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 326 | overlay::Overlay& ov = *ctx->mOverlay; |
| 327 | ovutils::eDest mdp_pipe = ovutils::OV_INVALID; |
| 328 | |
| 329 | switch(type) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 330 | case MDPCOMP_OV_DMA: |
| 331 | mdp_pipe = ov.nextPipe(ovutils::OV_MDP_PIPE_DMA, mDpy); |
| 332 | if(mdp_pipe != ovutils::OV_INVALID) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 333 | return mdp_pipe; |
| 334 | } |
| 335 | case MDPCOMP_OV_ANY: |
| 336 | case MDPCOMP_OV_RGB: |
| 337 | mdp_pipe = ov.nextPipe(ovutils::OV_MDP_PIPE_RGB, mDpy); |
| 338 | if(mdp_pipe != ovutils::OV_INVALID) { |
| 339 | return mdp_pipe; |
| 340 | } |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 341 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 342 | if(type == MDPCOMP_OV_RGB) { |
| 343 | //Requested only for RGB pipe |
| 344 | break; |
| 345 | } |
| 346 | case MDPCOMP_OV_VG: |
| 347 | return ov.nextPipe(ovutils::OV_MDP_PIPE_VG, mDpy); |
| 348 | default: |
| 349 | ALOGE("%s: Invalid pipe type",__FUNCTION__); |
| 350 | return ovutils::OV_INVALID; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 351 | }; |
| 352 | return ovutils::OV_INVALID; |
| 353 | } |
| 354 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 355 | bool MDPComp::isFrameDoable(hwc_context_t *ctx) { |
| 356 | int numAppLayers = ctx->listStats[mDpy].numAppLayers; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 357 | bool ret = true; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 358 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 359 | if(!isEnabled()) { |
| 360 | ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 361 | ret = false; |
| 362 | } else if(ctx->mExtDispConfiguring) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 363 | ALOGD_IF( isDebug(),"%s: External Display connection is pending", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 364 | __FUNCTION__); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 365 | ret = false; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 366 | } else if(ctx->isPaddingRound) { |
Saurabh Shah | 0ceeb6a | 2013-04-23 10:46:07 -0700 | [diff] [blame] | 367 | ctx->isPaddingRound = false; |
| 368 | ALOGD_IF(isDebug(), "%s: padding round",__FUNCTION__); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 369 | ret = false; |
| 370 | } else if(sIdleFallBack) { |
| 371 | sIdleFallBack = false; |
| 372 | ALOGD_IF(isDebug(), "%s: idle fallback",__FUNCTION__); |
| 373 | ret = false; |
Saurabh Shah | 0ceeb6a | 2013-04-23 10:46:07 -0700 | [diff] [blame] | 374 | } |
| 375 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 376 | return ret; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | /* Checks for conditions where all the layers marked for MDP comp cannot be |
| 380 | * bypassed. On such conditions we try to bypass atleast YUV layers */ |
| 381 | bool MDPComp::isFullFrameDoable(hwc_context_t *ctx, |
| 382 | hwc_display_contents_1_t* list){ |
| 383 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 384 | const int numAppLayers = ctx->listStats[mDpy].numAppLayers; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 385 | |
| 386 | if(mDpy > HWC_DISPLAY_PRIMARY){ |
| 387 | ALOGD_IF(isDebug(), "%s: Cannot support External display(s)", |
| 388 | __FUNCTION__); |
| 389 | return false; |
| 390 | } |
| 391 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 392 | if(isSkipPresent(ctx, mDpy)) { |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 393 | ALOGD_IF(isDebug(),"%s: SKIP present: %d", |
| 394 | __FUNCTION__, |
| 395 | isSkipPresent(ctx, mDpy)); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 396 | return false; |
| 397 | } |
| 398 | |
Saurabh Shah | 9f084ad | 2013-05-02 11:28:09 -0700 | [diff] [blame^] | 399 | if(ctx->listStats[mDpy].needsAlphaScale |
| 400 | && ctx->mMDP.version < qdutils::MDSS_V5) { |
| 401 | ALOGD_IF(isDebug(), "%s: frame needs alpha downscaling",__FUNCTION__); |
| 402 | return false; |
| 403 | } |
| 404 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 405 | //MDP composition is not efficient if layer needs rotator. |
| 406 | for(int i = 0; i < numAppLayers; ++i) { |
| 407 | // As MDP h/w supports flip operation, use MDP comp only for |
| 408 | // 180 transforms. Fail for any transform involving 90 (90, 270). |
| 409 | hwc_layer_1_t* layer = &list->hwLayers[i]; |
| 410 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
Jeykumar Sankaran | a37fdbf | 2013-03-06 18:59:28 -0800 | [diff] [blame] | 411 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 412 | if((layer->transform & HWC_TRANSFORM_ROT_90) && !isYuvBuffer(hnd)) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 413 | ALOGD_IF(isDebug(), "%s: orientation involved",__FUNCTION__); |
| 414 | return false; |
| 415 | } |
| 416 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 417 | if(!isValidDimension(ctx,layer)) { |
| 418 | ALOGD_IF(isDebug(), "%s: Buffer is of invalid width", |
| 419 | __FUNCTION__); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 420 | return false; |
| 421 | } |
| 422 | } |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 423 | |
| 424 | //If all above hard conditions are met we can do full or partial MDP comp. |
| 425 | bool ret = false; |
| 426 | if(fullMDPComp(ctx, list)) { |
| 427 | ret = true; |
| 428 | } else if (partialMDPComp(ctx, list)) { |
| 429 | ret = true; |
| 430 | } |
| 431 | return ret; |
| 432 | } |
| 433 | |
| 434 | bool MDPComp::fullMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list) { |
| 435 | //Setup mCurrentFrame |
| 436 | mCurrentFrame.mdpCount = mCurrentFrame.layerCount; |
| 437 | mCurrentFrame.fbCount = 0; |
| 438 | mCurrentFrame.fbZ = -1; |
| 439 | memset(&mCurrentFrame.isFBComposed, 0, sizeof(mCurrentFrame.isFBComposed)); |
| 440 | |
| 441 | int mdpCount = mCurrentFrame.mdpCount; |
| 442 | if(mdpCount > sMaxPipesPerMixer) { |
| 443 | ALOGD_IF(isDebug(), "%s: Exceeds MAX_PIPES_PER_MIXER",__FUNCTION__); |
| 444 | return false; |
| 445 | } |
| 446 | |
| 447 | int numPipesNeeded = pipesNeeded(ctx, list); |
| 448 | int availPipes = getAvailablePipes(ctx); |
| 449 | |
| 450 | if(numPipesNeeded > availPipes) { |
| 451 | ALOGD_IF(isDebug(), "%s: Insufficient MDP pipes, needed %d, avail %d", |
| 452 | __FUNCTION__, numPipesNeeded, availPipes); |
| 453 | return false; |
| 454 | } |
| 455 | |
| 456 | return true; |
| 457 | } |
| 458 | |
| 459 | bool MDPComp::partialMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list) |
| 460 | { |
| 461 | int numAppLayers = ctx->listStats[mDpy].numAppLayers; |
| 462 | //Setup mCurrentFrame |
| 463 | mCurrentFrame.reset(numAppLayers); |
| 464 | updateLayerCache(ctx, list); |
| 465 | updateYUV(ctx, list); |
| 466 | batchLayers(); //sets up fbZ also |
| 467 | |
| 468 | int mdpCount = mCurrentFrame.mdpCount; |
| 469 | if(mdpCount > (sMaxPipesPerMixer - 1)) { // -1 since FB is used |
| 470 | ALOGD_IF(isDebug(), "%s: Exceeds MAX_PIPES_PER_MIXER",__FUNCTION__); |
| 471 | return false; |
| 472 | } |
| 473 | |
| 474 | int numPipesNeeded = pipesNeeded(ctx, list); |
| 475 | int availPipes = getAvailablePipes(ctx); |
| 476 | |
| 477 | if(numPipesNeeded > availPipes) { |
| 478 | ALOGD_IF(isDebug(), "%s: Insufficient MDP pipes, needed %d, avail %d", |
| 479 | __FUNCTION__, numPipesNeeded, availPipes); |
| 480 | return false; |
| 481 | } |
| 482 | |
| 483 | return true; |
| 484 | } |
| 485 | |
| 486 | bool MDPComp::isOnlyVideoDoable(hwc_context_t *ctx, |
| 487 | hwc_display_contents_1_t* list){ |
| 488 | int numAppLayers = ctx->listStats[mDpy].numAppLayers; |
| 489 | mCurrentFrame.reset(numAppLayers); |
| 490 | updateYUV(ctx, list); |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 491 | int mdpCount = mCurrentFrame.mdpCount; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 492 | int fbNeeded = int(mCurrentFrame.fbCount != 0); |
| 493 | |
| 494 | if(!isYuvPresent(ctx, mDpy)) { |
| 495 | return false; |
| 496 | } |
| 497 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 498 | if(!mdpCount) |
| 499 | return false; |
| 500 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 501 | if(mdpCount > (sMaxPipesPerMixer - fbNeeded)) { |
| 502 | ALOGD_IF(isDebug(), "%s: Exceeds MAX_PIPES_PER_MIXER",__FUNCTION__); |
| 503 | return false; |
| 504 | } |
| 505 | |
| 506 | int numPipesNeeded = pipesNeeded(ctx, list); |
| 507 | int availPipes = getAvailablePipes(ctx); |
| 508 | if(numPipesNeeded > availPipes) { |
| 509 | ALOGD_IF(isDebug(), "%s: Insufficient MDP pipes, needed %d, avail %d", |
| 510 | __FUNCTION__, numPipesNeeded, availPipes); |
| 511 | return false; |
| 512 | } |
| 513 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 514 | return true; |
| 515 | } |
| 516 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 517 | /* Checks for conditions where YUV layers cannot be bypassed */ |
| 518 | bool MDPComp::isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 519 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 520 | if(isSkipLayer(layer)) { |
| 521 | ALOGE("%s: Unable to bypass skipped YUV", __FUNCTION__); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 522 | return false; |
| 523 | } |
| 524 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 525 | if(isSecuring(ctx, layer)) { |
| 526 | ALOGD_IF(isDebug(), "%s: MDP securing is active", __FUNCTION__); |
| 527 | return false; |
| 528 | } |
| 529 | |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 530 | if(!isValidDimension(ctx, layer)) { |
| 531 | ALOGD_IF(isDebug(), "%s: Buffer is of invalid width", |
| 532 | __FUNCTION__); |
| 533 | return false; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 534 | } |
Saurabh Shah | 4fdde76 | 2013-04-30 18:47:33 -0700 | [diff] [blame] | 535 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 536 | return true; |
| 537 | } |
| 538 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 539 | void MDPComp::batchLayers() { |
| 540 | /* Idea is to keep as many contiguous non-updating(cached) layers in FB and |
| 541 | * send rest of them through MDP. NEVER mark an updating layer for caching. |
| 542 | * But cached ones can be marked for MDP*/ |
| 543 | |
| 544 | int maxBatchStart = -1; |
| 545 | int maxBatchCount = 0; |
| 546 | |
| 547 | /* All or Nothing is cached. No batching needed */ |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 548 | if(!mCurrentFrame.fbCount) { |
| 549 | mCurrentFrame.fbZ = -1; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 550 | return; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 551 | } |
| 552 | if(!mCurrentFrame.mdpCount) { |
| 553 | mCurrentFrame.fbZ = 0; |
| 554 | return; |
| 555 | } |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 556 | |
| 557 | /* Search for max number of contiguous (cached) layers */ |
| 558 | int i = 0; |
| 559 | while (i < mCurrentFrame.layerCount) { |
| 560 | int count = 0; |
| 561 | while(mCurrentFrame.isFBComposed[i] && i < mCurrentFrame.layerCount) { |
| 562 | count++; i++; |
| 563 | } |
| 564 | if(count > maxBatchCount) { |
| 565 | maxBatchCount = count; |
| 566 | maxBatchStart = i - count; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 567 | mCurrentFrame.fbZ = maxBatchStart; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 568 | } |
| 569 | if(i < mCurrentFrame.layerCount) i++; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 570 | } |
| 571 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 572 | /* reset rest of the layers for MDP comp */ |
| 573 | for(int i = 0; i < mCurrentFrame.layerCount; i++) { |
| 574 | if(i != maxBatchStart){ |
| 575 | mCurrentFrame.isFBComposed[i] = false; |
| 576 | } else { |
| 577 | i += maxBatchCount; |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | mCurrentFrame.fbCount = maxBatchCount; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 582 | mCurrentFrame.mdpCount = mCurrentFrame.layerCount - |
| 583 | mCurrentFrame.fbCount; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 584 | |
| 585 | ALOGD_IF(isDebug(),"%s: cached count: %d",__FUNCTION__, |
| 586 | mCurrentFrame.fbCount); |
| 587 | } |
Saurabh Shah | 85234ec | 2013-04-12 17:09:00 -0700 | [diff] [blame] | 588 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 589 | void MDPComp::updateLayerCache(hwc_context_t* ctx, |
| 590 | hwc_display_contents_1_t* list) { |
| 591 | |
| 592 | int numAppLayers = ctx->listStats[mDpy].numAppLayers; |
| 593 | int numCacheableLayers = 0; |
| 594 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 595 | for(int i = 0; i < numAppLayers; i++) { |
| 596 | if (mCachedFrame.hnd[i] == list->hwLayers[i].handle) { |
| 597 | numCacheableLayers++; |
| 598 | mCurrentFrame.isFBComposed[i] = true; |
| 599 | } else { |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 600 | mCurrentFrame.isFBComposed[i] = false; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 601 | mCachedFrame.hnd[i] = list->hwLayers[i].handle; |
| 602 | } |
| 603 | } |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 604 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 605 | mCurrentFrame.fbCount = numCacheableLayers; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 606 | mCurrentFrame.mdpCount = mCurrentFrame.layerCount - |
| 607 | mCurrentFrame.fbCount; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 608 | ALOGD_IF(isDebug(),"%s: cached count: %d",__FUNCTION__, numCacheableLayers); |
| 609 | } |
| 610 | |
| 611 | int MDPComp::getAvailablePipes(hwc_context_t* ctx) { |
| 612 | int numDMAPipes = qdutils::MDPVersion::getInstance().getDMAPipes(); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 613 | overlay::Overlay& ov = *ctx->mOverlay; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 614 | |
| 615 | int numAvailable = ov.availablePipes(mDpy); |
| 616 | |
| 617 | //Reserve DMA for rotator |
Saurabh Shah | 85234ec | 2013-04-12 17:09:00 -0700 | [diff] [blame] | 618 | if(Overlay::getDMAMode() == Overlay::DMA_BLOCK_MODE) |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 619 | numAvailable -= numDMAPipes; |
| 620 | |
| 621 | //Reserve pipe(s)for FB |
| 622 | if(mCurrentFrame.fbCount) |
| 623 | numAvailable -= pipesForFB(); |
| 624 | |
| 625 | return numAvailable; |
| 626 | } |
| 627 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 628 | void MDPComp::updateYUV(hwc_context_t* ctx, hwc_display_contents_1_t* list) { |
| 629 | |
| 630 | int nYuvCount = ctx->listStats[mDpy].yuvCount; |
| 631 | for(int index = 0;index < nYuvCount; index++){ |
| 632 | int nYuvIndex = ctx->listStats[mDpy].yuvIndices[index]; |
| 633 | hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex]; |
| 634 | |
| 635 | if(!isYUVDoable(ctx, layer)) { |
| 636 | if(!mCurrentFrame.isFBComposed[nYuvIndex]) { |
| 637 | mCurrentFrame.isFBComposed[nYuvIndex] = true; |
| 638 | mCurrentFrame.fbCount++; |
| 639 | } |
| 640 | } else { |
| 641 | if(mCurrentFrame.isFBComposed[nYuvIndex]) { |
| 642 | mCurrentFrame.isFBComposed[nYuvIndex] = false; |
| 643 | mCurrentFrame.fbCount--; |
| 644 | } |
| 645 | } |
| 646 | } |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 647 | |
| 648 | mCurrentFrame.mdpCount = mCurrentFrame.layerCount - |
| 649 | mCurrentFrame.fbCount; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 650 | ALOGD_IF(isDebug(),"%s: cached count: %d",__FUNCTION__, |
| 651 | mCurrentFrame.fbCount); |
| 652 | } |
| 653 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 654 | bool MDPComp::programMDP(hwc_context_t *ctx, hwc_display_contents_1_t* list) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 655 | if(!allocLayerPipes(ctx, list)) { |
| 656 | ALOGD_IF(isDebug(), "%s: Unable to allocate MDP pipes", __FUNCTION__); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 657 | return false; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 658 | } |
| 659 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 660 | bool fbBatch = false; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 661 | for (int index = 0, mdpNextZOrder = 0; index < mCurrentFrame.layerCount; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 662 | index++) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 663 | if(!mCurrentFrame.isFBComposed[index]) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 664 | int mdpIndex = mCurrentFrame.layerToMDP[index]; |
| 665 | hwc_layer_1_t* layer = &list->hwLayers[index]; |
| 666 | |
| 667 | MdpPipeInfo* cur_pipe = mCurrentFrame.mdpToLayer[mdpIndex].pipeInfo; |
| 668 | cur_pipe->zOrder = mdpNextZOrder++; |
| 669 | |
| 670 | if(configure(ctx, layer, mCurrentFrame.mdpToLayer[mdpIndex]) != 0 ){ |
| 671 | ALOGD_IF(isDebug(), "%s: Failed to configure overlay for \ |
| 672 | layer %d",__FUNCTION__, index); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 673 | return false; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 674 | } |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 675 | } else if(fbBatch == false) { |
| 676 | mdpNextZOrder++; |
| 677 | fbBatch = true; |
| 678 | } |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 679 | } |
| 680 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 681 | return true; |
| 682 | } |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 683 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 684 | bool MDPComp::programYUV(hwc_context_t *ctx, hwc_display_contents_1_t* list) { |
| 685 | if(!allocLayerPipes(ctx, list)) { |
| 686 | ALOGD_IF(isDebug(), "%s: Unable to allocate MDP pipes", __FUNCTION__); |
| 687 | return false; |
| 688 | } |
| 689 | //If we are in this block, it means we have yuv + rgb layers both |
| 690 | int mdpIdx = 0; |
| 691 | for (int index = 0; index < mCurrentFrame.layerCount; index++) { |
| 692 | if(!mCurrentFrame.isFBComposed[index]) { |
| 693 | hwc_layer_1_t* layer = &list->hwLayers[index]; |
| 694 | int mdpIndex = mCurrentFrame.layerToMDP[index]; |
| 695 | MdpPipeInfo* cur_pipe = |
| 696 | mCurrentFrame.mdpToLayer[mdpIndex].pipeInfo; |
| 697 | cur_pipe->zOrder = mdpIdx++; |
| 698 | |
| 699 | if(configure(ctx, layer, |
| 700 | mCurrentFrame.mdpToLayer[mdpIndex]) != 0 ){ |
| 701 | ALOGD_IF(isDebug(), "%s: Failed to configure overlay for \ |
| 702 | layer %d",__FUNCTION__, index); |
| 703 | return false; |
| 704 | } |
| 705 | } |
| 706 | } |
| 707 | return true; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | int MDPComp::prepare(hwc_context_t *ctx, hwc_display_contents_1_t* list) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 711 | |
| 712 | //reset old data |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 713 | const int numLayers = ctx->listStats[mDpy].numAppLayers; |
| 714 | mCurrentFrame.reset(numLayers); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 715 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 716 | //Hard conditions, if not met, cannot do MDP comp |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 717 | if(!isFrameDoable(ctx)) { |
| 718 | ALOGD_IF( isDebug(),"%s: MDP Comp not possible for this frame", |
| 719 | __FUNCTION__); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 720 | mCurrentFrame.reset(numLayers); |
| 721 | mCachedFrame.cacheAll(list); |
| 722 | mCachedFrame.updateCounts(mCurrentFrame); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 723 | return 0; |
| 724 | } |
| 725 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 726 | //Check whether layers marked for MDP Composition is actually doable. |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 727 | if(isFullFrameDoable(ctx, list)){ |
Saurabh Shah | 2f3895f | 2013-05-02 10:13:31 -0700 | [diff] [blame] | 728 | mCurrentFrame.map(); |
| 729 | //Acquire and Program MDP pipes |
| 730 | if(!programMDP(ctx, list)) { |
| 731 | mCurrentFrame.reset(numLayers); |
| 732 | mCachedFrame.cacheAll(list); |
| 733 | } else { //Success |
| 734 | //Any change in composition types needs an FB refresh |
| 735 | mCurrentFrame.needsRedraw = false; |
| 736 | if(mCurrentFrame.fbCount && |
| 737 | ((mCurrentFrame.mdpCount != mCachedFrame.mdpCount) || |
| 738 | (mCurrentFrame.fbCount != mCachedFrame.cacheCount) || |
| 739 | (mCurrentFrame.fbZ != mCachedFrame.fbZ) || |
| 740 | (!mCurrentFrame.mdpCount) || |
| 741 | (list->flags & HWC_GEOMETRY_CHANGED) || |
| 742 | isSkipPresent(ctx, mDpy) || |
| 743 | (mDpy > HWC_DISPLAY_PRIMARY))) { |
| 744 | mCurrentFrame.needsRedraw = true; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 745 | } |
| 746 | } |
| 747 | } else if(isOnlyVideoDoable(ctx, list)) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 748 | //All layers marked for MDP comp cannot be bypassed. |
| 749 | //Try to compose atleast YUV layers through MDP comp and let |
| 750 | //all the RGB layers compose in FB |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 751 | //Destination over |
| 752 | mCurrentFrame.fbZ = -1; |
| 753 | if(mCurrentFrame.fbCount) |
| 754 | mCurrentFrame.fbZ = ctx->listStats[mDpy].yuvCount; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 755 | |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 756 | mCurrentFrame.map(); |
| 757 | if(!programYUV(ctx, list)) { |
| 758 | mCurrentFrame.reset(numLayers); |
| 759 | mCachedFrame.cacheAll(list); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 760 | } |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 761 | } else { |
| 762 | mCurrentFrame.reset(numLayers); |
| 763 | mCachedFrame.cacheAll(list); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 764 | } |
| 765 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 766 | //UpdateLayerFlags |
| 767 | setMDPCompLayerFlags(ctx, list); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 768 | mCachedFrame.updateCounts(mCurrentFrame); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 769 | |
| 770 | if(isDebug()) { |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 771 | ALOGD("GEOMETRY change: %d", (list->flags & HWC_GEOMETRY_CHANGED)); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 772 | android::String8 sDump(""); |
| 773 | dump(sDump); |
| 774 | ALOGE("%s",sDump.string()); |
| 775 | } |
| 776 | |
| 777 | return mCurrentFrame.fbZ; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 778 | } |
| 779 | |
| 780 | //=============MDPCompLowRes=================================================== |
| 781 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 782 | /* |
| 783 | * Configures pipe(s) for MDP composition |
| 784 | */ |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 785 | int MDPCompLowRes::configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 786 | PipeLayerPair& PipeLayerPair) { |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 787 | MdpPipeInfoLowRes& mdp_info = |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 788 | *(static_cast<MdpPipeInfoLowRes*>(PipeLayerPair.pipeInfo)); |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 789 | eMdpFlags mdpFlags = OV_MDP_BACKEND_COMPOSITION; |
| 790 | eZorder zOrder = static_cast<eZorder>(mdp_info.zOrder); |
| 791 | eIsFg isFg = IS_FG_OFF; |
| 792 | eDest dest = mdp_info.index; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 793 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 794 | ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipe: %d", |
| 795 | __FUNCTION__, layer, zOrder, dest); |
| 796 | |
| 797 | return configureLowRes(ctx, layer, mDpy, mdpFlags, zOrder, isFg, dest, |
| 798 | &PipeLayerPair.rot); |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 799 | } |
| 800 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 801 | int MDPCompLowRes::pipesNeeded(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 802 | hwc_display_contents_1_t* list) { |
| 803 | return mCurrentFrame.mdpCount; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 804 | } |
| 805 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 806 | bool MDPCompLowRes::allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 807 | hwc_display_contents_1_t* list) { |
| 808 | if(isYuvPresent(ctx, mDpy)) { |
| 809 | int nYuvCount = ctx->listStats[mDpy].yuvCount; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 810 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 811 | for(int index = 0; index < nYuvCount ; index ++) { |
| 812 | int nYuvIndex = ctx->listStats[mDpy].yuvIndices[index]; |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 813 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 814 | if(mCurrentFrame.isFBComposed[nYuvIndex]) |
| 815 | continue; |
Jeykumar Sankaran | cf53700 | 2013-01-21 21:19:15 -0800 | [diff] [blame] | 816 | |
Jeykumar Sankaran | cf53700 | 2013-01-21 21:19:15 -0800 | [diff] [blame] | 817 | hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 818 | |
| 819 | int mdpIndex = mCurrentFrame.layerToMDP[nYuvIndex]; |
| 820 | |
| 821 | PipeLayerPair& info = mCurrentFrame.mdpToLayer[mdpIndex]; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 822 | info.pipeInfo = new MdpPipeInfoLowRes; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 823 | info.rot = NULL; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 824 | MdpPipeInfoLowRes& pipe_info = *(MdpPipeInfoLowRes*)info.pipeInfo; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 825 | |
Jeykumar Sankaran | cf53700 | 2013-01-21 21:19:15 -0800 | [diff] [blame] | 826 | pipe_info.index = getMdpPipe(ctx, MDPCOMP_OV_VG); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 827 | if(pipe_info.index == ovutils::OV_INVALID) { |
Jeykumar Sankaran | cf53700 | 2013-01-21 21:19:15 -0800 | [diff] [blame] | 828 | ALOGD_IF(isDebug(), "%s: Unable to get pipe for Videos", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 829 | __FUNCTION__); |
Jeykumar Sankaran | cf53700 | 2013-01-21 21:19:15 -0800 | [diff] [blame] | 830 | return false; |
| 831 | } |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 832 | } |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 833 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 834 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 835 | for(int index = 0 ; index < mCurrentFrame.layerCount; index++ ) { |
| 836 | if(mCurrentFrame.isFBComposed[index]) continue; |
Jeykumar Sankaran | cf53700 | 2013-01-21 21:19:15 -0800 | [diff] [blame] | 837 | hwc_layer_1_t* layer = &list->hwLayers[index]; |
| 838 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 839 | |
| 840 | if(isYuvBuffer(hnd)) |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 841 | continue; |
| 842 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 843 | int mdpIndex = mCurrentFrame.layerToMDP[index]; |
| 844 | |
| 845 | PipeLayerPair& info = mCurrentFrame.mdpToLayer[mdpIndex]; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 846 | info.pipeInfo = new MdpPipeInfoLowRes; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 847 | info.rot = NULL; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 848 | MdpPipeInfoLowRes& pipe_info = *(MdpPipeInfoLowRes*)info.pipeInfo; |
| 849 | |
Jeykumar Sankaran | a37fdbf | 2013-03-06 18:59:28 -0800 | [diff] [blame] | 850 | ePipeType type = MDPCOMP_OV_ANY; |
| 851 | |
Saurabh Shah | 85234ec | 2013-04-12 17:09:00 -0700 | [diff] [blame] | 852 | if(!qhwc::needsScaling(layer) |
| 853 | && Overlay::getDMAMode() != Overlay::DMA_BLOCK_MODE |
| 854 | && ctx->mMDP.version >= qdutils::MDSS_V5) { |
Jeykumar Sankaran | a37fdbf | 2013-03-06 18:59:28 -0800 | [diff] [blame] | 855 | type = MDPCOMP_OV_DMA; |
| 856 | } |
| 857 | |
| 858 | pipe_info.index = getMdpPipe(ctx, type); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 859 | if(pipe_info.index == ovutils::OV_INVALID) { |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 860 | ALOGD_IF(isDebug(), "%s: Unable to get pipe for UI", __FUNCTION__); |
| 861 | return false; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 862 | } |
| 863 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 864 | return true; |
| 865 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 866 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 867 | bool MDPCompLowRes::draw(hwc_context_t *ctx, hwc_display_contents_1_t* list) { |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 868 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 869 | if(!isEnabled()) { |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 870 | ALOGD_IF(isDebug(),"%s: MDP Comp not configured", __FUNCTION__); |
| 871 | return true; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 872 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 873 | |
| 874 | if(!ctx || !list) { |
| 875 | ALOGE("%s: invalid contxt or list",__FUNCTION__); |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 876 | return false; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 877 | } |
| 878 | |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 879 | /* reset Invalidator */ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 880 | if(idleInvalidator && mCurrentFrame.mdpCount) |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 881 | idleInvalidator->markForSleep(); |
| 882 | |
| 883 | overlay::Overlay& ov = *ctx->mOverlay; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 884 | LayerProp *layerProp = ctx->layerProp[mDpy]; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 885 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 886 | int numHwLayers = ctx->listStats[mDpy].numAppLayers; |
| 887 | for(int i = 0; i < numHwLayers && mCurrentFrame.mdpCount; i++ ) |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 888 | { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 889 | if(mCurrentFrame.isFBComposed[i]) continue; |
| 890 | |
Naseer Ahmed | 5b6708a | 2012-08-02 13:46:08 -0700 | [diff] [blame] | 891 | hwc_layer_1_t *layer = &list->hwLayers[i]; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 892 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 893 | if(!hnd) { |
| 894 | ALOGE("%s handle null", __FUNCTION__); |
| 895 | return false; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 896 | } |
| 897 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 898 | int mdpIndex = mCurrentFrame.layerToMDP[i]; |
| 899 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 900 | MdpPipeInfoLowRes& pipe_info = |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 901 | *(MdpPipeInfoLowRes*)mCurrentFrame.mdpToLayer[mdpIndex].pipeInfo; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 902 | ovutils::eDest dest = pipe_info.index; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 903 | if(dest == ovutils::OV_INVALID) { |
| 904 | ALOGE("%s: Invalid pipe index (%d)", __FUNCTION__, dest); |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 905 | return false; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 906 | } |
| 907 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 908 | if(!(layerProp[i].mFlags & HWC_MDPCOMP)) { |
| 909 | continue; |
| 910 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 911 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 912 | ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 913 | using pipe: %d", __FUNCTION__, layer, |
| 914 | hnd, dest ); |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 915 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 916 | int fd = hnd->fd; |
| 917 | uint32_t offset = hnd->offset; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 918 | Rotator *rot = mCurrentFrame.mdpToLayer[mdpIndex].rot; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 919 | if(rot) { |
| 920 | if(!rot->queueBuffer(fd, offset)) |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 921 | return false; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 922 | fd = rot->getDstMemId(); |
| 923 | offset = rot->getDstOffset(); |
| 924 | } |
| 925 | |
| 926 | if (!ov.queueBuffer(fd, offset, dest)) { |
| 927 | ALOGE("%s: queueBuffer failed for external", __FUNCTION__); |
| 928 | return false; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 929 | } |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 930 | |
| 931 | layerProp[i].mFlags &= ~HWC_MDPCOMP; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 932 | } |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 933 | return true; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 934 | } |
| 935 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 936 | //=============MDPCompHighRes=================================================== |
| 937 | |
| 938 | int MDPCompHighRes::pipesNeeded(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 939 | hwc_display_contents_1_t* list) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 940 | int pipesNeeded = 0; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 941 | int hw_w = ctx->dpyAttr[mDpy].xres; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 942 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 943 | for(int i = 0; i < mCurrentFrame.layerCount; ++i) { |
| 944 | if(!mCurrentFrame.isFBComposed[i]) { |
| 945 | hwc_layer_1_t* layer = &list->hwLayers[i]; |
| 946 | hwc_rect_t dst = layer->displayFrame; |
| 947 | if(dst.left > hw_w/2) { |
| 948 | pipesNeeded++; |
| 949 | } else if(dst.right <= hw_w/2) { |
| 950 | pipesNeeded++; |
| 951 | } else { |
| 952 | pipesNeeded += 2; |
| 953 | } |
| 954 | } |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 955 | } |
| 956 | return pipesNeeded; |
| 957 | } |
| 958 | |
| 959 | bool MDPCompHighRes::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 960 | MdpPipeInfoHighRes& pipe_info, |
| 961 | ePipeType type) { |
| 962 | int hw_w = ctx->dpyAttr[mDpy].xres; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 963 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 964 | hwc_rect_t dst = layer->displayFrame; |
| 965 | if(dst.left > hw_w/2) { |
| 966 | pipe_info.lIndex = ovutils::OV_INVALID; |
| 967 | pipe_info.rIndex = getMdpPipe(ctx, type); |
| 968 | if(pipe_info.rIndex == ovutils::OV_INVALID) |
| 969 | return false; |
| 970 | } else if (dst.right <= hw_w/2) { |
| 971 | pipe_info.rIndex = ovutils::OV_INVALID; |
| 972 | pipe_info.lIndex = getMdpPipe(ctx, type); |
| 973 | if(pipe_info.lIndex == ovutils::OV_INVALID) |
| 974 | return false; |
| 975 | } else { |
| 976 | pipe_info.rIndex = getMdpPipe(ctx, type); |
| 977 | pipe_info.lIndex = getMdpPipe(ctx, type); |
| 978 | if(pipe_info.rIndex == ovutils::OV_INVALID || |
| 979 | pipe_info.lIndex == ovutils::OV_INVALID) |
| 980 | return false; |
| 981 | } |
| 982 | return true; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 983 | } |
| 984 | |
| 985 | bool MDPCompHighRes::allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 986 | hwc_display_contents_1_t* list) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 987 | overlay::Overlay& ov = *ctx->mOverlay; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 988 | int layer_count = ctx->listStats[mDpy].numAppLayers; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 989 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 990 | if(isYuvPresent(ctx, mDpy)) { |
| 991 | int nYuvCount = ctx->listStats[mDpy].yuvCount; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 992 | |
| 993 | for(int index = 0; index < nYuvCount; index ++) { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 994 | int nYuvIndex = ctx->listStats[mDpy].yuvIndices[index]; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 995 | hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 996 | PipeLayerPair& info = mCurrentFrame.mdpToLayer[nYuvIndex]; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 997 | info.pipeInfo = new MdpPipeInfoHighRes; |
Saurabh Shah | 9e3adb2 | 2013-03-26 11:16:27 -0700 | [diff] [blame] | 998 | info.rot = NULL; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 999 | MdpPipeInfoHighRes& pipe_info = *(MdpPipeInfoHighRes*)info.pipeInfo; |
| 1000 | if(!acquireMDPPipes(ctx, layer, pipe_info,MDPCOMP_OV_VG)) { |
| 1001 | ALOGD_IF(isDebug(),"%s: Unable to get pipe for videos", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1002 | __FUNCTION__); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1003 | //TODO: windback pipebook data on fail |
| 1004 | return false; |
| 1005 | } |
| 1006 | pipe_info.zOrder = nYuvIndex; |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | for(int index = 0 ; index < layer_count ; index++ ) { |
| 1011 | hwc_layer_1_t* layer = &list->hwLayers[index]; |
| 1012 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 1013 | |
| 1014 | if(isYuvBuffer(hnd)) |
| 1015 | continue; |
| 1016 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1017 | PipeLayerPair& info = mCurrentFrame.mdpToLayer[index]; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1018 | info.pipeInfo = new MdpPipeInfoHighRes; |
Saurabh Shah | 9e3adb2 | 2013-03-26 11:16:27 -0700 | [diff] [blame] | 1019 | info.rot = NULL; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1020 | MdpPipeInfoHighRes& pipe_info = *(MdpPipeInfoHighRes*)info.pipeInfo; |
| 1021 | |
| 1022 | ePipeType type = MDPCOMP_OV_ANY; |
| 1023 | |
Saurabh Shah | 85234ec | 2013-04-12 17:09:00 -0700 | [diff] [blame] | 1024 | if(!qhwc::needsScaling(layer) |
| 1025 | && Overlay::getDMAMode() != Overlay::DMA_BLOCK_MODE |
| 1026 | && ctx->mMDP.version >= qdutils::MDSS_V5) |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1027 | type = MDPCOMP_OV_DMA; |
| 1028 | |
| 1029 | if(!acquireMDPPipes(ctx, layer, pipe_info, type)) { |
| 1030 | ALOGD_IF(isDebug(), "%s: Unable to get pipe for UI", __FUNCTION__); |
| 1031 | //TODO: windback pipebook data on fail |
| 1032 | return false; |
| 1033 | } |
| 1034 | pipe_info.zOrder = index; |
| 1035 | } |
| 1036 | return true; |
| 1037 | } |
| 1038 | /* |
| 1039 | * Configures pipe(s) for MDP composition |
| 1040 | */ |
| 1041 | int MDPCompHighRes::configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1042 | PipeLayerPair& PipeLayerPair) { |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1043 | MdpPipeInfoHighRes& mdp_info = |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1044 | *(static_cast<MdpPipeInfoHighRes*>(PipeLayerPair.pipeInfo)); |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1045 | eZorder zOrder = static_cast<eZorder>(mdp_info.zOrder); |
| 1046 | eIsFg isFg = IS_FG_OFF; |
| 1047 | eMdpFlags mdpFlagsL = OV_MDP_BACKEND_COMPOSITION; |
| 1048 | eDest lDest = mdp_info.lIndex; |
| 1049 | eDest rDest = mdp_info.rIndex; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1050 | |
| 1051 | ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipeL: %d" |
| 1052 | "dest_pipeR: %d",__FUNCTION__, layer, zOrder, lDest, rDest); |
| 1053 | |
| 1054 | return configureHighRes(ctx, layer, mDpy, mdpFlagsL, zOrder, isFg, lDest, |
| 1055 | rDest, &PipeLayerPair.rot); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1056 | } |
| 1057 | |
| 1058 | bool MDPCompHighRes::draw(hwc_context_t *ctx, hwc_display_contents_1_t* list) { |
| 1059 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1060 | if(!isEnabled()) { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1061 | ALOGD_IF(isDebug(),"%s: MDP Comp not configured", __FUNCTION__); |
| 1062 | return true; |
| 1063 | } |
| 1064 | |
| 1065 | if(!ctx || !list) { |
| 1066 | ALOGE("%s: invalid contxt or list",__FUNCTION__); |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1067 | return false; |
| 1068 | } |
| 1069 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1070 | /* reset Invalidator */ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1071 | if(idleInvalidator && mCurrentFrame.mdpCount) |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1072 | idleInvalidator->markForSleep(); |
| 1073 | |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 1074 | overlay::Overlay& ov = *ctx->mOverlay; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1075 | LayerProp *layerProp = ctx->layerProp[mDpy]; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1076 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1077 | int numHwLayers = ctx->listStats[mDpy].numAppLayers; |
| 1078 | for(int i = 0; i < numHwLayers && mCurrentFrame.mdpCount; i++ ) |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1079 | { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1080 | if(mCurrentFrame.isFBComposed[i]) continue; |
| 1081 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1082 | hwc_layer_1_t *layer = &list->hwLayers[i]; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1083 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
| 1084 | if(!hnd) { |
| 1085 | ALOGE("%s handle null", __FUNCTION__); |
| 1086 | return false; |
| 1087 | } |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1088 | |
| 1089 | if(!(layerProp[i].mFlags & HWC_MDPCOMP)) { |
| 1090 | continue; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1091 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1092 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1093 | int mdpIndex = mCurrentFrame.layerToMDP[i]; |
| 1094 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1095 | MdpPipeInfoHighRes& pipe_info = |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1096 | *(MdpPipeInfoHighRes*)mCurrentFrame.mdpToLayer[mdpIndex].pipeInfo; |
| 1097 | Rotator *rot = mCurrentFrame.mdpToLayer[mdpIndex].rot; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1098 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1099 | ovutils::eDest indexL = pipe_info.lIndex; |
| 1100 | ovutils::eDest indexR = pipe_info.rIndex; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1101 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1102 | int fd = hnd->fd; |
| 1103 | int offset = hnd->offset; |
| 1104 | |
| 1105 | if(rot) { |
| 1106 | rot->queueBuffer(fd, offset); |
| 1107 | fd = rot->getDstMemId(); |
| 1108 | offset = rot->getDstOffset(); |
| 1109 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1110 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1111 | //************* play left mixer ********** |
| 1112 | if(indexL != ovutils::OV_INVALID) { |
| 1113 | ovutils::eDest destL = (ovutils::eDest)indexL; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1114 | ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1115 | using pipe: %d", __FUNCTION__, layer, hnd, indexL ); |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1116 | if (!ov.queueBuffer(fd, offset, destL)) { |
| 1117 | ALOGE("%s: queueBuffer failed for left mixer", __FUNCTION__); |
| 1118 | return false; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1119 | } |
| 1120 | } |
| 1121 | |
| 1122 | //************* play right mixer ********** |
| 1123 | if(indexR != ovutils::OV_INVALID) { |
| 1124 | ovutils::eDest destR = (ovutils::eDest)indexR; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1125 | ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 1126 | using pipe: %d", __FUNCTION__, layer, hnd, indexR ); |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1127 | if (!ov.queueBuffer(fd, offset, destR)) { |
| 1128 | ALOGE("%s: queueBuffer failed for right mixer", __FUNCTION__); |
| 1129 | return false; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1130 | } |
| 1131 | } |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1132 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1133 | layerProp[i].mFlags &= ~HWC_MDPCOMP; |
| 1134 | } |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 1135 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 1136 | return true; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1137 | } |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1138 | }; //namespace |
| 1139 | |