summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2025-03-13 17:08:36 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2025-04-02 02:22:19 +0300
commita47720c545065aef972fba78c50bf1bdc6f89d02 (patch)
tree818b251d5d5cce3e98dfbff6af5d62160fcc9f7e
parent0cd161e9472f2eb4be3436670c6db2dd0e3851e4 (diff)
downloadlinux-a47720c545065aef972fba78c50bf1bdc6f89d02.tar.xz
drm/i915: Lookup the memory region first in the BIOS FB takeover
When doing the BIOS FB takeover let's look up the appropriate memory region first. If it doesn't exist there's not much point in doing the PTE read/etc either. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250313140838.29742-9-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
-rw-r--r--drivers/gpu/drm/i915/display/intel_plane_initial.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
index 5f75ef4ba3b1..d522da7000ff 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
@@ -75,6 +75,15 @@ initial_plane_phys_lmem(struct intel_display *display,
dma_addr_t dma_addr;
u32 base;
+ mem_type = initial_plane_memory_type(i915);
+ mem = intel_memory_region_by_type(i915, mem_type);
+ if (!mem) {
+ drm_dbg_kms(display->drm,
+ "Initial plane memory region (type %s) not initialized\n",
+ intel_memory_type_str(mem_type));
+ return false;
+ }
+
base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT);
dma_addr = intel_ggtt_read_entry(&ggtt->vm, base, &is_present, &is_local);
@@ -91,15 +100,6 @@ initial_plane_phys_lmem(struct intel_display *display,
return false;
}
- mem_type = initial_plane_memory_type(i915);
- mem = intel_memory_region_by_type(i915, mem_type);
- if (!mem) {
- drm_dbg_kms(display->drm,
- "Initial plane memory region (type %s) not initialized\n",
- intel_memory_type_str(mem_type));
- return false;
- }
-
/*
* On lmem we don't currently expect this to
* ever be placed in the stolen portion.
@@ -133,6 +133,15 @@ initial_plane_phys_smem(struct intel_display *display,
dma_addr_t dma_addr;
u32 base;
+ mem_type = initial_plane_memory_type(i915);
+ mem = intel_memory_region_by_type(i915, mem_type);
+ if (!mem) {
+ drm_dbg_kms(display->drm,
+ "Initial plane memory region (type %s) not initialized\n",
+ intel_memory_type_str(mem_type));
+ return false;
+ }
+
base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT);
dma_addr = intel_ggtt_read_entry(&ggtt->vm, base, &is_present, &is_local);
@@ -149,15 +158,6 @@ initial_plane_phys_smem(struct intel_display *display,
return false;
}
- mem_type = initial_plane_memory_type(i915);
- mem = intel_memory_region_by_type(i915, mem_type);
- if (!mem) {
- drm_dbg_kms(display->drm,
- "Initial plane memory region (type %s) not initialized\n",
- intel_memory_type_str(mem_type));
- return false;
- }
-
if (dma_addr < mem->region.start || dma_addr > mem->region.end) {
drm_err(display->drm,
"Initial plane programming using invalid range, dma_addr=%pa (%s [%pa-%pa])\n",