summaryrefslogtreecommitdiffstats
path: root/libs/gui/include
diff options
context:
space:
mode:
authorMarissa Wall <marissaw@google.com>2019-03-29 14:03:53 -0700
committerValerie Hau <vhau@google.com>2019-04-16 15:39:28 -0700
commit947d34ecad84bdaf496748eeb9f6e35b33deb339 (patch)
tree29f668d1d193b97ab93d74b0d4cdc7b0bd239c3f /libs/gui/include
parent1688f5246f156e815bd7b07ba7d5c39cc821e8d6 (diff)
downloadandroid_frameworks_native-947d34ecad84bdaf496748eeb9f6e35b33deb339.tar.gz
android_frameworks_native-947d34ecad84bdaf496748eeb9f6e35b33deb339.tar.bz2
android_frameworks_native-947d34ecad84bdaf496748eeb9f6e35b33deb339.zip
Change slot generation for BufferState
BufferState layers now do slot generation with buffer death considered appropriately. When a buffer dies, the slot will be pushed onto a stack of available slots to be reused at the next opportunity. This should mimic BufferQueue slot behavior and prevent Composer Resources from growing too large. Test: build, boot, manual Bug: 129351223 Change-Id: Icef9592593cacb0b5c6b12f6679fc2c4dabdcd19
Diffstat (limited to 'libs/gui/include')
-rw-r--r--libs/gui/include/gui/ISurfaceComposer.h4
-rw-r--r--libs/gui/include/gui/LayerState.h12
2 files changed, 10 insertions, 6 deletions
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index 415b2d58e..e8c7a39ad 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -44,7 +44,7 @@
namespace android {
// ----------------------------------------------------------------------------
-struct cached_buffer_t;
+struct client_cache_t;
struct ComposerState;
struct DisplayState;
struct DisplayInfo;
@@ -137,7 +137,7 @@ public:
const sp<IBinder>& applyToken,
const InputWindowCommands& inputWindowCommands,
int64_t desiredPresentTime,
- const cached_buffer_t& uncacheBuffer,
+ const client_cache_t& uncacheBuffer,
const std::vector<ListenerCallbacks>& listenerCallbacks) = 0;
/* signal that we're done booting.
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index 225649775..f438eb3d0 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -40,9 +40,13 @@ namespace android {
class Parcel;
class ISurfaceComposerClient;
-struct cached_buffer_t {
- sp<IBinder> token = nullptr;
- uint64_t cacheId;
+struct client_cache_t {
+ wp<IBinder> token = nullptr;
+ uint64_t id;
+
+ bool operator==(const client_cache_t& other) const { return id == other.id; }
+
+ bool isValid() const { return token != nullptr; }
};
/*
@@ -187,7 +191,7 @@ struct layer_state_t {
InputWindowInfo inputInfo;
#endif
- cached_buffer_t cachedBuffer;
+ client_cache_t cachedBuffer;
LayerMetadata metadata;