summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_pci.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2023-12-05 04:32:59 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:45:11 +0300
commit4f122766f9043c30b879b44f7dc2ca540b5422cd (patch)
treeb9792350f229d9cb1108452e99ed5e9fd4aa213d /drivers/gpu/drm/xe/xe_pci.c
parent99e4b1aa8dbe2e23c73229ac1bbd9dc3e6b30c80 (diff)
downloadlinux-4f122766f9043c30b879b44f7dc2ca540b5422cd.tar.xz
drm/xe/device: Introduce xe_device_probe_early
SR-IOV VF doesn't have access to MMIO registers used to determine graphics/media ID. It can however communicate with GuC. Introduce xe_device_probe_early, which initializes enough HW to use MMIO GuC communication. This will allow both VF and PF/native driver to have unified probe ordering. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pci.c')
-rw-r--r--drivers/gpu/drm/xe/xe_pci.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 87257716b93e..d1b8f268ce09 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -536,10 +536,12 @@ static void handle_gmdid(struct xe_device *xe,
* Initialize device info content that only depends on static driver_data
* passed to the driver at probe time from PCI ID table.
*/
-static void xe_info_init_early(struct xe_device *xe,
- const struct xe_device_desc *desc,
- const struct xe_subplatform_desc *subplatform_desc)
+static int xe_info_init_early(struct xe_device *xe,
+ const struct xe_device_desc *desc,
+ const struct xe_subplatform_desc *subplatform_desc)
{
+ int err;
+
xe->info.platform = desc->platform;
xe->info.subplatform = subplatform_desc ?
subplatform_desc->subplatform : XE_SUBPLATFORM_NONE;
@@ -556,6 +558,12 @@ static void xe_info_init_early(struct xe_device *xe,
xe->info.enable_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) &&
xe_modparam.enable_display &&
desc->has_display;
+
+ err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0);
+ if (err)
+ return err;
+
+ return 0;
}
/*
@@ -623,13 +631,15 @@ static int xe_info_init(struct xe_device *xe,
*/
xe->info.tile_count = 1 + graphics_desc->max_remote_tiles;
- for_each_tile(tile, xe, id) {
+ for_each_remote_tile(tile, xe, id) {
int err;
err = xe_tile_init_early(tile, xe, id);
if (err)
return err;
+ }
+ for_each_tile(tile, xe, id) {
gt = tile->primary_gt;
gt->info.id = xe->info.gt_count++;
gt->info.type = XE_GT_TYPE_MAIN;
@@ -723,10 +733,16 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_master(pdev);
- xe_info_init_early(xe, desc, subplatform_desc);
+ err = xe_info_init_early(xe, desc, subplatform_desc);
+ if (err)
+ return err;
xe_sriov_probe_early(xe, desc->has_sriov);
+ err = xe_device_probe_early(xe);
+ if (err)
+ return err;
+
err = xe_info_init(xe, desc->graphics, desc->media);
if (err)
return err;