diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-08-13 00:14:49 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-08-13 00:14:49 +0000 |
commit | be9640b0e2660141d7b4ee5eadffdb3503d06b52 (patch) | |
tree | aa79eacd6994d2e241a4ded0fa269072bfcc41a9 /sys/dev/pci/drm/i915 | |
parent | 0a1f1b601c82f653c52b4ca33b2545d29b74e565 (diff) |
drm/i915: Fix MTL initial plane readout
From Ville Syrjala
f46fb69489f57141bb7f8308893ec3e8ba664462 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/i915')
-rw-r--r-- | sys/dev/pci/drm/i915/display/intel_plane_initial.c | 25 |
1 files changed, 18 insertions, 7 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 f14338bc5a5..dd35ae176e6 100644 --- a/sys/dev/pci/drm/i915/display/intel_plane_initial.c +++ b/sys/dev/pci/drm/i915/display/intel_plane_initial.c @@ -58,7 +58,7 @@ initial_plane_vma(struct drm_i915_private *i915, return NULL; base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT); - if (IS_DGFX(i915)) { + if (IS_DGFX(i915) || HAS_LMEMBAR_SMEM_STOLEN(i915)) { gen8_pte_t __iomem *gte = to_gt(i915)->ggtt->gsm; gen8_pte_t pte; @@ -72,11 +72,20 @@ initial_plane_vma(struct drm_i915_private *i915, } phys_base = pte & GEN12_GGTT_PTE_ADDR_MASK; - mem = i915->mm.regions[INTEL_REGION_LMEM_0]; + + if (IS_DGFX(i915)) + mem = i915->mm.regions[INTEL_REGION_LMEM_0]; + else + mem = i915->mm.stolen_region; + if (!mem) { + drm_dbg_kms(&i915->drm, + "Initial plane memory region not initialized\n"); + return NULL; + } /* - * We don't currently expect this to ever be placed in the - * stolen portion. + * On lmem we don't currently expect this to + * ever be placed in the stolen portion. */ if (phys_base < mem->region.start || phys_base > mem->region.end) { drm_err(&i915->drm, @@ -93,11 +102,13 @@ initial_plane_vma(struct drm_i915_private *i915, } else { phys_base = base; mem = i915->mm.stolen_region; + if (!mem) { + drm_dbg_kms(&i915->drm, + "Initial plane memory region not initialized\n"); + return NULL; + } } - if (!mem) - return NULL; - size = round_up(plane_config->base + plane_config->size, mem->min_page_size); size -= base; |