blob: 4d9d23254d12a70bb9c5b2a38aba88a144e4ab79 [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 */
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080047 void dump(android::String8& buf);
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080048 bool isGLESOnlyComp() { return (mCurrentFrame.mdpCount == 0); }
Saurabh Shah88e4d272013-09-03 13:31:29 -070049 static MDPComp* getObject(hwc_context_t *ctx, const int& dpy);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080050 /* Handler to invoke frame redraw on Idle Timer expiry */
51 static void timeout_handler(void *udata);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080052 /* Initialize MDP comp*/
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080053 static bool init(hwc_context_t *ctx);
Saurabh Shah98acd092013-05-03 10:48:24 -070054 static void resetIdleFallBack() { sIdleFallBack = false; }
Saurabh Shahbe7bd322014-02-20 16:18:45 -080055 static void reset() { sHandleTimeout = false; };
Ramkumar Radhakrishnanfb822912014-03-14 17:28:14 -070056 static bool isIdleFallback() { return sIdleFallBack; }
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -080057
58protected:
Saurabh Shahe9bc60f2013-08-29 12:58:06 -070059 enum { MAX_SEC_LAYERS = 1 }; //TODO add property support
60
Naseer Ahmed54821fe2012-11-28 18:44:38 -050061 enum ePipeType {
62 MDPCOMP_OV_RGB = ovutils::OV_MDP_PIPE_RGB,
63 MDPCOMP_OV_VG = ovutils::OV_MDP_PIPE_VG,
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080064 MDPCOMP_OV_DMA = ovutils::OV_MDP_PIPE_DMA,
Naseer Ahmed54821fe2012-11-28 18:44:38 -050065 MDPCOMP_OV_ANY,
Naseer Ahmed7c958d42012-07-31 18:57:03 -070066 };
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080067
Jeykumar Sankaran0ad97c42014-03-09 23:00:53 -070068 //Simulation flags
69 enum {
70 MDPCOMP_AVOID_FULL_MDP = 0x001,
71 MDPCOMP_AVOID_CACHE_MDP = 0x002,
72 MDPCOMP_AVOID_LOAD_MDP = 0x004,
73 MDPCOMP_AVOID_VIDEO_ONLY = 0x008,
74 };
75
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080076 /* mdp pipe data */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080077 struct MdpPipeInfo {
78 int zOrder;
79 virtual ~MdpPipeInfo(){};
80 };
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080081
radhakrishnac9a67412013-09-25 17:40:42 +053082 struct MdpYUVPipeInfo : public MdpPipeInfo{
83 ovutils::eDest lIndex;
84 ovutils::eDest rIndex;
85 virtual ~MdpYUVPipeInfo(){};
86 };
87
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080088 /* per layer data */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080089 struct PipeLayerPair {
90 MdpPipeInfo *pipeInfo;
Saurabh Shahacf10202013-02-26 10:15:15 -080091 overlay::Rotator* rot;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080092 int listIndex;
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080093 };
94
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080095 /* per frame data */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -080096 struct FrameInfo {
Jeykumar Sankaran85977e32013-02-25 17:06:08 -080097 /* maps layer list to mdp list */
98 int layerCount;
Ramkumar Radhakrishnane661f962013-06-05 17:21:38 -070099 int layerToMDP[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800100
101 /* maps mdp list to layer list */
102 int mdpCount;
103 struct PipeLayerPair mdpToLayer[MAX_PIPES_PER_MIXER];
104
105 /* layer composing on FB? */
106 int fbCount;
Ramkumar Radhakrishnane661f962013-06-05 17:21:38 -0700107 bool isFBComposed[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran6a9bb9e2013-08-01 14:19:26 -0700108 /* layers lying outside ROI. Will
109 * be dropped off from the composition */
110 int dropCount;
111 bool drop[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800112
113 bool needsRedraw;
114 int fbZ;
115
116 /* c'tor */
117 FrameInfo();
118 /* clear old frame data */
Saurabh Shahaa236822013-04-24 18:07:26 -0700119 void reset(const int& numLayers);
120 void map();
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800121 };
122
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800123 /* cached data */
124 struct LayerCache {
125 int layerCount;
Ramkumar Radhakrishnane661f962013-06-05 17:21:38 -0700126 buffer_handle_t hnd[MAX_NUM_APP_LAYERS];
Prabhanjan Kandula2243aa62013-10-24 12:58:55 +0530127 bool isFBComposed[MAX_NUM_APP_LAYERS];
128 bool drop[MAX_NUM_APP_LAYERS];
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800129
130 /* c'tor */
131 LayerCache();
132 /* clear caching info*/
133 void reset();
Saurabh Shahaa236822013-04-24 18:07:26 -0700134 void cacheAll(hwc_display_contents_1_t* list);
135 void updateCounts(const FrameInfo&);
Jeykumar Sankaran988d3682013-11-15 11:57:16 -0800136 bool isSameFrame(const FrameInfo& curFrame,
137 hwc_display_contents_1_t* list);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800138 };
139
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800140 /* allocates pipe from pipe book */
141 virtual bool allocLayerPipes(hwc_context_t *ctx,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800142 hwc_display_contents_1_t* list) = 0;
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800143 /* configures MPD pipes */
144 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800145 PipeLayerPair& pipeLayerPair) = 0;
Saurabh Shah3d4b8042013-12-10 15:19:17 -0800146 /* Increments mdpCount if 4k2k yuv layer split is enabled.
147 * updates framebuffer z order if fb lies above source-split layer */
148 virtual void adjustForSourceSplit(hwc_context_t *ctx,
radhakrishnac9a67412013-09-25 17:40:42 +0530149 hwc_display_contents_1_t* list) = 0;
150 /* configures 4kx2k yuv layer*/
151 virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
152 PipeLayerPair& PipeLayerPair) = 0;
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800153 /* generates ROI based on the modified area of the frame */
154 virtual void generateROI(hwc_context_t *ctx,
155 hwc_display_contents_1_t* list) = 0;
156 /* validates the ROI generated for fallback conditions */
157 virtual bool validateAndApplyROI(hwc_context_t *ctx,
158 hwc_display_contents_1_t* list) = 0;
159 /* Trims fbRect calculated against ROI generated */
160 virtual void trimAgainstROI(hwc_context_t *ctx, hwc_rect_t& fbRect) = 0;
161
Jeykumar Sankaran1e156112014-04-30 11:03:23 -0700162 /* set/reset flags for MDPComp */
163 void setMDPCompLayerFlags(hwc_context_t *ctx,
164 hwc_display_contents_1_t* list);
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800165 void setRedraw(hwc_context_t *ctx,
166 hwc_display_contents_1_t* list);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800167 /* checks for conditions where mdpcomp is not possible */
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800168 bool isFrameDoable(hwc_context_t *ctx);
169 /* checks for conditions where RGB layers cannot be bypassed */
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800170 bool tryFullFrame(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahaa236822013-04-24 18:07:26 -0700171 /* checks if full MDP comp can be done */
172 bool fullMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
173 /* check if we can use layer cache to do at least partial MDP comp */
174 bool partialMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shah8028e3b2013-10-15 12:27:59 -0700175 /* Partial MDP comp that uses caching to save power as primary goal */
176 bool cacheBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahbe7bd322014-02-20 16:18:45 -0800177 /* Partial MDP comp that balances the load between MDP and GPU such that
178 * MDP is loaded to the max of its capacity. The lower z order layers are
179 * fed to MDP, whereas the upper ones to GPU, because the upper ones have
180 * lower number of pixels and can reduce GPU processing time */
181 bool loadBasedComp(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shah8028e3b2013-10-15 12:27:59 -0700182 /* Checks if its worth doing load based partial comp */
Arun Kumar K.R2aa44c62014-01-21 23:08:28 -0800183 bool isLoadBasedCompDoable(hwc_context_t *ctx);
Saurabh Shahaa236822013-04-24 18:07:26 -0700184 /* checks for conditions where only video can be bypassed */
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800185 bool tryVideoOnly(hwc_context_t *ctx, hwc_display_contents_1_t* list);
186 bool videoOnlyComp(hwc_context_t *ctx, hwc_display_contents_1_t* list,
Saurabh Shah90b7b9b2013-09-12 16:36:08 -0700187 bool secureOnly);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800188 /* checks for conditions where YUV layers cannot be bypassed */
189 bool isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer);
Prabhanjan Kandula21918db2013-11-26 15:51:58 +0530190 /* checks if MDP/MDSS can process current list w.r.to HW limitations
191 * All peculiar HW limitations should go here */
192 bool hwLimitationsCheck(hwc_context_t* ctx, hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800193 /* Is debug enabled */
194 static bool isDebug() { return sDebugLogs ? true : false; };
195 /* Is feature enabled */
196 static bool isEnabled() { return sEnabled; };
Sravan Kumar D.V.Nad5d9292013-04-24 14:23:04 +0530197 /* checks for mdp comp dimension limitation */
198 bool isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800199 /* tracks non updating layers*/
200 void updateLayerCache(hwc_context_t* ctx, hwc_display_contents_1_t* list);
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800201 /* optimize layers for mdp comp*/
Prabhanjan Kandula9bd5f642013-09-25 17:00:36 +0530202 bool markLayersForCaching(hwc_context_t* ctx,
203 hwc_display_contents_1_t* list);
204 int getBatch(hwc_display_contents_1_t* list,
205 int& maxBatchStart, int& maxBatchEnd,
206 int& maxBatchCount);
207 bool canPushBatchToTop(const hwc_display_contents_1_t* list,
208 int fromIndex, int toIndex);
209 bool intersectingUpdatingLayers(const hwc_display_contents_1_t* list,
210 int fromIndex, int toIndex, int targetLayerIndex);
211
212 /* updates cache map with YUV info */
Saurabh Shah90b7b9b2013-09-12 16:36:08 -0700213 void updateYUV(hwc_context_t* ctx, hwc_display_contents_1_t* list,
214 bool secureOnly);
Saurabh Shahdf4741d2013-12-12 16:40:28 -0800215 /* Validates if the GPU/MDP layer split chosen by a strategy is supported
216 * by MDP.
217 * Sets up MDP comp data structures to reflect covnversion from layers to
218 * overlay pipes.
219 * Configures overlay.
220 * Configures if GPU should redraw.
221 */
222 bool postHeuristicsHandling(hwc_context_t *ctx,
223 hwc_display_contents_1_t* list);
224 void reset(hwc_context_t *ctx);
Saurabh Shahe9bc60f2013-08-29 12:58:06 -0700225 bool isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer);
Praveena Pachipulusud9443c72014-02-17 10:42:28 +0530226 bool resourceCheck();
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800227 hwc_rect_t getUpdatingFBRect(hwc_context_t *ctx,
228 hwc_display_contents_1_t* list);
229 /* checks for conditions to enable partial udpate */
230 bool canPartialUpdate(hwc_context_t *ctx, hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800231
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800232 int mDpy;
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800233 static bool sEnabled;
Jeykumar Sankaran24c199d2013-05-24 09:40:36 -0700234 static bool sEnableMixedMode;
Jeykumar Sankaran0ad97c42014-03-09 23:00:53 -0700235 static int sSimulationFlags;
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800236 static bool sDebugLogs;
237 static bool sIdleFallBack;
Ramkumar Radhakrishnan92abb4f2014-02-06 21:31:29 -0800238 /* Handles the timeout event from kernel, if the value is set to true */
239 static bool sHandleTimeout;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800240 static int sMaxPipesPerMixer;
Manoj Kumar AVM8cbbf7c2014-03-11 01:15:31 -0700241 static bool sSrcSplitEnabled;
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800242 static IdleInvalidator *idleInvalidator;
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800243 struct FrameInfo mCurrentFrame;
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800244 struct LayerCache mCachedFrame;
radhakrishnac9a67412013-09-25 17:40:42 +0530245 //Enable 4kx2k yuv layer split
246 static bool sEnable4k2kYUVSplit;
Arun Kumar K.R2aa44c62014-01-21 23:08:28 -0800247 bool allocSplitVGPipesfor4k2k(hwc_context_t *ctx, int index);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800248};
249
Saurabh Shah88e4d272013-09-03 13:31:29 -0700250class MDPCompNonSplit : public MDPComp {
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800251public:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700252 explicit MDPCompNonSplit(int dpy):MDPComp(dpy){};
253 virtual ~MDPCompNonSplit(){};
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800254 virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800255
256private:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700257 struct MdpPipeInfoNonSplit : public MdpPipeInfo {
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800258 ovutils::eDest index;
Saurabh Shah88e4d272013-09-03 13:31:29 -0700259 virtual ~MdpPipeInfoNonSplit() {};
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700260 };
261
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700262 /* configure's overlay pipes for the frame */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800263 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800264 PipeLayerPair& pipeLayerPair);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800265
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700266 /* allocates pipes to selected candidates */
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800267 virtual bool allocLayerPipes(hwc_context_t *ctx,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800268 hwc_display_contents_1_t* list);
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800269
Saurabh Shah3d4b8042013-12-10 15:19:17 -0800270 /* Increments mdpCount if 4k2k yuv layer split is enabled.
271 * updates framebuffer z order if fb lies above source-split layer */
272 virtual void adjustForSourceSplit(hwc_context_t *ctx,
Arun Kumar K.R2aa44c62014-01-21 23:08:28 -0800273 hwc_display_contents_1_t* list);
radhakrishnac9a67412013-09-25 17:40:42 +0530274
275 /* configures 4kx2k yuv layer to 2 VG pipes*/
276 virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
277 PipeLayerPair& PipeLayerPair);
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800278 /* generates ROI based on the modified area of the frame */
279 virtual void generateROI(hwc_context_t *ctx,
280 hwc_display_contents_1_t* list);
281 /* validates the ROI generated for fallback conditions */
282 virtual bool validateAndApplyROI(hwc_context_t *ctx,
283 hwc_display_contents_1_t* list);
284 /* Trims fbRect calculated against ROI generated */
285 virtual void trimAgainstROI(hwc_context_t *ctx, hwc_rect_t& fbRect);
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700286};
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800287
Saurabh Shah88e4d272013-09-03 13:31:29 -0700288class MDPCompSplit : public MDPComp {
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800289public:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700290 explicit MDPCompSplit(int dpy):MDPComp(dpy){};
291 virtual ~MDPCompSplit(){};
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800292 virtual bool draw(hwc_context_t *ctx, hwc_display_contents_1_t *list);
Saurabh Shahab47c692014-02-12 18:45:57 -0800293
294protected:
Saurabh Shah88e4d272013-09-03 13:31:29 -0700295 struct MdpPipeInfoSplit : public MdpPipeInfo {
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800296 ovutils::eDest lIndex;
297 ovutils::eDest rIndex;
Saurabh Shah88e4d272013-09-03 13:31:29 -0700298 virtual ~MdpPipeInfoSplit() {};
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800299 };
Saurabh Shahcbf7ccc2012-12-19 16:45:51 -0800300
Saurabh Shahab47c692014-02-12 18:45:57 -0800301 virtual bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
Saurabh Shahc62f3982014-03-05 14:28:26 -0800302 MdpPipeInfoSplit& pipe_info);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800303
304 /* configure's overlay pipes for the frame */
305 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800306 PipeLayerPair& pipeLayerPair);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800307
308 /* allocates pipes to selected candidates */
309 virtual bool allocLayerPipes(hwc_context_t *ctx,
Jeykumar Sankaran85977e32013-02-25 17:06:08 -0800310 hwc_display_contents_1_t* list);
Saurabh Shahab47c692014-02-12 18:45:57 -0800311private:
Saurabh Shah3d4b8042013-12-10 15:19:17 -0800312 /* Increments mdpCount if 4k2k yuv layer split is enabled.
313 * updates framebuffer z order if fb lies above source-split layer */
314 virtual void adjustForSourceSplit(hwc_context_t *ctx,
radhakrishnac9a67412013-09-25 17:40:42 +0530315 hwc_display_contents_1_t* list);
316
317 /* configures 4kx2k yuv layer*/
318 virtual int configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
319 PipeLayerPair& PipeLayerPair);
Jeykumar Sankaran6c7eeac2013-11-18 11:19:45 -0800320 /* generates ROI based on the modified area of the frame */
321 virtual void generateROI(hwc_context_t *ctx,
322 hwc_display_contents_1_t* list);
323 /* validates the ROI generated for fallback conditions */
324 virtual bool validateAndApplyROI(hwc_context_t *ctx,
325 hwc_display_contents_1_t* list);
326 /* Trims fbRect calculated against ROI generated */
327 virtual void trimAgainstROI(hwc_context_t *ctx, hwc_rect_t& fbRect);
Jeykumar Sankaranb551ce42013-01-10 16:26:48 -0800328};
Saurabh Shah2a4eb1b2013-07-22 16:33:23 -0700329
Saurabh Shahab47c692014-02-12 18:45:57 -0800330class MDPCompSrcSplit : public MDPCompSplit {
331public:
332 explicit MDPCompSrcSplit(int dpy) : MDPCompSplit(dpy){};
333 virtual ~MDPCompSrcSplit(){};
334private:
335 virtual bool acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
Saurabh Shahc62f3982014-03-05 14:28:26 -0800336 MdpPipeInfoSplit& pipe_info);
Saurabh Shahab47c692014-02-12 18:45:57 -0800337
Saurabh Shahab47c692014-02-12 18:45:57 -0800338 virtual int configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
339 PipeLayerPair& pipeLayerPair);
340};
341
Naseer Ahmed7c958d42012-07-31 18:57:03 -0700342}; //namespace
343#endif