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 | |
Saurabh Shah | 4578290 | 2013-11-15 10:13:14 -0800 | [diff] [blame] | 28 | #define DEFAULT_IDLE_TIME 70 |
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); |
Ramkumar Radhakrishnan | 8bb48d3 | 2013-12-30 23:11:27 -0800 | [diff] [blame] | 48 | bool isGLESOnlyComp() { return (mCurrentFrame.mdpCount == 0); } |
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 | be7bd32 | 2014-02-20 16:18:45 -0800 | [diff] [blame] | 55 | static void reset() { sHandleTimeout = false; }; |
Ramkumar Radhakrishnan | fb82291 | 2014-03-14 17:28:14 -0700 | [diff] [blame] | 56 | static bool isIdleFallback() { return sIdleFallBack; } |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 57 | |
| 58 | protected: |
Saurabh Shah | e9bc60f | 2013-08-29 12:58:06 -0700 | [diff] [blame] | 59 | enum { MAX_SEC_LAYERS = 1 }; //TODO add property support |
| 60 | |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 61 | enum ePipeType { |
| 62 | MDPCOMP_OV_RGB = ovutils::OV_MDP_PIPE_RGB, |
| 63 | MDPCOMP_OV_VG = ovutils::OV_MDP_PIPE_VG, |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 64 | MDPCOMP_OV_DMA = ovutils::OV_MDP_PIPE_DMA, |
Naseer Ahmed | 54821fe | 2012-11-28 18:44:38 -0500 | [diff] [blame] | 65 | MDPCOMP_OV_ANY, |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 66 | }; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 67 | |
| 68 | /* mdp pipe data */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 69 | struct MdpPipeInfo { |
| 70 | int zOrder; |
| 71 | virtual ~MdpPipeInfo(){}; |
| 72 | }; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 73 | |
radhakrishna | c9a6741 | 2013-09-25 17:40:42 +0530 | [diff] [blame] | 74 | struct MdpYUVPipeInfo : public MdpPipeInfo{ |
| 75 | ovutils::eDest lIndex; |
| 76 | ovutils::eDest rIndex; |
| 77 | virtual ~MdpYUVPipeInfo(){}; |
| 78 | }; |
| 79 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 80 | /* per layer data */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 81 | struct PipeLayerPair { |
| 82 | MdpPipeInfo *pipeInfo; |
Saurabh Shah | acf1020 | 2013-02-26 10:15:15 -0800 | [diff] [blame] | 83 | overlay::Rotator* rot; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 84 | int listIndex; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 85 | }; |
| 86 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 87 | /* per frame data */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 88 | struct FrameInfo { |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 89 | /* maps layer list to mdp list */ |
| 90 | int layerCount; |
Ramkumar Radhakrishnan | e661f96 | 2013-06-05 17:21:38 -0700 | [diff] [blame] | 91 | int layerToMDP[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 92 | |
| 93 | /* maps mdp list to layer list */ |
| 94 | int mdpCount; |
| 95 | struct PipeLayerPair mdpToLayer[MAX_PIPES_PER_MIXER]; |
| 96 | |
| 97 | /* layer composing on FB? */ |
| 98 | int fbCount; |
Ramkumar Radhakrishnan | e661f96 | 2013-06-05 17:21:38 -0700 | [diff] [blame] | 99 | bool isFBComposed[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 6a9bb9e | 2013-08-01 14:19:26 -0700 | [diff] [blame] | 100 | /* layers lying outside ROI. Will |
| 101 | * be dropped off from the composition */ |
| 102 | int dropCount; |
| 103 | bool drop[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 104 | |
| 105 | bool needsRedraw; |
| 106 | int fbZ; |
| 107 | |
| 108 | /* c'tor */ |
| 109 | FrameInfo(); |
| 110 | /* clear old frame data */ |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 111 | void reset(const int& numLayers); |
| 112 | void map(); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 113 | }; |
| 114 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 115 | /* cached data */ |
| 116 | struct LayerCache { |
| 117 | int layerCount; |
Ramkumar Radhakrishnan | e661f96 | 2013-06-05 17:21:38 -0700 | [diff] [blame] | 118 | buffer_handle_t hnd[MAX_NUM_APP_LAYERS]; |
Prabhanjan Kandula | 2243aa6 | 2013-10-24 12:58:55 +0530 | [diff] [blame] | 119 | bool isFBComposed[MAX_NUM_APP_LAYERS]; |
| 120 | bool drop[MAX_NUM_APP_LAYERS]; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 121 | |
| 122 | /* c'tor */ |
| 123 | LayerCache(); |
| 124 | /* clear caching info*/ |
| 125 | void reset(); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 126 | void cacheAll(hwc_display_contents_1_t* list); |
| 127 | void updateCounts(const FrameInfo&); |
Jeykumar Sankaran | 988d368 | 2013-11-15 11:57:16 -0800 | [diff] [blame] | 128 | bool isSameFrame(const FrameInfo& curFrame, |
| 129 | hwc_display_contents_1_t* list); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 130 | }; |
| 131 | |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 132 | /* allocates pipe from pipe book */ |
| 133 | virtual bool allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 134 | hwc_display_contents_1_t* list) = 0; |
Saurabh Shah | af5f597 | 2013-07-30 13:56:35 -0700 | [diff] [blame] | 135 | /* allocate MDP pipes from overlay */ |
| 136 | ovutils::eDest getMdpPipe(hwc_context_t *ctx, ePipeType type, int mixer); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 137 | /* configures MPD pipes */ |
| 138 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 139 | PipeLayerPair& pipeLayerPair) = 0; |
Saurabh Shah | 3d4b804 | 2013-12-10 15:19:17 -0800 | [diff] [blame] | 140 | /* Increments mdpCount if 4k2k yuv layer split is enabled. |
| 141 | * updates framebuffer z order if fb lies above source-split layer */ |
| 142 | virtual void adjustForSourceSplit(hwc_context_t *ctx, |
radhakrishna | c9a6741 | 2013-09-25 17:40:42 +0530 | [diff] [blame] | 143 | hwc_display_contents_1_t* list) = 0; |
| 144 | /* configures 4kx2k yuv layer*/ |
| 145 | virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer, |
| 146 | PipeLayerPair& PipeLayerPair) = 0; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 147 | /* set/reset flags for MDPComp */ |
| 148 | void setMDPCompLayerFlags(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 149 | hwc_display_contents_1_t* list); |
Saurabh Shah | df4741d | 2013-12-12 16:40:28 -0800 | [diff] [blame] | 150 | void setRedraw(hwc_context_t *ctx, |
| 151 | hwc_display_contents_1_t* list); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 152 | /* checks for conditions where mdpcomp is not possible */ |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 153 | bool isFrameDoable(hwc_context_t *ctx); |
| 154 | /* checks for conditions where RGB layers cannot be bypassed */ |
Saurabh Shah | df4741d | 2013-12-12 16:40:28 -0800 | [diff] [blame] | 155 | bool tryFullFrame(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 156 | /* checks if full MDP comp can be done */ |
| 157 | bool fullMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 158 | /* check if we can use layer cache to do at least partial MDP comp */ |
| 159 | bool partialMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | 8028e3b | 2013-10-15 12:27:59 -0700 | [diff] [blame] | 160 | /* Partial MDP comp that uses caching to save power as primary goal */ |
| 161 | bool cacheBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | be7bd32 | 2014-02-20 16:18:45 -0800 | [diff] [blame] | 162 | /* Partial MDP comp that balances the load between MDP and GPU such that |
| 163 | * MDP is loaded to the max of its capacity. The lower z order layers are |
| 164 | * fed to MDP, whereas the upper ones to GPU, because the upper ones have |
| 165 | * lower number of pixels and can reduce GPU processing time */ |
| 166 | bool loadBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
Saurabh Shah | 8028e3b | 2013-10-15 12:27:59 -0700 | [diff] [blame] | 167 | /* Checks if its worth doing load based partial comp */ |
Arun Kumar K.R | 2aa44c6 | 2014-01-21 23:08:28 -0800 | [diff] [blame] | 168 | bool isLoadBasedCompDoable(hwc_context_t *ctx); |
Saurabh Shah | aa23682 | 2013-04-24 18:07:26 -0700 | [diff] [blame] | 169 | /* checks for conditions where only video can be bypassed */ |
Saurabh Shah | df4741d | 2013-12-12 16:40:28 -0800 | [diff] [blame] | 170 | bool tryVideoOnly(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 171 | bool videoOnlyComp(hwc_context_t *ctx, hwc_display_contents_1_t* list, |
Saurabh Shah | 90b7b9b | 2013-09-12 16:36:08 -0700 | [diff] [blame] | 172 | bool secureOnly); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 173 | /* checks for conditions where YUV layers cannot be bypassed */ |
| 174 | bool isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer); |
Prabhanjan Kandula | 21918db | 2013-11-26 15:51:58 +0530 | [diff] [blame] | 175 | /* checks if MDP/MDSS can process current list w.r.to HW limitations |
| 176 | * All peculiar HW limitations should go here */ |
| 177 | bool hwLimitationsCheck(hwc_context_t* ctx, hwc_display_contents_1_t* list); |
Jeykumar Sankaran | 6a9bb9e | 2013-08-01 14:19:26 -0700 | [diff] [blame] | 178 | /* generates ROI based on the modified area of the frame */ |
| 179 | void generateROI(hwc_context_t *ctx, hwc_display_contents_1_t* list); |
| 180 | bool validateAndApplyROI(hwc_context_t *ctx, hwc_display_contents_1_t* list, |
| 181 | hwc_rect_t roi); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 182 | |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 183 | /* Is debug enabled */ |
| 184 | static bool isDebug() { return sDebugLogs ? true : false; }; |
| 185 | /* Is feature enabled */ |
| 186 | static bool isEnabled() { return sEnabled; }; |
Sravan Kumar D.V.N | ad5d929 | 2013-04-24 14:23:04 +0530 | [diff] [blame] | 187 | /* checks for mdp comp dimension limitation */ |
| 188 | bool isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 189 | /* tracks non updating layers*/ |
| 190 | void updateLayerCache(hwc_context_t* ctx, hwc_display_contents_1_t* list); |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 191 | /* optimize layers for mdp comp*/ |
Prabhanjan Kandula | 9bd5f64 | 2013-09-25 17:00:36 +0530 | [diff] [blame] | 192 | bool markLayersForCaching(hwc_context_t* ctx, |
| 193 | hwc_display_contents_1_t* list); |
| 194 | int getBatch(hwc_display_contents_1_t* list, |
| 195 | int& maxBatchStart, int& maxBatchEnd, |
| 196 | int& maxBatchCount); |
| 197 | bool canPushBatchToTop(const hwc_display_contents_1_t* list, |
| 198 | int fromIndex, int toIndex); |
| 199 | bool intersectingUpdatingLayers(const hwc_display_contents_1_t* list, |
| 200 | int fromIndex, int toIndex, int targetLayerIndex); |
| 201 | |
| 202 | /* updates cache map with YUV info */ |
Saurabh Shah | 90b7b9b | 2013-09-12 16:36:08 -0700 | [diff] [blame] | 203 | void updateYUV(hwc_context_t* ctx, hwc_display_contents_1_t* list, |
| 204 | bool secureOnly); |
Saurabh Shah | df4741d | 2013-12-12 16:40:28 -0800 | [diff] [blame] | 205 | /* Validates if the GPU/MDP layer split chosen by a strategy is supported |
| 206 | * by MDP. |
| 207 | * Sets up MDP comp data structures to reflect covnversion from layers to |
| 208 | * overlay pipes. |
| 209 | * Configures overlay. |
| 210 | * Configures if GPU should redraw. |
| 211 | */ |
| 212 | bool postHeuristicsHandling(hwc_context_t *ctx, |
| 213 | hwc_display_contents_1_t* list); |
| 214 | void reset(hwc_context_t *ctx); |
Saurabh Shah | e9bc60f | 2013-08-29 12:58:06 -0700 | [diff] [blame] | 215 | bool isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer); |
Praveena Pachipulusu | d9443c7 | 2014-02-17 10:42:28 +0530 | [diff] [blame] | 216 | bool resourceCheck(); |
| 217 | hwc_rect_t getUpdatingFBRect(hwc_display_contents_1_t* list); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 218 | |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 219 | int mDpy; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 220 | static bool sEnabled; |
Jeykumar Sankaran | 24c199d | 2013-05-24 09:40:36 -0700 | [diff] [blame] | 221 | static bool sEnableMixedMode; |
Jeykumar Sankaran | 6a9bb9e | 2013-08-01 14:19:26 -0700 | [diff] [blame] | 222 | /* Enables Partial frame composition */ |
| 223 | static bool sEnablePartialFrameUpdate; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 224 | static bool sDebugLogs; |
| 225 | static bool sIdleFallBack; |
Ramkumar Radhakrishnan | 92abb4f | 2014-02-06 21:31:29 -0800 | [diff] [blame] | 226 | /* Handles the timeout event from kernel, if the value is set to true */ |
| 227 | static bool sHandleTimeout; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 228 | static int sMaxPipesPerMixer; |
Manoj Kumar AVM | 8cbbf7c | 2014-03-11 01:15:31 -0700 | [diff] [blame] | 229 | static bool sSrcSplitEnabled; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 230 | static IdleInvalidator *idleInvalidator; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 231 | struct FrameInfo mCurrentFrame; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 232 | struct LayerCache mCachedFrame; |
radhakrishna | c9a6741 | 2013-09-25 17:40:42 +0530 | [diff] [blame] | 233 | //Enable 4kx2k yuv layer split |
| 234 | static bool sEnable4k2kYUVSplit; |
Arun Kumar K.R | 2aa44c6 | 2014-01-21 23:08:28 -0800 | [diff] [blame] | 235 | bool allocSplitVGPipesfor4k2k(hwc_context_t *ctx, int index); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 236 | }; |
| 237 | |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 238 | class MDPCompNonSplit : public MDPComp { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 239 | public: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 240 | explicit MDPCompNonSplit(int dpy):MDPComp(dpy){}; |
| 241 | virtual ~MDPCompNonSplit(){}; |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 242 | 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] | 243 | |
| 244 | private: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 245 | struct MdpPipeInfoNonSplit : public MdpPipeInfo { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 246 | ovutils::eDest index; |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 247 | virtual ~MdpPipeInfoNonSplit() {}; |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 248 | }; |
| 249 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 250 | /* configure's overlay pipes for the frame */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 251 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 252 | PipeLayerPair& pipeLayerPair); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 253 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 254 | /* allocates pipes to selected candidates */ |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 255 | virtual bool allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 256 | hwc_display_contents_1_t* list); |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 257 | |
Saurabh Shah | 3d4b804 | 2013-12-10 15:19:17 -0800 | [diff] [blame] | 258 | /* Increments mdpCount if 4k2k yuv layer split is enabled. |
| 259 | * updates framebuffer z order if fb lies above source-split layer */ |
| 260 | virtual void adjustForSourceSplit(hwc_context_t *ctx, |
Arun Kumar K.R | 2aa44c6 | 2014-01-21 23:08:28 -0800 | [diff] [blame] | 261 | hwc_display_contents_1_t* list); |
radhakrishna | c9a6741 | 2013-09-25 17:40:42 +0530 | [diff] [blame] | 262 | |
| 263 | /* configures 4kx2k yuv layer to 2 VG pipes*/ |
| 264 | virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer, |
| 265 | PipeLayerPair& PipeLayerPair); |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 266 | }; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 267 | |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 268 | class MDPCompSplit : public MDPComp { |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 269 | public: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 270 | explicit MDPCompSplit(int dpy):MDPComp(dpy){}; |
| 271 | virtual ~MDPCompSplit(){}; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 272 | virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list); |
Saurabh Shah | ab47c69 | 2014-02-12 18:45:57 -0800 | [diff] [blame] | 273 | |
| 274 | protected: |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 275 | struct MdpPipeInfoSplit : public MdpPipeInfo { |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 276 | ovutils::eDest lIndex; |
| 277 | ovutils::eDest rIndex; |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 278 | virtual ~MdpPipeInfoSplit() {}; |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 279 | }; |
Saurabh Shah | cbf7ccc | 2012-12-19 16:45:51 -0800 | [diff] [blame] | 280 | |
Saurabh Shah | ab47c69 | 2014-02-12 18:45:57 -0800 | [diff] [blame] | 281 | virtual bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer, |
Saurabh Shah | 88e4d27 | 2013-09-03 13:31:29 -0700 | [diff] [blame] | 282 | MdpPipeInfoSplit& pipe_info, ePipeType type); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 283 | |
| 284 | /* configure's overlay pipes for the frame */ |
| 285 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 286 | PipeLayerPair& pipeLayerPair); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 287 | |
| 288 | /* allocates pipes to selected candidates */ |
| 289 | virtual bool allocLayerPipes(hwc_context_t *ctx, |
Jeykumar Sankaran | 85977e3 | 2013-02-25 17:06:08 -0800 | [diff] [blame] | 290 | hwc_display_contents_1_t* list); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 291 | |
Saurabh Shah | ab47c69 | 2014-02-12 18:45:57 -0800 | [diff] [blame] | 292 | private: |
Saurabh Shah | 3d4b804 | 2013-12-10 15:19:17 -0800 | [diff] [blame] | 293 | /* Increments mdpCount if 4k2k yuv layer split is enabled. |
| 294 | * updates framebuffer z order if fb lies above source-split layer */ |
| 295 | virtual void adjustForSourceSplit(hwc_context_t *ctx, |
radhakrishna | c9a6741 | 2013-09-25 17:40:42 +0530 | [diff] [blame] | 296 | hwc_display_contents_1_t* list); |
| 297 | |
| 298 | /* configures 4kx2k yuv layer*/ |
| 299 | virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer, |
| 300 | PipeLayerPair& PipeLayerPair); |
Jeykumar Sankaran | b551ce4 | 2013-01-10 16:26:48 -0800 | [diff] [blame] | 301 | }; |
Saurabh Shah | 2a4eb1b | 2013-07-22 16:33:23 -0700 | [diff] [blame] | 302 | |
Saurabh Shah | ab47c69 | 2014-02-12 18:45:57 -0800 | [diff] [blame] | 303 | class MDPCompSrcSplit : public MDPCompSplit { |
| 304 | public: |
| 305 | explicit MDPCompSrcSplit(int dpy) : MDPCompSplit(dpy){}; |
| 306 | virtual ~MDPCompSrcSplit(){}; |
| 307 | private: |
| 308 | virtual bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer, |
| 309 | MdpPipeInfoSplit& pipe_info, ePipeType type); |
| 310 | |
Saurabh Shah | ab47c69 | 2014-02-12 18:45:57 -0800 | [diff] [blame] | 311 | virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer, |
| 312 | PipeLayerPair& pipeLayerPair); |
| 313 | }; |
| 314 | |
Naseer Ahmed | 7c958d4 | 2012-07-31 18:57:03 -0700 | [diff] [blame] | 315 | }; //namespace |
| 316 | #endif |