summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarissa Wall <marissaw@google.com>2016-09-07 12:26:57 -0700
committerMarissa Wall <marissaw@google.com>2017-03-02 13:06:21 -0800
commit5c262a2fc8ec5151916f3e51796fd86dec44ac29 (patch)
tree1ca27cd3e85b18f352fc12a99017e15384328dc5
parent9031c5046d364cd4e7e50557289fc4645e1e3f00 (diff)
downloadflounder-o-preview.tar.gz
Add atrace on validate and present display. Test: Add "TARGET_USES_HWC2 := true" to BoardConfig.mk. Recompile. Run testcases: https://android-review.googlesource.com/#/q/project: platform/frameworks/native+branch:master+topic:test-hwc2 Change-Id: I6d7c3853eb73ab7638980824f9c7b6a4bca69d7f
-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,