From b2d92daa024be660a214a20ed83655137d6ec85b Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 14 Jun 2024 01:14:18 +0000 Subject: [PATCH] unstub ip_ver_read() --- sys/dev/pci/drm/i915/intel_device_info.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/drm/i915/intel_device_info.c b/sys/dev/pci/drm/i915/intel_device_info.c index 78de74a469e..29b86182549 100644 --- a/sys/dev/pci/drm/i915/intel_device_info.c +++ b/sys/dev/pci/drm/i915/intel_device_info.c @@ -290,20 +290,25 @@ static void intel_device_info_subplatform_init(struct drm_i915_private *i915) static void ip_ver_read(struct drm_i915_private *i915, u32 offset, struct intel_ip_version *ip) { - STUB(); -#ifdef notyet +#ifdef __linux__ struct pci_dev *pdev = to_pci_dev(i915->drm.dev); void __iomem *addr; +#endif u32 val; u8 expected_ver = ip->ver; u8 expected_rel = ip->rel; +#ifdef __linux__ addr = pci_iomap_range(pdev, 0, offset, sizeof(u32)); if (drm_WARN_ON(&i915->drm, !addr)) return; val = ioread32(addr); pci_iounmap(pdev, addr); +#else + val = bus_space_read_4(i915->vga_regs->bst, i915->vga_regs->bsh, + offset); +#endif ip->ver = REG_FIELD_GET(GMD_ID_ARCH_MASK, val); ip->rel = REG_FIELD_GET(GMD_ID_RELEASE_MASK, val); @@ -314,7 +319,6 @@ static void ip_ver_read(struct drm_i915_private *i915, u32 offset, struct intel_ drm_dbg(&i915->drm, "Hardware reports GMD IP version %u.%u (REG[0x%x] = 0x%08x) but minimum expected is %u.%u\n", ip->ver, ip->rel, offset, val, expected_ver, expected_rel); -#endif } /* -- 2.20.1