diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c index 9240aff779da..51d032a9e01a 100644 --- a/drivers/gpu/drm/xe/tests/xe_pci.c +++ b/drivers/gpu/drm/xe/tests/xe_pci.c @@ -338,13 +338,21 @@ static void fake_xe_info_probe_tile_count(struct xe_device *xe) /* 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; @@ -379,8 +387,12 @@ int xe_pci_fake_device_init(struct xe_device *xe) 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; } diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 096c99b865b4..6156d8689430 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -739,13 +739,27 @@ static void init_devid(struct xe_device *xe) 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; @@ -912,6 +926,15 @@ static struct xe_gt *alloc_media_gt(struct xe_tile *tile, 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. @@ -919,7 +942,8 @@ static struct xe_gt *alloc_media_gt(struct xe_tile *tile, * 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; @@ -1075,6 +1099,7 @@ static void xe_pci_remove(struct pci_dev *pdev) */ 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; @@ -1127,7 +1152,11 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 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; @@ -1146,7 +1175,11 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 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;