summaryrefstree
path: root/kernel/drivers/gpu/exynos/g2d/g2d_debug.h
blob: ef3a20c3d1523cada19ff172c8f2486ba4fe7ece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * linux/drivers/gpu/exynos/g2d/g2d_debug.h
 *
 * Copyright (C) 2017 Samsung Electronics Co., Ltd.
 *
 * Contact: Hyesoo Yu <hyesoo.yu@samsung.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */

#ifndef __EXYNOS_G2D_DEBUG_H_
#define __EXYNOS_G2D_DEBUG_H_

enum debug_level {
	DBG_NO,
	DBG_INFO,
	DBG_PERF,
	DBG_DEBUG,
};

extern unsigned int g2d_debug;

#define g2d_print(level, fmt, args...)					\
do {									\
	if (g2d_debug & (1 << level))						\
		pr_info(fmt, ##args);					\
} while (0)

#define g2d_info(fmt, args...)	g2d_print(DBG_INFO, fmt, ##args)
#define g2d_perf(fmt, args...)	g2d_print(DBG_PERF, fmt, ##args)

struct regs_info {
	int start;
	int size;
	const char *name;
};

enum g2d_stamp_id {
	G2D_STAMP_STATE_RUNTIME_PM,
	G2D_STAMP_STATE_TASK_RESOURCE,
	G2D_STAMP_STATE_BEGIN,
	G2D_STAMP_STATE_PUSH,
	G2D_STAMP_STATE_INT,
	G2D_STAMP_STATE_DONE,
	G2D_STAMP_STATE_TIMEOUT_FENCE,
	G2D_STAMP_STATE_TIMEOUT_HW,
	G2D_STAMP_STATE_ERR_INT,
	G2D_STAMP_STATE_MMUFAULT,
	G2D_STAMP_STATE_SHUTDOWN,
	G2D_STAMP_STATE_SUSPEND,
	G2D_STAMP_STATE_RESUME,
	G2D_STAMP_STATE_HWFCBUF,
	G2D_STAMP_STATE_PENDING,
	G2D_STAMP_STATE_FENCE,
	G2D_STAMP_STATE_PUSH_RESET,
	G2D_STAMP_STATE_NUM,
};

void g2d_init_debug(struct g2d_device *dev);
void g2d_destroy_debug(struct g2d_device *dev);
void g2d_stamp_task(struct g2d_task *task, u32 stampid, u64 val);
void g2d_dump_info(struct g2d_device *g2d_dev, struct g2d_task *task);
#endif /* __EXYNOS_G2D_HELPER_H_ */