overlay.cpp revision 9fae8b8b5b928ba58a839d32e062069b7b561e2e
1/*
2* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
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 The Linux Foundation 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
30#include <dlfcn.h>
31#include "overlay.h"
32#include "pipes/overlayGenPipe.h"
33#include "mdp_version.h"
34#include "qdMetaData.h"
35
36#define PIPE_DEBUG 0
37
38namespace overlay {
39using namespace utils;
40using namespace qdutils;
41
42Overlay::Overlay() {
43    int numPipes = qdutils::MDPVersion::getInstance().getTotalPipes();
44    PipeBook::NUM_PIPES = (numPipes <= utils::OV_MAX)? numPipes : utils::OV_MAX;
45    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
46        mPipeBook[i].init();
47    }
48
49    mDumpStr[0] = '\0';
50    initScalar();
51    setDMAMultiplexingSupported();
52}
53
54Overlay::~Overlay() {
55    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
56        mPipeBook[i].destroy();
57    }
58    destroyScalar();
59}
60
61void Overlay::configBegin() {
62    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
63        //Mark as available for this round.
64        PipeBook::resetUse(i);
65        PipeBook::resetAllocation(i);
66    }
67    mDumpStr[0] = '\0';
68}
69
70void Overlay::configDone() {
71    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
72        if((PipeBook::isNotUsed(i) && !sessionInProgress((eDest)i)) ||
73                    isSessionEnded((eDest)i)) {
74            //Forces UNSET on pipes, flushes rotator memory and session, closes
75            //fds
76            if(mPipeBook[i].valid()) {
77                char str[32];
78                snprintf(str, 32, "Unset=%s dpy=%d mix=%d; ",
79                        PipeBook::getDestStr((eDest)i),
80                        mPipeBook[i].mDisplay, mPipeBook[i].mMixer);
81#if PIPE_DEBUG
82                strlcat(mDumpStr, str, sizeof(mDumpStr));
83#endif
84            }
85            mPipeBook[i].destroy();
86        }
87    }
88    dump();
89    PipeBook::save();
90}
91
92int Overlay::getPipeId(utils::eDest dest) {
93    return mPipeBook[(int)dest].mPipe->getPipeId();
94}
95
96eDest Overlay::getDest(int pipeid) {
97    eDest dest = OV_INVALID;
98    // finding the dest corresponding to the given pipe
99    for(int i=0; i < PipeBook::NUM_PIPES; ++i) {
100        if(mPipeBook[i].valid() && mPipeBook[i].mPipe->getPipeId() == pipeid) {
101            return (eDest)i;
102        }
103    }
104    return dest;
105}
106
107eDest Overlay::reservePipe(int pipeid) {
108    eDest dest = getDest(pipeid);
109    PipeBook::setAllocation((int)dest);
110    return dest;
111}
112
113eDest Overlay::nextPipe(eMdpPipeType type, int dpy, int mixer) {
114    eDest dest = OV_INVALID;
115
116    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
117        if( (type == OV_MDP_PIPE_ANY || //Pipe type match
118             type == PipeBook::getPipeType((eDest)i)) &&
119            (mPipeBook[i].mDisplay == DPY_UNUSED || //Free or same display
120             mPipeBook[i].mDisplay == dpy) &&
121            (mPipeBook[i].mMixer == MIXER_UNUSED || //Free or same mixer
122             mPipeBook[i].mMixer == mixer) &&
123            PipeBook::isNotAllocated(i) && //Free pipe
124            ( (sDMAMultiplexingSupported && dpy) ||
125              !(sDMAMode == DMA_BLOCK_MODE && //DMA pipe in Line mode
126               PipeBook::getPipeType((eDest)i) == OV_MDP_PIPE_DMA)) ){
127              //DMA-Multiplexing is only supported for WB on 8x26
128            dest = (eDest)i;
129            PipeBook::setAllocation(i);
130            break;
131        }
132    }
133
134    if(dest != OV_INVALID) {
135        int index = (int)dest;
136        mPipeBook[index].mDisplay = dpy;
137        mPipeBook[index].mMixer = mixer;
138        if(not mPipeBook[index].valid()) {
139            mPipeBook[index].mPipe = new GenericPipe(dpy);
140            mPipeBook[index].mSession = PipeBook::NONE;
141            char str[32];
142            snprintf(str, 32, "Set=%s dpy=%d mix=%d; ",
143                     PipeBook::getDestStr(dest), dpy, mixer);
144#if PIPE_DEBUG
145            strlcat(mDumpStr, str, sizeof(mDumpStr));
146#endif
147        }
148    } else {
149        ALOGD_IF(PIPE_DEBUG, "Pipe unavailable type=%d display=%d mixer=%d",
150                (int)type, dpy, mixer);
151    }
152
153    return dest;
154}
155
156utils::eDest Overlay::getPipe(const PipeSpecs& pipeSpecs) {
157    if(MDPVersion::getInstance().is8x26()) {
158        return getPipe_8x26(pipeSpecs);
159    } else if(MDPVersion::getInstance().is8x16()) {
160        return getPipe_8x16(pipeSpecs);
161    } else if(MDPVersion::getInstance().is8x39()) {
162        return getPipe_8x39(pipeSpecs);
163    }
164
165    eDest dest = OV_INVALID;
166
167    //The default behavior is to assume RGB and VG pipes have scalars
168    if(pipeSpecs.formatClass == FORMAT_YUV) {
169        return nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
170    } else if(pipeSpecs.fb == false) { //RGB App layers
171        if(not pipeSpecs.needsScaling) {
172            dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
173        }
174        if(dest == OV_INVALID) {
175            dest = nextPipe(OV_MDP_PIPE_RGB, pipeSpecs.dpy, pipeSpecs.mixer);
176        }
177        if(dest == OV_INVALID) {
178            dest = nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
179        }
180    } else { //FB layer
181        dest = nextPipe(OV_MDP_PIPE_RGB, pipeSpecs.dpy, pipeSpecs.mixer);
182        if(dest == OV_INVALID) {
183            dest = nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
184        }
185        //Some features can cause FB to have scaling as well.
186        //If we ever come to this block with FB needing scaling,
187        //the screen will be black for a frame, since the FB won't get a pipe
188        //but atleast this will prevent a hang
189        if(dest == OV_INVALID and (not pipeSpecs.needsScaling)) {
190            dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
191        }
192    }
193    return dest;
194}
195
196utils::eDest Overlay::getPipe_8x26(const PipeSpecs& pipeSpecs) {
197    //Use this to hide all the 8x26 requirements that cannot be humanly
198    //described in a generic way
199    eDest dest = OV_INVALID;
200    if(pipeSpecs.formatClass == FORMAT_YUV) { //video
201        return nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
202    } else if(pipeSpecs.fb == false) { //RGB app layers
203        if((not pipeSpecs.needsScaling) and
204          (not (pipeSpecs.numActiveDisplays > 1 &&
205                pipeSpecs.dpy == DPY_PRIMARY))) {
206            dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
207        }
208        if(dest == OV_INVALID) {
209            dest = nextPipe(OV_MDP_PIPE_RGB, pipeSpecs.dpy, pipeSpecs.mixer);
210        }
211        if(dest == OV_INVALID) {
212            dest = nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
213        }
214    } else { //FB layer
215        //For 8x26 Secondary we use DMA always for FB for inline rotation
216        if(pipeSpecs.dpy == DPY_PRIMARY) {
217            /* For wearable targets, secondary display is not applicable
218               Try for DMA pipe for FB first, if FB does not have scaling*/
219            if (not pipeSpecs.needsScaling) {
220                dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
221            }
222            if (dest == OV_INVALID) {
223                dest = nextPipe(OV_MDP_PIPE_RGB, pipeSpecs.dpy, pipeSpecs.mixer);
224            }
225            if (dest == OV_INVALID) {
226                // FB needs scaling, and RGB pipe is not available - try VG
227                dest = nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
228            }
229        }
230        if(dest == OV_INVALID and (not pipeSpecs.needsScaling) and
231                (not (pipeSpecs.numActiveDisplays > 1 &&
232                      pipeSpecs.dpy == DPY_PRIMARY))) {
233            dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
234        }
235    }
236    if (dest == OV_INVALID) {
237        ALOGE("%s - not able to allocate FB pipe", __func__);
238    }
239    return dest;
240}
241
242utils::eDest Overlay::getPipe_8x16(const PipeSpecs& pipeSpecs) {
243    //Having such functions help keeping the interface generic but code specific
244    //and rife with assumptions
245    eDest dest = OV_INVALID;
246    if(pipeSpecs.formatClass == FORMAT_YUV or pipeSpecs.needsScaling) {
247        return nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
248    } else {
249        //Since this is a specific func, we can assume stuff like RGB pipe not
250        //having scalar blocks
251        dest = nextPipe(OV_MDP_PIPE_RGB, pipeSpecs.dpy, pipeSpecs.mixer);
252        if(dest == OV_INVALID) {
253            dest = nextPipe(OV_MDP_PIPE_DMA, pipeSpecs.dpy, pipeSpecs.mixer);
254        }
255        if(dest == OV_INVALID) {
256            dest = nextPipe(OV_MDP_PIPE_VG, pipeSpecs.dpy, pipeSpecs.mixer);
257        }
258    }
259    return dest;
260}
261
262utils::eDest Overlay::getPipe_8x39(const PipeSpecs& pipeSpecs) {
263    //8x16 & 8x36 has same number of pipes, pipe-types & scaling capabilities.
264    //Rely on 8x16 until we see a need to change.
265    return getPipe_8x16(pipeSpecs);
266}
267
268void Overlay::endAllSessions() {
269    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
270        if(mPipeBook[i].valid() && mPipeBook[i].mSession==PipeBook::START)
271            mPipeBook[i].mSession = PipeBook::END;
272    }
273}
274
275bool Overlay::isPipeTypeAttached(eMdpPipeType type) {
276    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
277        if(type == PipeBook::getPipeType((eDest)i) &&
278                mPipeBook[i].mDisplay != DPY_UNUSED) {
279            return true;
280        }
281    }
282    return false;
283}
284
285int Overlay::comparePipePriority(utils::eDest pipe1Index,
286        utils::eDest pipe2Index) {
287    validate((int)pipe1Index);
288    validate((int)pipe2Index);
289    uint8_t pipe1Prio = mPipeBook[(int)pipe1Index].mPipe->getPriority();
290    uint8_t pipe2Prio = mPipeBook[(int)pipe2Index].mPipe->getPriority();
291    if(pipe1Prio > pipe2Prio)
292        return -1;
293    if(pipe1Prio < pipe2Prio)
294        return 1;
295    return 0;
296}
297
298bool Overlay::commit(utils::eDest dest) {
299    bool ret = false;
300    validate((int)dest);
301
302    if(mPipeBook[dest].mPipe->commit()) {
303        ret = true;
304        PipeBook::setUse((int)dest);
305    } else {
306        int dpy = mPipeBook[dest].mDisplay;
307        for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
308            if (mPipeBook[i].mDisplay == dpy) {
309                PipeBook::resetAllocation(i);
310                PipeBook::resetUse(i);
311            }
312        }
313    }
314    return ret;
315}
316
317bool Overlay::queueBuffer(int fd, uint32_t offset,
318        utils::eDest dest) {
319    bool ret = false;
320    validate((int)dest);
321    //Queue only if commit() has succeeded (and the bit set)
322    if(PipeBook::isUsed((int)dest)) {
323        ret = mPipeBook[dest].mPipe->queueBuffer(fd, offset);
324    }
325    return ret;
326}
327
328void Overlay::setCrop(const utils::Dim& d,
329        utils::eDest dest) {
330    validate((int)dest);
331    mPipeBook[dest].mPipe->setCrop(d);
332}
333
334void Overlay::setColor(const uint32_t color,
335        utils::eDest dest) {
336    validate((int)dest);
337    mPipeBook[dest].mPipe->setColor(color);
338}
339
340void Overlay::setPosition(const utils::Dim& d,
341        utils::eDest dest) {
342    validate((int)dest);
343    mPipeBook[dest].mPipe->setPosition(d);
344}
345
346void Overlay::setTransform(const int orient,
347        utils::eDest dest) {
348    validate((int)dest);
349
350    utils::eTransform transform =
351            static_cast<utils::eTransform>(orient);
352    mPipeBook[dest].mPipe->setTransform(transform);
353
354}
355
356void Overlay::setSource(const utils::PipeArgs args,
357        utils::eDest dest) {
358    validate((int)dest);
359
360    setPipeType(dest, PipeBook::getPipeType(dest));
361    mPipeBook[dest].mPipe->setSource(args);
362}
363
364void Overlay::setVisualParams(const MetaData_t& metadata, utils::eDest dest) {
365    validate((int)dest);
366    mPipeBook[dest].mPipe->setVisualParams(metadata);
367}
368
369void Overlay::setPipeType(utils::eDest pipeIndex,
370        const utils::eMdpPipeType pType) {
371    mPipeBook[pipeIndex].mPipe->setPipeType(pType);
372}
373
374Overlay* Overlay::getInstance() {
375    if(sInstance == NULL) {
376        sInstance = new Overlay();
377    }
378    return sInstance;
379}
380
381// Clears any VG pipes allocated to the fb devices
382// Generates a LUT for pipe types.
383int Overlay::initOverlay() {
384    int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion();
385    int numPipesXType[OV_MDP_PIPE_ANY] = {0};
386    numPipesXType[OV_MDP_PIPE_RGB] =
387            qdutils::MDPVersion::getInstance().getRGBPipes();
388    numPipesXType[OV_MDP_PIPE_VG] =
389            qdutils::MDPVersion::getInstance().getVGPipes();
390    numPipesXType[OV_MDP_PIPE_DMA] =
391            qdutils::MDPVersion::getInstance().getDMAPipes();
392
393    int index = 0;
394    for(int X = 0; X < (int)OV_MDP_PIPE_ANY; X++) { //iterate over types
395        for(int j = 0; j < numPipesXType[X]; j++) { //iterate over num
396            PipeBook::pipeTypeLUT[index] = (utils::eMdpPipeType)X;
397            index++;
398        }
399    }
400
401    if (mdpVersion < qdutils::MDSS_V5 && mdpVersion != qdutils::MDP_V3_0_4) {
402        msmfb_mixer_info_req  req;
403        mdp_mixer_info *minfo = NULL;
404        char name[64];
405        int fd = -1;
406        for(int i = 0; i < MAX_FB_DEVICES; i++) {
407            snprintf(name, 64, FB_DEVICE_TEMPLATE, i);
408            ALOGD("initoverlay:: opening the device:: %s", name);
409            fd = ::open(name, O_RDWR, 0);
410            if(fd < 0) {
411                ALOGE("cannot open framebuffer(%d)", i);
412                return -1;
413            }
414            //Get the mixer configuration */
415            req.mixer_num = i;
416            if (ioctl(fd, MSMFB_MIXER_INFO, &req) == -1) {
417                ALOGE("ERROR: MSMFB_MIXER_INFO ioctl failed");
418                close(fd);
419                return -1;
420            }
421            minfo = req.info;
422            for (int j = 0; j < req.cnt; j++) {
423                ALOGD("ndx=%d num=%d z_order=%d", minfo->pndx, minfo->pnum,
424                      minfo->z_order);
425                // except the RGB base layer with z_order of -1, clear any
426                // other pipes connected to mixer.
427                if((minfo->z_order) != -1) {
428                    int index = minfo->pndx;
429                    ALOGD("Unset overlay with index: %d at mixer %d", index, i);
430                    if(ioctl(fd, MSMFB_OVERLAY_UNSET, &index) == -1) {
431                        ALOGE("ERROR: MSMFB_OVERLAY_UNSET failed");
432                        close(fd);
433                        return -1;
434                    }
435                }
436                minfo++;
437            }
438            close(fd);
439            fd = -1;
440        }
441    }
442
443    FILE *displayDeviceFP = NULL;
444    const int MAX_FRAME_BUFFER_NAME_SIZE = 128;
445    char fbType[MAX_FRAME_BUFFER_NAME_SIZE];
446    char msmFbTypePath[MAX_FRAME_BUFFER_NAME_SIZE];
447    const char *strDtvPanel = "dtv panel";
448    const char *strWbPanel = "writeback panel";
449
450    for(int num = 1; num < MAX_FB_DEVICES; num++) {
451        snprintf (msmFbTypePath, sizeof(msmFbTypePath),
452                "/sys/class/graphics/fb%d/msm_fb_type", num);
453        displayDeviceFP = fopen(msmFbTypePath, "r");
454
455        if(displayDeviceFP){
456            fread(fbType, sizeof(char), MAX_FRAME_BUFFER_NAME_SIZE,
457                    displayDeviceFP);
458
459            if(strncmp(fbType, strDtvPanel, strlen(strDtvPanel)) == 0) {
460                sDpyFbMap[DPY_EXTERNAL] = num;
461            } else if(strncmp(fbType, strWbPanel, strlen(strWbPanel)) == 0) {
462                sDpyFbMap[DPY_WRITEBACK] = num;
463            }
464
465            fclose(displayDeviceFP);
466        }
467    }
468
469    return 0;
470}
471
472bool Overlay::displayCommit(const int& fd) {
473    utils::Dim lRoi, rRoi;
474    return displayCommit(fd, lRoi, rRoi);
475}
476
477bool Overlay::displayCommit(const int& fd, const utils::Dim& lRoi,
478        const utils::Dim& rRoi) {
479    //Commit
480    struct mdp_display_commit info;
481    memset(&info, 0, sizeof(struct mdp_display_commit));
482    info.flags = MDP_DISPLAY_COMMIT_OVERLAY;
483    info.l_roi.x = lRoi.x;
484    info.l_roi.y = lRoi.y;
485    info.l_roi.w = lRoi.w;
486    info.l_roi.h = lRoi.h;
487    info.r_roi.x = rRoi.x;
488    info.r_roi.y = rRoi.y;
489    info.r_roi.w = rRoi.w;
490    info.r_roi.h = rRoi.h;
491
492    if(!mdp_wrapper::displayCommit(fd, info)) {
493        ALOGE("%s: commit failed", __func__);
494        return false;
495    }
496    return true;
497}
498
499void Overlay::dump() const {
500#if PIPE_DEBUG
501    if(strlen(mDumpStr)) { //dump only on state change
502        ALOGD("%s\n", mDumpStr);
503    }
504#endif
505}
506
507void Overlay::getDump(char *buf, size_t len) {
508    int totalPipes = 0;
509    const char *str = "\nOverlay State\n\n";
510    strlcat(buf, str, len);
511    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
512        if(mPipeBook[i].valid()) {
513            mPipeBook[i].mPipe->getDump(buf, len);
514            char str[64] = {'\0'};
515            snprintf(str, 64, "Display=%d\n\n", mPipeBook[i].mDisplay);
516            strlcat(buf, str, len);
517            totalPipes++;
518        }
519    }
520    char str_pipes[64] = {'\0'};
521    snprintf(str_pipes, 64, "Pipes=%d\n\n", totalPipes);
522    strlcat(buf, str_pipes, len);
523}
524
525void Overlay::clear(int dpy) {
526    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
527        if (mPipeBook[i].mDisplay == dpy) {
528            // Mark as available for this round
529            PipeBook::resetUse(i);
530            PipeBook::resetAllocation(i);
531        }
532    }
533}
534
535bool Overlay::validateAndSet(const int& dpy, const int& fbFd) {
536    GenericPipe* pipeArray[PipeBook::NUM_PIPES];
537    memset(pipeArray, 0, sizeof(GenericPipe*)*(PipeBook::NUM_PIPES));
538
539    int num = 0;
540    for(int i = 0; i < PipeBook::NUM_PIPES; i++) {
541        if(PipeBook::isUsed(i) && mPipeBook[i].valid() &&
542                mPipeBook[i].mDisplay == dpy) {
543            pipeArray[num++] = mPipeBook[i].mPipe;
544        }
545    }
546
547    //Protect against misbehaving clients
548    return num ? GenericPipe::validateAndSet(pipeArray, num, fbFd) : true;
549}
550
551void Overlay::initScalar() {
552    if(sLibScaleHandle == NULL) {
553        sLibScaleHandle = dlopen("libscale.so", RTLD_NOW);
554        if(sLibScaleHandle) {
555            *(void **) &sFnProgramScale =
556                    dlsym(sLibScaleHandle, "programScale");
557        }
558    }
559}
560
561void Overlay::destroyScalar() {
562    if(sLibScaleHandle) {
563        dlclose(sLibScaleHandle);
564        sLibScaleHandle = NULL;
565    }
566}
567
568void Overlay::PipeBook::init() {
569    mPipe = NULL;
570    mDisplay = DPY_UNUSED;
571    mMixer = MIXER_UNUSED;
572}
573
574void Overlay::PipeBook::destroy() {
575    if(mPipe) {
576        delete mPipe;
577        mPipe = NULL;
578    }
579    mDisplay = DPY_UNUSED;
580    mMixer = MIXER_UNUSED;
581    mSession = NONE;
582}
583
584Overlay* Overlay::sInstance = 0;
585int Overlay::sDpyFbMap[DPY_MAX] = {0, -1, -1};
586int Overlay::sDMAMode = DMA_LINE_MODE;
587bool Overlay::sDMAMultiplexingSupported = false;
588int Overlay::PipeBook::NUM_PIPES = 0;
589int Overlay::PipeBook::sPipeUsageBitmap = 0;
590int Overlay::PipeBook::sLastUsageBitmap = 0;
591int Overlay::PipeBook::sAllocatedBitmap = 0;
592utils::eMdpPipeType Overlay::PipeBook::pipeTypeLUT[utils::OV_MAX] =
593    {utils::OV_MDP_PIPE_ANY};
594void *Overlay::sLibScaleHandle = NULL;
595int (*Overlay::sFnProgramScale)(struct mdp_overlay_list *) = NULL;
596
597}; // namespace overlay
598