| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 1 | /* | 
 | 2 | * Copyright (C) 2008 The Android Open Source Project | 
| Raj kamal | 23f69b2 | 2012-11-17 00:20:55 +0530 | [diff] [blame] | 3 | * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 4 | * | 
 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 6 | * you may not use this file except in compliance with the License. | 
 | 7 | * You may obtain a copy of the License at | 
 | 8 | * | 
 | 9 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
 | 10 | * | 
 | 11 | * Unless required by applicable law or agreed to in writing, software | 
 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, | 
 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 14 | * See the License for the specific language governing permissions and | 
 | 15 | * limitations under the License. | 
 | 16 | */ | 
 | 17 |  | 
 | 18 | #ifndef OVERLAY_MDP_H | 
 | 19 | #define OVERLAY_MDP_H | 
 | 20 |  | 
 | 21 | #include <linux/msm_mdp.h> | 
 | 22 |  | 
 | 23 | #include "overlayUtils.h" | 
 | 24 | #include "mdpWrapper.h" | 
| Saurabh Shah | 5daeee5 | 2013-01-23 16:52:26 +0800 | [diff] [blame] | 25 | #include "qdMetaData.h" | 
 | 26 | #ifdef USES_POST_PROCESSING | 
 | 27 | #include "lib-postproc.h" | 
 | 28 | #endif | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 29 |  | 
 | 30 | namespace overlay{ | 
 | 31 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 32 | /* | 
 | 33 | * Mdp Ctrl holds corresponding fd and MDP related struct. | 
 | 34 | * It is simple wrapper to MDP services | 
 | 35 | * */ | 
 | 36 | class MdpCtrl { | 
 | 37 | public: | 
 | 38 |     /* ctor reset */ | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 39 |     explicit MdpCtrl(const int& dpy); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 40 |     /* dtor close */ | 
 | 41 |     ~MdpCtrl(); | 
| Saurabh Shah | b8f58e2 | 2013-09-26 16:20:07 -0700 | [diff] [blame] | 42 |     /* init underlying device using fbnum for dpy */ | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 43 |     bool init(const int& dpy); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 44 |     /* unset overlay, reset and close fd */ | 
 | 45 |     bool close(); | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 46 |     /* reset and set ov id to -1 / MSMFB_NEW_REQUEST */ | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 47 |     void reset(); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 48 |     /* calls overlay set | 
 | 49 |      * Set would always consult last good known ov instance. | 
 | 50 |      * Only if it is different, set would actually exectue ioctl. | 
 | 51 |      * On a sucess ioctl. last good known ov instance is updated */ | 
 | 52 |     bool set(); | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 53 |     /* Sets the source total width, height, format */ | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 54 |     void setSource(const utils::PipeArgs& pargs); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 55 |     /* | 
 | 56 |      * Sets ROI, the unpadded region, for source buffer. | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 57 |      * Dim - ROI dimensions. | 
 | 58 |      */ | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 59 |     void setCrop(const utils::Dim& d); | 
| Sushil Chauhan | 897a9c3 | 2013-07-18 11:09:55 -0700 | [diff] [blame] | 60 |     /* set color for mdp pipe */ | 
 | 61 |     void setColor(const uint32_t color); | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 62 |     void setTransform(const utils::eTransform& orient); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 63 |     /* given a dim and w/h, set overlay dim */ | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 64 |     void setPosition(const utils::Dim& dim); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 65 |     /* using user_data, sets/unsets roationvalue in mdp flags */ | 
 | 66 |     void setRotationFlags(); | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 67 |     /* Update the src format with rotator's dest*/ | 
 | 68 |     void updateSrcFormat(const uint32_t& rotDstFormat); | 
| Saurabh Shah | 0d0a7cb | 2013-02-12 17:58:19 -0800 | [diff] [blame] | 69 |     /* dump state of the object */ | 
 | 70 |     void dump() const; | 
| Saurabh Shah | 0d0a7cb | 2013-02-12 17:58:19 -0800 | [diff] [blame] | 71 |     /* Return the dump in the specified buffer */ | 
 | 72 |     void getDump(char *buf, size_t len); | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 73 |     /* returns session id */ | 
 | 74 |     int getPipeId() const; | 
 | 75 |     /* returns the fd associated to ctrl*/ | 
 | 76 |     int getFd() const; | 
 | 77 |     /* returns a copy ro dst rect dim */ | 
 | 78 |     utils::Dim getDstRectDim() const; | 
 | 79 |     /* returns a copy to src rect dim */ | 
 | 80 |     utils::Dim getSrcRectDim() const; | 
| Saurabh Shah | dd8237a | 2014-02-28 14:29:09 -0800 | [diff] [blame] | 81 |     /* return pipe priority */ | 
 | 82 |     uint8_t getPriority() const; | 
| Saurabh Shah | 5daeee5 | 2013-01-23 16:52:26 +0800 | [diff] [blame] | 83 |     /* setVisualParam */ | 
 | 84 |     bool setVisualParams(const MetaData_t& data); | 
| radhakrishna | 8ccb908 | 2014-05-09 16:18:43 +0530 | [diff] [blame] | 85 |     /* sets pipe type RGB/DMA/VG */ | 
 | 86 |     void setPipeType(const utils::eMdpPipeType& pType); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 87 |  | 
| Saurabh Shah | a36be92 | 2013-12-16 18:18:39 -0800 | [diff] [blame] | 88 |     static bool validateAndSet(MdpCtrl* mdpCtrlArray[], const int& count, | 
 | 89 |             const int& fbFd); | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 90 | private: | 
 | 91 |     /* Perform transformation calculations */ | 
 | 92 |     void doTransform(); | 
 | 93 |     void doDownscale(); | 
 | 94 |     /* get orient / user_data[0] */ | 
| Saurabh Shah | a36be92 | 2013-12-16 18:18:39 -0800 | [diff] [blame] | 95 |     int getOrient() const; | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 96 |     /* returns flags from mdp structure */ | 
 | 97 |     int getFlags() const; | 
 | 98 |     /* set flags to mdp structure */ | 
 | 99 |     void setFlags(int f); | 
 | 100 |     /* set z order */ | 
 | 101 |     void setZ(utils::eZorder z); | 
| Naseer Ahmed | 522ce66 | 2013-03-18 20:14:05 -0400 | [diff] [blame] | 102 |     /* return a copy of src whf*/ | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 103 |     utils::Whf getSrcWhf() const; | 
| Naseer Ahmed | 522ce66 | 2013-03-18 20:14:05 -0400 | [diff] [blame] | 104 |     /* set plane alpha */ | 
 | 105 |     void setPlaneAlpha(int planeAlpha); | 
 | 106 |     /* set blending method */ | 
 | 107 |     void setBlending(overlay::utils::eBlending blending); | 
 | 108 |  | 
| Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 109 |     /* set src whf */ | 
 | 110 |     void setSrcWhf(const utils::Whf& whf); | 
 | 111 |     /* set src/dst rect dim */ | 
 | 112 |     void setSrcRectDim(const utils::Dim d); | 
 | 113 |     void setDstRectDim(const utils::Dim d); | 
 | 114 |     /* returns user_data[0]*/ | 
 | 115 |     int getUserData() const; | 
 | 116 |     /* sets user_data[0] */ | 
 | 117 |     void setUserData(int v); | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 118 |  | 
 | 119 |     utils::eTransform mOrientation; //Holds requested orientation | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 120 |     /* Actual overlay mdp structure */ | 
 | 121 |     mdp_overlay   mOVInfo; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 122 |     /* FD for the mdp fbnum */ | 
 | 123 |     OvFD          mFd; | 
| Saurabh Shah | b8f58e2 | 2013-09-26 16:20:07 -0700 | [diff] [blame] | 124 |     int mDpy; | 
| Saurabh Shah | df0be75 | 2013-05-23 14:40:00 -0700 | [diff] [blame] | 125 |  | 
| Saurabh Shah | 5daeee5 | 2013-01-23 16:52:26 +0800 | [diff] [blame] | 126 | #ifdef USES_POST_PROCESSING | 
 | 127 |     /* PP Compute Params */ | 
 | 128 |     struct compute_params mParams; | 
| Saurabh Shah | 5daeee5 | 2013-01-23 16:52:26 +0800 | [diff] [blame] | 129 | #endif | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 130 | }; | 
 | 131 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 132 | /* MDP data */ | 
 | 133 | class MdpData { | 
 | 134 | public: | 
 | 135 |     /* ctor reset data */ | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 136 |     explicit MdpData(const int& dpy); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 137 |     /* dtor close*/ | 
 | 138 |     ~MdpData(); | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 139 |     /* init FD */ | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 140 |     bool init(const int& dpy); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 141 |     /* memset0 the underlying mdp object */ | 
 | 142 |     void reset(); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 143 |     /* close fd, and reset */ | 
 | 144 |     bool close(); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 145 |     /* set id of mdp data */ | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 146 |     void setPipeId(int id); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 147 |     /* return ses id of data */ | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 148 |     int getPipeId() const; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 149 |     /* get underlying fd*/ | 
 | 150 |     int getFd() const; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 151 |     /* get memory_id */ | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 152 |     int getSrcMemoryId() const; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 153 |     /* calls wrapper play */ | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 154 |     bool play(int fd, uint32_t offset); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 155 |     /* dump state of the object */ | 
 | 156 |     void dump() const; | 
| Saurabh Shah | 0d0a7cb | 2013-02-12 17:58:19 -0800 | [diff] [blame] | 157 |     /* Return the dump in the specified buffer */ | 
 | 158 |     void getDump(char *buf, size_t len); | 
 | 159 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 160 | private: | 
 | 161 |  | 
 | 162 |     /* actual overlay mdp data */ | 
 | 163 |     msmfb_overlay_data mOvData; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 164 |     /* fd to mdp fbnum */ | 
 | 165 |     OvFD mFd; | 
 | 166 | }; | 
 | 167 |  | 
 | 168 | //--------------Inlines--------------------------------- | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 169 |  | 
 | 170 | /////   MdpCtrl  ////// | 
 | 171 |  | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 172 | inline MdpCtrl::MdpCtrl(const int& dpy) { | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 173 |     reset(); | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 174 |     init(dpy); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 175 | } | 
 | 176 |  | 
 | 177 | inline MdpCtrl::~MdpCtrl() { | 
 | 178 |     close(); | 
 | 179 | } | 
 | 180 |  | 
 | 181 | inline int MdpCtrl::getOrient() const { | 
 | 182 |     return getUserData(); | 
 | 183 | } | 
 | 184 |  | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 185 | inline int MdpCtrl::getPipeId() const { | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 186 |     return mOVInfo.id; | 
 | 187 | } | 
 | 188 |  | 
 | 189 | inline int MdpCtrl::getFd() const { | 
 | 190 |     return mFd.getFD(); | 
 | 191 | } | 
 | 192 |  | 
 | 193 | inline int MdpCtrl::getFlags() const { | 
 | 194 |     return mOVInfo.flags; | 
 | 195 | } | 
 | 196 |  | 
 | 197 | inline void MdpCtrl::setFlags(int f) { | 
 | 198 |     mOVInfo.flags = f; | 
 | 199 | } | 
 | 200 |  | 
 | 201 | inline void MdpCtrl::setZ(overlay::utils::eZorder z) { | 
 | 202 |     mOVInfo.z_order = z; | 
 | 203 | } | 
 | 204 |  | 
| Naseer Ahmed | 522ce66 | 2013-03-18 20:14:05 -0400 | [diff] [blame] | 205 | inline void MdpCtrl::setPlaneAlpha(int planeAlpha) { | 
 | 206 |     mOVInfo.alpha = planeAlpha; | 
 | 207 | } | 
 | 208 |  | 
 | 209 | inline void MdpCtrl::setBlending(overlay::utils::eBlending blending) { | 
 | 210 |     switch((int) blending) { | 
 | 211 |     case utils::OVERLAY_BLENDING_OPAQUE: | 
 | 212 |         mOVInfo.blend_op = BLEND_OP_OPAQUE; | 
 | 213 |         break; | 
 | 214 |     case utils::OVERLAY_BLENDING_PREMULT: | 
 | 215 |         mOVInfo.blend_op = BLEND_OP_PREMULTIPLIED; | 
 | 216 |         break; | 
 | 217 |     case utils::OVERLAY_BLENDING_COVERAGE: | 
 | 218 |     default: | 
 | 219 |         mOVInfo.blend_op = BLEND_OP_COVERAGE; | 
 | 220 |     } | 
 | 221 | } | 
 | 222 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 223 | inline overlay::utils::Whf MdpCtrl::getSrcWhf() const { | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 224 |     return utils::Whf(  mOVInfo.src.width, | 
 | 225 |                         mOVInfo.src.height, | 
 | 226 |                         mOVInfo.src.format); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 227 | } | 
 | 228 |  | 
 | 229 | inline void MdpCtrl::setSrcWhf(const overlay::utils::Whf& whf) { | 
 | 230 |     mOVInfo.src.width  = whf.w; | 
 | 231 |     mOVInfo.src.height = whf.h; | 
 | 232 |     mOVInfo.src.format = whf.format; | 
 | 233 | } | 
 | 234 |  | 
 | 235 | inline overlay::utils::Dim MdpCtrl::getSrcRectDim() const { | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 236 |     return utils::Dim(  mOVInfo.src_rect.x, | 
 | 237 |                         mOVInfo.src_rect.y, | 
 | 238 |                         mOVInfo.src_rect.w, | 
 | 239 |                         mOVInfo.src_rect.h); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 240 | } | 
 | 241 |  | 
 | 242 | inline void MdpCtrl::setSrcRectDim(const overlay::utils::Dim d) { | 
 | 243 |     mOVInfo.src_rect.x = d.x; | 
 | 244 |     mOVInfo.src_rect.y = d.y; | 
 | 245 |     mOVInfo.src_rect.w = d.w; | 
 | 246 |     mOVInfo.src_rect.h = d.h; | 
 | 247 | } | 
 | 248 |  | 
 | 249 | inline overlay::utils::Dim MdpCtrl::getDstRectDim() const { | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 250 |     return utils::Dim(  mOVInfo.dst_rect.x, | 
 | 251 |                         mOVInfo.dst_rect.y, | 
 | 252 |                         mOVInfo.dst_rect.w, | 
 | 253 |                         mOVInfo.dst_rect.h); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 254 | } | 
 | 255 |  | 
 | 256 | inline void MdpCtrl::setDstRectDim(const overlay::utils::Dim d) { | 
 | 257 |     mOVInfo.dst_rect.x = d.x; | 
 | 258 |     mOVInfo.dst_rect.y = d.y; | 
 | 259 |     mOVInfo.dst_rect.w = d.w; | 
 | 260 |     mOVInfo.dst_rect.h = d.h; | 
 | 261 | } | 
 | 262 |  | 
 | 263 | inline int MdpCtrl::getUserData() const { return mOVInfo.user_data[0]; } | 
 | 264 |  | 
 | 265 | inline void MdpCtrl::setUserData(int v) { mOVInfo.user_data[0] = v; } | 
 | 266 |  | 
 | 267 | inline void MdpCtrl::setRotationFlags() { | 
 | 268 |     const int u = getUserData(); | 
| Saurabh Shah | 76fd655 | 2013-03-14 14:45:38 -0700 | [diff] [blame] | 269 |     if (u & MDP_ROT_90) | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 270 |         mOVInfo.flags |= MDP_SOURCE_ROTATED_90; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 271 | } | 
 | 272 |  | 
| Saurabh Shah | dd8237a | 2014-02-28 14:29:09 -0800 | [diff] [blame] | 273 | inline uint8_t MdpCtrl::getPriority() const { | 
 | 274 |     return mOVInfo.priority; | 
 | 275 | } | 
 | 276 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 277 | ///////    MdpData   ////// | 
 | 278 |  | 
| Saurabh Shah | d18d88a | 2014-01-06 15:02:49 -0800 | [diff] [blame] | 279 | inline MdpData::MdpData(const int& dpy) { | 
 | 280 |     reset(); | 
 | 281 |     init(dpy); | 
 | 282 | } | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 283 |  | 
 | 284 | inline MdpData::~MdpData() { close(); } | 
 | 285 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 286 | inline void MdpData::reset() { | 
 | 287 |     overlay::utils::memset0(mOvData); | 
 | 288 |     mOvData.data.memory_id = -1; | 
 | 289 | } | 
 | 290 |  | 
 | 291 | inline bool MdpData::close() { | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 292 |     reset(); | 
| Saurabh Shah | 8e1ae95 | 2012-08-15 12:15:14 -0700 | [diff] [blame] | 293 |     return mFd.close(); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 294 | } | 
 | 295 |  | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 296 | inline int MdpData::getSrcMemoryId() const { return mOvData.data.memory_id; } | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 297 |  | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 298 | inline void MdpData::setPipeId(int id) { mOvData.id = id; } | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 299 |  | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 300 | inline int MdpData::getPipeId() const { return mOvData.id; } | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 301 |  | 
 | 302 | inline int MdpData::getFd() const { return mFd.getFD(); } | 
 | 303 |  | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 304 | inline bool MdpData::play(int fd, uint32_t offset) { | 
 | 305 |     mOvData.data.memory_id = fd; | 
 | 306 |     mOvData.data.offset = offset; | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 307 |     if(!mdp_wrapper::play(mFd.getFD(), mOvData)){ | 
 | 308 |         ALOGE("MdpData failed to play"); | 
| Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 309 |         dump(); | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 310 |         return false; | 
 | 311 |     } | 
 | 312 |     return true; | 
 | 313 | } | 
 | 314 |  | 
| Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 315 | } // overlay | 
 | 316 |  | 
 | 317 | #endif // OVERLAY_MDP_H |