/* Nothing to do, just use the statically defined value. */
}
+static int fake_probe_info(struct xe_device *xe,
+ struct xe_probed_info *probed_info)
+{
+ return 0;
+}
+
int xe_pci_fake_device_init(struct xe_device *xe)
{
struct kunit *test = kunit_get_current_test();
struct xe_pci_fake_data *data = test->priv;
+ struct xe_probed_info probed_info = {};
const struct pci_device_id *ent = pciidlist;
const struct xe_device_desc *desc;
const struct xe_subplatform_desc *subplatform_desc;
+ int err;
if (!data) {
desc = (const void *)ent->driver_data;
kunit_activate_static_stub(test, xe_info_probe_tile_count,
fake_xe_info_probe_tile_count);
- xe_info_init_early(xe, desc, subplatform_desc);
- xe_info_init(xe, desc);
+ err = fake_probe_info(xe, &probed_info);
+ if (err)
+ return err;
+
+ xe_info_init_early(xe, desc, subplatform_desc, &probed_info);
+ xe_info_init(xe, desc, &probed_info);
return 0;
}
xe->info.revid = pdev->revision;
}
+struct xe_probed_info {
+ /* Nothing for now. */
+};
+
+/*
+ * Probe from the hardware the info required by xe_info_init_early().
+ */
+static int xe_probe_info_early(struct xe_device *xe,
+ struct xe_probed_info *probed_info)
+{
+ return 0;
+}
+
/*
* Initialize device info content that only depends on static driver_data
* passed to the driver at probe time from PCI ID table.
*/
static int xe_info_init_early(struct xe_device *xe,
const struct xe_device_desc *desc,
- const struct xe_subplatform_desc *subplatform_desc)
+ const struct xe_subplatform_desc *subplatform_desc,
+ struct xe_probed_info *probed_info)
{
int err;
return gt;
}
+/*
+ * Probe from the hardware the info required by xe_info_init().
+ */
+static int xe_probe_info(struct xe_device *xe,
+ struct xe_probed_info *probed_info)
+{
+ return 0;
+}
+
/*
* Initialize device info content that does require knowledge about
* graphics / media IP version.
* present in device info.
*/
static int xe_info_init(struct xe_device *xe,
- const struct xe_device_desc *desc)
+ const struct xe_device_desc *desc,
+ struct xe_probed_info *probed_info)
{
u32 graphics_gmdid_revid = 0, media_gmdid_revid = 0;
const struct xe_ip *graphics_ip;
*/
static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
+ struct xe_probed_info probed_info = {};
const struct xe_device_desc *desc = (const void *)ent->driver_data;
const struct xe_subplatform_desc *subplatform_desc;
struct xe_device *xe;
pci_set_master(pdev);
- err = xe_info_init_early(xe, desc, subplatform_desc);
+ err = xe_probe_info_early(xe, &probed_info);
+ if (err)
+ return err;
+
+ err = xe_info_init_early(xe, desc, subplatform_desc, &probed_info);
if (err)
return err;
if (err)
return err;
- err = xe_info_init(xe, desc);
+ err = xe_probe_info(xe, &probed_info);
+ if (err)
+ return err;
+
+ err = xe_info_init(xe, desc, &probed_info);
if (err)
return err;