summaryrefslogtreecommitdiff
path: root/drmresources.cpp
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2015-08-13 14:53:41 -0700
committerZach Reizner <zachr@google.com>2015-08-13 15:03:53 -0700
commit098070590ae648ede5f2ef846298de178ccd3637 (patch)
tree0b0ddea80dbdaa89c60c6aa14e463fa2327cd706 /drmresources.cpp
parentc6520e488fa82accb1882381bb5540ea419a0276 (diff)
drm_hwcomposer: enhance stability using various wrapper classes
This commit contains a lot of churn because it changes code to use automatic resource lifetimes as much as possible. As more things get changed, this is essential to maintaining stability. In addition, this change changes how layers are passed through the compositor API. Before each layer was passed down one at a time. Now they are passed in all at once. This is simpler for the implementation because it makes errors more atomic and makes decisions easier for the compositors. Change-Id: Ic3e6b5d0089fb1631ea256adcce9910ed8f38366
Diffstat (limited to 'drmresources.cpp')
-rw-r--r--drmresources.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/drmresources.cpp b/drmresources.cpp
index feb5187..32fe5cc 100644
--- a/drmresources.cpp
+++ b/drmresources.cpp
@@ -467,18 +467,17 @@ int DrmResources::SetDpmsMode(int display, uint64_t mode) {
return -EINVAL;
}
- DrmComposition *comp = compositor_.CreateComposition(NULL);
+ std::unique_ptr<DrmComposition> comp(compositor_.CreateComposition(NULL));
if (!comp) {
ALOGE("Failed to create composition for dpms on %d", display);
return -ENOMEM;
}
- int ret = comp->AddDpmsMode(display, mode);
+ int ret = comp->SetDpmsMode(display, mode);
if (ret) {
ALOGE("Failed to add dpms %ld to composition on %d %d", mode, display, ret);
- delete comp;
return ret;
}
- ret = compositor_.QueueComposition(comp);
+ ret = compositor_.QueueComposition(std::move(comp));
if (ret) {
ALOGE("Failed to queue dpms composition on %d %d", display, ret);
return ret;