hwc/overlay: validate and prepare frame
Send the entire frame (array of overlays) to driver, so that it would
check pipes params and the whole frame wrt bandwidth and SMP.
Now, the overlay's commit API just prepares an overlay object but
makes no ioctl calls.
If the driver finds the frame, as a whole, to be not ok, the
validation fails and overlay/hwc return silently.
If a certain overlay object is mis-configured or pipes are
unavailable, the driver sets the number of objects it processed.
Overlay uses this to dump the incorrect config.
Change-Id: Ifb2b7fadc6bd6d9d94a35ba3908fbd832f41447f
diff --git a/liboverlay/overlay.h b/liboverlay/overlay.h
index fe855c1..d8615cd 100644
--- a/liboverlay/overlay.h
+++ b/liboverlay/overlay.h
@@ -120,6 +120,8 @@
void getDump(char *buf, size_t len);
/* Reset usage and allocation bits on all pipes for given display */
void clear(int dpy);
+ /* Validate the set of pipes for a display and set them in driver */
+ bool validateAndSet(const int& dpy, const int& fbFd);
/* Closes open pipes, called during startup */
static int initOverlay();
@@ -131,8 +133,6 @@
static int getFbForDpy(const int& dpy);
static bool displayCommit(const int& fd, const utils::Dim& roi);
static bool displayCommit(const int& fd);
- /* Returns the scalar object */
- static scale::Scale *getScalar();
private:
/* Ctor setup */
@@ -141,6 +141,8 @@
void validate(int index);
static void setDMAMultiplexingSupported();
void dump() const;
+ /* Returns the scalar object */
+ static scale::Scale *getScalar();
/* Creates a scalar object using libscale.so */
static void initScalar();
/* Destroys the scalar object using libscale.so */
@@ -212,6 +214,8 @@
static bool sDMAMultiplexingSupported;
static void *sLibScaleHandle;
static scale::Scale *sScale;
+
+ friend class MdpCtrl;
};
inline void Overlay::validate(int index) {