From a413f484b812d055142d6001a22eb92fcd0e679f Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 13 Aug 2024 00:12:42 +0000 Subject: [PATCH] drm/i915: Fix region start during initial plane readout From Ville Syrjala d74f3a930c1d075a876a22b44723556455526881 in mainline linux --- sys/dev/pci/drm/i915/display/intel_plane_initial.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/drm/i915/display/intel_plane_initial.c b/sys/dev/pci/drm/i915/display/intel_plane_initial.c index 41a5936b903..f14338bc5a5 100644 --- a/sys/dev/pci/drm/i915/display/intel_plane_initial.c +++ b/sys/dev/pci/drm/i915/display/intel_plane_initial.c @@ -78,16 +78,18 @@ initial_plane_vma(struct drm_i915_private *i915, * We don't currently expect this to ever be placed in the * stolen portion. */ - if (phys_base >= resource_size(&mem->region)) { + if (phys_base < mem->region.start || phys_base > mem->region.end) { drm_err(&i915->drm, - "Initial plane programming using invalid range, phys_base=%pa\n", - &phys_base); + "Initial plane programming using invalid range, phys_base=%pa (%s [%pa-%pa])\n", + &phys_base, mem->region.name, &mem->region.start, &mem->region.end); return NULL; } drm_dbg(&i915->drm, "Using phys_base=%pa, based on initial plane programming\n", &phys_base); + + phys_base -= mem->region.start; } else { phys_base = base; mem = i915->mm.stolen_region; -- 2.20.1