summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/i915
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-08-13 00:12:43 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-08-13 00:12:43 +0000
commit0a1f1b601c82f653c52b4ca33b2545d29b74e565 (patch)
tree54e32bd34b20e7a21f4c94f7d0d784ce49c4a922 /sys/dev/pci/drm/i915
parentf593d79a2093e8444fab4cf149d978418b24e4ab (diff)
drm/i915: Fix region start during initial plane readout
From Ville Syrjala d74f3a930c1d075a876a22b44723556455526881 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/i915')
-rw-r--r--sys/dev/pci/drm/i915/display/intel_plane_initial.c8
1 files 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;