Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 1 | /* |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 2 | * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved. |
| 3 | * |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 4 | * Not a Contribution, Apache license notifications and license are retained |
| 5 | * for attribution purposes only. |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | |
| 20 | #ifndef HWC_MDP_COMP |
| 21 | #define HWC_MDP_COMP |
| 22 | |
| 23 | #include <hwc_utils.h> |
| 24 | #include <idle_invalidator.h> |
| 25 | #include <cutils/properties.h> |
| 26 | #include <overlay.h> |
| 27 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 28 | #define DEFAULT_IDLE_TIME 2000 |
Sushil Chauhan | 69f2bb2 | 2013-02-13 10:50:47 -0800 | [diff] [blame] | 29 | #define MAX_PIPES_PER_MIXER 4 |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 30 | |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 31 | namespace overlay { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 32 | class Rotator; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 33 | }; |
| 34 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 35 | namespace qhwc { |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 36 | namespace ovutils = overlay::utils; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 37 | |
| 38 | class MDPComp { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 39 | public: |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 40 | explicit MDPComp(int); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 41 | virtual ~MDPComp(){}; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 42 | /*sets up mdp comp for the current frame */ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 43 | int prepare(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 44 | /* draw */ |
| 45 | virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list) = 0; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 46 | /* dumpsys */ |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 47 | void dump(android::String8& buf); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 48 | |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 49 | static MDPComp* getObject(hwc_context_t *ctx, const int& dpy); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 50 | /* Handler to invoke frame redraw on Idle Timer expiry */ |
| 51 | static void timeout_handler(void *udata); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 52 | /* Initialize MDP comp*/ |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 53 | static bool init(hwc_context_t *ctx); |
Saurabh Shah | 98acd09 | 2013-05-03 10:48:24 -0700 | [diff] [blame] | 54 | static void resetIdleFallBack() { sIdleFallBack = false; } |
Saurabh Shah | 8c5c852 | 2013-08-29 17:32:49 -0700 | [diff] [blame] | 55 | static void reset() { sCompBytesClaimed = 0; }; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 56 | |
| 57 | protected: |
Saurabh Shah | e9bc60f | 2013-08-29 12:58:06 -0700 | [diff] [blame] | 58 | enum { MAX_SEC_LAYERS = 1 }; //TODO add property support |
| 59 | |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 60 | enum ePipeType { |
| 61 | MDPCOMP_OV_RGB = ovutils::OV_MDP_PIPE_RGB, |
| 62 | MDPCOMP_OV_VG = ovutils::OV_MDP_PIPE_VG, |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 63 | MDPCOMP_OV_DMA = ovutils::OV_MDP_PIPE_DMA, |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 64 | MDPCOMP_OV_ANY, |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 65 | }; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 66 | |
| 67 | /* mdp pipe data */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 68 | struct MdpPipeInfo { |
| 69 | int zOrder; |
| 70 | virtual ~MdpPipeInfo(){}; |
| 71 | }; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 72 | |
| 73 | /* per layer data */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 74 | struct PipeLayerPair { |
| 75 | MdpPipeInfo *pipeInfo; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 76 | overlay::Rotator* rot; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 77 | int listIndex; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 78 | }; |
| 79 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 80 | /* per frame data */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 81 | struct FrameInfo { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 82 | /* maps layer list to mdp list */ |
| 83 | int layerCount; |
Ramkumar Radhakrishnan | e661f96 | 2013-06-05 17:21:38 -0700 | [diff] [blame] | 84 | int layerToMDP[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 85 | |
| 86 | /* maps mdp list to layer list */ |
| 87 | int mdpCount; |
| 88 | struct PipeLayerPair mdpToLayer[MAX_PIPES_PER_MIXER]; |
| 89 | |
| 90 | /* layer composing on FB? */ |
| 91 | int fbCount; |
Ramkumar Radhakrishnan | e661f96 | 2013-06-05 17:21:38 -0700 | [diff] [blame] | 92 | bool isFBComposed[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 6a9bb9e | 2013-08-01 14:19:26 -0700 | [diff] [blame] | 93 | /* layers lying outside ROI. Will |
| 94 | * be dropped off from the composition */ |
| 95 | int dropCount; |
| 96 | bool drop[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 97 | |
| 98 | bool needsRedraw; |
| 99 | int fbZ; |
| 100 | |
| 101 | /* c'tor */ |
| 102 | FrameInfo(); |
| 103 | /* clear old frame data */ |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 104 | void reset(const int& numLayers); |
| 105 | void map(); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 106 | }; |
| 107 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 108 | /* cached data */ |
| 109 | struct LayerCache { |
| 110 | int layerCount; |
| 111 | int mdpCount; |
Saurabh Shah | e9bc60f | 2013-08-29 12:58:06 -0700 | [diff] [blame] | 112 | int fbCount; |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 113 | int fbZ; |
Ramkumar Radhakrishnan | e661f96 | 2013-06-05 17:21:38 -0700 | [diff] [blame] | 114 | buffer_handle_t hnd[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 115 | |
| 116 | /* c'tor */ |
| 117 | LayerCache(); |
| 118 | /* clear caching info*/ |
| 119 | void reset(); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 120 | void cacheAll(hwc_display_contents_1_t* list); |
| 121 | void updateCounts(const FrameInfo&); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 122 | }; |
| 123 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 124 | /* allocates pipe from pipe book */ |
| 125 | virtual bool allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 126 | hwc_display_contents_1_t* list) = 0; |
Saurabh Shah | af5f597 | 2013-07-30 13:56:35 -0700 | [diff] [blame] | 127 | /* allocate MDP pipes from overlay */ |
| 128 | ovutils::eDest getMdpPipe(hwc_context_t *ctx, ePipeType type, int mixer); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 129 | /* configures MPD pipes */ |
| 130 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 131 | PipeLayerPair& pipeLayerPair) = 0; |
Saurabh Shah | af5f597 | 2013-07-30 13:56:35 -0700 | [diff] [blame] | 132 | /* Checks for pipes needed versus pipes available */ |
| 133 | virtual bool arePipesAvailable(hwc_context_t *ctx, |
| 134 | hwc_display_contents_1_t* list) = 0; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 135 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 136 | /* set/reset flags for MDPComp */ |
| 137 | void setMDPCompLayerFlags(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 138 | hwc_display_contents_1_t* list); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 139 | /* checks for conditions where mdpcomp is not possible */ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 140 | bool isFrameDoable(hwc_context_t *ctx); |
| 141 | /* checks for conditions where RGB layers cannot be bypassed */ |
| 142 | bool isFullFrameDoable(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 143 | /* checks if full MDP comp can be done */ |
| 144 | bool fullMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 145 | /* check if we can use layer cache to do at least partial MDP comp */ |
| 146 | bool partialMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | 8028e3b | 2013-10-15 12:27:59 -0700 | [diff] [blame^] | 147 | /* Partial MDP comp that uses caching to save power as primary goal */ |
| 148 | bool cacheBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 149 | /* Partial MDP comp that uses number of pixels to optimize perf goal */ |
| 150 | bool loadBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 151 | /* Checks if its worth doing load based partial comp */ |
| 152 | bool isLoadBasedCompDoable(hwc_context_t *ctx, |
| 153 | hwc_display_contents_1_t* list); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 154 | /* checks for conditions where only video can be bypassed */ |
Saurabh Shah | 90b7b9b | 2013-09-12 16:36:08 -0700 | [diff] [blame] | 155 | bool isOnlyVideoDoable(hwc_context_t *ctx, hwc_display_contents_1_t* list, |
| 156 | bool secureOnly); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 157 | /* checks for conditions where YUV layers cannot be bypassed */ |
| 158 | bool isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer); |
Saurabh Shah | 8c5c852 | 2013-08-29 17:32:49 -0700 | [diff] [blame] | 159 | /* calcs bytes read by MDP for a given frame */ |
| 160 | uint32_t calcMDPBytesRead(hwc_context_t *ctx, |
| 161 | hwc_display_contents_1_t* list); |
| 162 | /* checks if the required bandwidth exceeds a certain max */ |
| 163 | bool bandwidthCheck(hwc_context_t *ctx, const uint32_t& size); |
Jeykumar Sankaran | 6a9bb9e | 2013-08-01 14:19:26 -0700 | [diff] [blame] | 164 | /* generates ROI based on the modified area of the frame */ |
| 165 | void generateROI(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 166 | bool validateAndApplyROI(hwc_context_t *ctx, hwc_display_contents_1_t* list, |
| 167 | hwc_rect_t roi); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 168 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 169 | /* Is debug enabled */ |
| 170 | static bool isDebug() { return sDebugLogs ? true : false; }; |
| 171 | /* Is feature enabled */ |
| 172 | static bool isEnabled() { return sEnabled; }; |
Sravan Kumar D.V.N | ad5d929 | 2013-04-24 14:23:04 +0530 | [diff] [blame] | 173 | /* checks for mdp comp dimension limitation */ |
| 174 | bool isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 175 | /* tracks non updating layers*/ |
| 176 | void updateLayerCache(hwc_context_t* ctx, hwc_display_contents_1_t* list); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 177 | /* optimize layers for mdp comp*/ |
Prabhanjan Kandula | 9bd5f64 | 2013-09-25 17:00:36 +0530 | [diff] [blame] | 178 | bool markLayersForCaching(hwc_context_t* ctx, |
| 179 | hwc_display_contents_1_t* list); |
| 180 | int getBatch(hwc_display_contents_1_t* list, |
| 181 | int& maxBatchStart, int& maxBatchEnd, |
| 182 | int& maxBatchCount); |
| 183 | bool canPushBatchToTop(const hwc_display_contents_1_t* list, |
| 184 | int fromIndex, int toIndex); |
| 185 | bool intersectingUpdatingLayers(const hwc_display_contents_1_t* list, |
| 186 | int fromIndex, int toIndex, int targetLayerIndex); |
| 187 | |
| 188 | /* updates cache map with YUV info */ |
Saurabh Shah | 90b7b9b | 2013-09-12 16:36:08 -0700 | [diff] [blame] | 189 | void updateYUV(hwc_context_t* ctx, hwc_display_contents_1_t* list, |
| 190 | bool secureOnly); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 191 | bool programMDP(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 192 | bool programYUV(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | 2a4eb1b | 2013-07-22 16:33:23 -0700 | [diff] [blame] | 193 | void reset(const int& numAppLayers, hwc_display_contents_1_t* list); |
Saurabh Shah | e9bc60f | 2013-08-29 12:58:06 -0700 | [diff] [blame] | 194 | bool isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 195 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 196 | int mDpy; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 197 | static bool sEnabled; |
Jeykumar Sankaran | 24c199d | 2013-05-24 09:40:36 -0700 | [diff] [blame] | 198 | static bool sEnableMixedMode; |
Jeykumar Sankaran | 6a9bb9e | 2013-08-01 14:19:26 -0700 | [diff] [blame] | 199 | /* Enables Partial frame composition */ |
| 200 | static bool sEnablePartialFrameUpdate; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 201 | static bool sDebugLogs; |
| 202 | static bool sIdleFallBack; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 203 | static int sMaxPipesPerMixer; |
Saurabh Shah | 8c5c852 | 2013-08-29 17:32:49 -0700 | [diff] [blame] | 204 | //Max bandwidth. Value is in GBPS. For ex: 2.3 means 2.3GBPS |
| 205 | static float sMaxBw; |
| 206 | //Tracks composition bytes claimed. Represented as the total w*h*bpp |
| 207 | //going to MDP mixers |
| 208 | static uint32_t sCompBytesClaimed; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 209 | static IdleInvalidator *idleInvalidator; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 210 | struct FrameInfo mCurrentFrame; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 211 | struct LayerCache mCachedFrame; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 212 | }; |
| 213 | |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 214 | class MDPCompNonSplit : public MDPComp { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 215 | public: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 216 | explicit MDPCompNonSplit(int dpy):MDPComp(dpy){}; |
| 217 | virtual ~MDPCompNonSplit(){}; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 218 | virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 219 | |
| 220 | private: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 221 | struct MdpPipeInfoNonSplit : public MdpPipeInfo { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 222 | ovutils::eDest index; |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 223 | virtual ~MdpPipeInfoNonSplit() {}; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 224 | }; |
| 225 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 226 | /* configure's overlay pipes for the frame */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 227 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 228 | PipeLayerPair& pipeLayerPair); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 229 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 230 | /* allocates pipes to selected candidates */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 231 | virtual bool allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 232 | hwc_display_contents_1_t* list); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 233 | |
Saurabh Shah | af5f597 | 2013-07-30 13:56:35 -0700 | [diff] [blame] | 234 | /* Checks for pipes needed versus pipes available */ |
| 235 | virtual bool arePipesAvailable(hwc_context_t *ctx, |
| 236 | hwc_display_contents_1_t* list); |
Saurabh Shah | 90b7b9b | 2013-09-12 16:36:08 -0700 | [diff] [blame] | 237 | |
| 238 | /* Checks for video pipes needed versus pipes available */ |
| 239 | virtual bool areVGPipesAvailable(hwc_context_t *ctx, |
| 240 | hwc_display_contents_1_t* list); |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 241 | }; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 242 | |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 243 | class MDPCompSplit : public MDPComp { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 244 | public: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 245 | explicit MDPCompSplit(int dpy):MDPComp(dpy){}; |
| 246 | virtual ~MDPCompSplit(){}; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 247 | virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list); |
| 248 | private: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 249 | struct MdpPipeInfoSplit : public MdpPipeInfo { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 250 | ovutils::eDest lIndex; |
| 251 | ovutils::eDest rIndex; |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 252 | virtual ~MdpPipeInfoSplit() {}; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 253 | }; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 254 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 255 | bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer, |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 256 | MdpPipeInfoSplit& pipe_info, ePipeType type); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 257 | |
| 258 | /* configure's overlay pipes for the frame */ |
| 259 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 260 | PipeLayerPair& pipeLayerPair); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 261 | |
| 262 | /* allocates pipes to selected candidates */ |
| 263 | virtual bool allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 264 | hwc_display_contents_1_t* list); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 265 | |
Saurabh Shah | af5f597 | 2013-07-30 13:56:35 -0700 | [diff] [blame] | 266 | /* Checks for pipes needed versus pipes available */ |
| 267 | virtual bool arePipesAvailable(hwc_context_t *ctx, |
| 268 | hwc_display_contents_1_t* list); |
| 269 | |
Saurabh Shah | 90b7b9b | 2013-09-12 16:36:08 -0700 | [diff] [blame] | 270 | /* Checks for video pipes needed versus pipes available */ |
| 271 | virtual bool areVGPipesAvailable(hwc_context_t *ctx, |
| 272 | hwc_display_contents_1_t* list); |
| 273 | |
Saurabh Shah | af5f597 | 2013-07-30 13:56:35 -0700 | [diff] [blame] | 274 | int pipesNeeded(hwc_context_t *ctx, hwc_display_contents_1_t* list, |
| 275 | int mixer); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 276 | }; |
Saurabh Shah | 2a4eb1b | 2013-07-22 16:33:23 -0700 | [diff] [blame] | 277 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 278 | }; //namespace |
| 279 | #endif |