summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarissa Wall <marissaw@google.com>2017-03-02 22:12:34 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-02 22:12:34 +0000
commit3f06eec6f541c02a83bd9f39085378c2afbfbed8 (patch)
tree3cf1ff7c4eaf3f11c5655a50438bcc2e91896965
parent352a8ccae88ecf99ed1f65e22bfafdaf43b1fe45 (diff)
parent5c262a2fc8ec5151916f3e51796fd86dec44ac29 (diff)
downloadflounder-3f06eec6f541c02a83bd9f39085378c2afbfbed8.tar.gz
hwc2: atrace
am: 5c262a2fc8 Change-Id: I8301fea5de61b8a453747d45d03419d51169c9d4
-rw-r--r--hwc2/Android.mk3
-rw-r--r--hwc2/hwc2_dev.cpp20
2 files changed, 20 insertions, 3 deletions
diff --git a/hwc2/Android.mk b/hwc2/Android.mk
index b2c32c0..ec95af1 100644
--- a/hwc2/Android.mk
+++ b/hwc2/Android.mk
@@ -32,7 +32,8 @@ LOCAL_MODULE := hwcomposer.$(TARGET_BOOTLOADER_BOARD_NAME)
LOCAL_SHARED_LIBRARIES := \
liblog \
- libutils
+ libutils \
+ libcutils
LOCAL_STATIC_LIBRARIES := \
libadfhwc \
diff --git a/hwc2/hwc2_dev.cpp b/hwc2/hwc2_dev.cpp
index adffecf..a854958 100644
--- a/hwc2/hwc2_dev.cpp
+++ b/hwc2/hwc2_dev.cpp
@@ -24,6 +24,9 @@
#include "hwc2.h"
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include "cutils/trace.h"
+
static void hwc2_vsync(void *data, int dpy_id, uint64_t timestamp)
{
hwc2_dev *dev = static_cast<hwc2_dev *>(data);
@@ -180,6 +183,8 @@ hwc2_error_t hwc2_dev::get_doze_support(hwc2_display_t dpy_id,
hwc2_error_t hwc2_dev::validate_display(hwc2_display_t dpy_id,
uint32_t *out_num_types, uint32_t *out_num_requests)
{
+ ATRACE_BEGIN(__func__);
+
std::lock_guard<std::mutex> guard(state_mutex);
auto it = displays.find(dpy_id);
@@ -188,7 +193,12 @@ hwc2_error_t hwc2_dev::validate_display(hwc2_display_t dpy_id,
return HWC2_ERROR_BAD_DISPLAY;
}
- return it->second.validate_display(out_num_types, out_num_requests);
+ hwc2_error_t ret = it->second.validate_display(out_num_types,
+ out_num_requests);
+
+ ATRACE_END();
+
+ return ret;
}
hwc2_error_t hwc2_dev::get_changed_composition_types(hwc2_display_t dpy_id,
@@ -240,6 +250,8 @@ hwc2_error_t hwc2_dev::accept_display_changes(hwc2_display_t dpy_id)
hwc2_error_t hwc2_dev::present_display(hwc2_display_t dpy_id,
int32_t *out_present_fence)
{
+ ATRACE_BEGIN(__func__);
+
std::lock_guard<std::mutex> guard(state_mutex);
auto it = displays.find(dpy_id);
@@ -248,7 +260,11 @@ hwc2_error_t hwc2_dev::present_display(hwc2_display_t dpy_id,
return HWC2_ERROR_BAD_DISPLAY;
}
- return it->second.present_display(out_present_fence);
+ hwc2_error_t ret = it->second.present_display(out_present_fence);
+
+ ATRACE_END();
+
+ return ret;
}
hwc2_error_t hwc2_dev::get_release_fences(hwc2_display_t dpy_id,