i915_trace.h revision 1.3.28.1 1 1.3.28.1 pgoyette /* $NetBSD: i915_trace.h,v 1.3.28.1 2018/09/06 06:56:36 pgoyette Exp $ */
2 1.2 riastrad
3 1.2 riastrad /*-
4 1.2 riastrad * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 1.2 riastrad * All rights reserved.
6 1.2 riastrad *
7 1.2 riastrad * This code is derived from software contributed to The NetBSD Foundation
8 1.2 riastrad * by Taylor R. Campbell.
9 1.2 riastrad *
10 1.2 riastrad * Redistribution and use in source and binary forms, with or without
11 1.2 riastrad * modification, are permitted provided that the following conditions
12 1.2 riastrad * are met:
13 1.2 riastrad * 1. Redistributions of source code must retain the above copyright
14 1.2 riastrad * notice, this list of conditions and the following disclaimer.
15 1.2 riastrad * 2. Redistributions in binary form must reproduce the above copyright
16 1.2 riastrad * notice, this list of conditions and the following disclaimer in the
17 1.2 riastrad * documentation and/or other materials provided with the distribution.
18 1.2 riastrad *
19 1.2 riastrad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.2 riastrad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.2 riastrad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.2 riastrad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.2 riastrad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.2 riastrad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.2 riastrad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.2 riastrad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.2 riastrad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.2 riastrad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.2 riastrad * POSSIBILITY OF SUCH DAMAGE.
30 1.2 riastrad */
31 1.2 riastrad
32 1.2 riastrad #ifndef _I915_TRACE_H_
33 1.2 riastrad #define _I915_TRACE_H_
34 1.2 riastrad
35 1.2 riastrad #include <sys/types.h>
36 1.3.28.1 pgoyette #include <sys/sdt.h>
37 1.2 riastrad
38 1.2 riastrad #include "intel_drv.h"
39 1.2 riastrad
40 1.3.28.1 pgoyette /* Must come last. */
41 1.3.28.1 pgoyette #include <drm/drm_trace_netbsd.h>
42 1.3.28.1 pgoyette
43 1.3.28.1 pgoyette DEFINE_TRACE2(i915,, flip__request,
44 1.3.28.1 pgoyette "enum plane"/*plane*/, "struct drm_i915_gem_object *"/*obj*/);
45 1.3.28.1 pgoyette static inline void
46 1.3.28.1 pgoyette trace_i915_flip_request(enum plane plane, struct drm_i915_gem_object *obj)
47 1.3.28.1 pgoyette {
48 1.3.28.1 pgoyette TRACE2(i915,, flip__request, plane, obj);
49 1.3.28.1 pgoyette }
50 1.3.28.1 pgoyette
51 1.3.28.1 pgoyette DEFINE_TRACE2(i915,, flip__complete,
52 1.3.28.1 pgoyette "enum plane"/*plane*/, "struct drm_i915_gem_object *"/*obj*/);
53 1.3.28.1 pgoyette static inline void
54 1.3.28.1 pgoyette trace_i915_flip_complete(enum plane plane, struct drm_i915_gem_object *obj)
55 1.3.28.1 pgoyette {
56 1.3.28.1 pgoyette TRACE2(i915,, flip__complete, plane, obj);
57 1.3.28.1 pgoyette }
58 1.3.28.1 pgoyette
59 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, gem__evict,
60 1.3.28.1 pgoyette "int"/*devno*/,
61 1.3.28.1 pgoyette "int"/*min_size*/, "unsigned"/*alignment*/, "unsigned"/*flags*/);
62 1.3.28.1 pgoyette static inline void
63 1.3.28.1 pgoyette trace_i915_gem_evict(struct drm_device *dev, int min_size, unsigned alignment,
64 1.3.28.1 pgoyette unsigned flags)
65 1.3.28.1 pgoyette {
66 1.3.28.1 pgoyette TRACE4(i915,, gem__evict,
67 1.3.28.1 pgoyette dev->primary->index, min_size, alignment, flags);
68 1.3.28.1 pgoyette }
69 1.3.28.1 pgoyette
70 1.3.28.1 pgoyette DEFINE_TRACE2(i915,, gem__evict__vm,
71 1.3.28.1 pgoyette "int"/*devno*/, "struct i915_address_space *"/*vm*/);
72 1.3.28.1 pgoyette static inline void
73 1.3.28.1 pgoyette trace_i915_gem_evict_vm(struct i915_address_space *vm)
74 1.3.28.1 pgoyette {
75 1.3.28.1 pgoyette TRACE2(i915,, gem__evict__vm, vm->dev->primary->index, vm);
76 1.3.28.1 pgoyette }
77 1.3.28.1 pgoyette
78 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__object__change__domain,
79 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
80 1.3.28.1 pgoyette "uint32_t"/*read_domains*/,
81 1.3.28.1 pgoyette "uint32_t"/*write_domain*/);
82 1.3.28.1 pgoyette static inline void
83 1.3.28.1 pgoyette trace_i915_gem_object_change_domain(struct drm_i915_gem_object *obj,
84 1.3.28.1 pgoyette uint32_t old_read_domains, uint32_t old_write_domain)
85 1.3.28.1 pgoyette {
86 1.3.28.1 pgoyette TRACE3(i915,, gem__object__change__domain,
87 1.3.28.1 pgoyette obj,
88 1.3.28.1 pgoyette obj->base.read_domains | (old_read_domains << 16),
89 1.3.28.1 pgoyette obj->base.write_domain | (old_write_domain << 16));
90 1.3.28.1 pgoyette }
91 1.3.28.1 pgoyette
92 1.3.28.1 pgoyette DEFINE_TRACE1(i915,, gem__object__clflush,
93 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/);
94 1.3.28.1 pgoyette static inline void
95 1.3.28.1 pgoyette trace_i915_gem_object_clflush(struct drm_i915_gem_object *obj)
96 1.3.28.1 pgoyette {
97 1.3.28.1 pgoyette TRACE1(i915,, gem__object__clflush, obj);
98 1.3.28.1 pgoyette }
99 1.3.28.1 pgoyette
100 1.3.28.1 pgoyette DEFINE_TRACE2(i915,, gem__object__create,
101 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
102 1.3.28.1 pgoyette "size_t"/*size*/);
103 1.3.28.1 pgoyette static inline void
104 1.3.28.1 pgoyette trace_i915_gem_object_create(struct drm_i915_gem_object *obj)
105 1.3.28.1 pgoyette {
106 1.3.28.1 pgoyette TRACE2(i915,, gem__object__create, obj, obj->base.size);
107 1.3.28.1 pgoyette }
108 1.3.28.1 pgoyette
109 1.3.28.1 pgoyette DEFINE_TRACE1(i915,, gem__object__destroy,
110 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/);
111 1.2 riastrad static inline void
112 1.3.28.1 pgoyette trace_i915_gem_object_destroy(struct drm_i915_gem_object *obj)
113 1.2 riastrad {
114 1.3.28.1 pgoyette TRACE1(i915,, gem__object__destroy, obj);
115 1.2 riastrad }
116 1.2 riastrad
117 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, gem__object__fault,
118 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
119 1.3.28.1 pgoyette "pgoff_t"/*page_offset*/,
120 1.3.28.1 pgoyette "bool"/*gtt*/,
121 1.3.28.1 pgoyette "bool"/*write*/);
122 1.2 riastrad static inline void
123 1.3.28.1 pgoyette trace_i915_gem_object_fault(struct drm_i915_gem_object *obj,
124 1.3.28.1 pgoyette pgoff_t page_offset, bool gtt, bool write)
125 1.2 riastrad {
126 1.3.28.1 pgoyette TRACE4(i915,, gem__object__fault, obj, page_offset, gtt, write);
127 1.2 riastrad }
128 1.2 riastrad
129 1.3.28.1 pgoyette /* XXX Not sure about size/offset types here. */
130 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__object__pread,
131 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
132 1.3.28.1 pgoyette "off_t"/*offset*/,
133 1.3.28.1 pgoyette "size_t"/*size*/);
134 1.2 riastrad static inline void
135 1.3.28.1 pgoyette trace_i915_gem_object_pread(struct drm_i915_gem_object *obj, off_t offset,
136 1.3.28.1 pgoyette size_t size)
137 1.2 riastrad {
138 1.3.28.1 pgoyette TRACE3(i915,, gem__object__pread, obj, offset, size);
139 1.2 riastrad }
140 1.2 riastrad
141 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__object__write,
142 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
143 1.3.28.1 pgoyette "off_t"/*offset*/,
144 1.3.28.1 pgoyette "size_t"/*size*/);
145 1.2 riastrad static inline void
146 1.3.28.1 pgoyette trace_i915_gem_object_pwrite(struct drm_i915_gem_object *obj, off_t offset,
147 1.3.28.1 pgoyette size_t size)
148 1.2 riastrad {
149 1.3.28.1 pgoyette TRACE3(i915,, gem__object__write, obj, offset, size);
150 1.2 riastrad }
151 1.2 riastrad
152 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__request__add,
153 1.3.28.1 pgoyette "int"/*devno*/, "int"/*ringid*/, "uint32_t"/*seqno*/);
154 1.2 riastrad static inline void
155 1.3.28.1 pgoyette trace_i915_gem_request_add(struct drm_i915_gem_request *request)
156 1.3 riastrad {
157 1.3.28.1 pgoyette TRACE3(i915,, gem__request__add,
158 1.3.28.1 pgoyette request->ring->dev->primary->index,
159 1.3.28.1 pgoyette request->ring->id,
160 1.3.28.1 pgoyette request->seqno);
161 1.3 riastrad }
162 1.3 riastrad
163 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__request__retire,
164 1.3.28.1 pgoyette "int"/*devno*/, "int"/*ringid*/, "uint32_t"/*seqno*/);
165 1.3 riastrad static inline void
166 1.3.28.1 pgoyette trace_i915_gem_request_retire(struct drm_i915_gem_request *request)
167 1.2 riastrad {
168 1.3.28.1 pgoyette TRACE3(i915,, gem__request__retire,
169 1.3.28.1 pgoyette request->ring->dev->primary->index,
170 1.3.28.1 pgoyette request->ring->id,
171 1.3.28.1 pgoyette request->seqno);
172 1.2 riastrad }
173 1.2 riastrad
174 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__request__wait__begin,
175 1.3.28.1 pgoyette "int"/*devno*/, "int"/*ringid*/, "uint32_t"/*seqno*/);
176 1.2 riastrad static inline void
177 1.3.28.1 pgoyette trace_i915_gem_request_wait_begin(struct drm_i915_gem_request *request)
178 1.2 riastrad {
179 1.3.28.1 pgoyette TRACE3(i915,, gem__request__wait__begin,
180 1.3.28.1 pgoyette request->ring->dev->primary->index,
181 1.3.28.1 pgoyette request->ring->id,
182 1.3.28.1 pgoyette request->seqno);
183 1.2 riastrad }
184 1.2 riastrad
185 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__request__wait__end,
186 1.3.28.1 pgoyette "int"/*devno*/, "int"/*ringid*/, "uint32_t"/*seqno*/);
187 1.2 riastrad static inline void
188 1.3.28.1 pgoyette trace_i915_gem_request_wait_end(struct drm_i915_gem_request *request)
189 1.2 riastrad {
190 1.3.28.1 pgoyette TRACE3(i915,, gem__request__wait__end,
191 1.3.28.1 pgoyette request->ring->dev->primary->index,
192 1.3.28.1 pgoyette request->ring->id,
193 1.3.28.1 pgoyette request->seqno);
194 1.2 riastrad }
195 1.2 riastrad
196 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__request__notify,
197 1.3.28.1 pgoyette "int"/*devno*/, "int"/*ringid*/, "uint32_t"/*seqno*/);
198 1.2 riastrad static inline void
199 1.3.28.1 pgoyette trace_i915_gem_request_notify(struct intel_engine_cs *ring)
200 1.2 riastrad {
201 1.3.28.1 pgoyette TRACE3(i915,, gem__request__notify,
202 1.3.28.1 pgoyette ring->dev->primary->index, ring->id, ring->get_seqno(ring, false));
203 1.2 riastrad }
204 1.2 riastrad
205 1.3.28.1 pgoyette /* XXX Why no request in the trace upstream? */
206 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, gem__ring__dispatch,
207 1.3.28.1 pgoyette "int"/*devno*/, "int"/*ringid*/, "uint32_t"/*seqno*/, "uint32_t"/*flags*/);
208 1.2 riastrad static inline void
209 1.3.28.1 pgoyette trace_i915_gem_ring_dispatch(struct drm_i915_gem_request *request,
210 1.3.28.1 pgoyette uint32_t flags)
211 1.2 riastrad {
212 1.3.28.1 pgoyette TRACE4(i915,, gem__ring__dispatch,
213 1.3.28.1 pgoyette request->ring->dev->primary->index,
214 1.3.28.1 pgoyette request->ring->id,
215 1.3.28.1 pgoyette request->seqno,
216 1.3.28.1 pgoyette flags);
217 1.3.28.1 pgoyette /* XXX i915_trace_irq_get? Doesn't seem to be used. */
218 1.2 riastrad }
219 1.2 riastrad
220 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, gem__ring__flush,
221 1.3.28.1 pgoyette "int"/*devno*/,
222 1.3.28.1 pgoyette "int"/*ringid*/,
223 1.3.28.1 pgoyette "uint32_t"/*invalidate*/,
224 1.3.28.1 pgoyette "uint32_t"/*flags*/);
225 1.2 riastrad static inline void
226 1.3.28.1 pgoyette trace_i915_gem_ring_flush(struct drm_i915_gem_request *request,
227 1.3.28.1 pgoyette uint32_t invalidate, uint32_t flags)
228 1.2 riastrad {
229 1.3.28.1 pgoyette TRACE4(i915,, gem__ring__flush,
230 1.3.28.1 pgoyette request->ring->dev->primary->index,
231 1.3.28.1 pgoyette request->ring->id,
232 1.3.28.1 pgoyette invalidate,
233 1.3.28.1 pgoyette flags);
234 1.2 riastrad }
235 1.2 riastrad
236 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, gem__ring__sync__to,
237 1.3.28.1 pgoyette "int"/*devno*/,
238 1.3.28.1 pgoyette "int"/*from_ringid*/,
239 1.3.28.1 pgoyette "int"/*to_ringid*/,
240 1.3.28.1 pgoyette "uint32_t"/*seqno*/);
241 1.2 riastrad static inline void
242 1.3.28.1 pgoyette trace_i915_gem_ring_sync_to(struct drm_i915_gem_request *to_req,
243 1.3.28.1 pgoyette struct intel_engine_cs *from, struct drm_i915_gem_request *from_req)
244 1.2 riastrad {
245 1.3.28.1 pgoyette TRACE4(i915,, gem__ring__sync__to,
246 1.3.28.1 pgoyette from->dev->primary->index,
247 1.3.28.1 pgoyette from->id,
248 1.3.28.1 pgoyette to_req->ring->id,
249 1.3.28.1 pgoyette i915_gem_request_get_seqno(from_req));
250 1.2 riastrad }
251 1.2 riastrad
252 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, register__read,
253 1.3.28.1 pgoyette "uint32_t"/*reg*/, "uint64_t"/*value*/, "size_t"/*len*/);
254 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, register__write,
255 1.3.28.1 pgoyette "uint32_t"/*reg*/, "uint64_t"/*value*/, "size_t"/*len*/);
256 1.2 riastrad static inline void
257 1.3.28.1 pgoyette trace_i915_reg_rw(bool write, uint32_t reg, uint64_t value, size_t len,
258 1.3.28.1 pgoyette bool trace)
259 1.2 riastrad {
260 1.3.28.1 pgoyette if (!trace)
261 1.3.28.1 pgoyette return;
262 1.3.28.1 pgoyette if (write) {
263 1.3.28.1 pgoyette TRACE3(i915,, register__read, reg, value, len);
264 1.3.28.1 pgoyette } else {
265 1.3.28.1 pgoyette TRACE3(i915,, register__write, reg, value, len);
266 1.3.28.1 pgoyette }
267 1.2 riastrad }
268 1.2 riastrad
269 1.3.28.1 pgoyette DEFINE_TRACE5(i915,, vma__bind,
270 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
271 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
272 1.3.28.1 pgoyette "uint64_t"/*offset*/,
273 1.3.28.1 pgoyette "uint64_t"/*size*/,
274 1.3.28.1 pgoyette "uint64_t"/*flags*/);
275 1.2 riastrad static inline void
276 1.3.28.1 pgoyette trace_i915_vma_bind(struct i915_vma *vma, uint64_t flags)
277 1.2 riastrad {
278 1.3.28.1 pgoyette TRACE5(i915,, vma__bind,
279 1.3.28.1 pgoyette vma->obj, vma->vm, vma->node.start, vma->node.size, flags);
280 1.2 riastrad }
281 1.2 riastrad
282 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, vma__unbind,
283 1.3.28.1 pgoyette "struct drm_i915_gem_object *"/*obj*/,
284 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
285 1.3.28.1 pgoyette "uint64_t"/*offset*/,
286 1.3.28.1 pgoyette "uint64_t"/*size*/);
287 1.2 riastrad static inline void
288 1.3.28.1 pgoyette trace_i915_vma_unbind(struct i915_vma *vma)
289 1.2 riastrad {
290 1.3.28.1 pgoyette TRACE4(i915,, vma__unbind,
291 1.3.28.1 pgoyette vma->obj, vma->vm, vma->node.start, vma->node.size);
292 1.2 riastrad }
293 1.2 riastrad
294 1.3.28.1 pgoyette DEFINE_TRACE1(i915,, gpu__freq__change,
295 1.3.28.1 pgoyette "int"/*freq*/);
296 1.2 riastrad static inline void
297 1.3.28.1 pgoyette trace_intel_gpu_freq_change(int freq)
298 1.2 riastrad {
299 1.3.28.1 pgoyette TRACE1(i915,, gpu__freq__change, freq);
300 1.2 riastrad }
301 1.2 riastrad
302 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, context__create,
303 1.3.28.1 pgoyette "int"/*devno*/,
304 1.3.28.1 pgoyette "struct intel_context *"/*ctx*/,
305 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/);
306 1.2 riastrad static inline void
307 1.3.28.1 pgoyette trace_i915_context_create(struct intel_context *ctx)
308 1.2 riastrad {
309 1.3.28.1 pgoyette TRACE3(i915,, context__create,
310 1.3.28.1 pgoyette ctx->i915->dev->primary->index,
311 1.3.28.1 pgoyette ctx,
312 1.3.28.1 pgoyette (ctx->ppgtt ? &ctx->ppgtt->base : NULL));
313 1.2 riastrad }
314 1.2 riastrad
315 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, context__free,
316 1.3.28.1 pgoyette "int"/*devno*/,
317 1.3.28.1 pgoyette "struct intel_context *"/*ctx*/,
318 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/);
319 1.2 riastrad static inline void
320 1.3.28.1 pgoyette trace_i915_context_free(struct intel_context *ctx)
321 1.2 riastrad {
322 1.3.28.1 pgoyette TRACE3(i915,, context__free,
323 1.3.28.1 pgoyette ctx->i915->dev->primary->index,
324 1.3.28.1 pgoyette ctx,
325 1.3.28.1 pgoyette (ctx->ppgtt ? &ctx->ppgtt->base : NULL));
326 1.2 riastrad }
327 1.2 riastrad
328 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, page_directory_entry_alloc,
329 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
330 1.3.28.1 pgoyette "uint32_t"/*pdpe*/,
331 1.3.28.1 pgoyette "uint64_t"/*start*/,
332 1.3.28.1 pgoyette "uint64_t"/*pde_shift*/);
333 1.2 riastrad static inline void
334 1.3.28.1 pgoyette trace_i915_page_directory_entry_alloc(struct i915_address_space *vm,
335 1.3.28.1 pgoyette uint32_t pdpe, uint64_t start, uint64_t pde_shift)
336 1.2 riastrad {
337 1.3.28.1 pgoyette TRACE4(i915,, page_directory_entry_alloc, vm, pdpe, start, pde_shift);
338 1.2 riastrad }
339 1.2 riastrad
340 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, page_directory_pointer_entry_alloc,
341 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
342 1.3.28.1 pgoyette "uint32_t"/*pml4e*/,
343 1.3.28.1 pgoyette "uint64_t"/*start*/,
344 1.3.28.1 pgoyette "uint64_t"/*pde_shift*/);
345 1.2 riastrad static inline void
346 1.3.28.1 pgoyette trace_i915_page_directory_pointer_entry_alloc(struct i915_address_space *vm,
347 1.3.28.1 pgoyette uint32_t pml4e, uint64_t start, uint64_t pde_shift)
348 1.2 riastrad {
349 1.3.28.1 pgoyette TRACE4(i915,, page_directory_pointer_entry_alloc,
350 1.3.28.1 pgoyette vm, pml4e, start, pde_shift);
351 1.2 riastrad }
352 1.2 riastrad
353 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, page_table_entry_alloc,
354 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
355 1.3.28.1 pgoyette "uint32_t"/*pde*/,
356 1.3.28.1 pgoyette "uint64_t"/*start*/,
357 1.3.28.1 pgoyette "uint64_t"/*pde_shift*/);
358 1.2 riastrad static inline void
359 1.3.28.1 pgoyette trace_i915_page_table_entry_alloc(struct i915_address_space *vm, uint32_t pde,
360 1.3.28.1 pgoyette uint64_t start, uint64_t pde_shift)
361 1.2 riastrad {
362 1.3.28.1 pgoyette TRACE4(i915,, page_table_entry_alloc, vm, pde, start, pde_shift);
363 1.2 riastrad }
364 1.2 riastrad
365 1.3.28.1 pgoyette DEFINE_TRACE6(i915,, page_table_entry_map,
366 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
367 1.3.28.1 pgoyette "uint32_t"/*pde*/,
368 1.3.28.1 pgoyette "struct i915_page_table *"/*pt*/,
369 1.3.28.1 pgoyette "uint32_t"/*first*/,
370 1.3.28.1 pgoyette "uint32_t"/*count*/,
371 1.3.28.1 pgoyette "uint32_t"/*bits*/);
372 1.2 riastrad static inline void
373 1.3.28.1 pgoyette trace_i915_page_table_entry_map(struct i915_address_space *vm, uint32_t pde,
374 1.3.28.1 pgoyette struct i915_page_table *pt, uint32_t first, uint32_t count, uint32_t bits)
375 1.3 riastrad {
376 1.3.28.1 pgoyette TRACE6(i915,, page_table_entry_map, vm, pde, pt, first, count, bits);
377 1.3 riastrad }
378 1.3 riastrad
379 1.3.28.1 pgoyette DEFINE_TRACE2(i915,, ppgtt__create,
380 1.3.28.1 pgoyette "int"/*devno*/,
381 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/);
382 1.3.28.1 pgoyette static inline void
383 1.3.28.1 pgoyette trace_i915_ppgtt_create(struct i915_address_space *vm)
384 1.3.28.1 pgoyette {
385 1.3.28.1 pgoyette TRACE2(i915,, ppgtt__create, vm->dev->primary->index, vm);
386 1.3.28.1 pgoyette }
387 1.3.28.1 pgoyette
388 1.3.28.1 pgoyette DEFINE_TRACE2(i915,, ppgtt__release,
389 1.3.28.1 pgoyette "int"/*devno*/,
390 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/);
391 1.3.28.1 pgoyette static inline void
392 1.3.28.1 pgoyette trace_i915_ppgtt_release(struct i915_address_space *vm)
393 1.3.28.1 pgoyette {
394 1.3.28.1 pgoyette TRACE2(i915,, ppgtt__release, vm->dev->primary->index, vm);
395 1.3.28.1 pgoyette }
396 1.3.28.1 pgoyette
397 1.3.28.1 pgoyette #define VM_TO_TRACE_NAME(vm) (i915_is_ggtt(vm) ? "G" : "P")
398 1.3.28.1 pgoyette
399 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, va__alloc,
400 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/,
401 1.3.28.1 pgoyette "uint64_t"/*start*/,
402 1.3.28.1 pgoyette "uint64_t"/*end*/,
403 1.3.28.1 pgoyette "const char *"/*name*/);
404 1.3 riastrad static inline void
405 1.3.28.1 pgoyette trace_i915_va_alloc(struct i915_address_space *vm, uint64_t start,
406 1.3.28.1 pgoyette uint64_t length, const char *name)
407 1.2 riastrad {
408 1.3.28.1 pgoyette /* XXX Why start/end upstream? */
409 1.3.28.1 pgoyette TRACE4(i915,, va__alloc, vm, start, start + length - 1, name);
410 1.2 riastrad }
411 1.2 riastrad
412 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, gem__shrink,
413 1.3.28.1 pgoyette "int"/*devno*/,
414 1.3.28.1 pgoyette "unsigned long"/*target*/,
415 1.3.28.1 pgoyette "unsigned"/*flags*/);
416 1.2 riastrad static inline void
417 1.3.28.1 pgoyette trace_i915_gem_shrink(struct drm_i915_private *dev_priv, unsigned long target,
418 1.3.28.1 pgoyette unsigned flags)
419 1.2 riastrad {
420 1.3.28.1 pgoyette TRACE3(i915,, gem__shrink,
421 1.3.28.1 pgoyette dev_priv->dev->primary->index, target, flags);
422 1.2 riastrad }
423 1.2 riastrad
424 1.3.28.1 pgoyette DEFINE_TRACE5(i915,, pipe__update__start,
425 1.3.28.1 pgoyette "enum i915_pipe"/*pipe*/,
426 1.3.28.1 pgoyette "uint32_t"/*frame*/,
427 1.3.28.1 pgoyette "int"/*scanline*/,
428 1.3.28.1 pgoyette "uint32_t"/*min*/,
429 1.3.28.1 pgoyette "uint32_t"/*max*/);
430 1.2 riastrad static inline void
431 1.3.28.1 pgoyette trace_i915_pipe_update_start(struct intel_crtc *crtc)
432 1.2 riastrad {
433 1.3.28.1 pgoyette TRACE5(i915,, pipe__update__start,
434 1.3.28.1 pgoyette crtc->pipe,
435 1.3.28.1 pgoyette crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
436 1.3.28.1 pgoyette crtc->pipe),
437 1.3.28.1 pgoyette intel_get_crtc_scanline(crtc),
438 1.3.28.1 pgoyette crtc->debug.min_vbl,
439 1.3.28.1 pgoyette crtc->debug.max_vbl);
440 1.2 riastrad }
441 1.2 riastrad
442 1.3.28.1 pgoyette DEFINE_TRACE5(i915,, pipe__update__vblank__evaded,
443 1.3.28.1 pgoyette "enum i915_pipe"/*pipe*/,
444 1.3.28.1 pgoyette "uint32_t"/*frame*/,
445 1.3.28.1 pgoyette "int"/*scanline*/,
446 1.3.28.1 pgoyette "uint32_t"/*min*/,
447 1.3.28.1 pgoyette "uint32_t"/*max*/);
448 1.2 riastrad static inline void
449 1.3.28.1 pgoyette trace_i915_pipe_update_vblank_evaded(struct intel_crtc *crtc)
450 1.3 riastrad {
451 1.3.28.1 pgoyette TRACE5(i915,, pipe__update__vblank__evaded,
452 1.3.28.1 pgoyette crtc->pipe,
453 1.3.28.1 pgoyette crtc->debug.start_vbl_count,
454 1.3.28.1 pgoyette crtc->debug.scanline_start,
455 1.3.28.1 pgoyette crtc->debug.min_vbl,
456 1.3.28.1 pgoyette crtc->debug.max_vbl);
457 1.3 riastrad }
458 1.3 riastrad
459 1.3.28.1 pgoyette DEFINE_TRACE3(i915,, pipe__update__end,
460 1.3.28.1 pgoyette "enum i915_pipe"/*pipe*/,
461 1.3.28.1 pgoyette "uint32_t"/*frame*/,
462 1.3.28.1 pgoyette "int"/*scanline*/);
463 1.3 riastrad static inline void
464 1.3.28.1 pgoyette trace_i915_pipe_update_end(struct intel_crtc *crtc, uint32_t frame,
465 1.3.28.1 pgoyette int scanline)
466 1.3 riastrad {
467 1.3.28.1 pgoyette TRACE3(i915,, pipe__update__end, crtc->pipe, frame, scanline);
468 1.3 riastrad }
469 1.3 riastrad
470 1.3.28.1 pgoyette DEFINE_TRACE4(i915,, switch__mm,
471 1.3.28.1 pgoyette "int"/*devno*/,
472 1.3.28.1 pgoyette "int"/*ringid*/,
473 1.3.28.1 pgoyette "struct intel_context *"/*to*/,
474 1.3.28.1 pgoyette "struct i915_address_space *"/*vm*/);
475 1.3 riastrad static inline void
476 1.3.28.1 pgoyette trace_switch_mm(struct intel_engine_cs *ring, struct intel_context *to)
477 1.2 riastrad {
478 1.3.28.1 pgoyette TRACE4(i915,, switch__mm,
479 1.3.28.1 pgoyette ring->dev->primary->index,
480 1.3.28.1 pgoyette ring->id,
481 1.3.28.1 pgoyette to,
482 1.3.28.1 pgoyette to->ppgtt ? &to->ppgtt->base : NULL);
483 1.2 riastrad }
484 1.2 riastrad
485 1.2 riastrad #endif /* _I915_TRACE_H_ */
486