libhwcomposer: MDP partial frame update
This change adds support in HWC for MDP partial update applicable
only for command mode panels. Presence of MDP FB (GRAM) in
command mode panels allows MDP clients to update only the updating region
of the frame as rest of the frame will be cached in the GRAM.
HWC calculates the updating region of a frame (ROI) by deducing
outer bounds of its updating layer destinations. Layers not lying
within the calculated ROI will be dropped from the composition
since its illegal to program MDP pipes for non participating layers.
Change-Id: I890d98ff7960fe888787981803cac62f68471201
diff --git a/liboverlay/overlay.cpp b/liboverlay/overlay.cpp
index afe62e2..b095e9e 100644
--- a/liboverlay/overlay.cpp
+++ b/liboverlay/overlay.cpp
@@ -321,13 +321,23 @@
}
bool Overlay::displayCommit(const int& fd) {
+ utils::Dim roi;
+ return displayCommit(fd, roi);
+}
+
+bool Overlay::displayCommit(const int& fd, const utils::Dim& roi) {
//Commit
struct mdp_display_commit info;
memset(&info, 0, sizeof(struct mdp_display_commit));
info.flags = MDP_DISPLAY_COMMIT_OVERLAY;
+ info.roi.x = roi.x;
+ info.roi.y = roi.y;
+ info.roi.w = roi.w;
+ info.roi.h = roi.h;
+
if(!mdp_wrapper::displayCommit(fd, info)) {
- ALOGE("%s: commit failed", __func__);
- return false;
+ ALOGE("%s: commit failed", __func__);
+ return false;
}
return true;
}
diff --git a/liboverlay/overlay.h b/liboverlay/overlay.h
index 9d7f5c8..c16f6e6 100644
--- a/liboverlay/overlay.h
+++ b/liboverlay/overlay.h
@@ -109,6 +109,7 @@
static int getDMAMode();
/* Returns the framebuffer node backing up the display */
static int getFbForDpy(const int& dpy);
+ static bool displayCommit(const int& fd, const utils::Dim& roi);
static bool displayCommit(const int& fd);
private: