blob: ac2650cb7ea9054b2b87659473faadfe6ffe19a3 [file] [log] [blame]
Naseer Ahmed758bfc52012-11-28 17:02:08 -05001/*
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 Shahcf053c62012-12-13 12:32:55 -080021#define DEBUG_FBUPDATE 0
Arun Kumar K.Rffef7482013-04-10 14:17:22 -070022#include <cutils/properties.h>
Naseer Ahmed758bfc52012-11-28 17:02:08 -050023#include <gralloc_priv.h>
Saurabh Shahaf5f5972013-07-30 13:56:35 -070024#include <overlay.h>
Arun Kumar K.Rffef7482013-04-10 14:17:22 -070025#include <overlayRotator.h>
Naseer Ahmed758bfc52012-11-28 17:02:08 -050026#include "hwc_fbupdate.h"
Saurabh Shahbd2d0832013-04-04 14:33:08 -070027#include "mdp_version.h"
Arun Kumar K.Rffef7482013-04-10 14:17:22 -070028#include "external.h"
Saurabh Shahbd2d0832013-04-04 14:33:08 -070029
30using namespace qdutils;
Saurabh Shahaf5f5972013-07-30 13:56:35 -070031using namespace overlay;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -070032using overlay::Rotator;
33
Naseer Ahmed758bfc52012-11-28 17:02:08 -050034namespace qhwc {
35
36namespace ovutils = overlay::utils;
37
Saurabh Shah67a38c32013-06-10 16:23:15 -070038IFBUpdate* IFBUpdate::getObject(const int& width, const int& rightSplit,
39 const int& dpy) {
40 if(width > MAX_DISPLAY_DIM || rightSplit) {
Saurabh Shahcf053c62012-12-13 12:32:55 -080041 return new FBUpdateHighRes(dpy);
42 }
43 return new FBUpdateLowRes(dpy);
Naseer Ahmed758bfc52012-11-28 17:02:08 -050044}
45
Saurabh Shahcf053c62012-12-13 12:32:55 -080046inline void IFBUpdate::reset() {
47 mModeOn = false;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -070048 mRot = NULL;
Saurabh Shahcf053c62012-12-13 12:32:55 -080049}
50
51//================= Low res====================================
52FBUpdateLowRes::FBUpdateLowRes(const int& dpy): IFBUpdate(dpy) {}
53
54inline void FBUpdateLowRes::reset() {
55 IFBUpdate::reset();
56 mDest = ovutils::OV_INVALID;
57}
58
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080059bool FBUpdateLowRes::prepare(hwc_context_t *ctx, hwc_display_contents_1 *list,
60 int fbZorder) {
Naseer Ahmed758bfc52012-11-28 17:02:08 -050061 if(!ctx->mMDP.hasOverlay) {
Saurabh Shahcf053c62012-12-13 12:32:55 -080062 ALOGD_IF(DEBUG_FBUPDATE, "%s, this hw doesnt support overlays",
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080063 __FUNCTION__);
64 return false;
Naseer Ahmed758bfc52012-11-28 17:02:08 -050065 }
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080066 mModeOn = configure(ctx, list, fbZorder);
Saurabh Shahcf053c62012-12-13 12:32:55 -080067 return mModeOn;
Naseer Ahmed758bfc52012-11-28 17:02:08 -050068}
69
70// Configure
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080071bool FBUpdateLowRes::configure(hwc_context_t *ctx, hwc_display_contents_1 *list,
72 int fbZorder) {
Naseer Ahmed758bfc52012-11-28 17:02:08 -050073 bool ret = false;
Naseer Ahmed64b81212013-02-14 10:29:47 -050074 hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1];
Naseer Ahmed758bfc52012-11-28 17:02:08 -050075 if (LIKELY(ctx->mOverlay)) {
Arun Kumar K.Ra2978452013-02-07 01:34:24 -080076 int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex;
77 // ext only layer present..
78 if(extOnlyLayerIndex != -1) {
79 layer = &list->hwLayers[extOnlyLayerIndex];
80 layer->compositionType = HWC_OVERLAY;
81 }
Naseer Ahmed758bfc52012-11-28 17:02:08 -050082 overlay::Overlay& ov = *(ctx->mOverlay);
83 private_handle_t *hnd = (private_handle_t *)layer->handle;
Saurabh Shahacf10202013-02-26 10:15:15 -080084 ovutils::Whf info(hnd->width, hnd->height,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080085 ovutils::getMdpFormat(hnd->format), hnd->size);
Naseer Ahmed758bfc52012-11-28 17:02:08 -050086
Saurabh Shahd4e65852013-06-17 11:33:53 -070087 //Request a pipe
88 ovutils::eMdpPipeType type = ovutils::OV_MDP_PIPE_ANY;
89 if(qdutils::MDPVersion::getInstance().is8x26() && mDpy) {
90 //For 8x26 external always use DMA pipe
91 type = ovutils::OV_MDP_PIPE_DMA;
92 }
Saurabh Shahaf5f5972013-07-30 13:56:35 -070093 ovutils::eDest dest = ov.nextPipe(type, mDpy, Overlay::MIXER_DEFAULT);
Naseer Ahmed758bfc52012-11-28 17:02:08 -050094 if(dest == ovutils::OV_INVALID) { //None available
Saurabh Shahaa236822013-04-24 18:07:26 -070095 ALOGE("%s: No pipes available to configure fb for dpy %d",
96 __FUNCTION__, mDpy);
Naseer Ahmed758bfc52012-11-28 17:02:08 -050097 return false;
98 }
Saurabh Shahcf053c62012-12-13 12:32:55 -080099 mDest = dest;
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500100
Ramkumar Radhakrishnan1829d282013-07-23 14:54:36 -0700101 if((mDpy && ctx->deviceOrientation) &&
102 ctx->listStats[mDpy].isDisplayAnimating) {
103 fbZorder = 0;
104 }
105
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800106 ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_BLEND_FG_PREMULT;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700107 ovutils::eIsFg isFg = ovutils::IS_FG_OFF;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800108 ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder);
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500109
Arun Kumar K.Ra2978452013-02-07 01:34:24 -0800110 hwc_rect_t sourceCrop = layer->sourceCrop;
111 hwc_rect_t displayFrame = layer->displayFrame;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700112 int transform = layer->transform;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700113 int rotFlags = ovutils::ROT_FLAGS_NONE;
114
115 ovutils::eTransform orient =
116 static_cast<ovutils::eTransform>(transform);
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700117
Ramkumar Radhakrishnan59a11072013-04-15 16:14:49 -0700118 // Do not use getNonWormholeRegion() function to calculate the
119 // sourceCrop during animation on external display and
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700120 // Dont do wormhole calculation when extorientation is set on External
Ramkumar Radhakrishnan59a11072013-04-15 16:14:49 -0700121 if(ctx->listStats[mDpy].isDisplayAnimating && mDpy) {
122 sourceCrop = layer->displayFrame;
123 displayFrame = sourceCrop;
Ramkumar Radhakrishnan31f4c4e2013-08-22 13:32:18 -0700124 } else if((!mDpy || (mDpy && !ctx->mExtOrientation))
125 && extOnlyLayerIndex == -1) {
Saurabh Shahd4e65852013-06-17 11:33:53 -0700126 if(!qdutils::MDPVersion::getInstance().is8x26()) {
127 getNonWormholeRegion(list, sourceCrop);
128 displayFrame = sourceCrop;
129 }
Arun Kumar K.Ra2978452013-02-07 01:34:24 -0800130 }
Ramkumar Radhakrishnan31f4c4e2013-08-22 13:32:18 -0700131
Saurabh Shahd4e65852013-06-17 11:33:53 -0700132 if(mDpy && !qdutils::MDPVersion::getInstance().is8x26()) {
Ramkumar Radhakrishnan31f4c4e2013-08-22 13:32:18 -0700133 if(ctx->mExtOrientation) {
134 calcExtDisplayPosition(ctx, mDpy, displayFrame);
Arun Kumar K.R5898c652013-07-17 14:20:32 -0700135 // If there is a external orientation set, use that
Ramkumar Radhakrishnan31f4c4e2013-08-22 13:32:18 -0700136 transform = ctx->mExtOrientation;
137 orient = static_cast<ovutils::eTransform >(ctx->mExtOrientation);
Arun Kumar K.R5898c652013-07-17 14:20:32 -0700138 }
Arun Kumar K.R82f1d282013-05-17 15:37:31 -0700139 // Calculate the actionsafe dimensions for External(dpy = 1 or 2)
Arun Kumar K.R5898c652013-07-17 14:20:32 -0700140 getActionSafePosition(ctx, mDpy, displayFrame);
Ramkumar Radhakrishnan31f4c4e2013-08-22 13:32:18 -0700141 }
Ramkumar Radhakrishnan9d52f432013-05-14 14:46:59 -0700142 setMdpFlags(layer, mdpFlags, 0, transform);
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700143 // For External use rotator if there is a rotation value set
Ramkumar Radhakrishnandc4aeb52013-08-22 13:31:33 -0700144 if(mDpy && (ctx->mExtOrientation & HWC_TRANSFORM_ROT_90)) {
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700145 mRot = ctx->mRotMgr->getNext();
146 if(mRot == NULL) return -1;
147 //Configure rotator for pre-rotation
148 if(configRotator(mRot, info, sourceCrop, mdpFlags, orient, 0) < 0) {
149 ALOGE("%s: configRotator Failed!", __FUNCTION__);
150 mRot = NULL;
151 return -1;
152 }
153 info.format = (mRot)->getDstFormat();
154 updateSource(orient, info, sourceCrop);
155 rotFlags |= ovutils::ROT_PREROTATED;
156 }
157 //For the mdp, since either we are pre-rotating or MDP does flips
158 orient = ovutils::OVERLAY_TRANSFORM_0;
159 transform = 0;
160 ovutils::PipeArgs parg(mdpFlags, info, zOrder, isFg,
Naseer Ahmed522ce662013-03-18 20:14:05 -0400161 static_cast<ovutils::eRotFlags>(rotFlags),
162 ovutils::DEFAULT_PLANE_ALPHA,
163 (ovutils::eBlending)
164 getBlending(layer->blending));
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500165 ret = true;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700166 if(configMdp(ctx->mOverlay, parg, orient, sourceCrop, displayFrame,
167 NULL, mDest) < 0) {
Saurabh Shahe2474082013-05-15 16:32:13 -0700168 ALOGE("%s: configMdp failed for dpy %d", __FUNCTION__, mDpy);
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500169 ret = false;
170 }
171 }
172 return ret;
173}
174
Naseer Ahmed64b81212013-02-14 10:29:47 -0500175bool FBUpdateLowRes::draw(hwc_context_t *ctx, private_handle_t *hnd)
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500176{
Saurabh Shahcf053c62012-12-13 12:32:55 -0800177 if(!mModeOn) {
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500178 return true;
179 }
180 bool ret = true;
181 overlay::Overlay& ov = *(ctx->mOverlay);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800182 ovutils::eDest dest = mDest;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700183 int fd = hnd->fd;
184 uint32_t offset = hnd->offset;
185 if(mRot) {
186 if(!mRot->queueBuffer(fd, offset))
187 return false;
188 fd = mRot->getDstMemId();
189 offset = mRot->getDstOffset();
190 }
191 if (!ov.queueBuffer(fd, offset, dest)) {
Amara Venkata Mastan Manoj Kumardc01a532013-01-30 18:34:56 -0800192 ALOGE("%s: queueBuffer failed for FBUpdate", __FUNCTION__);
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500193 ret = false;
194 }
195 return ret;
196}
197
Saurabh Shahcf053c62012-12-13 12:32:55 -0800198//================= High res====================================
199FBUpdateHighRes::FBUpdateHighRes(const int& dpy): IFBUpdate(dpy) {}
200
201inline void FBUpdateHighRes::reset() {
202 IFBUpdate::reset();
203 mDestLeft = ovutils::OV_INVALID;
204 mDestRight = ovutils::OV_INVALID;
Arun Kumar K.Rffef7482013-04-10 14:17:22 -0700205 mRot = NULL;
Saurabh Shahcf053c62012-12-13 12:32:55 -0800206}
207
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800208bool FBUpdateHighRes::prepare(hwc_context_t *ctx, hwc_display_contents_1 *list,
209 int fbZorder) {
Saurabh Shahcf053c62012-12-13 12:32:55 -0800210 if(!ctx->mMDP.hasOverlay) {
211 ALOGD_IF(DEBUG_FBUPDATE, "%s, this hw doesnt support overlays",
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800212 __FUNCTION__);
213 return false;
Saurabh Shahcf053c62012-12-13 12:32:55 -0800214 }
215 ALOGD_IF(DEBUG_FBUPDATE, "%s, mModeOn = %d", __FUNCTION__, mModeOn);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800216 mModeOn = configure(ctx, list, fbZorder);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800217 return mModeOn;
218}
219
220// Configure
Naseer Ahmed64b81212013-02-14 10:29:47 -0500221bool FBUpdateHighRes::configure(hwc_context_t *ctx,
Saurabh Shah67a38c32013-06-10 16:23:15 -0700222 hwc_display_contents_1 *list, int fbZorder) {
Saurabh Shahcf053c62012-12-13 12:32:55 -0800223 bool ret = false;
Naseer Ahmed64b81212013-02-14 10:29:47 -0500224 hwc_layer_1_t *layer = &list->hwLayers[list->numHwLayers - 1];
Saurabh Shahcf053c62012-12-13 12:32:55 -0800225 if (LIKELY(ctx->mOverlay)) {
Arun Kumar K.Ra2978452013-02-07 01:34:24 -0800226 int extOnlyLayerIndex = ctx->listStats[mDpy].extOnlyLayerIndex;
227 // ext only layer present..
228 if(extOnlyLayerIndex != -1) {
229 layer = &list->hwLayers[extOnlyLayerIndex];
230 layer->compositionType = HWC_OVERLAY;
231 }
Saurabh Shahcf053c62012-12-13 12:32:55 -0800232 overlay::Overlay& ov = *(ctx->mOverlay);
233 private_handle_t *hnd = (private_handle_t *)layer->handle;
Saurabh Shahacf10202013-02-26 10:15:15 -0800234 ovutils::Whf info(hnd->width, hnd->height,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800235 ovutils::getMdpFormat(hnd->format), hnd->size);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800236
Saurabh Shahc66f54d2013-06-12 15:45:59 -0700237 //Request left pipe
Saurabh Shahaf5f5972013-07-30 13:56:35 -0700238 ovutils::eDest destL = ov.nextPipe(ovutils::OV_MDP_PIPE_ANY, mDpy,
239 Overlay::MIXER_LEFT);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800240 if(destL == ovutils::OV_INVALID) { //None available
Saurabh Shahaa236822013-04-24 18:07:26 -0700241 ALOGE("%s: No pipes available to configure fb for dpy %d's left"
242 " mixer", __FUNCTION__, mDpy);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800243 return false;
244 }
Saurabh Shahc66f54d2013-06-12 15:45:59 -0700245 //Request right pipe
Saurabh Shahaf5f5972013-07-30 13:56:35 -0700246 ovutils::eDest destR = ov.nextPipe(ovutils::OV_MDP_PIPE_ANY, mDpy,
247 Overlay::MIXER_RIGHT);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800248 if(destR == ovutils::OV_INVALID) { //None available
Saurabh Shahaa236822013-04-24 18:07:26 -0700249 ALOGE("%s: No pipes available to configure fb for dpy %d's right"
250 " mixer", __FUNCTION__, mDpy);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800251 return false;
252 }
253
254 mDestLeft = destL;
255 mDestRight = destR;
256
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800257 ovutils::eMdpFlags mdpFlagsL = ovutils::OV_MDP_BLEND_FG_PREMULT;
Sravan Kumar D.V.Nb5ed0292013-03-15 08:51:16 +0530258
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800259 ovutils::eZorder zOrder = static_cast<ovutils::eZorder>(fbZorder);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800260
Naseer Ahmed522ce662013-03-18 20:14:05 -0400261 //XXX: FB layer plane alpha is currently sent as zero from
262 //surfaceflinger
Saurabh Shahcf053c62012-12-13 12:32:55 -0800263 ovutils::PipeArgs pargL(mdpFlagsL,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800264 info,
265 zOrder,
266 ovutils::IS_FG_OFF,
Naseer Ahmed522ce662013-03-18 20:14:05 -0400267 ovutils::ROT_FLAGS_NONE,
268 ovutils::DEFAULT_PLANE_ALPHA,
269 (ovutils::eBlending)
270 getBlending(layer->blending));
Saurabh Shahcf053c62012-12-13 12:32:55 -0800271 ov.setSource(pargL, destL);
272
273 ovutils::eMdpFlags mdpFlagsR = mdpFlagsL;
274 ovutils::setMdpFlags(mdpFlagsR, ovutils::OV_MDSS_MDP_RIGHT_MIXER);
275 ovutils::PipeArgs pargR(mdpFlagsR,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800276 info,
277 zOrder,
278 ovutils::IS_FG_OFF,
Naseer Ahmed522ce662013-03-18 20:14:05 -0400279 ovutils::ROT_FLAGS_NONE,
280 ovutils::DEFAULT_PLANE_ALPHA,
281 (ovutils::eBlending)
282 getBlending(layer->blending));
Saurabh Shahcf053c62012-12-13 12:32:55 -0800283 ov.setSource(pargR, destR);
284
Arun Kumar K.Ra2978452013-02-07 01:34:24 -0800285 hwc_rect_t sourceCrop = layer->sourceCrop;
286 hwc_rect_t displayFrame = layer->displayFrame;
Saurabh Shah67a38c32013-06-10 16:23:15 -0700287
288 const float xres = ctx->dpyAttr[mDpy].xres;
Saurabh Shah07a8ca82013-08-06 18:45:42 -0700289 const int lSplit = getLeftSplit(ctx, mDpy);
Saurabh Shah67a38c32013-06-10 16:23:15 -0700290 const float lSplitRatio = lSplit / xres;
Saurabh Shah67a38c32013-06-10 16:23:15 -0700291 const float lCropWidth =
292 (sourceCrop.right - sourceCrop.left) * lSplitRatio;
293
294 ovutils::Dim dcropL(
295 sourceCrop.left,
296 sourceCrop.top,
297 lCropWidth,
298 sourceCrop.bottom - sourceCrop.top);
299
Saurabh Shahcf053c62012-12-13 12:32:55 -0800300 ovutils::Dim dcropR(
Saurabh Shah67a38c32013-06-10 16:23:15 -0700301 sourceCrop.left + lCropWidth,
302 sourceCrop.top,
303 (sourceCrop.right - sourceCrop.left) - lCropWidth,
304 sourceCrop.bottom - sourceCrop.top);
305
Saurabh Shahcf053c62012-12-13 12:32:55 -0800306 ov.setCrop(dcropL, destL);
307 ov.setCrop(dcropR, destR);
308
309 int transform = layer->transform;
310 ovutils::eTransform orient =
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800311 static_cast<ovutils::eTransform>(transform);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800312 ov.setTransform(orient, destL);
313 ov.setTransform(orient, destR);
314
Saurabh Shah67a38c32013-06-10 16:23:15 -0700315 const int lWidth = (lSplit - displayFrame.left);
316 const int rWidth = (displayFrame.right - lSplit);
Saurabh Shahce416f02013-04-10 13:33:09 -0700317 const int height = displayFrame.bottom - displayFrame.top;
318
Saurabh Shah67a38c32013-06-10 16:23:15 -0700319 ovutils::Dim dposL(displayFrame.left,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800320 displayFrame.top,
Saurabh Shah67a38c32013-06-10 16:23:15 -0700321 lWidth,
Saurabh Shahce416f02013-04-10 13:33:09 -0700322 height);
Arun Kumar K.R0e8efb82013-03-18 17:31:50 -0700323 ov.setPosition(dposL, destL);
Saurabh Shahce416f02013-04-10 13:33:09 -0700324
Arun Kumar K.R0e8efb82013-03-18 17:31:50 -0700325 ovutils::Dim dposR(0,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800326 displayFrame.top,
Saurabh Shah67a38c32013-06-10 16:23:15 -0700327 rWidth,
Saurabh Shahce416f02013-04-10 13:33:09 -0700328 height);
Arun Kumar K.R0e8efb82013-03-18 17:31:50 -0700329 ov.setPosition(dposR, destR);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800330
331 ret = true;
332 if (!ov.commit(destL)) {
333 ALOGE("%s: commit fails for left", __FUNCTION__);
334 ret = false;
335 }
336 if (!ov.commit(destR)) {
337 ALOGE("%s: commit fails for right", __FUNCTION__);
338 ret = false;
339 }
340 }
341 return ret;
342}
343
Naseer Ahmed64b81212013-02-14 10:29:47 -0500344bool FBUpdateHighRes::draw(hwc_context_t *ctx, private_handle_t *hnd)
Saurabh Shahcf053c62012-12-13 12:32:55 -0800345{
346 if(!mModeOn) {
347 return true;
348 }
349 bool ret = true;
350 overlay::Overlay& ov = *(ctx->mOverlay);
351 ovutils::eDest destL = mDestLeft;
352 ovutils::eDest destR = mDestRight;
Saurabh Shahcf053c62012-12-13 12:32:55 -0800353 if (!ov.queueBuffer(hnd->fd, hnd->offset, destL)) {
354 ALOGE("%s: queue failed for left of dpy = %d",
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800355 __FUNCTION__, mDpy);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800356 ret = false;
357 }
358 if (!ov.queueBuffer(hnd->fd, hnd->offset, destR)) {
359 ALOGE("%s: queue failed for right of dpy = %d",
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800360 __FUNCTION__, mDpy);
Saurabh Shahcf053c62012-12-13 12:32:55 -0800361 ret = false;
362 }
363 return ret;
364}
365
Naseer Ahmed758bfc52012-11-28 17:02:08 -0500366//---------------------------------------------------------------------
367}; //namespace qhwc