From f327808bd62af73d349febeb7cc1a555012cbf01 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 12 Aug 2024 23:57:43 +0000 Subject: [PATCH] drm/i915: Print memory region info during probe From Ville Syrjala 2ab1fe53e298fd2ca6491c73a8d306cc042cd2f0 in mainline linux --- sys/dev/pci/drm/i915/intel_memory_region.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/dev/pci/drm/i915/intel_memory_region.c b/sys/dev/pci/drm/i915/intel_memory_region.c index 6adbbc15dc5..a30a29ec390 100644 --- a/sys/dev/pci/drm/i915/intel_memory_region.c +++ b/sys/dev/pci/drm/i915/intel_memory_region.c @@ -359,6 +359,24 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915) i915->mm.regions[i] = mem; } + for (i = 0; i < ARRAY_SIZE(i915->mm.regions); i++) { + struct intel_memory_region *mem = i915->mm.regions[i]; + u64 region_size, io_size; + + if (!mem) + continue; + + region_size = resource_size(&mem->region) >> 20; + io_size = resource_size(&mem->io) >> 20; + + if (resource_size(&mem->io)) + drm_dbg(&i915->drm, "Memory region(%d): %s: %llu MiB %pR, io: %llu MiB %pR\n", + mem->id, mem->name, region_size, &mem->region, io_size, &mem->io); + else + drm_dbg(&i915->drm, "Memory region(%d): %s: %llu MiB %pR, io: n/a\n", + mem->id, mem->name, region_size, &mem->region); + } + return 0; out_cleanup: -- 2.20.1