Home | History | Annotate | Line # | Download | only in include
i915_trace.h revision 1.17
      1  1.17  riastrad /*	$NetBSD: i915_trace.h,v 1.17 2021/12/19 11:13:06 riastradh Exp $	*/
      2   1.2  riastrad 
      3   1.2  riastrad /*-
      4  1.15  riastrad  * Copyright (c) 2013, 2018 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.13  riastrad #include <sys/sdt.h>
     37   1.2  riastrad 
     38  1.15  riastrad #include "i915_request.h"
     39  1.16  riastrad #include "i915_drv.h"
     40   1.2  riastrad 
     41  1.13  riastrad /* Must come last.  */
     42  1.13  riastrad #include <drm/drm_trace_netbsd.h>
     43  1.11  riastrad 
     44  1.15  riastrad DEFINE_TRACE3(i915,, cpu__fifo__underrun,
     45  1.17  riastrad     "enum pipe_drmhack"/*pipe*/,
     46  1.15  riastrad     "uint32_t"/*frame*/,
     47  1.15  riastrad     "uint32_t"/*scanline*/);
     48  1.11  riastrad static inline void
     49  1.15  riastrad trace_intel_cpu_fifo_underrun(struct drm_i915_private *dev_priv,
     50  1.17  riastrad     enum pipe pipe)
     51   1.2  riastrad {
     52  1.15  riastrad 	TRACE3(i915,, cpu__fifo__underrun,
     53  1.15  riastrad 	    pipe,
     54  1.15  riastrad 	    dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe),
     55  1.15  riastrad 	    intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe)));
     56   1.2  riastrad }
     57   1.2  riastrad 
     58  1.15  riastrad DEFINE_TRACE3(i915,, pch__fifo__underrun,
     59  1.17  riastrad     "enum pipe_drmhack"/*pipe*/,
     60  1.15  riastrad     "uint32_t"/*frame*/,
     61  1.15  riastrad     "uint32_t"/*scanline*/);
     62   1.2  riastrad static inline void
     63  1.15  riastrad trace_intel_pch_fifo_underrun(struct drm_i915_private *dev_priv,
     64  1.17  riastrad     enum pipe pipe)
     65   1.2  riastrad {
     66  1.15  riastrad 	TRACE3(i915,, pch__fifo__underrun,
     67  1.15  riastrad 	    pipe,
     68  1.15  riastrad 	    dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe),
     69  1.15  riastrad 	    intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe)));
     70   1.2  riastrad }
     71   1.2  riastrad 
     72  1.15  riastrad DEFINE_TRACE5(i915,, gem__evict,
     73  1.13  riastrad     "int"/*devno*/,
     74  1.15  riastrad     "struct i915_address_space *"/*vm*/,
     75  1.15  riastrad     "uint64_t"/*size*/,
     76  1.15  riastrad     "uint64_t"/*align*/,
     77  1.15  riastrad     "unsigned"/*flags*/);
     78   1.2  riastrad static inline void
     79  1.15  riastrad trace_i915_gem_evict(struct i915_address_space *vm,
     80  1.15  riastrad     uint64_t size, uint64_t align, unsigned flags)
     81   1.3  riastrad {
     82  1.15  riastrad 	TRACE5(i915,, gem__evict,
     83  1.15  riastrad 	    vm->i915->drm.primary->index, vm, size, align, flags);
     84   1.3  riastrad }
     85   1.3  riastrad 
     86  1.15  riastrad DEFINE_TRACE6(i915,, gem__evict__node,
     87  1.15  riastrad     "int"/*devno*/,
     88  1.15  riastrad     "struct i915_address_space *"/*vm*/,
     89  1.15  riastrad     "uint64_t"/*start*/,
     90  1.15  riastrad     "uint64_t"/*size*/,
     91  1.15  riastrad     "unsigned long"/*color*/,
     92  1.15  riastrad     "unsigned"/*flags*/);
     93   1.3  riastrad static inline void
     94  1.15  riastrad trace_i915_gem_evict_node(struct i915_address_space *vm,
     95  1.15  riastrad     struct drm_mm_node *node, unsigned flags)
     96   1.2  riastrad {
     97  1.15  riastrad 	TRACE6(i915,, gem__evict__node,
     98  1.15  riastrad 	    vm->i915->drm.primary->index, vm,
     99  1.15  riastrad 	    node->start, node->size, node->color,
    100  1.15  riastrad 	    flags);
    101   1.2  riastrad }
    102   1.2  riastrad 
    103  1.15  riastrad DEFINE_TRACE2(i915,, gem__evict__vm,
    104  1.15  riastrad     "int"/*devno*/,
    105  1.15  riastrad     "struct i915_address_space *"/*vm*/);
    106   1.2  riastrad static inline void
    107  1.15  riastrad trace_i915_gem_evict_vm(struct i915_address_space *vm)
    108   1.2  riastrad {
    109  1.15  riastrad 	TRACE2(i915,, gem__evict__vm,  vm->i915->drm.primary->index, vm);
    110   1.2  riastrad }
    111   1.2  riastrad 
    112  1.13  riastrad DEFINE_TRACE1(i915,, gem__object__clflush,
    113  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/);
    114   1.2  riastrad static inline void
    115  1.13  riastrad trace_i915_gem_object_clflush(struct drm_i915_gem_object *obj)
    116   1.2  riastrad {
    117  1.13  riastrad 	TRACE1(i915,, gem__object__clflush,  obj);
    118   1.2  riastrad }
    119   1.2  riastrad 
    120  1.13  riastrad DEFINE_TRACE2(i915,, gem__object__create,
    121  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/,
    122  1.13  riastrad     "size_t"/*size*/);
    123   1.2  riastrad static inline void
    124  1.13  riastrad trace_i915_gem_object_create(struct drm_i915_gem_object *obj)
    125   1.2  riastrad {
    126  1.13  riastrad 	TRACE2(i915,, gem__object__create,  obj, obj->base.size);
    127   1.2  riastrad }
    128   1.2  riastrad 
    129  1.13  riastrad DEFINE_TRACE1(i915,, gem__object__destroy,
    130  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/);
    131   1.2  riastrad static inline void
    132  1.13  riastrad trace_i915_gem_object_destroy(struct drm_i915_gem_object *obj)
    133   1.2  riastrad {
    134  1.13  riastrad 	TRACE1(i915,, gem__object__destroy,  obj);
    135   1.2  riastrad }
    136   1.2  riastrad 
    137  1.13  riastrad DEFINE_TRACE4(i915,, gem__object__fault,
    138  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/,
    139  1.13  riastrad     "pgoff_t"/*page_offset*/,
    140  1.13  riastrad     "bool"/*gtt*/,
    141  1.13  riastrad     "bool"/*write*/);
    142   1.2  riastrad static inline void
    143  1.13  riastrad trace_i915_gem_object_fault(struct drm_i915_gem_object *obj,
    144  1.13  riastrad     pgoff_t page_offset, bool gtt, bool write)
    145   1.2  riastrad {
    146  1.13  riastrad 	TRACE4(i915,, gem__object__fault,  obj, page_offset, gtt, write);
    147   1.2  riastrad }
    148   1.2  riastrad 
    149  1.13  riastrad /* XXX Not sure about size/offset types here.  */
    150  1.13  riastrad DEFINE_TRACE3(i915,, gem__object__pread,
    151  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/,
    152  1.13  riastrad     "off_t"/*offset*/,
    153  1.13  riastrad     "size_t"/*size*/);
    154   1.2  riastrad static inline void
    155  1.13  riastrad trace_i915_gem_object_pread(struct drm_i915_gem_object *obj, off_t offset,
    156  1.13  riastrad     size_t size)
    157   1.2  riastrad {
    158  1.13  riastrad 	TRACE3(i915,, gem__object__pread,  obj, offset, size);
    159   1.2  riastrad }
    160   1.2  riastrad 
    161  1.13  riastrad DEFINE_TRACE3(i915,, gem__object__write,
    162  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/,
    163  1.13  riastrad     "off_t"/*offset*/,
    164  1.13  riastrad     "size_t"/*size*/);
    165   1.2  riastrad static inline void
    166  1.13  riastrad trace_i915_gem_object_pwrite(struct drm_i915_gem_object *obj, off_t offset,
    167  1.13  riastrad     size_t size)
    168   1.2  riastrad {
    169  1.13  riastrad 	TRACE3(i915,, gem__object__write,  obj, offset, size);
    170   1.2  riastrad }
    171   1.2  riastrad 
    172  1.15  riastrad #define	I915_DEFINE_TRACE_REQ(M, F, N)					      \
    173  1.15  riastrad 	DEFINE_TRACE7(M, F, N,						      \
    174  1.15  riastrad 	    "int"/*devno*/,						      \
    175  1.15  riastrad 	    "unsigned"/*hw_id*/,					      \
    176  1.15  riastrad 	    "uint8_t"/*uabi_class*/,					      \
    177  1.15  riastrad 	    "uint8_t"/*instance*/,					      \
    178  1.15  riastrad 	    "unsigned"/*context*/,					      \
    179  1.15  riastrad 	    "unsigned"/*seqno*/,					      \
    180  1.15  riastrad 	    "unsigned"/*global*/)
    181  1.15  riastrad 
    182  1.15  riastrad #define	I915_TRACE_REQ(M, F, N, R)					      \
    183  1.15  riastrad 	TRACE7(M, F, N,							      \
    184  1.15  riastrad 	    (R)->i915->drm.primary->index,				      \
    185  1.15  riastrad 	    (R)->gem_context->hw_id,					      \
    186  1.15  riastrad 	    (R)->engine->uabi_class,					      \
    187  1.15  riastrad 	    (R)->engine->instance,					      \
    188  1.15  riastrad 	    (R)->fence.context,						      \
    189  1.15  riastrad 	    (R)->fence.seqno,						      \
    190  1.15  riastrad 	    (R)->global_seqno)
    191  1.15  riastrad 
    192  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__queue);
    193  1.15  riastrad static inline void
    194  1.15  riastrad trace_i915_request_queue(struct i915_request *request, uint32_t flags)
    195  1.15  riastrad {
    196  1.15  riastrad 	__USE(flags);		/* XXX too many trace operands */
    197  1.15  riastrad 	I915_TRACE_REQ(i915,, request__queue,  request);
    198  1.15  riastrad }
    199  1.15  riastrad 
    200  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__add);
    201  1.15  riastrad static inline void
    202  1.15  riastrad trace_i915_request_add(struct i915_request *request)
    203  1.15  riastrad {
    204  1.15  riastrad 	I915_TRACE_REQ(i915,, request__add,  request);
    205  1.15  riastrad }
    206  1.15  riastrad 
    207  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__submit);
    208  1.15  riastrad static inline void
    209  1.15  riastrad trace_i915_request_submit(struct i915_request *request)
    210  1.15  riastrad {
    211  1.15  riastrad 	I915_TRACE_REQ(i915,, request__submit,  request);
    212  1.15  riastrad }
    213  1.15  riastrad 
    214  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__execute);
    215   1.2  riastrad static inline void
    216  1.15  riastrad trace_i915_request_execute(struct i915_request *request)
    217   1.2  riastrad {
    218  1.15  riastrad 	I915_TRACE_REQ(i915,, request__execute,  request);
    219   1.2  riastrad }
    220   1.2  riastrad 
    221  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__in);
    222   1.2  riastrad static inline void
    223  1.15  riastrad trace_i915_request_in(struct i915_request *request, unsigned port)
    224   1.2  riastrad {
    225  1.15  riastrad 	__USE(port);		/* XXX too many trace operands */
    226  1.15  riastrad 	I915_TRACE_REQ(i915,, request__in,  request);
    227   1.2  riastrad }
    228   1.2  riastrad 
    229  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__out);
    230   1.2  riastrad static inline void
    231  1.15  riastrad trace_i915_request_out(struct i915_request *request)
    232   1.2  riastrad {
    233  1.15  riastrad 	/* XXX i915_request_completed(request) */
    234  1.15  riastrad 	I915_TRACE_REQ(i915,, request__out,  request);
    235   1.2  riastrad }
    236   1.2  riastrad 
    237  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__retire);
    238   1.2  riastrad static inline void
    239  1.15  riastrad trace_i915_request_retire(struct i915_request *request)
    240   1.2  riastrad {
    241  1.15  riastrad 	I915_TRACE_REQ(i915,, request__retire, request);
    242   1.2  riastrad }
    243   1.2  riastrad 
    244  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__wait__begin);
    245   1.2  riastrad static inline void
    246  1.15  riastrad trace_i915_request_wait_begin(struct i915_request *request)
    247   1.8  riastrad {
    248  1.15  riastrad 	I915_TRACE_REQ(i915,, request__wait__begin, request);
    249   1.8  riastrad }
    250   1.8  riastrad 
    251  1.15  riastrad I915_DEFINE_TRACE_REQ(i915,, request__wait__end);
    252   1.8  riastrad static inline void
    253  1.15  riastrad trace_i915_request_wait_end(struct i915_request *request)
    254   1.2  riastrad {
    255  1.15  riastrad 	I915_TRACE_REQ(i915,, request__wait__end, request);
    256   1.2  riastrad }
    257   1.2  riastrad 
    258  1.15  riastrad DEFINE_TRACE5(i915,, engine__notify,
    259  1.13  riastrad     "int"/*devno*/,
    260  1.15  riastrad     "uint8_t"/*uabi_class*/,
    261  1.15  riastrad     "uint8_t"/*instance*/,
    262  1.15  riastrad     "unsigned"/*seqno*/,
    263  1.15  riastrad     "bool"/*waiters*/);
    264  1.15  riastrad static inline void
    265  1.15  riastrad trace_intel_engine_notify(struct intel_engine_cs *engine, bool waiters)
    266  1.15  riastrad {
    267  1.15  riastrad 	TRACE5(i915,, engine__notify,
    268  1.15  riastrad 	    engine->i915->drm.primary->index,
    269  1.15  riastrad 	    engine->uabi_class,
    270  1.15  riastrad 	    engine->instance,
    271  1.15  riastrad 	    intel_engine_get_seqno(engine),
    272  1.15  riastrad 	    waiters);
    273   1.2  riastrad }
    274   1.2  riastrad 
    275  1.15  riastrad DEFINE_TRACE6(i915,, gem__ring__sync__to,
    276  1.13  riastrad     "int"/*devno*/,
    277  1.15  riastrad     "uint8_t"/*from_class*/,
    278  1.15  riastrad     "uint8_t"/*from_instance*/,
    279  1.15  riastrad     "uint8_t"/*to_class*/,
    280  1.15  riastrad     "uint8_t"/*to_instance*/,
    281  1.15  riastrad     "unsigned"/*seqno*/);
    282  1.15  riastrad static inline void
    283  1.15  riastrad trace_i915_gem_ring_sync_to(struct i915_request *to, struct i915_request *from)
    284  1.15  riastrad {
    285  1.15  riastrad 	TRACE6(i915,, gem__ring__sync__to,
    286  1.15  riastrad 	    from->i915->drm.primary->index,
    287  1.15  riastrad 	    from->engine->uabi_class,
    288  1.15  riastrad 	    from->engine->instance,
    289  1.15  riastrad 	    to->engine->uabi_class,
    290  1.15  riastrad 	    to->engine->instance,
    291  1.15  riastrad 	    from->global_seqno);
    292   1.3  riastrad }
    293   1.3  riastrad 
    294  1.13  riastrad DEFINE_TRACE3(i915,, register__read,
    295  1.13  riastrad     "uint32_t"/*reg*/, "uint64_t"/*value*/, "size_t"/*len*/);
    296  1.13  riastrad DEFINE_TRACE3(i915,, register__write,
    297  1.13  riastrad     "uint32_t"/*reg*/, "uint64_t"/*value*/, "size_t"/*len*/);
    298   1.3  riastrad static inline void
    299  1.15  riastrad trace_i915_reg_rw(bool write, i915_reg_t reg, uint64_t value, size_t len,
    300  1.13  riastrad     bool trace)
    301   1.2  riastrad {
    302  1.15  riastrad 	uint32_t regoff = i915_mmio_reg_offset(reg);
    303  1.15  riastrad 
    304  1.13  riastrad 	if (!trace)
    305  1.13  riastrad 		return;
    306  1.14  riastrad 	if (write) {
    307  1.15  riastrad 		TRACE3(i915,, register__read,  regoff, value, len);
    308  1.14  riastrad 	} else {
    309  1.15  riastrad 		TRACE3(i915,, register__write,  regoff, value, len);
    310  1.14  riastrad 	}
    311   1.2  riastrad }
    312   1.2  riastrad 
    313  1.13  riastrad DEFINE_TRACE5(i915,, vma__bind,
    314  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/,
    315  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    316  1.13  riastrad     "uint64_t"/*offset*/,
    317  1.13  riastrad     "uint64_t"/*size*/,
    318  1.13  riastrad     "uint64_t"/*flags*/);
    319   1.2  riastrad static inline void
    320  1.13  riastrad trace_i915_vma_bind(struct i915_vma *vma, uint64_t flags)
    321   1.3  riastrad {
    322  1.13  riastrad 	TRACE5(i915,, vma__bind,
    323  1.13  riastrad 	    vma->obj, vma->vm, vma->node.start, vma->node.size, flags);
    324   1.3  riastrad }
    325   1.3  riastrad 
    326  1.13  riastrad DEFINE_TRACE4(i915,, vma__unbind,
    327  1.13  riastrad     "struct drm_i915_gem_object *"/*obj*/,
    328  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    329  1.13  riastrad     "uint64_t"/*offset*/,
    330  1.13  riastrad     "uint64_t"/*size*/);
    331   1.3  riastrad static inline void
    332  1.13  riastrad trace_i915_vma_unbind(struct i915_vma *vma)
    333   1.3  riastrad {
    334  1.13  riastrad 	TRACE4(i915,, vma__unbind,
    335  1.13  riastrad 	    vma->obj, vma->vm, vma->node.start, vma->node.size);
    336   1.3  riastrad }
    337   1.3  riastrad 
    338  1.13  riastrad DEFINE_TRACE1(i915,, gpu__freq__change,
    339  1.13  riastrad     "int"/*freq*/);
    340   1.3  riastrad static inline void
    341  1.13  riastrad trace_intel_gpu_freq_change(int freq)
    342   1.2  riastrad {
    343  1.13  riastrad 	TRACE1(i915,, gpu__freq__change,  freq);
    344   1.2  riastrad }
    345   1.2  riastrad 
    346  1.15  riastrad DEFINE_TRACE4(i915,, context__create,
    347  1.13  riastrad     "int"/*devno*/,
    348  1.15  riastrad     "struct i915_gem_context *"/*ctx*/,
    349  1.15  riastrad     "unsigned"/*hw_id*/,
    350  1.13  riastrad     "struct i915_address_space *"/*vm*/);
    351   1.6  riastrad static inline void
    352  1.15  riastrad trace_i915_context_create(struct i915_gem_context *ctx)
    353   1.6  riastrad {
    354  1.15  riastrad 	TRACE4(i915,, context__create,
    355  1.15  riastrad 	    ctx->i915->drm.primary->index,
    356  1.13  riastrad 	    ctx,
    357  1.15  riastrad 	    ctx->hw_id,
    358  1.15  riastrad 	    (ctx->ppgtt ? &ctx->ppgtt->vm : NULL));
    359   1.6  riastrad }
    360   1.6  riastrad 
    361  1.15  riastrad DEFINE_TRACE4(i915,, context__free,
    362  1.13  riastrad     "int"/*devno*/,
    363  1.15  riastrad     "struct i915_gem_context *"/*ctx*/,
    364  1.15  riastrad     "unsigned"/*hw_id*/,
    365  1.13  riastrad     "struct i915_address_space *"/*vm*/);
    366   1.6  riastrad static inline void
    367  1.15  riastrad trace_i915_context_free(struct i915_gem_context *ctx)
    368   1.6  riastrad {
    369  1.15  riastrad 	TRACE4(i915,, context__free,
    370  1.15  riastrad 	    ctx->i915->drm.primary->index,
    371  1.13  riastrad 	    ctx,
    372  1.15  riastrad 	    ctx->hw_id,
    373  1.15  riastrad 	    (ctx->ppgtt ? &ctx->ppgtt->vm : NULL));
    374   1.6  riastrad }
    375   1.6  riastrad 
    376  1.13  riastrad DEFINE_TRACE4(i915,, page_directory_entry_alloc,
    377  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    378  1.13  riastrad     "uint32_t"/*pdpe*/,
    379  1.13  riastrad     "uint64_t"/*start*/,
    380  1.13  riastrad     "uint64_t"/*pde_shift*/);
    381   1.6  riastrad static inline void
    382  1.13  riastrad trace_i915_page_directory_entry_alloc(struct i915_address_space *vm,
    383  1.13  riastrad     uint32_t pdpe, uint64_t start, uint64_t pde_shift)
    384   1.9  riastrad {
    385  1.13  riastrad 	TRACE4(i915,, page_directory_entry_alloc,  vm, pdpe, start, pde_shift);
    386   1.9  riastrad }
    387   1.9  riastrad 
    388  1.13  riastrad DEFINE_TRACE4(i915,, page_directory_pointer_entry_alloc,
    389  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    390  1.13  riastrad     "uint32_t"/*pml4e*/,
    391  1.13  riastrad     "uint64_t"/*start*/,
    392  1.13  riastrad     "uint64_t"/*pde_shift*/);
    393   1.9  riastrad static inline void
    394  1.13  riastrad trace_i915_page_directory_pointer_entry_alloc(struct i915_address_space *vm,
    395  1.13  riastrad     uint32_t pml4e, uint64_t start, uint64_t pde_shift)
    396   1.9  riastrad {
    397  1.13  riastrad 	TRACE4(i915,, page_directory_pointer_entry_alloc,
    398  1.13  riastrad 	    vm, pml4e, start, pde_shift);
    399   1.9  riastrad }
    400   1.9  riastrad 
    401  1.13  riastrad DEFINE_TRACE4(i915,, page_table_entry_alloc,
    402  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    403  1.13  riastrad     "uint32_t"/*pde*/,
    404  1.13  riastrad     "uint64_t"/*start*/,
    405  1.13  riastrad     "uint64_t"/*pde_shift*/);
    406   1.9  riastrad static inline void
    407  1.13  riastrad trace_i915_page_table_entry_alloc(struct i915_address_space *vm, uint32_t pde,
    408  1.13  riastrad     uint64_t start, uint64_t pde_shift)
    409   1.9  riastrad {
    410  1.13  riastrad 	TRACE4(i915,, page_table_entry_alloc,  vm, pde, start, pde_shift);
    411   1.9  riastrad }
    412   1.9  riastrad 
    413  1.13  riastrad DEFINE_TRACE6(i915,, page_table_entry_map,
    414  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    415  1.13  riastrad     "uint32_t"/*pde*/,
    416  1.13  riastrad     "struct i915_page_table *"/*pt*/,
    417  1.13  riastrad     "uint32_t"/*first*/,
    418  1.13  riastrad     "uint32_t"/*count*/,
    419  1.13  riastrad     "uint32_t"/*bits*/);
    420   1.9  riastrad static inline void
    421  1.13  riastrad trace_i915_page_table_entry_map(struct i915_address_space *vm, uint32_t pde,
    422  1.13  riastrad     struct i915_page_table *pt, uint32_t first, uint32_t count, uint32_t bits)
    423   1.9  riastrad {
    424  1.13  riastrad 	TRACE6(i915,, page_table_entry_map,  vm, pde, pt, first, count, bits);
    425   1.9  riastrad }
    426   1.9  riastrad 
    427  1.13  riastrad DEFINE_TRACE2(i915,, ppgtt__create,
    428  1.13  riastrad     "int"/*devno*/,
    429  1.13  riastrad     "struct i915_address_space *"/*vm*/);
    430   1.9  riastrad static inline void
    431  1.13  riastrad trace_i915_ppgtt_create(struct i915_address_space *vm)
    432   1.9  riastrad {
    433  1.15  riastrad 	TRACE2(i915,, ppgtt__create,  vm->i915->drm.primary->index, vm);
    434   1.9  riastrad }
    435   1.9  riastrad 
    436  1.13  riastrad DEFINE_TRACE2(i915,, ppgtt__release,
    437  1.13  riastrad     "int"/*devno*/,
    438  1.13  riastrad     "struct i915_address_space *"/*vm*/);
    439   1.9  riastrad static inline void
    440  1.13  riastrad trace_i915_ppgtt_release(struct i915_address_space *vm)
    441   1.9  riastrad {
    442  1.15  riastrad 	TRACE2(i915,, ppgtt__release,  vm->i915->drm.primary->index, vm);
    443   1.9  riastrad }
    444   1.9  riastrad 
    445  1.13  riastrad #define	VM_TO_TRACE_NAME(vm)	(i915_is_ggtt(vm) ? "G" : "P")
    446   1.9  riastrad 
    447  1.13  riastrad DEFINE_TRACE4(i915,, va__alloc,
    448  1.13  riastrad     "struct i915_address_space *"/*vm*/,
    449  1.13  riastrad     "uint64_t"/*start*/,
    450  1.13  riastrad     "uint64_t"/*end*/,
    451  1.13  riastrad     "const char *"/*name*/);
    452   1.9  riastrad static inline void
    453  1.13  riastrad trace_i915_va_alloc(struct i915_address_space *vm, uint64_t start,
    454  1.13  riastrad     uint64_t length, const char *name)
    455   1.9  riastrad {
    456  1.13  riastrad 	/* XXX Why start/end upstream?  */
    457  1.13  riastrad 	TRACE4(i915,, va__alloc,  vm, start, start + length - 1, name);
    458   1.9  riastrad }
    459   1.9  riastrad 
    460  1.13  riastrad DEFINE_TRACE3(i915,, gem__shrink,
    461  1.13  riastrad     "int"/*devno*/,
    462  1.13  riastrad     "unsigned long"/*target*/,
    463  1.13  riastrad     "unsigned"/*flags*/);
    464   1.9  riastrad static inline void
    465  1.10  riastrad trace_i915_gem_shrink(struct drm_i915_private *dev_priv, unsigned long target,
    466  1.13  riastrad     unsigned flags)
    467  1.10  riastrad {
    468  1.13  riastrad 	TRACE3(i915,, gem__shrink,
    469  1.15  riastrad 	    dev_priv->drm.primary->index, target, flags);
    470  1.10  riastrad }
    471  1.10  riastrad 
    472  1.13  riastrad DEFINE_TRACE5(i915,, pipe__update__start,
    473  1.17  riastrad     "enum pipe_drmhack"/*pipe*/,
    474  1.13  riastrad     "uint32_t"/*frame*/,
    475  1.13  riastrad     "int"/*scanline*/,
    476  1.13  riastrad     "uint32_t"/*min*/,
    477  1.13  riastrad     "uint32_t"/*max*/);
    478  1.10  riastrad static inline void
    479  1.12  riastrad trace_i915_pipe_update_start(struct intel_crtc *crtc)
    480  1.12  riastrad {
    481  1.13  riastrad 	TRACE5(i915,, pipe__update__start,
    482  1.13  riastrad 	    crtc->pipe,
    483  1.13  riastrad 	    crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
    484  1.13  riastrad 		crtc->pipe),
    485  1.13  riastrad 	    intel_get_crtc_scanline(crtc),
    486  1.13  riastrad 	    crtc->debug.min_vbl,
    487  1.13  riastrad 	    crtc->debug.max_vbl);
    488  1.12  riastrad }
    489  1.12  riastrad 
    490  1.13  riastrad DEFINE_TRACE5(i915,, pipe__update__vblank__evaded,
    491  1.17  riastrad     "enum pipe_drmhack"/*pipe*/,
    492  1.13  riastrad     "uint32_t"/*frame*/,
    493  1.13  riastrad     "int"/*scanline*/,
    494  1.13  riastrad     "uint32_t"/*min*/,
    495  1.13  riastrad     "uint32_t"/*max*/);
    496  1.12  riastrad static inline void
    497  1.12  riastrad trace_i915_pipe_update_vblank_evaded(struct intel_crtc *crtc)
    498  1.12  riastrad {
    499  1.13  riastrad 	TRACE5(i915,, pipe__update__vblank__evaded,
    500  1.13  riastrad 	    crtc->pipe,
    501  1.13  riastrad 	    crtc->debug.start_vbl_count,
    502  1.13  riastrad 	    crtc->debug.scanline_start,
    503  1.13  riastrad 	    crtc->debug.min_vbl,
    504  1.13  riastrad 	    crtc->debug.max_vbl);
    505  1.13  riastrad }
    506  1.13  riastrad 
    507  1.13  riastrad DEFINE_TRACE3(i915,, pipe__update__end,
    508  1.17  riastrad     "enum pipe_drmhack"/*pipe*/,
    509  1.13  riastrad     "uint32_t"/*frame*/,
    510  1.13  riastrad     "int"/*scanline*/);
    511  1.13  riastrad static inline void
    512  1.13  riastrad trace_i915_pipe_update_end(struct intel_crtc *crtc, uint32_t frame,
    513  1.13  riastrad     int scanline)
    514  1.13  riastrad {
    515  1.13  riastrad 	TRACE3(i915,, pipe__update__end,  crtc->pipe, frame, scanline);
    516  1.13  riastrad }
    517  1.13  riastrad 
    518   1.2  riastrad #endif  /* _I915_TRACE_H_ */
    519