drm/xe/kunit: Allow to replace xe_managed_bo_create_pin_map()
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 20 Dec 2024 19:42:03 +0000 (20:42 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Sat, 18 Jan 2025 23:12:06 +0000 (00:12 +0100)
We want to use replacement functions in upcoming kunit tests.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241220194205.995-11-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_bo.c

index cf0dc9e9c53eb68f443257e015e1a6c8fdab11f4..c32201123d4488c6f0b0ed1ff2a0451c15da140b 100644 (file)
@@ -15,6 +15,8 @@
 #include <drm/ttm/ttm_tt.h>
 #include <uapi/drm/xe_drm.h>
 
+#include <kunit/static_stub.h>
+
 #include "xe_device.h"
 #include "xe_dma_buf.h"
 #include "xe_drm_client.h"
@@ -1797,6 +1799,8 @@ struct xe_bo *xe_managed_bo_create_pin_map(struct xe_device *xe, struct xe_tile
        struct xe_bo *bo;
        int ret;
 
+       KUNIT_STATIC_STUB_REDIRECT(xe_managed_bo_create_pin_map, xe, tile, size, flags);
+
        bo = xe_bo_create_pin_map(xe, tile, NULL, size, ttm_bo_type_kernel, flags);
        if (IS_ERR(bo))
                return bo;