Skip to contentSkip to conversation

drm/xe: Enable out of tree compile for Xe KMD

PATCH In review Umesh Nerlige Ramappa 3 participants 6 messages Dec 24, 2025 – Dec 30, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/xe: Enable out of tree compile for Xe KMD

When trying to build the xe module out of tree, the compile fails to find the right trace header files and display paths.

Both i915 and xe directories are copied to an out of tree location and the usual commands to build an out of tree module must be used to build xe.

Based on the link below, modify the TRACE_INCLUDE_PATH to fix this.

https://lwn.net/Articles/383362/

In addition use relative path for display components in the Makefile

---
 drivers/gpu/drm/i915/Makefile                      | 4 ++++
 drivers/gpu/drm/i915/display/intel_display_trace.h | 2 +-
 drivers/gpu/drm/i915/gvt/trace.h                   | 2 +-
 drivers/gpu/drm/i915/i915_trace.h                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore_trace.h          | 2 +-
 drivers/gpu/drm/xe/Makefile                        | 6 +++---
 drivers/gpu/drm/xe/xe_trace.h                      | 2 +-
 drivers/gpu/drm/xe/xe_trace_bo.h                   | 2 +-
 drivers/gpu/drm/xe/xe_trace_guc.h                  | 2 +-
 drivers/gpu/drm/xe/xe_trace_lrc.h                  | 2 +-
 10 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/Makefile +4 -0
index 4db24050edb0..13a910a005fa 100644
@@ -374,6 +374,8 @@ i915-y += \
 	display/intel_vrr.o \
 	display/vlv_dsi.o \
 	display/vlv_dsi_pll.o
+subdir-ccflags-y += \
+	-I$(src)/display
 
 i915-$(CONFIG_DRM_I915_DP_TUNNEL) += \
 	display/intel_dp_tunnel.o
@@ -419,6 +421,8 @@ i915-y += \
 i915-$(CONFIG_DRM_I915_GVT) += \
 	intel_gvt.o \
 	intel_gvt_mmio_table.o
+subdir-ccflags-$(CONFIG_DRM_I915_GVT) += \
+	-I$(src)/gvt
 include $(src)/gvt/Makefile
 
 obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/display/intel_display_trace.h +1 -1
