]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Fix conflicting intel_pcode_* symbols
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 27 Jun 2025 20:30:34 +0000 (13:30 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sat, 28 Jun 2025 13:56:58 +0000 (06:56 -0700)
If CONFIG_DRM_XE_DISPLAY is set, the xe module can only be built as
module to avoid duplicate symbols from i915. The interface for pcode was
added without considering that, so the build breaks if both xe and i915
are built-in.

Since the intel_pcode_* functions should only be called from the display
side (xe side should call the xe interface directly) and there's already
a protection in Kconfig to avoid the problematic configuration, ifdef it
out in case CONFIG_DRM_XE_DISPLAY is disabled.

Closes: https://lore.kernel.org/r/3667a992-a24b-4e49-aab2-5ca73f2c0a56@infradead.org
Fixes: d9465cc8ac2d ("drm/xe/pcode: add struct drm_device based interface")
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250627-xe-kunit-v2-1-756fe5cd56cf@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_pcode.c

index 87323ad0cbbb22238c44feb71c2460ce73306927..6a7ddb9005f993a5e1369a0808605bb71efc4745 100644 (file)
@@ -337,7 +337,9 @@ int xe_pcode_probe_early(struct xe_device *xe)
 }
 ALLOW_ERROR_INJECTION(xe_pcode_probe_early, ERRNO); /* See xe_pci_probe */
 
-/* Helpers with drm device */
+/* Helpers with drm device. These should only be called by the display side */
+#if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
+
 int intel_pcode_read(struct drm_device *drm, u32 mbox, u32 *val, u32 *val1)
 {
        struct xe_device *xe = to_xe_device(drm);
@@ -362,3 +364,5 @@ int intel_pcode_request(struct drm_device *drm, u32 mbox, u32 request,
 
        return xe_pcode_request(tile, mbox, request, reply_mask, reply, timeout_base_ms);
 }
+
+#endif