Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 1 | /* |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are |
| 6 | * met: |
| 7 | * * Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * * Redistributions in binary form must reproduce the above |
| 10 | * copyright notice, this list of conditions and the following |
| 11 | * disclaimer in the documentation and/or other materials provided |
| 12 | * with the distribution. |
| 13 | * * Neither the name of Code Aurora Forum, Inc. nor the names of its |
| 14 | * contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | */ |
| 29 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 30 | #ifndef OVERlAY_ROTATOR_H |
| 31 | #define OVERlAY_ROTATOR_H |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 32 | |
| 33 | #include <stdlib.h> |
| 34 | |
| 35 | #include "mdpWrapper.h" |
| 36 | #include "overlayUtils.h" |
| 37 | #include "overlayMem.h" |
| 38 | |
| 39 | namespace overlay { |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 40 | |
| 41 | class IRotatorHw; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 42 | /* |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 43 | * RotatorBase. No members, just interface. |
| 44 | * can also be =0 with empty impl in cpp. |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 45 | * */ |
| 46 | class RotatorBase { |
| 47 | public: |
| 48 | /* Most of the below are No op funcs for RotatorBase */ |
| 49 | virtual ~RotatorBase() {} |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 50 | virtual bool init() = 0; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 51 | virtual bool close() = 0; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 52 | virtual void setSource(const utils::Whf& wfh) = 0; |
| 53 | virtual void setFlags(const utils::eMdpFlags& flags) = 0; |
| 54 | virtual void setTransform(const utils::eTransform& rot, |
| 55 | const bool& rotUsed) = 0; |
| 56 | virtual bool commit() = 0; |
| 57 | virtual bool queueBuffer(int fd, uint32_t offset) = 0; |
| 58 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 59 | virtual void setEnable() = 0; |
| 60 | virtual void setDisable() = 0; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 61 | virtual void setRotations(uint32_t r) = 0; |
| 62 | virtual void setSrcFB() = 0; |
| 63 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 64 | virtual bool enabled() const = 0; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 65 | virtual int getSessId() const = 0; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 66 | virtual int getDstMemId() const = 0; |
| 67 | virtual uint32_t getDstOffset() const = 0; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 68 | virtual void dump() const = 0; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 69 | |
| 70 | protected: |
| 71 | //Hardware specific rotator impl. |
| 72 | IRotatorHw *mRot; |
| 73 | }; |
| 74 | |
| 75 | /* |
| 76 | * Rotator Hw Interface. Any hardware specific implementation should inherit |
| 77 | * from this. |
| 78 | */ |
| 79 | class IRotatorHw { |
| 80 | public: |
| 81 | /* Most of the below are No op funcs for RotatorBase */ |
| 82 | virtual ~IRotatorHw() {} |
| 83 | /* init fd for rotator. map bufs is defered */ |
| 84 | virtual bool init() = 0; |
| 85 | /* close fd, mem */ |
| 86 | virtual bool close() = 0; |
| 87 | /* set src */ |
| 88 | virtual void setSource(const utils::Whf& wfh) = 0; |
| 89 | /* set mdp flags, will use only stuff necessary for rotator */ |
| 90 | virtual void setFlags(const utils::eMdpFlags& flags) = 0; |
| 91 | /* Set rotation and calculate */ |
| 92 | virtual void setTransform(const utils::eTransform& rot, |
| 93 | const bool& rotUsed) = 0; |
| 94 | /* calls underlying wrappers to start rotator */ |
| 95 | virtual bool commit() = 0; |
| 96 | /* Lazy buffer allocation. queue buffer */ |
| 97 | virtual bool queueBuffer(int fd, uint32_t offset) = 0; |
| 98 | /* set enable/disable flag */ |
| 99 | virtual void setEnable() = 0; |
| 100 | virtual void setDisable() = 0; |
| 101 | /* set rotator flag*/ |
| 102 | virtual void setRotations(uint32_t r) = 0; |
| 103 | /* Mark src as FB (non-ION) */ |
| 104 | virtual void setSrcFB() = 0; |
| 105 | /* Retusn true if rotator enabled */ |
| 106 | virtual bool enabled() const = 0; |
| 107 | /* returns rotator session id */ |
| 108 | virtual int getSessId() const = 0; |
| 109 | /* get dst (for offset and memory id) non-virt */ |
| 110 | virtual int getDstMemId() const = 0; |
| 111 | virtual uint32_t getDstOffset() const = 0; |
| 112 | /* dump the state of the object */ |
| 113 | virtual void dump() const = 0; |
| 114 | |
| 115 | enum { TYPE_MDP, TYPE_MDSS }; |
| 116 | /*Returns rotator h/w type */ |
| 117 | static int getRotatorHwType(); |
| 118 | }; |
| 119 | |
| 120 | /* |
| 121 | * Actual Rotator impl. |
| 122 | * */ |
| 123 | class Rotator : public RotatorBase |
| 124 | { |
| 125 | public: |
| 126 | explicit Rotator(); |
| 127 | virtual ~Rotator(); |
| 128 | virtual bool init(); |
| 129 | virtual bool close(); |
| 130 | virtual void setSource(const utils::Whf& wfh); |
| 131 | virtual void setFlags(const utils::eMdpFlags& flags); |
| 132 | virtual void setTransform(const utils::eTransform& rot, |
| 133 | const bool& rotUsed); |
| 134 | virtual bool commit(); |
| 135 | virtual void setRotations(uint32_t r); |
| 136 | virtual void setSrcFB(); |
| 137 | virtual int getDstMemId() const; |
| 138 | virtual uint32_t getDstOffset() const; |
| 139 | virtual void setEnable(); |
| 140 | virtual void setDisable(); |
| 141 | virtual bool enabled () const; |
| 142 | virtual int getSessId() const; |
| 143 | virtual bool queueBuffer(int fd, uint32_t offset); |
| 144 | virtual void dump() const; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 145 | }; |
| 146 | |
| 147 | /* |
| 148 | * Null/Empty impl of RotatorBase |
| 149 | * */ |
| 150 | class NullRotator : public RotatorBase { |
| 151 | public: |
| 152 | /* Most of the below are No op funcs for RotatorBase */ |
| 153 | virtual ~NullRotator(); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 154 | virtual bool init(); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 155 | virtual bool close(); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 156 | virtual void setSource(const utils::Whf& wfh); |
| 157 | virtual void setFlags(const utils::eMdpFlags& flags); |
| 158 | virtual void setTransform(const utils::eTransform& rot, |
| 159 | const bool& rotUsed); |
| 160 | virtual bool commit(); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 161 | virtual void setRotations(uint32_t r); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 162 | virtual bool queueBuffer(int fd, uint32_t offset); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 163 | virtual void setEnable(); |
| 164 | virtual void setDisable(); |
| 165 | virtual bool enabled () const; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 166 | virtual void setSrcFB(); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 167 | virtual int getSessId() const; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 168 | virtual int getDstMemId() const; |
| 169 | virtual uint32_t getDstOffset() const; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 170 | virtual void dump() const; |
| 171 | }; |
| 172 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 173 | /* |
| 174 | Manages the case where new rotator memory needs to be |
| 175 | allocated, before previous is freed, due to resolution change etc. If we make |
| 176 | rotator memory to be always max size, irrespctive of source resolution then |
| 177 | we don't need this RotMem wrapper. The inner class is sufficient. |
| 178 | */ |
| 179 | struct RotMem { |
| 180 | // Max rotator memory allocations |
| 181 | enum { MAX_ROT_MEM = 2}; |
| 182 | |
| 183 | //Manages the rotator buffer offsets. |
| 184 | struct Mem { |
| 185 | Mem() : mCurrOffset(0) {utils::memset0(mRotOffset); } |
| 186 | bool valid() { return m.valid(); } |
| 187 | bool close() { return m.close(); } |
| 188 | uint32_t size() const { return m.bufSz(); } |
| 189 | // Max rotator buffers |
| 190 | enum { ROT_NUM_BUFS = 2 }; |
| 191 | // rotator data info dst offset |
| 192 | uint32_t mRotOffset[ROT_NUM_BUFS]; |
| 193 | // current offset slot from mRotOffset |
| 194 | uint32_t mCurrOffset; |
| 195 | OvMem m; |
| 196 | }; |
| 197 | |
| 198 | RotMem() : _curr(0) {} |
| 199 | Mem& curr() { return m[_curr % MAX_ROT_MEM]; } |
| 200 | const Mem& curr() const { return m[_curr % MAX_ROT_MEM]; } |
| 201 | Mem& prev() { return m[(_curr+1) % MAX_ROT_MEM]; } |
| 202 | RotMem& operator++() { ++_curr; return *this; } |
| 203 | bool close(); |
| 204 | uint32_t _curr; |
| 205 | Mem m[MAX_ROT_MEM]; |
| 206 | }; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 207 | |
| 208 | /* |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 209 | * MDP rot holds MDP's rotation related structures. |
| 210 | * |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 211 | * */ |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 212 | class MdpRot : public IRotatorHw { |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 213 | public: |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 214 | explicit MdpRot(); |
| 215 | ~MdpRot(); |
| 216 | bool init(); |
| 217 | bool close(); |
| 218 | void setSource(const utils::Whf& whf); |
| 219 | virtual void setFlags(const utils::eMdpFlags& flags); |
| 220 | void setTransform(const utils::eTransform& rot, |
| 221 | const bool& rotUsed); |
| 222 | bool commit(); |
| 223 | bool queueBuffer(int fd, uint32_t offset); |
| 224 | void setEnable(); |
| 225 | void setDisable(); |
| 226 | void setRotations(uint32_t r); |
| 227 | void setSrcFB(); |
| 228 | bool enabled() const; |
| 229 | int getSessId() const; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 230 | int getDstMemId() const; |
| 231 | uint32_t getDstOffset() const; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 232 | void dump() const; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 233 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 234 | private: |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 235 | /* remap rot buffers */ |
| 236 | bool remap(uint32_t numbufs); |
| 237 | bool open_i(uint32_t numbufs, uint32_t bufsz); |
| 238 | /* Deferred transform calculations */ |
| 239 | void doTransform(); |
| 240 | /* reset underlying data, basically memset 0 */ |
| 241 | void reset(); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 242 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 243 | /* rot info*/ |
| 244 | msm_rotator_img_info mRotImgInfo; |
| 245 | /* rot data */ |
| 246 | msm_rotator_data_info mRotDataInfo; |
| 247 | /* Orientation */ |
| 248 | utils::eTransform mOrientation; |
| 249 | /* rotator fd */ |
| 250 | OvFD mFd; |
| 251 | /* Rotator memory manager */ |
| 252 | RotMem mMem; |
| 253 | /* Single Rotator buffer size */ |
| 254 | uint32_t mBufSize; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 255 | }; |
| 256 | |
Saurabh Shah | e012f7a | 2012-08-18 15:11:57 -0700 | [diff] [blame^] | 257 | /* |
| 258 | +* MDSS Rot holds MDSS's rotation related structures. |
| 259 | +* |
| 260 | +* */ |
| 261 | class MdssRot : public IRotatorHw { |
| 262 | public: |
| 263 | explicit MdssRot(); |
| 264 | ~MdssRot(); |
| 265 | bool init(); |
| 266 | bool close(); |
| 267 | void setSource(const utils::Whf& whf); |
| 268 | virtual void setFlags(const utils::eMdpFlags& flags); |
| 269 | void setTransform(const utils::eTransform& rot, |
| 270 | const bool& rotUsed); |
| 271 | bool commit(); |
| 272 | bool queueBuffer(int fd, uint32_t offset); |
| 273 | void setEnable(); |
| 274 | void setDisable(); |
| 275 | void setRotations(uint32_t r); |
| 276 | void setSrcFB(); |
| 277 | bool enabled() const; |
| 278 | int getSessId() const; |
| 279 | int getDstMemId() const; |
| 280 | uint32_t getDstOffset() const; |
| 281 | void dump() const; |
| 282 | |
| 283 | private: |
| 284 | /* remap rot buffers */ |
| 285 | bool remap(uint32_t numbufs); |
| 286 | bool open_i(uint32_t numbufs, uint32_t bufsz); |
| 287 | /* Deferred transform calculations */ |
| 288 | void doTransform(); |
| 289 | /* reset underlying data, basically memset 0 */ |
| 290 | void reset(); |
| 291 | |
| 292 | /* MdssRot info structure */ |
| 293 | mdp_overlay mRotInfo; |
| 294 | /* MdssRot data structure */ |
| 295 | msmfb_overlay_data mRotData; |
| 296 | /* Orientation */ |
| 297 | utils::eTransform mOrientation; |
| 298 | /* rotator fd */ |
| 299 | OvFD mFd; |
| 300 | /* Rotator memory manager */ |
| 301 | RotMem mMem; |
| 302 | /* Single Rotator buffer size */ |
| 303 | uint32_t mBufSize; |
| 304 | /* Enable/Disable Mdss Rot*/ |
| 305 | bool mEnabled; |
| 306 | }; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 307 | |
| 308 | //--------------inlines------------------------------------ |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 309 | |
| 310 | ///// Rotator ///// |
| 311 | inline Rotator::Rotator() { |
| 312 | int type = IRotatorHw::getRotatorHwType(); |
| 313 | if(type == IRotatorHw::TYPE_MDP) { |
| 314 | mRot = new MdpRot(); //will do reset |
| 315 | } else if(type == IRotatorHw::TYPE_MDSS) { |
Saurabh Shah | e012f7a | 2012-08-18 15:11:57 -0700 | [diff] [blame^] | 316 | mRot = new MdssRot(); |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 317 | } else { |
| 318 | ALOGE("%s Unknown h/w type %d", __FUNCTION__, type); |
| 319 | } |
| 320 | } |
| 321 | inline Rotator::~Rotator() { |
| 322 | delete mRot; //will do close |
| 323 | } |
| 324 | inline bool Rotator::init() { |
| 325 | if(!mRot->init()) { |
| 326 | ALOGE("Rotator::init failed"); |
| 327 | return false; |
| 328 | } |
| 329 | return true; |
| 330 | } |
| 331 | inline bool Rotator::close() { |
| 332 | return mRot->close(); |
| 333 | } |
| 334 | inline void Rotator::setSource(const utils::Whf& whf) { |
| 335 | mRot->setSource(whf); |
| 336 | } |
| 337 | inline void Rotator::setFlags(const utils::eMdpFlags& flags) { |
| 338 | mRot->setFlags(flags); |
| 339 | } |
| 340 | inline void Rotator::setTransform(const utils::eTransform& rot, |
| 341 | const bool& rotUsed) |
| 342 | { |
| 343 | mRot->setTransform(rot, rotUsed); |
| 344 | } |
| 345 | inline bool Rotator::commit() { |
| 346 | return mRot->commit(); |
| 347 | } |
| 348 | inline void Rotator::setEnable(){ mRot->setEnable(); } |
| 349 | inline void Rotator::setDisable(){ mRot->setDisable(); } |
| 350 | inline bool Rotator::enabled() const { return mRot->enabled(); } |
| 351 | inline void Rotator::setSrcFB() { mRot->setSrcFB(); } |
| 352 | inline int Rotator::getDstMemId() const { |
| 353 | return mRot->getDstMemId(); |
| 354 | } |
| 355 | inline uint32_t Rotator::getDstOffset() const { |
| 356 | return mRot->getDstOffset(); |
| 357 | } |
| 358 | inline void Rotator::setRotations(uint32_t rot) { |
| 359 | mRot->setRotations (rot); |
| 360 | } |
| 361 | inline int Rotator::getSessId() const { |
| 362 | return mRot->getSessId(); |
| 363 | } |
| 364 | inline void Rotator::dump() const { |
| 365 | ALOGE("== Dump Rotator start =="); |
| 366 | mRot->dump(); |
| 367 | ALOGE("== Dump Rotator end =="); |
| 368 | } |
| 369 | inline bool Rotator::queueBuffer(int fd, uint32_t offset) { |
| 370 | return mRot->queueBuffer(fd, offset); |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 371 | } |
| 372 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 373 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 374 | ///// Null Rotator ///// |
| 375 | inline NullRotator::~NullRotator() {} |
| 376 | inline bool NullRotator::init() { return true; } |
| 377 | inline bool NullRotator::close() { return true; } |
| 378 | inline bool NullRotator::commit() { return true; } |
| 379 | inline void NullRotator::setSource(const utils::Whf& wfh) {} |
| 380 | inline void NullRotator::setFlags(const utils::eMdpFlags& flags) {} |
| 381 | inline void NullRotator::setTransform(const utils::eTransform& rot, const bool&) |
| 382 | {} |
| 383 | inline void NullRotator::setRotations(uint32_t) {} |
| 384 | inline void NullRotator::setEnable() {} |
| 385 | inline void NullRotator::setDisable() {} |
| 386 | inline bool NullRotator::enabled() const { return false; } |
| 387 | inline int NullRotator::getSessId() const { return -1; } |
| 388 | inline bool NullRotator::queueBuffer(int fd, uint32_t offset) { return true; } |
| 389 | inline void NullRotator::setSrcFB() {} |
| 390 | inline int NullRotator::getDstMemId() const { return -1; } |
| 391 | inline uint32_t NullRotator::getDstOffset() const { return 0;} |
| 392 | inline void NullRotator::dump() const { |
| 393 | ALOGE("== Dump NullRotator dump (null) start/end =="); |
| 394 | } |
| 395 | |
| 396 | |
| 397 | //// MdpRot //// |
| 398 | inline MdpRot::MdpRot() { reset(); } |
| 399 | inline MdpRot::~MdpRot() { close(); } |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 400 | inline void MdpRot::setEnable() { mRotImgInfo.enable = 1; } |
| 401 | inline void MdpRot::setDisable() { mRotImgInfo.enable = 0; } |
| 402 | inline bool MdpRot::enabled() const { return mRotImgInfo.enable; } |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 403 | inline void MdpRot::setRotations(uint32_t r) { mRotImgInfo.rotations = r; } |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 404 | inline int MdpRot::getDstMemId() const { |
| 405 | return mRotDataInfo.dst.memory_id; |
| 406 | } |
| 407 | inline uint32_t MdpRot::getDstOffset() const { |
| 408 | return mRotDataInfo.dst.offset; |
| 409 | } |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 410 | inline int MdpRot::getSessId() const { return mRotImgInfo.session_id; } |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 411 | inline void MdpRot::setSrcFB() { |
| 412 | mRotDataInfo.src.flags |= MDP_MEMORY_ID_TYPE_FB; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 413 | } |
| 414 | |
Saurabh Shah | e012f7a | 2012-08-18 15:11:57 -0700 | [diff] [blame^] | 415 | |
| 416 | //// MdssRot //// |
| 417 | inline MdssRot::MdssRot() { reset(); } |
| 418 | inline MdssRot::~MdssRot() { close(); } |
| 419 | inline void MdssRot::setEnable() { mEnabled = true; } |
| 420 | inline void MdssRot::setDisable() { mEnabled = false; } |
| 421 | inline bool MdssRot::enabled() const { return mEnabled; } |
| 422 | inline void MdssRot::setRotations(uint32_t flags) { mRotInfo.flags |= flags; } |
| 423 | inline int MdssRot::getDstMemId() const { |
| 424 | return mRotData.dst_data.memory_id; |
| 425 | } |
| 426 | inline uint32_t MdssRot::getDstOffset() const { |
| 427 | return mRotData.dst_data.offset; |
| 428 | } |
| 429 | inline int MdssRot::getSessId() const { return mRotInfo.id; } |
| 430 | inline void MdssRot::setSrcFB() { |
| 431 | mRotData.data.flags |= MDP_MEMORY_ID_TYPE_FB; |
| 432 | } |
| 433 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 434 | } // overlay |
| 435 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 436 | #endif // OVERlAY_ROTATOR_H |