drm/xe: Enable PCI device earlier

Newer Intel platforms require that inspect the contents of the GMD_ID
registers very early in the driver initialization process to determine
the IP version (and proper init sequences), of the platform.  Move the
general PCI device setup and enablement slightly earlier, before we
start trying to peek at the GMD_ID registers.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/20230614205202.3376752-5-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
Matt Roper 2023-06-14 13:52:02 -07:00 committed by Rodrigo Vivi
parent 98b6d09234
commit c0ab10ee2e

View File

@ -627,10 +627,20 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
xe_pm_assert_unbounded_bridge(xe);
subplatform_desc = find_subplatform(xe, desc);
err = xe_info_init(xe, desc, subplatform_desc);
pci_set_drvdata(pdev, xe);
err = pci_enable_device(pdev);
if (err)
goto err_drm_put;
pci_set_master(pdev);
if (pci_enable_msi(pdev) < 0)
drm_dbg(&xe->drm, "can't enable MSI");
err = xe_info_init(xe, desc, subplatform_desc);
if (err)
goto err_pci_disable;
drm_dbg(&xe->drm, "%s %s %04x:%04x dgfx:%d gfx:%s (%d.%02d) media:%s (%d.%02d) dma_m_s:%d tc:%d",
desc->platform_name,
subplatform_desc ? subplatform_desc->name : "",
@ -650,16 +660,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
xe_step_name(xe->info.step.display),
xe_step_name(xe->info.step.basedie));
pci_set_drvdata(pdev, xe);
err = pci_enable_device(pdev);
if (err)
goto err_drm_put;
pci_set_master(pdev);
if (pci_enable_msi(pdev) < 0)
drm_dbg(&xe->drm, "can't enable MSI");
err = xe_device_probe(xe);
if (err)
goto err_pci_disable;