// SPDX-License-Identifier: GPL-2.0 AND MIT /* * Copyright © 2023 Intel Corporation */ #include "tests/xe_pci_test.h" #include "tests/xe_test.h" #include <kunit/test-bug.h> #include <kunit/test.h> #include <kunit/test-bug.h> #include <kunit/visibility.h> struct kunit_test_data { … }; static int dev_to_xe_device_fn(struct device *dev, void *__data) { … } /** * xe_call_for_each_device - Iterate over all devices this driver binds to * @xe_fn: Function to call for each device. * * This function iterated over all devices this driver binds to, and calls * @xe_fn: for each one of them. If the called function returns anything else * than 0, iteration is stopped and the return value is returned by this * function. Across each function call, drm_dev_enter() / drm_dev_exit() is * called for the corresponding drm device. * * Return: Number of devices iterated or * the error code of a call to @xe_fn returning an error code. */ int xe_call_for_each_device(xe_device_fn xe_fn) { … } /** * xe_call_for_each_graphics_ip - Iterate over all recognized graphics IPs * @xe_fn: Function to call for each device. * * This function iterates over the descriptors for all graphics IPs recognized * by the driver and calls @xe_fn: for each one of them. */ void xe_call_for_each_graphics_ip(xe_graphics_fn xe_fn) { … } EXPORT_SYMBOL_IF_KUNIT(…); /** * xe_call_for_each_media_ip - Iterate over all recognized media IPs * @xe_fn: Function to call for each device. * * This function iterates over the descriptors for all media IPs recognized * by the driver and calls @xe_fn: for each one of them. */ void xe_call_for_each_media_ip(xe_media_fn xe_fn) { … } EXPORT_SYMBOL_IF_KUNIT(…); static void fake_read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, u32 *revid) { … } int xe_pci_fake_device_init(struct xe_device *xe) { … } EXPORT_SYMBOL_IF_KUNIT(…);