[PATCH 1/1] drm/i915/gt : Add logs to print phys_addr

Riana Tauro riana.tauro at intel.com
Thu Sep 1 16:36:40 UTC 2022


Add logs to print phys_addr

Signed-off-by: Riana Tauro <riana.tauro at intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.c |  2 ++
 drivers/gpu/drm/i915/i915_driver.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index e4bac2431e41..b5da81bbd935 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -832,7 +832,9 @@ int intel_gt_probe_all(struct drm_i915_private *i915)
 	int ret;
 
 	mmio_bar = GRAPHICS_VER(i915) == 2 ? GEN2_GTTMMADR_BAR : GTTMMADR_BAR;
+	drm_dbg(&i915->drm, "%s mmio_bar %d\n",__func__,mmio_bar);
 	phys_addr = pci_resource_start(pdev, mmio_bar);
+	drm_dbg(&i915->drm, "%s phys_addr %llu\n",__func__,phys_addr);
 
 	/*
 	 * We always have at least one primary GT on any device
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 1332c70370a6..7190aba20699 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -854,6 +854,8 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct drm_i915_private *i915;
 	int ret;
+	unsigned int bar0, bar1, bar2, bar3, bar4, bar5;
+	u16 cmd;
 
 	i915 = i915_driver_create(pdev, ent);
 	if (IS_ERR(i915))
@@ -867,6 +869,8 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto out_fini;
 
+	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
+
 	ret = i915_driver_early_probe(i915);
 	if (ret < 0)
 		goto out_pci_disable;
@@ -875,6 +879,19 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	intel_vgpu_detect(i915);
 
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &bar0);
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_1, &bar1);
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_2, &bar2);
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_3, &bar3);
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_4, &bar4);
+	pci_read_config_dword(pdev, PCI_BASE_ADDRESS_5, &bar5);
+	printk(KERN_INFO "PCI_BASE_ADDRESS_0 %x\n",bar0);
+	printk(KERN_INFO "PCI_BASE_ADDRESS_1 %x\n",bar1);
+	printk(KERN_INFO "PCI_BASE_ADDRESS_2 %x\n",bar2);
+	printk(KERN_INFO "PCI_BASE_ADDRESS_3 %x\n",bar3);
+	printk(KERN_INFO "PCI_BASE_ADDRESS_4 %x\n",bar4);
+	printk(KERN_INFO "PCI_BASE_ADDRESS_5 %x\n",bar5);
+
 	ret = intel_gt_probe_all(i915);
 	if (ret < 0)
 		goto out_runtime_pm_put;
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list