1ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson/* 2ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. 3ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* 4ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* Redistribution and use in source and binary forms, with or without 5ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* modification, are permitted provided that the following conditions are 6ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* met: 7ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* * Redistributions of source code must retain the above copyright 8ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* notice, this list of conditions and the following disclaimer. 9ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* * Redistributions in binary form must reproduce the above 10ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* copyright notice, this list of conditions and the following 11ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* disclaimer in the documentation and/or other materials provided 12ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* with the distribution. 13ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* * Neither the name of The Linux Foundation nor the names of its 14ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* contributors may be used to endorse or promote products derived 15ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* from this software without specific prior written permission. 16ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* 17ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson*/ 29ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 30ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#ifndef OVERLAY_CTRLDATA_H 31ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#define OVERLAY_CTRLDATA_H 32ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 33ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#include "overlayUtils.h" 34ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#include "overlayMdp.h" 35ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#include "gralloc_priv.h" // INTERLACE_MASK 36ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 37ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonnamespace ovutils = overlay::utils; 38ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 39ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonnamespace overlay { 40ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 41ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson/* 42ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* Sequence to use: 43ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* init 44ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* start 45ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* setXXX 46ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* close 47ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson* */ 48ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonclass Ctrl : utils::NoCopy { 49ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonpublic: 50ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 51ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* ctor */ 52a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson explicit Ctrl(const int& dpy); 53ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* dtor close */ 54ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ~Ctrl(); 55ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 56ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* set source using whf, orient and wait flag */ 57ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void setSource(const utils::PipeArgs& args); 58ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* set crop info and pass it down to mdp */ 59ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void setCrop(const utils::Dim& d); 60a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson /* set color for mdp pipe */ 61a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson void setColor(const uint32_t color); 62ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* set orientation */ 63ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void setTransform(const utils::eTransform& p); 64ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* set mdp position using dim */ 65ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void setPosition(const utils::Dim& dim); 66ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* set mdp visual params using metadata */ 67ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson bool setVisualParams(const MetaData_t &metadata); 68ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishna /* set pipe type RGB/DMA/VG */ 69ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishna void setPipeType(const utils::eMdpPipeType& pType); 70ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* mdp set overlay/commit changes */ 71ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson bool commit(); 72ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 73ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* ctrl id */ 74ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson int getPipeId() const; 75ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* ctrl fd */ 76ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson int getFd() const; 77ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* retrieve crop data */ 78ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson utils::Dim getCrop() const; 79ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson utils::Dim getPosition() const; 80ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* Update the src format based on rotator's dest */ 81ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void updateSrcFormat(const uint32_t& rotDstFormat); 820bc6186c13bed6530aadad53308916869871aa8cSaurabh Shah /* return pipe priority */ 830bc6186c13bed6530aadad53308916869871aa8cSaurabh Shah uint8_t getPriority() const; 84ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* dump the state of the object */ 85ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void dump() const; 86ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* Return the dump in the specified buffer */ 87ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void getDump(char *buf, size_t len); 88ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 89a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson static bool validateAndSet(Ctrl* ctrlArray[], const int& count, 90a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson const int& fbFd); 91ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonprivate: 92ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson // mdp ctrl struct(info e.g.) 93a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson MdpCtrl *mMdp; 94ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson}; 95ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 96ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 97ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonclass Data : utils::NoCopy { 98ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonpublic: 99ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* init, reset */ 100a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson explicit Data(const int& dpy); 101ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* calls close */ 102ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ~Data(); 103ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* set overlay pipe id in the mdp struct */ 104ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void setPipeId(int id); 105ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* get overlay id in the mdp struct */ 106ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson int getPipeId() const; 107ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* queue buffer to the overlay */ 108ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson bool queueBuffer(int fd, uint32_t offset); 109ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* sump the state of the obj */ 110ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void dump() const; 111ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson /* Return the dump in the specified buffer */ 112ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson void getDump(char *buf, size_t len); 113ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 114ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonprivate: 115ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson // mdp data struct 116a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson MdpData *mMdp; 117ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson}; 118ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 119ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson//-------------Inlines------------------------------- 120ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 121a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline Ctrl::Ctrl(const int& dpy) : mMdp(new MdpCtrl(dpy)) { 122ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 123ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 124ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline Ctrl::~Ctrl() { 125a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson delete mMdp; 126ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 127ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 128ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::setSource(const utils::PipeArgs& args) 129ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson{ 130a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->setSource(args); 131ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 132ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 133ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::setPosition(const utils::Dim& dim) 134ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson{ 135a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->setPosition(dim); 136ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 137ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 138ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::setTransform(const utils::eTransform& orient) 139ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson{ 140a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->setTransform(orient); 141ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 142ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 143ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::setCrop(const utils::Dim& d) 144ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson{ 145a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->setCrop(d); 146a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson} 147a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson 148a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline void Ctrl::setColor(const uint32_t color) 149a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson{ 150a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->setColor(color); 151ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 152ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 153ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline bool Ctrl::setVisualParams(const MetaData_t &metadata) 154ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson{ 155a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson if (!mMdp->setVisualParams(metadata)) { 156ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ALOGE("Ctrl setVisualParams failed in MDP setVisualParams"); 157ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson return false; 158ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson } 159ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson return true; 160ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 161ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 162ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishnainline void Ctrl::setPipeType(const utils::eMdpPipeType& pType) 163ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishna{ 164ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishna mMdp->setPipeType(pType); 165ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishna} 166ab05b00fefd34a761dfaf1ccaf8ad14d325873f4radhakrishna 167ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::dump() const { 168ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ALOGE("== Dump Ctrl start =="); 169a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->dump(); 170ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ALOGE("== Dump Ctrl end =="); 171ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 172ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 173ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline bool Ctrl::commit() { 174a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson if(!mMdp->set()) { 175ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ALOGE("Ctrl commit failed set overlay"); 176ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson return false; 177ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson } 178ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson return true; 179ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 180ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 181ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline int Ctrl::getPipeId() const { 182a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson return mMdp->getPipeId(); 183ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 184ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 185ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline int Ctrl::getFd() const { 186a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson return mMdp->getFd(); 187ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 188ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 189ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::updateSrcFormat(const uint32_t& rotDstFmt) { 190a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->updateSrcFormat(rotDstFmt); 191a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson} 192a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson 193a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline bool Ctrl::validateAndSet(Ctrl* ctrlArray[], const int& count, 194a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson const int& fbFd) { 195a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson MdpCtrl* mdpCtrlArray[count]; 196a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson memset(&mdpCtrlArray, 0, sizeof(mdpCtrlArray)); 197a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson 198a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson for(int i = 0; i < count; i++) { 199a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mdpCtrlArray[i] = ctrlArray[i]->mMdp; 200a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson } 201a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson 202a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson bool ret = MdpCtrl::validateAndSet(mdpCtrlArray, count, fbFd); 203a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson return ret; 204ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 205ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 206ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline utils::Dim Ctrl::getCrop() const { 207a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson return mMdp->getSrcRectDim(); 208ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 209ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 210ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline utils::Dim Ctrl::getPosition() const { 211a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson return mMdp->getDstRectDim(); 212ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 213ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 2140bc6186c13bed6530aadad53308916869871aa8cSaurabh Shahinline uint8_t Ctrl::getPriority() const { 2150bc6186c13bed6530aadad53308916869871aa8cSaurabh Shah return mMdp->getPriority(); 2160bc6186c13bed6530aadad53308916869871aa8cSaurabh Shah} 2170bc6186c13bed6530aadad53308916869871aa8cSaurabh Shah 218ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Ctrl::getDump(char *buf, size_t len) { 219a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->getDump(buf, len); 220ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 221ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 222a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline Data::Data(const int& dpy) : mMdp(new MdpData(dpy)) { 223ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 224ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 225a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline Data::~Data() { 226a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson delete mMdp; 227ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 228ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 229a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline void Data::setPipeId(int id) { mMdp->setPipeId(id); } 230ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 231a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsoninline int Data::getPipeId() const { return mMdp->getPipeId(); } 232ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 233ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline bool Data::queueBuffer(int fd, uint32_t offset) { 234a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson return mMdp->play(fd, offset); 235ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 236ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 237ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Data::dump() const { 238ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ALOGE("== Dump Data MDP start =="); 239a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->dump(); 240ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson ALOGE("== Dump Data MDP end =="); 241ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 242ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 243ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsoninline void Data::getDump(char *buf, size_t len) { 244a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson mMdp->getDump(buf, len); 245ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} 246ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 247ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson} // overlay 248ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson 249ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#endif 250