Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: extract intel_uncore_trace.[ch]

The i915_reg_rw tracing is a small isolated part of i915_trace.h. Its
users are orthogonal to the other i915_trace.h users as well, and its
implementation does not require all the includes of i915_trace.h. Split
i915_reg_rw tracing to separate intel_uncore_trace.[ch].

The main underlying goal is to reduce implicit includes of i915_drv.h
from display code.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1a3623fbb120adc55bc1cab1e27aca6e55487163.1732104170.git.jani.nikula@intel.com

+61 -31
+1
drivers/gpu/drm/i915/Makefile
··· 43 43 intel_sbi.o \ 44 44 intel_step.o \ 45 45 intel_uncore.o \ 46 + intel_uncore_trace.o \ 46 47 intel_wakeref.o \ 47 48 vlv_sideband.o \ 48 49 vlv_suspend.o
+1 -1
drivers/gpu/drm/i915/display/intel_de.h
··· 7 7 #define __INTEL_DE_H__ 8 8 9 9 #include "i915_drv.h" 10 - #include "i915_trace.h" 11 10 #include "intel_dsb.h" 12 11 #include "intel_uncore.h" 12 + #include "intel_uncore_trace.h" 13 13 14 14 static inline struct intel_uncore *__to_uncore(struct intel_display *display) 15 15 {
+1 -1
drivers/gpu/drm/i915/display/intel_dp_aux.c
··· 5 5 6 6 #include "i915_drv.h" 7 7 #include "i915_reg.h" 8 - #include "i915_trace.h" 9 8 #include "intel_de.h" 10 9 #include "intel_display_types.h" 11 10 #include "intel_dp.h" ··· 13 14 #include "intel_pps.h" 14 15 #include "intel_quirks.h" 15 16 #include "intel_tc.h" 17 + #include "intel_uncore_trace.h" 16 18 17 19 #define AUX_CH_NAME_BUFSIZE 6 18 20
-28
drivers/gpu/drm/i915/i915_trace.h
··· 642 642 TP_ARGS(rq) 643 643 ); 644 644 645 - TRACE_EVENT_CONDITION(i915_reg_rw, 646 - TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace), 647 - 648 - TP_ARGS(write, reg, val, len, trace), 649 - 650 - TP_CONDITION(trace), 651 - 652 - TP_STRUCT__entry( 653 - __field(u64, val) 654 - __field(u32, reg) 655 - __field(u16, write) 656 - __field(u16, len) 657 - ), 658 - 659 - TP_fast_assign( 660 - __entry->val = (u64)val; 661 - __entry->reg = i915_mmio_reg_offset(reg); 662 - __entry->write = write; 663 - __entry->len = len; 664 - ), 665 - 666 - TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)", 667 - __entry->write ? "write" : "read", 668 - __entry->reg, __entry->len, 669 - (u32)(__entry->val & 0xffffffff), 670 - (u32)(__entry->val >> 32)) 671 - ); 672 - 673 645 /** 674 646 * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints 675 647 *
+1 -1
drivers/gpu/drm/i915/intel_uncore.c
··· 31 31 #include "i915_drv.h" 32 32 #include "i915_iosf_mbi.h" 33 33 #include "i915_reg.h" 34 - #include "i915_trace.h" 35 34 #include "i915_vgpu.h" 35 + #include "intel_uncore_trace.h" 36 36 37 37 #define FORCEWAKE_ACK_TIMEOUT_MS 50 38 38 #define GT_FIFO_TIMEOUT_MS 10
+7
drivers/gpu/drm/i915/intel_uncore_trace.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* Copyright © 2024 Intel Corporation */ 3 + 4 + #ifndef __CHECKER__ 5 + #define CREATE_TRACE_POINTS 6 + #include "intel_uncore_trace.h" 7 + #endif
+49
drivers/gpu/drm/i915/intel_uncore_trace.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* Copyright © 2024 Intel Corporation */ 3 + 4 + #undef TRACE_SYSTEM 5 + #define TRACE_SYSTEM i915 6 + 7 + #if !defined(__INTEL_UNCORE_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ) 8 + #define __INTEL_UNCORE_TRACE_H__ 9 + 10 + #include "i915_reg_defs.h" 11 + 12 + #include <linux/types.h> 13 + #include <linux/tracepoint.h> 14 + 15 + TRACE_EVENT_CONDITION(i915_reg_rw, 16 + TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace), 17 + 18 + TP_ARGS(write, reg, val, len, trace), 19 + 20 + TP_CONDITION(trace), 21 + 22 + TP_STRUCT__entry( 23 + __field(u64, val) 24 + __field(u32, reg) 25 + __field(u16, write) 26 + __field(u16, len) 27 + ), 28 + 29 + TP_fast_assign( 30 + __entry->val = (u64)val; 31 + __entry->reg = i915_mmio_reg_offset(reg); 32 + __entry->write = write; 33 + __entry->len = len; 34 + ), 35 + 36 + TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)", 37 + __entry->write ? "write" : "read", 38 + __entry->reg, __entry->len, 39 + (u32)(__entry->val & 0xffffffff), 40 + (u32)(__entry->val >> 32)) 41 + ); 42 + #endif /* __INTEL_UNCORE_TRACE_H__ */ 43 + 44 + /* This part must be outside protection */ 45 + #undef TRACE_INCLUDE_PATH 46 + #undef TRACE_INCLUDE_FILE 47 + #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915 48 + #define TRACE_INCLUDE_FILE intel_uncore_trace 49 + #include <trace/define_trace.h>
+1
drivers/gpu/drm/i915/vlv_suspend.c
··· 13 13 #include "i915_trace.h" 14 14 #include "i915_utils.h" 15 15 #include "intel_clock_gating.h" 16 + #include "intel_uncore_trace.h" 16 17 #include "vlv_suspend.h" 17 18 18 19 #include "gt/intel_gt_regs.h"
drivers/gpu/drm/xe/compat-i915-headers/i915_trace.h drivers/gpu/drm/xe/compat-i915-headers/intel_uncore_trace.h