aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0056-drm-amd-display-Added-timing-sync-trace.patch
blob: 5b0387e8025fd52a7b2956ea63a4dad8d121534d (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
From 8621808029f8a9d604aaabc934e4dc25847381b4 Mon Sep 17 00:00:00 2001
From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Thu, 8 Dec 2016 09:47:11 -0500
Subject: [PATCH 0056/4131] drm/amd/display: Added timing sync trace.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  4 ++-
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c     | 32 ++++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h                |  1 +
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  1 -
 .../gpu/drm/amd/display/include/logger_interface.h |  5 ++++
 5 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 8e1d695..de99d71 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1488,8 +1488,10 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 				core_dc->hwss.prepare_pipe_for_context(
 						core_dc, pipe_ctx, context);
 		}
-		if (apply_ctx)
+		if (apply_ctx) {
 			core_dc->hwss.apply_ctx_for_surface(core_dc, surface, context);
+			context_timing_trace(dc, &context->res_ctx);
+		}
 	}
 
 	for (i = context->res_ctx.pool->pipe_count - 1; i >= 0; i--) {
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c b/drivers/gpu/drm/amd/display/dc/core/dc_debug.c
index 8ca0f1e..78b8e0c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_debug.c
@@ -22,6 +22,13 @@
 					##__VA_ARGS__); \
 } while (0)
 
+#define TIMING_TRACE(...) do {\
+	if (dc->debug.timing_trace) \
+		dm_logger_write(logger, \
+				LOG_SYNC, \
+				##__VA_ARGS__); \
+} while (0)
+
 void pre_surface_trace(
 		const struct dc *dc,
 		const struct dc_surface *const *surfaces,
@@ -268,3 +275,28 @@ void post_surface_trace(const struct dc *dc)
 	SURFACE_TRACE("post surface process.\n");
 
 }
+
+void context_timing_trace(
+		const struct dc *dc,
+		struct resource_context *res_ctx)
+{
+	int i;
+	struct core_dc *core_dc = DC_TO_CORE(dc);
+	struct dal_logger *logger =  core_dc->ctx->logger;
+
+	for (i = 0; i < core_dc->res_pool->pipe_count; i++) {
+		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
+		int h_pos = 0;
+		int v_pos = 0;
+
+		if (pipe_ctx->stream == NULL)
+			continue;
+
+		pipe_ctx->tg->funcs->get_position(pipe_ctx->tg, &h_pos, &v_pos);
+		TIMING_TRACE("Pipe_%d   H_tot:%d  V_tot:%d   H_pos:%d  V_pos:%d\n",
+				pipe_ctx->pipe_idx,
+				pipe_ctx->stream->public.timing.h_total,
+				pipe_ctx->stream->public.timing.v_total,
+				h_pos, v_pos);
+	}
+}
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 5f60800..454485b 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -140,6 +140,7 @@ struct dc_debug {
 	bool max_disp_clk;
 	bool target_trace;
 	bool surface_trace;
+	bool timing_trace;
 	bool validation_trace;
 	bool disable_stutter;
 	bool disable_dcc;
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 6ad23f3..99937fa 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -1892,7 +1892,6 @@ static void dce110_apply_ctx_for_surface(
 		program_blender(dc, pipe_ctx);
 
 	}
-
 }
 
 static void dce110_power_down_fe(struct core_dc *dc, struct pipe_ctx *pipe)
diff --git a/drivers/gpu/drm/amd/display/include/logger_interface.h b/drivers/gpu/drm/amd/display/include/logger_interface.h
index b58d30d..08a6911 100644
--- a/drivers/gpu/drm/amd/display/include/logger_interface.h
+++ b/drivers/gpu/drm/amd/display/include/logger_interface.h
@@ -31,6 +31,7 @@
 struct dc_context;
 struct dc_link;
 struct dc_surface_update;
+struct resource_context;
 
 /*
  *
@@ -85,6 +86,10 @@ void update_surface_trace(
 
 void post_surface_trace(const struct dc *dc);
 
+void context_timing_trace(
+		const struct dc *dc,
+		struct resource_context *res_ctx);
+
 
 /* Any function which is empty or have incomplete implementation should be
  * marked by this macro.
-- 
2.7.4