diff options
author | HyunKyung Kim <hk310.kim@samsung.com> | 2019-08-12 15:27:36 +0900 |
---|---|---|
committer | HyunKyung Kim <hk310.kim@samsung.com> | 2019-09-18 19:34:02 +0900 |
commit | 6935a9b0ac01b978519d8d704dee3994440ff023 (patch) | |
tree | b221bd0957f7ca7d936d598394dfc7dbf44ecdf7 /libhwc2.1/ExynosHWCDebug.h | |
parent | ac1c0535583ce3eeb8f2b59431ebe510619c0416 (diff) |
Add initial source code
Change-Id: I285a55c44c9fd5d3a8abaa781ef9dc8d9d39f53a
Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com>
Diffstat (limited to 'libhwc2.1/ExynosHWCDebug.h')
-rw-r--r-- | libhwc2.1/ExynosHWCDebug.h | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/libhwc2.1/ExynosHWCDebug.h b/libhwc2.1/ExynosHWCDebug.h new file mode 100644 index 0000000..2e9c9fb --- /dev/null +++ b/libhwc2.1/ExynosHWCDebug.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef HWC_DEBUG_H +#define HWC_DEBUG_H + +#include <utils/String8.h> +#include "ExynosHWC.h" +#include "ExynosHWCHelper.h" + +enum { + eDebugDefault = 0x00000001, + eDebugWindowUpdate = 0x00000002, + eDebugWinConfig = 0x00000004, + eDebugSkipStaicLayer = 0x00000008, + eDebugOverlaySupported = 0x00000010, + eDebugResourceAssigning = 0x00000020, + eDebugFence = 0x00000040, + eDebugResourceManager = 0x00000080, + eDebugMPP = 0x00000100, + eDebugHWC = 0x00000200, + eDebugLayer = 0x00000400, + eDebugBuf = 0x00000800, + eDebugVirtualDisplay = 0x00001000, + eDebugCapacity = 0x00002000, + eDebugExternalDisplay = 0x00004000, + eDebugSkipResourceAssign= 0x00008000, + eDebugSkipValidate = 0x00010000, + eDebugDynamicRecomp = 0x00020000, +}; + +class ExynosDisplay; + +extern int hwcDebug; +extern int hwcFenceDebug[FENCE_IP_ALL]; + +inline bool hwcCheckDebugMessages(uint32_t type) +{ + return hwcDebug & type; +} + +inline int hwcCheckFenceDebug(ExynosDisplay *display, uint32_t fence_type, uint32_t ip_type, int fence) +{ + if ((hwcFenceDebug[ip_type] & (1 << fence_type)) && fence_valid(fence)) + return fence_close(fence, display, FENCE_TYPE_ALL, FENCE_IP_ALL); + else + return fence; +} + +int32_t saveErrorLog(const android::String8 &errString, ExynosDisplay *display = NULL); +int32_t saveFenceTrace(ExynosDisplay *display); + +#if defined(DISABLE_HWC_DEBUG) +#define HDEBUGLOGD(...) +#define HDEBUGLOGV(type,...) \ + ALOGV(__VA_ARGS__); +#define HDEBUGLOGE(type,...) \ + ALOGE(__VA_ARGS__); +#else +#define HDEBUGLOGD(type, ...) \ + {\ + if (hwcCheckDebugMessages(type)) \ + ALOGD(__VA_ARGS__); \ + } +#define HDEBUGLOGV(type, ...) \ + ALOGV(__VA_ARGS__); +#define HDEBUGLOGE(type, ...) \ + ALOGE(__VA_ARGS__); +#endif + +#if defined(DISABLE_HWC_DEBUG) +#define DISPLAY_LOGD(...) +#define MPP_LOGD(...) +#else +#define DISPLAY_LOGD(type, msg, ...) \ + {\ + if (hwcCheckDebugMessages(type)) \ + ALOGD("%s:: [%s] " msg, __func__, mDisplayName.string(), ##__VA_ARGS__); \ + } +#define MPP_LOGD(type, msg, ...) \ + {\ + if (hwcCheckDebugMessages(type)) \ + ALOGD("%s:: [%s][%d] " msg, __func__, mName.string(), mLogicalIndex, ##__VA_ARGS__); \ + } +#endif +#define DISPLAY_LOGV(msg, ...) ALOGV("[%s] " msg, mDisplayName.string(), ##__VA_ARGS__) +#define DISPLAY_LOGI(msg, ...) ALOGI("[%s] " msg, mDisplayName.string(), ##__VA_ARGS__) +#define DISPLAY_LOGW(msg, ...) ALOGW("[%s] " msg, mDisplayName.string(), ##__VA_ARGS__) +#define DISPLAY_LOGE(msg, ...) \ + {\ + ALOGE("[%s] " msg, mDisplayName.string(), ##__VA_ARGS__); \ + String8 saveString; \ + saveString.appendFormat(msg, ##__VA_ARGS__); \ + saveErrorLog(saveString, this); \ + } + +#define MPP_LOGV(msg, ...) ALOGV("[%s][%d] " msg, mName.string(), mLogicalIndex, ##__VA_ARGS__) +#define MPP_LOGI(msg, ...) ALOGI("[%s][%d] " msg, mName.string(), mLogicalIndex, ##__VA_ARGS__) +#define MPP_LOGW(msg, ...) ALOGW("[%s][%d] " msg, mName.string(), mLogicalIndex, ##__VA_ARGS__) +#define MPP_LOGE(msg, ...) \ + {\ + ALOGE("[%s][%d] " msg, mName.string(), mLogicalIndex, ##__VA_ARGS__); \ + String8 saveString; \ + saveString.appendFormat(msg, ##__VA_ARGS__); \ + saveErrorLog(saveString, mAssignedDisplay); \ + } + +#define HWC_LOGE(display, msg, ...) \ + {\ + ALOGE(msg, ##__VA_ARGS__); \ + String8 saveString; \ + saveString.appendFormat(msg, ##__VA_ARGS__); \ + saveErrorLog(saveString, display); \ + } + +#endif |