qdutils: Retrieve MDP revision and pipes information from driver.
Userspace can retrieve MDP revision number and number of different
types of MDP pipes (RGB,VG,DMA) information from driver. Add target
specific flag as previous MDP versions do not provide this support.
- Make use of this information while maintaining PipeBook.
- Move PipeBook related functions from overlay utils to PipeBook.
Change-Id: I46578bb27e515c4b9525d90b6619c11d7749914f
diff --git a/liboverlay/overlay.h b/liboverlay/overlay.h
index 0f15baa..aa12b76 100644
--- a/liboverlay/overlay.h
+++ b/liboverlay/overlay.h
@@ -68,7 +68,7 @@
bool queueBuffer(int fd, uint32_t offset, utils::eDest dest);
/* Closes open pipes, called during startup */
- static void initOverlay();
+ static int initOverlay();
/* Returns the singleton instance of overlay */
static Overlay* getInstance();
/* Returns available ("unallocated") pipes for a display */
@@ -116,7 +116,12 @@
static bool isAllocated(int index);
static bool isNotAllocated(int index);
+ static utils::eMdpPipeType getPipeType(utils::eDest dest);
+ static const char* getDestStr(utils::eDest dest);
+
static int NUM_PIPES;
+ static utils::eMdpPipeType pipeTypeLUT[utils::OV_MAX];
+
private:
//usage tracks if a successful commit happened. So a pipe could be
@@ -146,7 +151,7 @@
OVASSERT(index >=0 && index < PipeBook::NUM_PIPES, \
"%s, Index out of bounds: %d", __FUNCTION__, index);
OVASSERT(mPipeBook[index].valid(), "Pipe does not exist %s",
- utils::getDestStr((utils::eDest)index));
+ PipeBook::getDestStr((utils::eDest)index));
}
inline int Overlay::availablePipes(int dpy) {
@@ -212,6 +217,20 @@
return !isAllocated(index);
}
+inline utils::eMdpPipeType Overlay::PipeBook::getPipeType(utils::eDest dest) {
+ return pipeTypeLUT[(int)dest];
+}
+
+inline const char* Overlay::PipeBook::getDestStr(utils::eDest dest) {
+ switch(getPipeType(dest)) {
+ case utils::OV_MDP_PIPE_RGB: return "RGB";
+ case utils::OV_MDP_PIPE_VG: return "VG";
+ case utils::OV_MDP_PIPE_DMA: return "DMA";
+ default: return "Invalid";
+ }
+ return "Invalid";
+}
+
}; // overlay
#endif // OVERLAY_H