summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-02-23 14:21:05 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-02-23 14:21:05 -0800
commit4676cd3f185ba9262e9e11c019b9eea150fd28d0 (patch)
treea484e759c31623de49a6110c1487473319d85964
parenta1faecfcfcdb022fa0adf59b1a006eeac400bff5 (diff)
parenta22d789a0e6cf44835a491cf3248fad2ac067ecb (diff)
downloaddisplay-4676cd3f185ba9262e9e11c019b9eea150fd28d0.tar.gz
Merge "hwc2: Flush while destroying external display."
-rw-r--r--sdm/libs/hwc2/hwc_display.h6
-rw-r--r--sdm/libs/hwc2/hwc_display_external.cpp4
-rw-r--r--sdm/libs/hwc2/hwc_display_external.h3
-rw-r--r--sdm/libs/hwc2/hwc_session.cpp4
4 files changed, 15 insertions, 2 deletions
diff --git a/sdm/libs/hwc2/hwc_display.h b/sdm/libs/hwc2/hwc_display.h
index beed4255..3977e737 100644
--- a/sdm/libs/hwc2/hwc_display.h
+++ b/sdm/libs/hwc2/hwc_display.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
@@ -150,6 +150,10 @@ class HWCDisplay : public DisplayEventHandler {
virtual int SetState(bool connected) {
return kErrorNotSupported;
}
+ virtual DisplayError Flush() {
+ return kErrorNotSupported;
+ }
+
int SetPanelBrightness(int level);
int GetPanelBrightness(int *level);
int ToggleScreenUpdates(bool enable);
diff --git a/sdm/libs/hwc2/hwc_display_external.cpp b/sdm/libs/hwc2/hwc_display_external.cpp
index 9d1ad6cc..bb4ea891 100644
--- a/sdm/libs/hwc2/hwc_display_external.cpp
+++ b/sdm/libs/hwc2/hwc_display_external.cpp
@@ -293,4 +293,8 @@ void HWCDisplayExternal::GetUnderScanConfig() {
}
}
+DisplayError HWCDisplayExternal::Flush() {
+ return display_intf_->Flush();
+}
+
} // namespace sdm
diff --git a/sdm/libs/hwc2/hwc_display_external.h b/sdm/libs/hwc2/hwc_display_external.h
index fbee6a3d..5eb1704f 100644
--- a/sdm/libs/hwc2/hwc_display_external.h
+++ b/sdm/libs/hwc2/hwc_display_external.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -49,6 +49,7 @@ class HWCDisplayExternal : public HWCDisplay {
virtual HWC2::Error Present(int32_t *out_retire_fence);
virtual void SetSecureDisplay(bool secure_display_active);
virtual int SetState(bool connected);
+ virtual DisplayError Flush();
private:
HWCDisplayExternal(CoreInterface *core_intf, HWCBufferAllocator *buffer_allocator,
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index fa3d7664..7518b402 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -960,6 +960,10 @@ int HWCSession::DisconnectDisplay(int disp) {
DLOGI("Display = %d", disp);
if (disp == HWC_DISPLAY_EXTERNAL) {
+ DisplayError error = hwc_display_[disp]->Flush();
+ if (error != kErrorNone) {
+ DLOGW("Flush failed. Error = %d", error);
+ }
HWCDisplayExternal::Destroy(hwc_display_[disp]);
} else if (disp == HWC_DISPLAY_VIRTUAL) {
HWCDisplayVirtual::Destroy(hwc_display_[disp]);