Merge "hwc2: Flush while destroying external display."

This commit is contained in:
Linux Build Service Account
2018-03-08 13:15:47 -08:00
committed by Gerrit - the friendly Code Review server
4 changed files with 15 additions and 2 deletions

View File

@@ -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);

View File

@@ -278,4 +278,8 @@ void HWCDisplayExternal::GetUnderScanConfig() {
}
}
DisplayError HWCDisplayExternal::Flush() {
return display_intf_->Flush();
}
} // namespace sdm

View File

@@ -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,

View File

@@ -944,6 +944,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]);