blob: 520c176b60f70cdd83606d523e6e3a226ee41967 [file] [log] [blame]
Naseer Ahmed7c958d42012-07-31 18:57:03 -07001/*
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -08002 * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved.
3 *
Naseer Ahmed7c958d42012-07-31 18:57:03 -07004 * 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 Shah45782902013-11-15 10:13:14 -080028#define DEFAULT_IDLE_TIME 70
Sushil Chauhan69f2bb22013-02-13 10:50:47 -080029#define MAX_PIPES_PER_MIXER 4
Naseer Ahmed7c958d42012-07-31 18:57:03 -070030
Saurabh Shahacf10202013-02-26 10:15:15 -080031namespace overlay {
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080032class Rotator;
Saurabh Shahacf10202013-02-26 10:15:15 -080033};
34
Naseer Ahmed7c958d42012-07-31 18:57:03 -070035namespace qhwc {
Naseer Ahmed54821fe2012-11-28 18:44:38 -050036namespace ovutils = overlay::utils;
Naseer Ahmed7c958d42012-07-31 18:57:03 -070037
38class MDPComp {
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080039public:
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080040 explicit MDPComp(int);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080041 virtual ~MDPComp(){};
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080042 /*sets up mdp comp for the current frame */
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080043 int prepare(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080044 /* draw */
45 virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list) = 0;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080046 /* dumpsys */
Jeykumar Sankaran6850ac62014-05-27 10:07:26 -070047 void dump(android::String8& buf, hwc_context_t *ctx);
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080048 bool isGLESOnlyComp() { return (mCurrentFrame.mdpCount == 0); }
Sushil Chauhandefd3522014-05-13 18:17:12 -070049 bool isPTORActive() { return (mOverlapIndex != -1); }
50 int drawOverlap(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shah88e4d272013-09-03 13:31:29 -070051 static MDPComp* getObject(hwc_context_t *ctx, const int& dpy);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080052 /* Handler to invoke frame redraw on Idle Timer expiry */
53 static void timeout_handler(void *udata);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080054 /* Initialize MDP comp*/
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080055 static bool init(hwc_context_t *ctx);
Saurabh Shah98acd092013-05-03 10:48:24 -070056 static void resetIdleFallBack() { sIdleFallBack = false; }
Saurabh Shahbe7bd322014-02-20 16:18:45 -080057 static void reset() { sHandleTimeout = false; };
Ramkumar Radhakrishnanfb822912014-03-14 17:28:14 -070058 static bool isIdleFallback() { return sIdleFallBack; }
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080059
60protected:
Saurabh Shahe9bc60f2013-08-29 12:58:06 -070061 enum { MAX_SEC_LAYERS = 1 }; //TODO add property support
62
Naseer Ahmed54821fe2012-11-28 18:44:38 -050063 enum ePipeType {
64 MDPCOMP_OV_RGB = ovutils::OV_MDP_PIPE_RGB,
65 MDPCOMP_OV_VG = ovutils::OV_MDP_PIPE_VG,
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080066 MDPCOMP_OV_DMA = ovutils::OV_MDP_PIPE_DMA,
Naseer Ahmed54821fe2012-11-28 18:44:38 -050067 MDPCOMP_OV_ANY,
Naseer Ahmed7c958d42012-07-31 18:57:03 -070068 };
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080069
Jeykumar Sankaran0ad97c42014-03-09 23:00:53 -070070 //Simulation flags
71 enum {
72 MDPCOMP_AVOID_FULL_MDP = 0x001,
73 MDPCOMP_AVOID_CACHE_MDP = 0x002,
74 MDPCOMP_AVOID_LOAD_MDP = 0x004,
75 MDPCOMP_AVOID_VIDEO_ONLY = 0x008,
76 };
77
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080078 /* mdp pipe data */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080079 struct MdpPipeInfo {
80 int zOrder;
81 virtual ~MdpPipeInfo(){};
82 };
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080083
radhakrishnac9a67412013-09-25 17:40:42 +053084 struct MdpYUVPipeInfo : public MdpPipeInfo{
85 ovutils::eDest lIndex;
86 ovutils::eDest rIndex;
87 virtual ~MdpYUVPipeInfo(){};
88 };
89
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080090 /* per layer data */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080091 struct PipeLayerPair {
92 MdpPipeInfo *pipeInfo;
Saurabh Shahacf10202013-02-26 10:15:15 -080093 overlay::Rotator* rot;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080094 int listIndex;
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080095 };
96
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080097 /* per frame data */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080098 struct FrameInfo {
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080099 /* maps layer list to mdp list */
100 int layerCount;
Ramkumar Radhakrishnane661f962013-06-05 17:21:38 -0700101 int layerToMDP[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800102
103 /* maps mdp list to layer list */
104 int mdpCount;
105 struct PipeLayerPair mdpToLayer[MAX_PIPES_PER_MIXER];
106
107 /* layer composing on FB? */
108 int fbCount;
Ramkumar Radhakrishnane661f962013-06-05 17:21:38 -0700109 bool isFBComposed[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran6a9bb9e2013-08-01 14:19:26 -0700110 /* layers lying outside ROI. Will
111 * be dropped off from the composition */
112 int dropCount;
113 bool drop[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800114
115 bool needsRedraw;
116 int fbZ;
117
118 /* c'tor */
119 FrameInfo();
120 /* clear old frame data */
Saurabh Shahaa236822013-04-24 18:07:26 -0700121 void reset(const int& numLayers);
122 void map();
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800123 };
124
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800125 /* cached data */
126 struct LayerCache {
127 int layerCount;
Ramkumar Radhakrishnane661f962013-06-05 17:21:38 -0700128 buffer_handle_t hnd[MAX_NUM_APP_LAYERS];
Prabhanjan Kandula2243aa62013-10-24 12:58:55 +0530129 bool isFBComposed[MAX_NUM_APP_LAYERS];
130 bool drop[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800131
132 /* c'tor */
133 LayerCache();
134 /* clear caching info*/
135 void reset();
Saurabh Shahaa236822013-04-24 18:07:26 -0700136 void cacheAll(hwc_display_contents_1_t* list);
137 void updateCounts(const FrameInfo&);
Jeykumar Sankaran988d3682013-11-15 11:57:16 -0800138 bool isSameFrame(const FrameInfo& curFrame,
139 hwc_display_contents_1_t* list);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800140 };
141
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800142 /* allocates pipe from pipe book */
143 virtual bool allocLayerPipes(hwc_context_t *ctx,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800144 hwc_display_contents_1_t* list) = 0;
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800145 /* configures MPD pipes */
146 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800147 PipeLayerPair& pipeLayerPair) = 0;
Saurabh Shah3d4b8042013-12-10 15:19:17 -0800148 /* Increments mdpCount if 4k2k yuv layer split is enabled.
149 * updates framebuffer z order if fb lies above source-split layer */
150 virtual void adjustForSourceSplit(hwc_context_t *ctx,
radhakrishnac9a67412013-09-25 17:40:42 +0530151 hwc_display_contents_1_t* list) = 0;
152 /* configures 4kx2k yuv layer*/
153 virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
154 PipeLayerPair& PipeLayerPair) = 0;
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800155 /* generates ROI based on the modified area of the frame */
156 virtual void generateROI(hwc_context_t *ctx,
157 hwc_display_contents_1_t* list) = 0;
158 /* validates the ROI generated for fallback conditions */
159 virtual bool validateAndApplyROI(hwc_context_t *ctx,
160 hwc_display_contents_1_t* list) = 0;
161 /* Trims fbRect calculated against ROI generated */
162 virtual void trimAgainstROI(hwc_context_t *ctx, hwc_rect_t& fbRect) = 0;
163
Jeykumar Sankaran1e156112014-04-30 11:03:23 -0700164 /* set/reset flags for MDPComp */
165 void setMDPCompLayerFlags(hwc_context_t *ctx,
166 hwc_display_contents_1_t* list);
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800167 void setRedraw(hwc_context_t *ctx,
168 hwc_display_contents_1_t* list);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800169 /* checks for conditions where mdpcomp is not possible */
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800170 bool isFrameDoable(hwc_context_t *ctx);
171 /* checks for conditions where RGB layers cannot be bypassed */
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800172 bool tryFullFrame(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahaa236822013-04-24 18:07:26 -0700173 /* checks if full MDP comp can be done */
174 bool fullMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Sushil Chauhandefd3522014-05-13 18:17:12 -0700175 /* Full MDP Composition with Peripheral Tiny Overlap Removal */
176 bool fullMDPCompWithPTOR(hwc_context_t *ctx,hwc_display_contents_1_t* list);
Saurabh Shahaa236822013-04-24 18:07:26 -0700177 /* check if we can use layer cache to do at least partial MDP comp */
178 bool partialMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shah8028e3b2013-10-15 12:27:59 -0700179 /* Partial MDP comp that uses caching to save power as primary goal */
180 bool cacheBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahbe7bd322014-02-20 16:18:45 -0800181 /* Partial MDP comp that balances the load between MDP and GPU such that
182 * MDP is loaded to the max of its capacity. The lower z order layers are
183 * fed to MDP, whereas the upper ones to GPU, because the upper ones have
184 * lower number of pixels and can reduce GPU processing time */
185 bool loadBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shah8028e3b2013-10-15 12:27:59 -0700186 /* Checks if its worth doing load based partial comp */
Arun Kumar K.R2aa44c62014-01-21 23:08:28 -0800187 bool isLoadBasedCompDoable(hwc_context_t *ctx);
Saurabh Shahaa236822013-04-24 18:07:26 -0700188 /* checks for conditions where only video can be bypassed */
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800189 bool tryVideoOnly(hwc_context_t *ctx, hwc_display_contents_1_t* list);
190 bool videoOnlyComp(hwc_context_t *ctx, hwc_display_contents_1_t* list,
Saurabh Shah90b7b9b2013-09-12 16:36:08 -0700191 bool secureOnly);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800192 /* checks for conditions where YUV layers cannot be bypassed */
193 bool isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer);
Prabhanjan Kandula21918db2013-11-26 15:51:58 +0530194 /* checks if MDP/MDSS can process current list w.r.to HW limitations
195 * All peculiar HW limitations should go here */
196 bool hwLimitationsCheck(hwc_context_t* ctx, hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800197 /* Is debug enabled */
198 static bool isDebug() { return sDebugLogs ? true : false; };
199 /* Is feature enabled */
200 static bool isEnabled() { return sEnabled; };
Sravan Kumar D.V.Nad5d9292013-04-24 14:23:04 +0530201 /* checks for mdp comp dimension limitation */
202 bool isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800203 /* tracks non updating layers*/
204 void updateLayerCache(hwc_context_t* ctx, hwc_display_contents_1_t* list);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800205 /* optimize layers for mdp comp*/
Prabhanjan Kandula9bd5f642013-09-25 17:00:36 +0530206 bool markLayersForCaching(hwc_context_t* ctx,
207 hwc_display_contents_1_t* list);
208 int getBatch(hwc_display_contents_1_t* list,
209 int& maxBatchStart, int& maxBatchEnd,
210 int& maxBatchCount);
211 bool canPushBatchToTop(const hwc_display_contents_1_t* list,
212 int fromIndex, int toIndex);
213 bool intersectingUpdatingLayers(const hwc_display_contents_1_t* list,
214 int fromIndex, int toIndex, int targetLayerIndex);
215
216 /* updates cache map with YUV info */
Saurabh Shah90b7b9b2013-09-12 16:36:08 -0700217 void updateYUV(hwc_context_t* ctx, hwc_display_contents_1_t* list,
218 bool secureOnly);
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800219 /* Validates if the GPU/MDP layer split chosen by a strategy is supported
220 * by MDP.
221 * Sets up MDP comp data structures to reflect covnversion from layers to
222 * overlay pipes.
223 * Configures overlay.
224 * Configures if GPU should redraw.
225 */
226 bool postHeuristicsHandling(hwc_context_t *ctx,
227 hwc_display_contents_1_t* list);
228 void reset(hwc_context_t *ctx);
Saurabh Shahe9bc60f2013-08-29 12:58:06 -0700229 bool isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer);
Praveena Pachipulusud9443c72014-02-17 10:42:28 +0530230 bool resourceCheck();
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800231 hwc_rect_t getUpdatingFBRect(hwc_context_t *ctx,
232 hwc_display_contents_1_t* list);
233 /* checks for conditions to enable partial udpate */
234 bool canPartialUpdate(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800235
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800236 int mDpy;
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800237 static bool sEnabled;
Jeykumar Sankaran24c199d2013-05-24 09:40:36 -0700238 static bool sEnableMixedMode;
Jeykumar Sankaran0ad97c42014-03-09 23:00:53 -0700239 static int sSimulationFlags;
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800240 static bool sDebugLogs;
241 static bool sIdleFallBack;
Ramkumar Radhakrishnan92abb4f2014-02-06 21:31:29 -0800242 /* Handles the timeout event from kernel, if the value is set to true */
243 static bool sHandleTimeout;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800244 static int sMaxPipesPerMixer;
Manoj Kumar AVM8cbbf7c2014-03-11 01:15:31 -0700245 static bool sSrcSplitEnabled;
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800246 static IdleInvalidator *idleInvalidator;
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800247 struct FrameInfo mCurrentFrame;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800248 struct LayerCache mCachedFrame;
radhakrishnac9a67412013-09-25 17:40:42 +0530249 //Enable 4kx2k yuv layer split
250 static bool sEnable4k2kYUVSplit;
Sushil Chauhandefd3522014-05-13 18:17:12 -0700251 /* Overlap layer index */
252 int mOverlapIndex;
Arun Kumar K.R2aa44c62014-01-21 23:08:28 -0800253 bool allocSplitVGPipesfor4k2k(hwc_context_t *ctx, int index);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800254};
255
Saurabh Shah88e4d272013-09-03 13:31:29 -0700256class MDPCompNonSplit : public MDPComp {
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800257public:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700258 explicit MDPCompNonSplit(int dpy):MDPComp(dpy){};
259 virtual ~MDPCompNonSplit(){};
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800260 virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800261
262private:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700263 struct MdpPipeInfoNonSplit : public MdpPipeInfo {
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800264 ovutils::eDest index;
Saurabh Shah88e4d272013-09-03 13:31:29 -0700265 virtual ~MdpPipeInfoNonSplit() {};
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700266 };
267
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700268 /* configure's overlay pipes for the frame */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800269 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800270 PipeLayerPair& pipeLayerPair);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800271
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700272 /* allocates pipes to selected candidates */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800273 virtual bool allocLayerPipes(hwc_context_t *ctx,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800274 hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800275
Saurabh Shah3d4b8042013-12-10 15:19:17 -0800276 /* Increments mdpCount if 4k2k yuv layer split is enabled.
277 * updates framebuffer z order if fb lies above source-split layer */
278 virtual void adjustForSourceSplit(hwc_context_t *ctx,
Arun Kumar K.R2aa44c62014-01-21 23:08:28 -0800279 hwc_display_contents_1_t* list);
radhakrishnac9a67412013-09-25 17:40:42 +0530280
281 /* configures 4kx2k yuv layer to 2 VG pipes*/
282 virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
283 PipeLayerPair& PipeLayerPair);
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800284 /* generates ROI based on the modified area of the frame */
285 virtual void generateROI(hwc_context_t *ctx,
286 hwc_display_contents_1_t* list);
287 /* validates the ROI generated for fallback conditions */
288 virtual bool validateAndApplyROI(hwc_context_t *ctx,
289 hwc_display_contents_1_t* list);
290 /* Trims fbRect calculated against ROI generated */
291 virtual void trimAgainstROI(hwc_context_t *ctx, hwc_rect_t& fbRect);
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700292};
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800293
Saurabh Shah88e4d272013-09-03 13:31:29 -0700294class MDPCompSplit : public MDPComp {
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800295public:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700296 explicit MDPCompSplit(int dpy):MDPComp(dpy){};
297 virtual ~MDPCompSplit(){};
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800298 virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list);
Saurabh Shahab47c692014-02-12 18:45:57 -0800299
300protected:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700301 struct MdpPipeInfoSplit : public MdpPipeInfo {
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800302 ovutils::eDest lIndex;
303 ovutils::eDest rIndex;
Saurabh Shah88e4d272013-09-03 13:31:29 -0700304 virtual ~MdpPipeInfoSplit() {};
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800305 };
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800306
Saurabh Shahab47c692014-02-12 18:45:57 -0800307 virtual bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
Saurabh Shahc62f3982014-03-05 14:28:26 -0800308 MdpPipeInfoSplit& pipe_info);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800309
310 /* configure's overlay pipes for the frame */
311 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800312 PipeLayerPair& pipeLayerPair);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800313
314 /* allocates pipes to selected candidates */
315 virtual bool allocLayerPipes(hwc_context_t *ctx,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800316 hwc_display_contents_1_t* list);
Saurabh Shahab47c692014-02-12 18:45:57 -0800317private:
Saurabh Shah3d4b8042013-12-10 15:19:17 -0800318 /* Increments mdpCount if 4k2k yuv layer split is enabled.
319 * updates framebuffer z order if fb lies above source-split layer */
320 virtual void adjustForSourceSplit(hwc_context_t *ctx,
radhakrishnac9a67412013-09-25 17:40:42 +0530321 hwc_display_contents_1_t* list);
322
323 /* configures 4kx2k yuv layer*/
324 virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
325 PipeLayerPair& PipeLayerPair);
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800326 /* generates ROI based on the modified area of the frame */
327 virtual void generateROI(hwc_context_t *ctx,
328 hwc_display_contents_1_t* list);
329 /* validates the ROI generated for fallback conditions */
330 virtual bool validateAndApplyROI(hwc_context_t *ctx,
331 hwc_display_contents_1_t* list);
332 /* Trims fbRect calculated against ROI generated */
333 virtual void trimAgainstROI(hwc_context_t *ctx, hwc_rect_t& fbRect);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800334};
Saurabh Shah2a4eb1b2013-07-22 16:33:23 -0700335
Saurabh Shahab47c692014-02-12 18:45:57 -0800336class MDPCompSrcSplit : public MDPCompSplit {
337public:
338 explicit MDPCompSrcSplit(int dpy) : MDPCompSplit(dpy){};
339 virtual ~MDPCompSrcSplit(){};
340private:
341 virtual bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
Saurabh Shahc62f3982014-03-05 14:28:26 -0800342 MdpPipeInfoSplit& pipe_info);
Saurabh Shahab47c692014-02-12 18:45:57 -0800343
Saurabh Shahab47c692014-02-12 18:45:57 -0800344 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
345 PipeLayerPair& pipeLayerPair);
346};
347
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700348}; //namespace
349#endif