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