]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Fix MTL initial plane readout
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 2 Feb 2024 22:43:33 +0000 (00:43 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 6 Feb 2024 23:59:10 +0000 (01:59 +0200)
MTL stolen memory looks more like local memory, so use the
(now fixed) lmem path when doing the initial plane readout.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Tested-by: Paz Zcharya <pazz@chromium.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240202224340.30647-10-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_plane_initial.c

index db594ccf032339924e9bb944c37960dad13a9f34..c72d4cacf631defa26086de37dec875228e5db3a 100644 (file)
@@ -59,7 +59,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;
 
@@ -73,11 +73,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,
@@ -94,11 +103,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;