Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * Copyright (C) 2012, The Linux Foundation. All rights reserved. |
| 4 | * |
| 5 | * Not a Contribution, Apache license notifications and license are |
| 6 | * retained for attribution purposes only. |
| 7 | * |
| 8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | * you may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | * |
| 14 | * Unless required by applicable law or agreed to in writing, software |
| 15 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | * See the License for the specific language governing permissions and |
| 18 | * limitations under the License. |
| 19 | */ |
| 20 | |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 21 | #define DEBUG_FBUPDATE 0 |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 22 | #include <gralloc_priv.h> |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 23 | #include "hwc_fbupdate.h" |
Saurabh Shah | bd2d083 | 2013-04-04 14:33:08 -0700 | [diff] [blame] | 24 | #include "mdp_version.h" |
| 25 | |
| 26 | using namespace qdutils; |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 27 | |
| 28 | namespace qhwc { |
| 29 | |
| 30 | namespace ovutils = overlay::utils; |
| 31 | |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 32 | IFBUpdate* IFBUpdate::getObject(const int& width, const int& dpy) { |
| 33 | if(width > MAX_DISPLAY_DIM) { |
| 34 | return new FBUpdateHighRes(dpy); |
| 35 | } |
| 36 | return new FBUpdateLowRes(dpy); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 37 | } |
| 38 | |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 39 | inline void IFBUpdate::reset() { |
| 40 | mModeOn = false; |
| 41 | } |
| 42 | |
| 43 | //================= Low res==================================== |
| 44 | FBUpdateLowRes::FBUpdateLowRes(const int& dpy): IFBUpdate(dpy) {} |
| 45 | |
| 46 | inline void FBUpdateLowRes::reset() { |
| 47 | IFBUpdate::reset(); |
| 48 | mDest = ovutils::OV_INVALID; |
| 49 | } |
| 50 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 51 | bool FBUpdateLowRes::prepare(hwc_context_t *ctx, hwc_display_contents_1 *list, |
| 52 | int fbZorder) { |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 53 | if(!ctx->mMDP.hasOverlay) { |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 54 | ALOGD_IF(DEBUG_FBUPDATE, "%s, this hw doesnt support overlays", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 55 | __FUNCTION__); |
| 56 | return false; |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 57 | } |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 58 | mModeOn = configure(ctx, list, fbZorder); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 59 | return mModeOn; |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | // Configure |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 63 | bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list, |
| 64 | int fbZorder) { |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 65 | bool ret = false; |
Naseer Ahmed | 64b8121 | 2013-02-14 10:29:47 -0500 | [diff] [blame] | 66 | hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1]; |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 67 | if (LIKELY(ctx->mOverlay)) { |
Arun Kumar K.R | a297845 | 2013-02-07 01:34:24 -0800 | [diff] [blame^] | 68 | int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex; |
| 69 | // ext only layer present.. |
| 70 | if(extOnlyLayerIndex != -1) { |
| 71 | layer = &list->hwLayers[extOnlyLayerIndex]; |
| 72 | layer->compositionType = HWC_OVERLAY; |
| 73 | } |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 74 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 75 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 76 | ovutils::Whf info(hnd->width, hnd->height, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 77 | ovutils::getMdpFormat(hnd->format), hnd->size); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 78 | |
| 79 | //Request an RGB pipe |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 80 | ovutils::eDest dest = ov.nextPipe(ovutils::OV_MDP_PIPE_ANY, mDpy); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 81 | if(dest == ovutils::OV_INVALID) { //None available |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 82 | ALOGE("%s: No pipes available to configure fb for dpy %d", |
| 83 | __FUNCTION__, mDpy); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 84 | return false; |
| 85 | } |
| 86 | |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 87 | mDest = dest; |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 88 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 89 | ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_BLEND_FG_PREMULT; |
Sravan Kumar D.V.N | b5ed029 | 2013-03-15 08:51:16 +0530 | [diff] [blame] | 90 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 91 | ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 92 | |
| 93 | ovutils::PipeArgs parg(mdpFlags, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 94 | info, |
| 95 | zOrder, |
| 96 | ovutils::IS_FG_OFF, |
| 97 | ovutils::ROT_FLAGS_NONE); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 98 | ov.setSource(parg, dest); |
| 99 | |
Arun Kumar K.R | a297845 | 2013-02-07 01:34:24 -0800 | [diff] [blame^] | 100 | hwc_rect_t sourceCrop = layer->sourceCrop; |
| 101 | hwc_rect_t displayFrame = layer->displayFrame; |
| 102 | if(extOnlyLayerIndex == -1) { |
| 103 | getNonWormholeRegion(list, sourceCrop); |
| 104 | displayFrame = sourceCrop; |
| 105 | } |
| 106 | |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 107 | // x,y,w,h |
| 108 | ovutils::Dim dcrop(sourceCrop.left, sourceCrop.top, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 109 | sourceCrop.right - sourceCrop.left, |
| 110 | sourceCrop.bottom - sourceCrop.top); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 111 | ov.setCrop(dcrop, dest); |
| 112 | |
| 113 | int transform = layer->transform; |
| 114 | ovutils::eTransform orient = |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 115 | static_cast<ovutils::eTransform>(transform); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 116 | ov.setTransform(orient, dest); |
| 117 | |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 118 | ovutils::Dim dpos(displayFrame.left, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 119 | displayFrame.top, |
| 120 | displayFrame.right - displayFrame.left, |
| 121 | displayFrame.bottom - displayFrame.top); |
Arun Kumar K.R | feb2d8a | 2013-02-01 02:53:13 -0800 | [diff] [blame] | 122 | // Calculate the actionsafe dimensions for External(dpy = 1 or 2) |
| 123 | if(mDpy) |
| 124 | getActionSafePosition(ctx, mDpy, dpos.x, dpos.y, dpos.w, dpos.h); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 125 | ov.setPosition(dpos, dest); |
| 126 | |
| 127 | ret = true; |
| 128 | if (!ov.commit(dest)) { |
| 129 | ALOGE("%s: commit fails", __FUNCTION__); |
| 130 | ret = false; |
| 131 | } |
| 132 | } |
| 133 | return ret; |
| 134 | } |
| 135 | |
Naseer Ahmed | 64b8121 | 2013-02-14 10:29:47 -0500 | [diff] [blame] | 136 | bool FBUpdateLowRes::draw(hwc_context_t *ctx, private_handle_t *hnd) |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 137 | { |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 138 | if(!mModeOn) { |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 139 | return true; |
| 140 | } |
| 141 | bool ret = true; |
| 142 | overlay::Overlay& ov = *(ctx->mOverlay); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 143 | ovutils::eDest dest = mDest; |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 144 | if (!ov.queueBuffer(hnd->fd, hnd->offset, dest)) { |
Amara Venkata Mastan Manoj Kumar | dc01a53 | 2013-01-30 18:34:56 -0800 | [diff] [blame] | 145 | ALOGE("%s: queueBuffer failed for FBUpdate", __FUNCTION__); |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 146 | ret = false; |
| 147 | } |
| 148 | return ret; |
| 149 | } |
| 150 | |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 151 | //================= High res==================================== |
| 152 | FBUpdateHighRes::FBUpdateHighRes(const int& dpy): IFBUpdate(dpy) {} |
| 153 | |
| 154 | inline void FBUpdateHighRes::reset() { |
| 155 | IFBUpdate::reset(); |
| 156 | mDestLeft = ovutils::OV_INVALID; |
| 157 | mDestRight = ovutils::OV_INVALID; |
| 158 | } |
| 159 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 160 | bool FBUpdateHighRes::prepare(hwc_context_t *ctx, hwc_display_contents_1 *list, |
| 161 | int fbZorder) { |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 162 | if(!ctx->mMDP.hasOverlay) { |
| 163 | ALOGD_IF(DEBUG_FBUPDATE, "%s, this hw doesnt support overlays", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 164 | __FUNCTION__); |
| 165 | return false; |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 166 | } |
| 167 | ALOGD_IF(DEBUG_FBUPDATE, "%s, mModeOn = %d", __FUNCTION__, mModeOn); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 168 | mModeOn = configure(ctx, list, fbZorder); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 169 | return mModeOn; |
| 170 | } |
| 171 | |
| 172 | // Configure |
Naseer Ahmed | 64b8121 | 2013-02-14 10:29:47 -0500 | [diff] [blame] | 173 | bool FBUpdateHighRes::configure(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 174 | hwc_display_contents_1 *list, int fbZorder) { |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 175 | bool ret = false; |
Naseer Ahmed | 64b8121 | 2013-02-14 10:29:47 -0500 | [diff] [blame] | 176 | hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1]; |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 177 | if (LIKELY(ctx->mOverlay)) { |
Arun Kumar K.R | a297845 | 2013-02-07 01:34:24 -0800 | [diff] [blame^] | 178 | int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex; |
| 179 | // ext only layer present.. |
| 180 | if(extOnlyLayerIndex != -1) { |
| 181 | layer = &list->hwLayers[extOnlyLayerIndex]; |
| 182 | layer->compositionType = HWC_OVERLAY; |
| 183 | } |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 184 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 185 | private_handle_t *hnd = (private_handle_t *)layer->handle; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 186 | ovutils::Whf info(hnd->width, hnd->height, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 187 | ovutils::getMdpFormat(hnd->format), hnd->size); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 188 | |
| 189 | //Request left RGB pipe |
| 190 | ovutils::eDest destL = ov.nextPipe(ovutils::OV_MDP_PIPE_RGB, mDpy); |
| 191 | if(destL == ovutils::OV_INVALID) { //None available |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 192 | ALOGE("%s: No pipes available to configure fb for dpy %d's left" |
| 193 | " mixer", __FUNCTION__, mDpy); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 194 | return false; |
| 195 | } |
| 196 | //Request right RGB pipe |
| 197 | ovutils::eDest destR = ov.nextPipe(ovutils::OV_MDP_PIPE_RGB, mDpy); |
| 198 | if(destR == ovutils::OV_INVALID) { //None available |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 199 | ALOGE("%s: No pipes available to configure fb for dpy %d's right" |
| 200 | " mixer", __FUNCTION__, mDpy); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 201 | return false; |
| 202 | } |
| 203 | |
| 204 | mDestLeft = destL; |
| 205 | mDestRight = destR; |
| 206 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 207 | ovutils::eMdpFlags mdpFlagsL = ovutils::OV_MDP_BLEND_FG_PREMULT; |
Sravan Kumar D.V.N | b5ed029 | 2013-03-15 08:51:16 +0530 | [diff] [blame] | 208 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 209 | ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 210 | |
| 211 | ovutils::PipeArgs pargL(mdpFlagsL, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 212 | info, |
| 213 | zOrder, |
| 214 | ovutils::IS_FG_OFF, |
| 215 | ovutils::ROT_FLAGS_NONE); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 216 | ov.setSource(pargL, destL); |
| 217 | |
| 218 | ovutils::eMdpFlags mdpFlagsR = mdpFlagsL; |
| 219 | ovutils::setMdpFlags(mdpFlagsR, ovutils::OV_MDSS_MDP_RIGHT_MIXER); |
| 220 | ovutils::PipeArgs pargR(mdpFlagsR, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 221 | info, |
| 222 | zOrder, |
| 223 | ovutils::IS_FG_OFF, |
| 224 | ovutils::ROT_FLAGS_NONE); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 225 | ov.setSource(pargR, destR); |
| 226 | |
Arun Kumar K.R | a297845 | 2013-02-07 01:34:24 -0800 | [diff] [blame^] | 227 | hwc_rect_t sourceCrop = layer->sourceCrop; |
| 228 | hwc_rect_t displayFrame = layer->displayFrame; |
| 229 | if(extOnlyLayerIndex == -1) { |
| 230 | getNonWormholeRegion(list, sourceCrop); |
| 231 | displayFrame = sourceCrop; |
| 232 | } |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 233 | ovutils::Dim dcropL(sourceCrop.left, sourceCrop.top, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 234 | (sourceCrop.right - sourceCrop.left) / 2, |
| 235 | sourceCrop.bottom - sourceCrop.top); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 236 | ovutils::Dim dcropR( |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 237 | sourceCrop.left + (sourceCrop.right - sourceCrop.left) / 2, |
| 238 | sourceCrop.top, |
| 239 | (sourceCrop.right - sourceCrop.left) / 2, |
| 240 | sourceCrop.bottom - sourceCrop.top); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 241 | ov.setCrop(dcropL, destL); |
| 242 | ov.setCrop(dcropR, destR); |
| 243 | |
| 244 | int transform = layer->transform; |
| 245 | ovutils::eTransform orient = |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 246 | static_cast<ovutils::eTransform>(transform); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 247 | ov.setTransform(orient, destL); |
| 248 | ov.setTransform(orient, destR); |
| 249 | |
Saurabh Shah | ce416f0 | 2013-04-10 13:33:09 -0700 | [diff] [blame] | 250 | const int halfWidth = (displayFrame.right - displayFrame.left) / 2; |
| 251 | const int height = displayFrame.bottom - displayFrame.top; |
| 252 | |
Saurabh Shah | ca31759 | 2013-05-02 14:53:58 -0700 | [diff] [blame] | 253 | const int halfDpy = ctx->dpyAttr[mDpy].xres / 2; |
| 254 | ovutils::Dim dposL(halfDpy - halfWidth, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 255 | displayFrame.top, |
Saurabh Shah | ce416f0 | 2013-04-10 13:33:09 -0700 | [diff] [blame] | 256 | halfWidth, |
| 257 | height); |
Arun Kumar K.R | 0e8efb8 | 2013-03-18 17:31:50 -0700 | [diff] [blame] | 258 | ov.setPosition(dposL, destL); |
Saurabh Shah | ce416f0 | 2013-04-10 13:33:09 -0700 | [diff] [blame] | 259 | |
Arun Kumar K.R | 0e8efb8 | 2013-03-18 17:31:50 -0700 | [diff] [blame] | 260 | ovutils::Dim dposR(0, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 261 | displayFrame.top, |
Saurabh Shah | ce416f0 | 2013-04-10 13:33:09 -0700 | [diff] [blame] | 262 | halfWidth, |
| 263 | height); |
Arun Kumar K.R | 0e8efb8 | 2013-03-18 17:31:50 -0700 | [diff] [blame] | 264 | ov.setPosition(dposR, destR); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 265 | |
| 266 | ret = true; |
| 267 | if (!ov.commit(destL)) { |
| 268 | ALOGE("%s: commit fails for left", __FUNCTION__); |
| 269 | ret = false; |
| 270 | } |
| 271 | if (!ov.commit(destR)) { |
| 272 | ALOGE("%s: commit fails for right", __FUNCTION__); |
| 273 | ret = false; |
| 274 | } |
| 275 | } |
| 276 | return ret; |
| 277 | } |
| 278 | |
Naseer Ahmed | 64b8121 | 2013-02-14 10:29:47 -0500 | [diff] [blame] | 279 | bool FBUpdateHighRes::draw(hwc_context_t *ctx, private_handle_t *hnd) |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 280 | { |
| 281 | if(!mModeOn) { |
| 282 | return true; |
| 283 | } |
| 284 | bool ret = true; |
| 285 | overlay::Overlay& ov = *(ctx->mOverlay); |
| 286 | ovutils::eDest destL = mDestLeft; |
| 287 | ovutils::eDest destR = mDestRight; |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 288 | if (!ov.queueBuffer(hnd->fd, hnd->offset, destL)) { |
| 289 | ALOGE("%s: queue failed for left of dpy = %d", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 290 | __FUNCTION__, mDpy); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 291 | ret = false; |
| 292 | } |
| 293 | if (!ov.queueBuffer(hnd->fd, hnd->offset, destR)) { |
| 294 | ALOGE("%s: queue failed for right of dpy = %d", |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 295 | __FUNCTION__, mDpy); |
Saurabh Shah | cf053c6 | 2012-12-13 12:32:55 -0800 | [diff] [blame] | 296 | ret = false; |
| 297 | } |
| 298 | return ret; |
| 299 | } |
| 300 | |
Naseer Ahmed | 758bfc5 | 2012-11-28 17:02:08 -0500 | [diff] [blame] | 301 | //--------------------------------------------------------------------- |
| 302 | }; //namespace qhwc |