diff options
author | Ramkumar Radhakrishnan <ramkumar@codeaurora.org> | 2018-01-17 11:39:33 -0800 |
---|---|---|
committer | Ramkumar Radhakrishnan <ramkumar@codeaurora.org> | 2018-02-06 14:29:46 -0800 |
commit | 00698decef667ee7700b663091e1f6c4fbefbf71 (patch) | |
tree | 7a6469cb987745447c67872d910d0c60e8f561f8 /sdm/libs/hwc2/hwc_display_external.cpp | |
parent | f5464da30116baa43cc1e4e9e5a6af980dca11ac (diff) | |
download | display-00698decef667ee7700b663091e1f6c4fbefbf71.tar.gz |
sdm: Merge release fence after set power mode
On SetPowerMode() with retain pipes, DRM driver triggers the kick off
that enables MDP to read the previously queued buffer, Since the fence
created during SetPowerMode() is not merged with the previously queued
buffer, it may result in tearing. Hence get the release fence from
driver on SetPowerMode and propagate it to hwcomposer to merge it with
the previous release fence of all layer buffers to avoid tearing.
Change-Id: I81c078a1b05dd3fb34f10b9b70e25cfbcfabd117
CRs-Fixed: 2184515
Diffstat (limited to 'sdm/libs/hwc2/hwc_display_external.cpp')
-rw-r--r-- | sdm/libs/hwc2/hwc_display_external.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sdm/libs/hwc2/hwc_display_external.cpp b/sdm/libs/hwc2/hwc_display_external.cpp index 2bc2d189..675484b8 100644 --- a/sdm/libs/hwc2/hwc_display_external.cpp +++ b/sdm/libs/hwc2/hwc_display_external.cpp @@ -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 @@ -230,9 +230,12 @@ int HWCDisplayExternal::SetState(bool connected) { DLOGW("Set frame buffer config failed. Error = %d", error); return -1; } - + int release_fence = -1; display_null_.GetDisplayState(&state); - display_intf_->SetDisplayState(state); + display_intf_->SetDisplayState(state, &release_fence); + if (release_fence >= 0) { + ::close(release_fence); + } validated_ = false; SetVsyncEnabled(HWC2::Vsync::Enable); @@ -244,10 +247,14 @@ int HWCDisplayExternal::SetState(bool connected) { } } else { if (!display_null_.IsActive()) { + int release_fence = -1; // Preserve required attributes of HDMI display that surfaceflinger sees. // Restore HDMI attributes when display is reconnected. display_intf_->GetDisplayState(&state); - display_null_.SetDisplayState(state); + display_null_.SetDisplayState(state, &release_fence); + if (release_fence >= 0) { + ::close(release_fence); + } error = display_intf_->GetFrameBufferConfig(&fb_config); if (error != kErrorNone) { |