2024-04-28 06:49:01 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 MediaTek Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MTK_DRM_TRACE__
|
|
|
|
#define __MTK_DRM_TRACE__
|
|
|
|
|
|
|
|
#include "mtk_drm_ddp_comp.h"
|
|
|
|
|
|
|
|
#define DRM_TRACE_ID 0xFFFF0000
|
|
|
|
#define DRM_TRACE_FPS_ID (DRM_TRACE_ID + 1)
|
|
|
|
#define DRM_TRACE_FENCE_ID (DRM_TRACE_ID + 2)
|
|
|
|
#define DRM_TRACE_VSYNC_ID (DRM_TRACE_ID + 3)
|
|
|
|
|
|
|
|
enum TRACE_PATTERN {
|
|
|
|
TRACE_OFF = 0,
|
|
|
|
TRACE_ON,
|
|
|
|
TRACE_MARK
|
|
|
|
};
|
|
|
|
|
|
|
|
extern int hwc_pid;
|
|
|
|
|
|
|
|
/* MTK_DRM FTRACE */
|
|
|
|
extern bool g_trace_log;
|
|
|
|
#define mtk_drm_trace_begin(fmt, args...) do { \
|
|
|
|
if (g_trace_log) { \
|
2024-04-28 06:51:13 -07:00
|
|
|
mtk_drm_print_trace( \
|
2024-04-28 06:49:01 -07:00
|
|
|
"B|%d|"fmt"\n", current->tgid, ##args); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define mtk_drm_trace_end() do { \
|
|
|
|
if (g_trace_log) { \
|
2024-04-28 06:51:13 -07:00
|
|
|
mtk_drm_print_trace("E\n"); \
|
2024-04-28 06:49:01 -07:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define mtk_drm_trace_async_begin(fmt, args...) do { \
|
2024-04-28 06:51:13 -07:00
|
|
|
if (g_trace_log) { \
|
|
|
|
mtk_drm_print_trace( \
|
|
|
|
"S|%d|"fmt"\n", current->tgid, ##args); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2024-04-28 06:49:01 -07:00
|
|
|
|
|
|
|
#define mtk_drm_trace_async_end(fmt, args...) do { \
|
2024-04-28 06:51:13 -07:00
|
|
|
if (g_trace_log) { \
|
|
|
|
mtk_drm_print_trace( \
|
|
|
|
"F|%d|"fmt"\n", current->tgid, ##args); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2024-04-28 06:49:01 -07:00
|
|
|
|
|
|
|
#define mtk_drm_trace_c(fmt, args...) do { \
|
|
|
|
if (g_trace_log) { \
|
2024-04-28 06:51:13 -07:00
|
|
|
mtk_drm_print_trace( \
|
2024-04-28 06:49:01 -07:00
|
|
|
"C|"fmt"\n", ##args); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2024-04-28 06:51:13 -07:00
|
|
|
#define mtk_drm_trace_default(fmt, args...) mtk_drm_print_trace("C|"fmt"\n", ##args)
|
2024-04-28 06:49:01 -07:00
|
|
|
|
2024-04-28 06:51:13 -07:00
|
|
|
void mtk_drm_print_trace(char *fmt, ...);
|
2024-04-28 06:49:01 -07:00
|
|
|
void drm_trace_tag_start(const char *tag);
|
|
|
|
void drm_trace_tag_end(const char *tag);
|
|
|
|
void drm_trace_tag_mark(const char *tag);
|
|
|
|
void mtk_drm_refresh_tag_start(struct mtk_ddp_comp *ddp_comp);
|
|
|
|
void mtk_drm_refresh_tag_end(struct mtk_ddp_comp *ddp_comp);
|
|
|
|
void mtk_drm_default_tag(struct mtk_ddp_comp *ddp_comp, const char *tag, enum TRACE_PATTERN pat);
|
|
|
|
void MMPathTraceDRM(struct mtk_ddp_comp *ddp_comp);
|
|
|
|
int MMPathTraceRDMA(struct mtk_ddp_comp *ddp_comp, char *str,
|
|
|
|
unsigned int strlen, unsigned int n);
|
|
|
|
int MMPathTraceWDMA(struct mtk_ddp_comp *ddp_comp, char *str,
|
|
|
|
unsigned int strlen, unsigned int n);
|
|
|
|
int MMPathTraceCrtcPlanes(struct drm_crtc *crtc,
|
|
|
|
char *str, int strlen, int n);
|
|
|
|
#endif
|