index 27ebc32cb61a..aa43f2a5510a 100644
@@ -853,6 +853,6 @@ TRACE_EVENT(intel_frontbuffer_flush,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_display_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/gvt/trace.h +1 -1
index 63874d385c6f..235d51ee48ad 100644
@@ -378,6 +378,6 @@ TRACE_EVENT(render_mmio,
 /* This part must be out of protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/gvt
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/i915_trace.h +1 -1
index 7ed41ce9b708..a074a5f542fc 100644
@@ -721,6 +721,6 @@ DEFINE_EVENT(i915_context, i915_context_free,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE i915_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/intel_uncore_trace.h +1 -1
index f13ff71edf2d..01219e97574b 100644
@@ -44,6 +44,6 @@ TRACE_EVENT_CONDITION(i915_reg_rw,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_uncore_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/Makefile +3 -3
index a6749dd6a725..00aa4634f10b 100644
@@ -201,16 +201,16 @@ endif
 subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
 	-I$(src)/display/ext \
 	-I$(src)/compat-i915-headers \
-	-I$(srctree)/drivers/gpu/drm/i915/display/ \
+	-I$(src)/../i915/display/ \
 	-Ddrm_i915_private=xe_device
 
 # Rule to build SOC code shared with i915
-$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
+$(obj)/i915-soc/%.o: $(src)/../i915/soc/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Rule to build display code shared with i915
-$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
+$(obj)/i915-display/%.o: $(src)/../i915/display/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
drivers/gpu/drm/xe/xe_trace.h +1 -1
index 6d12fcc13f43..f3ef77e2bcda 100644
@@ -515,6 +515,6 @@ TRACE_EVENT(xe_exec_queue_reach_max_job_count,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_bo.h +1 -1
index 86323cf3be2c..8a687dcf09ba 100644
@@ -258,6 +258,6 @@ DEFINE_EVENT(xe_vm, xe_vm_ops_fail,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_bo
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_guc.h +1 -1
index 78949db9cfce..aac9eebd4815 100644
@@ -154,6 +154,6 @@ TRACE_EVENT(xe_guc_engine_activity,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_guc
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_lrc.h +1 -1
index d525cbee1e34..ada8f97a99e0 100644
@@ -47,6 +47,6 @@ TRACE_EVENT(xe_lrc_update_timestamp,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_lrc
 #include <trace/define_trace.h>
Signature · 1 line
2.51.0
#1 lore raw
Quoted 7 lines · Umesh Nerlige Ramappa

When trying to build the xe module out of tree, the compile fails to find the right trace header files and display paths.

Both i915 and xe directories are copied to an out of tree location and the usual commands to build an out of tree module must be used to build xe.

Quoted 5 lines

Based on the link below, modify the TRACE_INCLUDE_PATH to fix this.

https://lwn.net/Articles/383362/

In addition use relative path for display components in the Makefile

Please don't do any of this.

See include/trace/define_trace.h and the comment on TRACE_INCLUDE_PATH:

* TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace

 *     then this macro can define the path to use. Note, the path is relative to
 *     define_trace.h, not the file including it. Full path names for out of tree
 *     modules must be used.

See also commit 4e6d7719bdc5 ("drm/i915: Use correct path to trace include").

If you are doing some weird out-of-tree hacks, you need to keep them, well, out-of-tree.

Quoted 19 lines
---
 drivers/gpu/drm/i915/Makefile                      | 4 ++++
 drivers/gpu/drm/i915/display/intel_display_trace.h | 2 +-
 drivers/gpu/drm/i915/gvt/trace.h                   | 2 +-
 drivers/gpu/drm/i915/i915_trace.h                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore_trace.h          | 2 +-
 drivers/gpu/drm/xe/Makefile                        | 6 +++---
 drivers/gpu/drm/xe/xe_trace.h                      | 2 +-
 drivers/gpu/drm/xe/xe_trace_bo.h                   | 2 +-
 drivers/gpu/drm/xe/xe_trace_guc.h                  | 2 +-
 drivers/gpu/drm/xe/xe_trace_lrc.h                  | 2 +-
 10 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/Makefile +0 -0
index 4db24050edb0..13a910a005fa 100644

drivers/gpu/drm/i915/Makefile i915-y += \ · line 378

Quoted 5 lines
drivers/gpu/drm/i915/Makefile +2 -0
@@ -374,6 +374,8 @@ i915-y += \
 	display/intel_vrr.o \
 	display/vlv_dsi.o \
 	display/vlv_dsi_pll.o
+subdir-ccflags-y += \
+	-I$(src)/display

In particular, I do not want display/ added to header search path here. We're in the process of removing i915 includes of display headers, and this makes it harder to track them.

BR,
Jani.

Quoted 132 lines
drivers/gpu/drm/i915/Makefile +2 -0
 i915-$(CONFIG_DRM_I915_DP_TUNNEL) += \
 	display/intel_dp_tunnel.o
@@ -419,6 +421,8 @@ i915-y += \
 i915-$(CONFIG_DRM_I915_GVT) += \
 	intel_gvt.o \
 	intel_gvt_mmio_table.o
+subdir-ccflags-$(CONFIG_DRM_I915_GVT) += \
+	-I$(src)/gvt
 include $(src)/gvt/Makefile
 
 obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/display/intel_display_trace.h +1 -1
index 27ebc32cb61a..aa43f2a5510a 100644
@@ -853,6 +853,6 @@ TRACE_EVENT(intel_frontbuffer_flush,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_display_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/gvt/trace.h +1 -1
index 63874d385c6f..235d51ee48ad 100644
@@ -378,6 +378,6 @@ TRACE_EVENT(render_mmio,
 /* This part must be out of protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/gvt
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/i915_trace.h +1 -1
index 7ed41ce9b708..a074a5f542fc 100644
@@ -721,6 +721,6 @@ DEFINE_EVENT(i915_context, i915_context_free,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE i915_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/intel_uncore_trace.h +1 -1
index f13ff71edf2d..01219e97574b 100644
@@ -44,6 +44,6 @@ TRACE_EVENT_CONDITION(i915_reg_rw,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_uncore_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/Makefile +3 -3
index a6749dd6a725..00aa4634f10b 100644
@@ -201,16 +201,16 @@ endif
 subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
 	-I$(src)/display/ext \
 	-I$(src)/compat-i915-headers \
-	-I$(srctree)/drivers/gpu/drm/i915/display/ \
+	-I$(src)/../i915/display/ \
 	-Ddrm_i915_private=xe_device
 
 # Rule to build SOC code shared with i915
-$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
+$(obj)/i915-soc/%.o: $(src)/../i915/soc/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Rule to build display code shared with i915
-$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
+$(obj)/i915-display/%.o: $(src)/../i915/display/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
drivers/gpu/drm/xe/xe_trace.h +1 -1
index 6d12fcc13f43..f3ef77e2bcda 100644
@@ -515,6 +515,6 @@ TRACE_EVENT(xe_exec_queue_reach_max_job_count,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_bo.h +1 -1
index 86323cf3be2c..8a687dcf09ba 100644
@@ -258,6 +258,6 @@ DEFINE_EVENT(xe_vm, xe_vm_ops_fail,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_bo
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_guc.h +1 -1
index 78949db9cfce..aac9eebd4815 100644
@@ -154,6 +154,6 @@ TRACE_EVENT(xe_guc_engine_activity,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_guc
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_lrc.h +1 -1
index d525cbee1e34..ada8f97a99e0 100644
@@ -47,6 +47,6 @@ TRACE_EVENT(xe_lrc_update_timestamp,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_lrc
 #include <trace/define_trace.h>
Signature · 1 line
Jani Nikula, Intel
#2 lore raw
Quoted 23 lines · Jani Nikula
Quoted 7 lines · Umesh Nerlige Ramappa

When trying to build the xe module out of tree, the compile fails to find the right trace header files and display paths.

Both i915 and xe directories are copied to an out of tree location and the usual commands to build an out of tree module must be used to build xe.

Quoted 5 lines

Based on the link below, modify the TRACE_INCLUDE_PATH to fix this.

https://lwn.net/Articles/383362/

In addition use relative path for display components in the Makefile

Please don't do any of this.

See include/trace/define_trace.h and the comment on TRACE_INCLUDE_PATH:

* TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace

*     then this macro can define the path to use. Note, the path is relative to
*     define_trace.h, not the file including it. Full path names for out of tree
*     modules must be used.
Quoted 5 lines

See also commit 4e6d7719bdc5 ("drm/i915: Use correct path to trace include").

If you are doing some weird out-of-tree hacks, you need to keep them, well, out-of-tree.

Out of tree build didn't work for me without these. Maybe I am missing something then. Will look into it.

Thanks,
Umesh

Quoted 168 lines
Quoted 20 lines
---
 drivers/gpu/drm/i915/Makefile                      | 4 ++++
 drivers/gpu/drm/i915/display/intel_display_trace.h | 2 +-
 drivers/gpu/drm/i915/gvt/trace.h                   | 2 +-
 drivers/gpu/drm/i915/i915_trace.h                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore_trace.h          | 2 +-
 drivers/gpu/drm/xe/Makefile                        | 6 +++---
 drivers/gpu/drm/xe/xe_trace.h                      | 2 +-
 drivers/gpu/drm/xe/xe_trace_bo.h                   | 2 +-
 drivers/gpu/drm/xe/xe_trace_guc.h                  | 2 +-
 drivers/gpu/drm/xe/xe_trace_lrc.h                  | 2 +-
 10 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/Makefile +0 -0
index 4db24050edb0..13a910a005fa 100644

drivers/gpu/drm/i915/Makefile i915-y += \ · line 378

Quoted 5 lines
drivers/gpu/drm/i915/Makefile +2 -0
@@ -374,6 +374,8 @@ i915-y += \
 	display/intel_vrr.o \
 	display/vlv_dsi.o \
 	display/vlv_dsi_pll.o
+subdir-ccflags-y += \
+	-I$(src)/display

In particular, I do not want display/ added to header search path here. We're in the process of removing i915 includes of display headers, and this makes it harder to track them.

BR,
Jani.

Quoted 132 lines
drivers/gpu/drm/i915/Makefile +2 -0
 i915-$(CONFIG_DRM_I915_DP_TUNNEL) += \
 	display/intel_dp_tunnel.o
@@ -419,6 +421,8 @@ i915-y += \
 i915-$(CONFIG_DRM_I915_GVT) += \
 	intel_gvt.o \
 	intel_gvt_mmio_table.o
+subdir-ccflags-$(CONFIG_DRM_I915_GVT) += \
+	-I$(src)/gvt
 include $(src)/gvt/Makefile
 
 obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/display/intel_display_trace.h +1 -1
index 27ebc32cb61a..aa43f2a5510a 100644
@@ -853,6 +853,6 @@ TRACE_EVENT(intel_frontbuffer_flush,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_display_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/gvt/trace.h +1 -1
index 63874d385c6f..235d51ee48ad 100644
@@ -378,6 +378,6 @@ TRACE_EVENT(render_mmio,
 /* This part must be out of protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/gvt
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/i915_trace.h +1 -1
index 7ed41ce9b708..a074a5f542fc 100644
@@ -721,6 +721,6 @@ DEFINE_EVENT(i915_context, i915_context_free,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE i915_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/intel_uncore_trace.h +1 -1
index f13ff71edf2d..01219e97574b 100644
@@ -44,6 +44,6 @@ TRACE_EVENT_CONDITION(i915_reg_rw,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_uncore_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/Makefile +3 -3
index a6749dd6a725..00aa4634f10b 100644
@@ -201,16 +201,16 @@ endif
 subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
 	-I$(src)/display/ext \
 	-I$(src)/compat-i915-headers \
-	-I$(srctree)/drivers/gpu/drm/i915/display/ \
+	-I$(src)/../i915/display/ \
 	-Ddrm_i915_private=xe_device
 
 # Rule to build SOC code shared with i915
-$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
+$(obj)/i915-soc/%.o: $(src)/../i915/soc/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Rule to build display code shared with i915
-$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
+$(obj)/i915-display/%.o: $(src)/../i915/display/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
drivers/gpu/drm/xe/xe_trace.h +1 -1
index 6d12fcc13f43..f3ef77e2bcda 100644
@@ -515,6 +515,6 @@ TRACE_EVENT(xe_exec_queue_reach_max_job_count,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_bo.h +1 -1
index 86323cf3be2c..8a687dcf09ba 100644
@@ -258,6 +258,6 @@ DEFINE_EVENT(xe_vm, xe_vm_ops_fail,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_bo
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_guc.h +1 -1
index 78949db9cfce..aac9eebd4815 100644
@@ -154,6 +154,6 @@ TRACE_EVENT(xe_guc_engine_activity,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_guc
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_lrc.h +1 -1
index d525cbee1e34..ada8f97a99e0 100644
@@ -47,6 +47,6 @@ TRACE_EVENT(xe_lrc_update_timestamp,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_lrc
 #include <trace/define_trace.h>
Signature · 1 line
Jani Nikula, Intel
#3 lore raw
Quoted 24 lines · Umesh Nerlige Ramappa
Quoted 23 lines · Jani Nikula
Quoted 7 lines · Umesh Nerlige Ramappa

When trying to build the xe module out of tree, the compile fails to find the right trace header files and display paths.

Both i915 and xe directories are copied to an out of tree location and the usual commands to build an out of tree module must be used to build xe.

Quoted 5 lines

Based on the link below, modify the TRACE_INCLUDE_PATH to fix this.

https://lwn.net/Articles/383362/

In addition use relative path for display components in the Makefile

Please don't do any of this.

See include/trace/define_trace.h and the comment on TRACE_INCLUDE_PATH:

* TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace

*     then this macro can define the path to use. Note, the path is relative to
*     define_trace.h, not the file including it. Full path names for out of tree
*     modules must be used.
Quoted 8 lines
Quoted 5 lines

See also commit 4e6d7719bdc5 ("drm/i915: Use correct path to trace include").

If you are doing some weird out-of-tree hacks, you need to keep them, well, out-of-tree.

Out of tree build didn't work for me without these. Maybe I am missing something then. Will look into it.

No matter what, building an upstream in-tree driver out-of-tree is not much of a rationale for making changes upstream, is it?

BR,
Jani.

Quoted 172 lines

Thanks,
Umesh

Quoted 168 lines
Quoted 20 lines
---
 drivers/gpu/drm/i915/Makefile                      | 4 ++++
 drivers/gpu/drm/i915/display/intel_display_trace.h | 2 +-
 drivers/gpu/drm/i915/gvt/trace.h                   | 2 +-
 drivers/gpu/drm/i915/i915_trace.h                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore_trace.h          | 2 +-
 drivers/gpu/drm/xe/Makefile                        | 6 +++---
 drivers/gpu/drm/xe/xe_trace.h                      | 2 +-
 drivers/gpu/drm/xe/xe_trace_bo.h                   | 2 +-
 drivers/gpu/drm/xe/xe_trace_guc.h                  | 2 +-
 drivers/gpu/drm/xe/xe_trace_lrc.h                  | 2 +-
 10 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/Makefile +0 -0
index 4db24050edb0..13a910a005fa 100644

drivers/gpu/drm/i915/Makefile i915-y += \ · line 378

Quoted 5 lines
drivers/gpu/drm/i915/Makefile +2 -0
@@ -374,6 +374,8 @@ i915-y += \
 	display/intel_vrr.o \
 	display/vlv_dsi.o \
 	display/vlv_dsi_pll.o
+subdir-ccflags-y += \
+	-I$(src)/display

In particular, I do not want display/ added to header search path here. We're in the process of removing i915 includes of display headers, and this makes it harder to track them.

BR,
Jani.

Quoted 132 lines
drivers/gpu/drm/i915/Makefile +2 -0
 i915-$(CONFIG_DRM_I915_DP_TUNNEL) += \
 	display/intel_dp_tunnel.o
@@ -419,6 +421,8 @@ i915-y += \
 i915-$(CONFIG_DRM_I915_GVT) += \
 	intel_gvt.o \
 	intel_gvt_mmio_table.o
+subdir-ccflags-$(CONFIG_DRM_I915_GVT) += \
+	-I$(src)/gvt
 include $(src)/gvt/Makefile
 
 obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/display/intel_display_trace.h +1 -1
index 27ebc32cb61a..aa43f2a5510a 100644
@@ -853,6 +853,6 @@ TRACE_EVENT(intel_frontbuffer_flush,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_display_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/gvt/trace.h +1 -1
index 63874d385c6f..235d51ee48ad 100644
@@ -378,6 +378,6 @@ TRACE_EVENT(render_mmio,
 /* This part must be out of protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/gvt
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/i915_trace.h +1 -1
index 7ed41ce9b708..a074a5f542fc 100644
@@ -721,6 +721,6 @@ DEFINE_EVENT(i915_context, i915_context_free,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE i915_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/intel_uncore_trace.h +1 -1
index f13ff71edf2d..01219e97574b 100644
@@ -44,6 +44,6 @@ TRACE_EVENT_CONDITION(i915_reg_rw,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_uncore_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/Makefile +3 -3
index a6749dd6a725..00aa4634f10b 100644
@@ -201,16 +201,16 @@ endif
 subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
 	-I$(src)/display/ext \
 	-I$(src)/compat-i915-headers \
-	-I$(srctree)/drivers/gpu/drm/i915/display/ \
+	-I$(src)/../i915/display/ \
 	-Ddrm_i915_private=xe_device
 
 # Rule to build SOC code shared with i915
-$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
+$(obj)/i915-soc/%.o: $(src)/../i915/soc/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Rule to build display code shared with i915
-$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
+$(obj)/i915-display/%.o: $(src)/../i915/display/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
drivers/gpu/drm/xe/xe_trace.h +1 -1
index 6d12fcc13f43..f3ef77e2bcda 100644
@@ -515,6 +515,6 @@ TRACE_EVENT(xe_exec_queue_reach_max_job_count,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_bo.h +1 -1
index 86323cf3be2c..8a687dcf09ba 100644
@@ -258,6 +258,6 @@ DEFINE_EVENT(xe_vm, xe_vm_ops_fail,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_bo
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_guc.h +1 -1
index 78949db9cfce..aac9eebd4815 100644
@@ -154,6 +154,6 @@ TRACE_EVENT(xe_guc_engine_activity,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_guc
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_lrc.h +1 -1
index d525cbee1e34..ada8f97a99e0 100644
@@ -47,6 +47,6 @@ TRACE_EVENT(xe_lrc_update_timestamp,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_lrc
 #include <trace/define_trace.h>
Signature · 1 line
Jani Nikula, Intel
Signature · 1 line
Jani Nikula, Intel
#4 lore raw
Quoted 28 lines · Jani Nikula
Quoted 27 lines · Umesh Nerlige Ramappa
Quoted 26 lines · Jani Nikula
Quoted 7 lines · Umesh Nerlige Ramappa

When trying to build the xe module out of tree, the compile fails to find the right trace header files and display paths.

Both i915 and xe directories are copied to an out of tree location and the usual commands to build an out of tree module must be used to build xe.

Quoted 5 lines

Based on the link below, modify the TRACE_INCLUDE_PATH to fix this.

https://lwn.net/Articles/383362/

In addition use relative path for display components in the Makefile

Please don't do any of this.

See include/trace/define_trace.h and the comment on TRACE_INCLUDE_PATH:

* TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace

*     then this macro can define the path to use. Note, the path is relative to
*     define_trace.h, not the file including it. Full path names for out of tree
*     modules must be used.

See also commit 4e6d7719bdc5 ("drm/i915: Use correct path to trace include").

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

If you are doing some weird out-of-tree hacks, you need to keep them, well, out-of-tree.

Out of tree build didn't work for me without these. Maybe I am missing something then. Will look into it.

No matter what, building an upstream in-tree driver out-of-tree is not much of a rationale for making changes upstream, is it?

From talking to Umesh offline yesterday, it sounds like "out-of-tree" might have been a misleading term for what he was trying to do. I believe what he was actually attempting was:

- install a pre-built deb/rpm package of drm-tip generated by our CI system
- checkout drm-tip source at the same commit as the prebuilt binary
- apply an additional Xe patch for testing
- rebuild just xe.ko without rebuilding the entire kernel via:

cd ${drmtipsrc}/drivers/gpu/drm/xe
make -C /lib/modules/$drmtip/build M=$PWD

So his real goal was just to leverage the symbols+headers from the pre-built CI package while building drm-tip's xe.ko in the hopes that he could bypass the need to re-build the rest of the Linux kernel at the same time.

But I don't think pointing "M=<path>" back at an in-tree location (instead of a truly out-of-tree module) is something that most people do and I'm not sure if it's really expected to work for in-tree drivers.

Matt

Quoted 180 lines

BR,
Jani.

Quoted 172 lines

Thanks,
Umesh

Quoted 168 lines
Quoted 20 lines
---
 drivers/gpu/drm/i915/Makefile                      | 4 ++++
 drivers/gpu/drm/i915/display/intel_display_trace.h | 2 +-
 drivers/gpu/drm/i915/gvt/trace.h                   | 2 +-
 drivers/gpu/drm/i915/i915_trace.h                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore_trace.h          | 2 +-
 drivers/gpu/drm/xe/Makefile                        | 6 +++---
 drivers/gpu/drm/xe/xe_trace.h                      | 2 +-
 drivers/gpu/drm/xe/xe_trace_bo.h                   | 2 +-
 drivers/gpu/drm/xe/xe_trace_guc.h                  | 2 +-
 drivers/gpu/drm/xe/xe_trace_lrc.h                  | 2 +-
 10 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/Makefile +0 -0
index 4db24050edb0..13a910a005fa 100644

drivers/gpu/drm/i915/Makefile i915-y += \ · line 378

Quoted 5 lines
drivers/gpu/drm/i915/Makefile +2 -0
@@ -374,6 +374,8 @@ i915-y += \
 	display/intel_vrr.o \
 	display/vlv_dsi.o \
 	display/vlv_dsi_pll.o
+subdir-ccflags-y += \
+	-I$(src)/display

In particular, I do not want display/ added to header search path here. We're in the process of removing i915 includes of display headers, and this makes it harder to track them.

BR,
Jani.

Quoted 132 lines
drivers/gpu/drm/i915/Makefile +2 -0
 i915-$(CONFIG_DRM_I915_DP_TUNNEL) += \
 	display/intel_dp_tunnel.o
@@ -419,6 +421,8 @@ i915-y += \
 i915-$(CONFIG_DRM_I915_GVT) += \
 	intel_gvt.o \
 	intel_gvt_mmio_table.o
+subdir-ccflags-$(CONFIG_DRM_I915_GVT) += \
+	-I$(src)/gvt
 include $(src)/gvt/Makefile
 
 obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/display/intel_display_trace.h +1 -1
index 27ebc32cb61a..aa43f2a5510a 100644
@@ -853,6 +853,6 @@ TRACE_EVENT(intel_frontbuffer_flush,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_display_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/gvt/trace.h +1 -1
index 63874d385c6f..235d51ee48ad 100644
@@ -378,6 +378,6 @@ TRACE_EVENT(render_mmio,
 /* This part must be out of protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/gvt
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/i915_trace.h +1 -1
index 7ed41ce9b708..a074a5f542fc 100644
@@ -721,6 +721,6 @@ DEFINE_EVENT(i915_context, i915_context_free,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE i915_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/intel_uncore_trace.h +1 -1
index f13ff71edf2d..01219e97574b 100644
@@ -44,6 +44,6 @@ TRACE_EVENT_CONDITION(i915_reg_rw,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_uncore_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/Makefile +3 -3
index a6749dd6a725..00aa4634f10b 100644
@@ -201,16 +201,16 @@ endif
 subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
 	-I$(src)/display/ext \
 	-I$(src)/compat-i915-headers \
-	-I$(srctree)/drivers/gpu/drm/i915/display/ \
+	-I$(src)/../i915/display/ \
 	-Ddrm_i915_private=xe_device
 
 # Rule to build SOC code shared with i915
-$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
+$(obj)/i915-soc/%.o: $(src)/../i915/soc/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Rule to build display code shared with i915
-$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
+$(obj)/i915-display/%.o: $(src)/../i915/display/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
drivers/gpu/drm/xe/xe_trace.h +1 -1
index 6d12fcc13f43..f3ef77e2bcda 100644
@@ -515,6 +515,6 @@ TRACE_EVENT(xe_exec_queue_reach_max_job_count,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_bo.h +1 -1
index 86323cf3be2c..8a687dcf09ba 100644
@@ -258,6 +258,6 @@ DEFINE_EVENT(xe_vm, xe_vm_ops_fail,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_bo
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_guc.h +1 -1
index 78949db9cfce..aac9eebd4815 100644
@@ -154,6 +154,6 @@ TRACE_EVENT(xe_guc_engine_activity,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_guc
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_lrc.h +1 -1
index d525cbee1e34..ada8f97a99e0 100644
@@ -47,6 +47,6 @@ TRACE_EVENT(xe_lrc_update_timestamp,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_lrc
 #include <trace/define_trace.h>
Signature · 1 line
Jani Nikula, Intel
Signature · 1 line
Jani Nikula, Intel
Signature · 4 lines
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
#5 lore raw
Quoted 51 lines · Matt Roper
Quoted 28 lines · Jani Nikula
Quoted 27 lines · Umesh Nerlige Ramappa
Quoted 26 lines · Jani Nikula
Quoted 7 lines · Umesh Nerlige Ramappa

When trying to build the xe module out of tree, the compile fails to find the right trace header files and display paths.

Both i915 and xe directories are copied to an out of tree location and the usual commands to build an out of tree module must be used to build xe.

Quoted 5 lines

Based on the link below, modify the TRACE_INCLUDE_PATH to fix this.

https://lwn.net/Articles/383362/

In addition use relative path for display components in the Makefile

Please don't do any of this.

See include/trace/define_trace.h and the comment on TRACE_INCLUDE_PATH:

* TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace

*     then this macro can define the path to use. Note, the path is relative to
*     define_trace.h, not the file including it. Full path names for out of tree
*     modules must be used.

See also commit 4e6d7719bdc5 ("drm/i915: Use correct path to trace include").

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

If you are doing some weird out-of-tree hacks, you need to keep them, well, out-of-tree.

Out of tree build didn't work for me without these. Maybe I am missing something then. Will look into it.

No matter what, building an upstream in-tree driver out-of-tree is not much of a rationale for making changes upstream, is it?

From talking to Umesh offline yesterday, it sounds like "out-of-tree" might have been a misleading term for what he was trying to do. I believe what he was actually attempting was:

- install a pre-built deb/rpm package of drm-tip generated by our CI system
- checkout drm-tip source at the same commit as the prebuilt binary
- apply an additional Xe patch for testing
- rebuild just xe.ko without rebuilding the entire kernel via:

cd ${drmtipsrc}/drivers/gpu/drm/xe
make -C /lib/modules/$drmtip/build M=$PWD

Quoted 9 lines

So his real goal was just to leverage the symbols+headers from the pre-built CI package while building drm-tip's xe.ko in the hopes that he could bypass the need to re-build the rest of the Linux kernel at the same time.

But I don't think pointing "M=<path>" back at an in-tree location (instead of a truly out-of-tree module) is something that most people do and I'm not sure if it's really expected to work for in-tree drivers.

Yeah, sorry, I misunderstood what out-of-tree meant and Matt clarified that. My intention is to just build the xe driver against installed kernel and header packages.

Thanks,
Umesh

Quoted 189 lines

Matt

Quoted 180 lines

BR,
Jani.

Quoted 172 lines

Thanks,
Umesh

Quoted 168 lines
Quoted 20 lines
---
 drivers/gpu/drm/i915/Makefile                      | 4 ++++
 drivers/gpu/drm/i915/display/intel_display_trace.h | 2 +-
 drivers/gpu/drm/i915/gvt/trace.h                   | 2 +-
 drivers/gpu/drm/i915/i915_trace.h                  | 2 +-
 drivers/gpu/drm/i915/intel_uncore_trace.h          | 2 +-
 drivers/gpu/drm/xe/Makefile                        | 6 +++---
 drivers/gpu/drm/xe/xe_trace.h                      | 2 +-
 drivers/gpu/drm/xe/xe_trace_bo.h                   | 2 +-
 drivers/gpu/drm/xe/xe_trace_guc.h                  | 2 +-
 drivers/gpu/drm/xe/xe_trace_lrc.h                  | 2 +-
 10 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/Makefile +0 -0
index 4db24050edb0..13a910a005fa 100644

drivers/gpu/drm/i915/Makefile i915-y += \ · line 378

Quoted 5 lines
drivers/gpu/drm/i915/Makefile +2 -0
@@ -374,6 +374,8 @@ i915-y += \
 	display/intel_vrr.o \
 	display/vlv_dsi.o \
 	display/vlv_dsi_pll.o
+subdir-ccflags-y += \
+	-I$(src)/display

In particular, I do not want display/ added to header search path here. We're in the process of removing i915 includes of display headers, and this makes it harder to track them.

BR,
Jani.

Quoted 125 lines
drivers/gpu/drm/i915/Makefile +2 -0
 i915-$(CONFIG_DRM_I915_DP_TUNNEL) += \
 	display/intel_dp_tunnel.o
@@ -419,6 +421,8 @@ i915-y += \
 i915-$(CONFIG_DRM_I915_GVT) += \
 	intel_gvt.o \
 	intel_gvt_mmio_table.o
+subdir-ccflags-$(CONFIG_DRM_I915_GVT) += \
+	-I$(src)/gvt
 include $(src)/gvt/Makefile
 
 obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/display/intel_display_trace.h +1 -1
index 27ebc32cb61a..aa43f2a5510a 100644
@@ -853,6 +853,6 @@ TRACE_EVENT(intel_frontbuffer_flush,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_display_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/gvt/trace.h +1 -1
index 63874d385c6f..235d51ee48ad 100644
@@ -378,6 +378,6 @@ TRACE_EVENT(render_mmio,
 /* This part must be out of protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/gvt
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/i915_trace.h +1 -1
index 7ed41ce9b708..a074a5f542fc 100644
@@ -721,6 +721,6 @@ DEFINE_EVENT(i915_context, i915_context_free,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE i915_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/i915/intel_uncore_trace.h +1 -1
index f13ff71edf2d..01219e97574b 100644
@@ -44,6 +44,6 @@ TRACE_EVENT_CONDITION(i915_reg_rw,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE intel_uncore_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/Makefile +3 -3
index a6749dd6a725..00aa4634f10b 100644
@@ -201,16 +201,16 @@ endif
 subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
 	-I$(src)/display/ext \
 	-I$(src)/compat-i915-headers \
-	-I$(srctree)/drivers/gpu/drm/i915/display/ \
+	-I$(src)/../i915/display/ \
 	-Ddrm_i915_private=xe_device
 
 # Rule to build SOC code shared with i915
-$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
+$(obj)/i915-soc/%.o: $(src)/../i915/soc/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
 # Rule to build display code shared with i915
-$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
+$(obj)/i915-display/%.o: $(src)/../i915/display/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
drivers/gpu/drm/xe/xe_trace.h +1 -1
index 6d12fcc13f43..f3ef77e2bcda 100644
@@ -515,6 +515,6 @@ TRACE_EVENT(xe_exec_queue_reach_max_job_count,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_bo.h +1 -1
index 86323cf3be2c..8a687dcf09ba 100644
@@ -258,6 +258,6 @@ DEFINE_EVENT(xe_vm, xe_vm_ops_fail,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_bo
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_guc.h +1 -1
index 78949db9cfce..aac9eebd4815 100644
@@ -154,6 +154,6 @@ TRACE_EVENT(xe_guc_engine_activity,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_guc
 #include <trace/define_trace.h>
drivers/gpu/drm/xe/xe_trace_lrc.h +0 -0
index d525cbee1e34..ada8f97a99e0 100644

drivers/gpu/drm/xe/xe_trace_lrc.h TRACE_EVENT(xe_lrc_update_timestamp, · line 52

Quoted 7 lines
drivers/gpu/drm/xe/xe_trace_lrc.h +1 -1
@@ -47,6 +47,6 @@ TRACE_EVENT(xe_lrc_update_timestamp,
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
+#define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE xe_trace_lrc
 #include <trace/define_trace.h>

--
Jani Nikula, Intel

--
Jani Nikula, Intel

Signature · 4 lines
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation