Merge "hwc2: Flush while destroying external display."
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
08282814e4
@@ -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);
|
||||
|
||||
@@ -278,4 +278,8 @@ void HWCDisplayExternal::GetUnderScanConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
DisplayError HWCDisplayExternal::Flush() {
|
||||
return display_intf_->Flush();
|
||||
}
|
||||
|
||||
} // namespace sdm
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user