summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Adithya Srinivasan <adsrini@google.com> 2021-02-08 21:52:51 +0000
committer Adithya Srinivasan <adsrini@google.com> 2021-02-12 00:35:15 +0000
commit95619432267937029494728c6e7e028093834036 (patch)
tree9773b6220bee45aefcbd5d30da0a352b18090613 /vulkan/libvulkan/api.cpp
parente06403fa179494d6c5cafd0b4ffce767413eb14c (diff)
Return janktype properly for dropped frames
In SurfaceFrame::getJankType(), a dropped frame won't have any present time set and will return std::nullopt currently. This behavior can result in a memory leak in releasePendingBuffer. Whenever SurfaceFrames are created, they are added to a deque 'mPendingJankClassification'. This deque is popped from the front as and when the frames are presented. However, if a dropped frame is in the front of the deque, the deque keeps growing in size to infinity. Since getJankType() reports a std::nullopt, it assumes that the frame hasn't been presented yet and keeps waiting for it. Bug: 179701581 Test: libsurfaceflinger_unittest Change-Id: I8ad1ed07222d39e4f98e4f7f3178db9fe52ea712
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions