Skip to content

Commit 17d7072

Browse files
committed
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
1 parent 57442cf commit 17d7072

File tree

9 files changed

+61
-31
lines changed

9 files changed

+61
-31
lines changed

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ i915-y += \
4343
intel_sbi.o \
4444
intel_step.o \
4545
intel_uncore.o \
46+
intel_uncore_trace.o \
4647
intel_wakeref.o \
4748
vlv_sideband.o \
4849
vlv_suspend.o

drivers/gpu/drm/i915/display/intel_de.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#define __INTEL_DE_H__
88

99
#include "i915_drv.h"
10-
#include "i915_trace.h"
1110
#include "intel_dsb.h"
1211
#include "intel_uncore.h"
12+
#include "intel_uncore_trace.h"
1313

1414
static inline struct intel_uncore *__to_uncore(struct intel_display *display)
1515
{

drivers/gpu/drm/i915/display/intel_dp_aux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include "i915_drv.h"
77
#include "i915_reg.h"
8-
#include "i915_trace.h"
98
#include "intel_de.h"
109
#include "intel_display_types.h"
1110
#include "intel_dp.h"
@@ -14,6 +13,7 @@
1413
#include "intel_pps.h"
1514
#include "intel_quirks.h"
1615
#include "intel_tc.h"
16+
#include "intel_uncore_trace.h"
1717

1818
#define AUX_CH_NAME_BUFSIZE 6
1919

drivers/gpu/drm/i915/i915_trace.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -642,34 +642,6 @@ DEFINE_EVENT(i915_request, i915_request_wait_end,
642642
TP_ARGS(rq)
643643
);
644644

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-
673645
/**
674646
* DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints
675647
*

drivers/gpu/drm/i915/intel_uncore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "i915_drv.h"
3232
#include "i915_iosf_mbi.h"
3333
#include "i915_reg.h"
34-
#include "i915_trace.h"
3534
#include "i915_vgpu.h"
35+
#include "intel_uncore_trace.h"
3636

3737
#define FORCEWAKE_ACK_TIMEOUT_MS 50
3838
#define GT_FIFO_TIMEOUT_MS 10
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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>

drivers/gpu/drm/i915/vlv_suspend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "i915_trace.h"
1414
#include "i915_utils.h"
1515
#include "intel_clock_gating.h"
16+
#include "intel_uncore_trace.h"
1617
#include "vlv_suspend.h"
1718

1819
#include "gt/intel_gt_regs.h"

0 commit comments

Comments
 (0)