[PATCH 02/10] drm/i915: Remove 'mem' and 'phy_base' from struct intel_initial_plane_config

Ville Syrjala
2026-04-10T15:05:02Z

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The 'mem' and 'phy_base' members or struct intel_initial_plane_config
only exist to be passed from initial_plane_phys() to its sole caller.
Just return them via function arguments.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_display_types.h | 2 --
drivers/gpu/drm/i915/i915_initial_plane.c | 13 ++++++-------
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index ca2581fb7bbd..eaa37b8d9584 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -756,8 +756,6 @@ struct intel_plane_state {

struct intel_initial_plane_config {
struct intel_framebuffer *fb;
- struct intel_memory_region *mem;
- resource_size_t phys_base;
struct i915_vma *vma;
int size;
u32 base;
diff --git a/drivers/gpu/drm/i915/i915_initial_plane.c b/drivers/gpu/drm/i915/i915_initial_plane.c
index c1a12bf6b66c..060aa0388c39 100644
--- a/drivers/gpu/drm/i915/i915_initial_plane.c
+++ b/drivers/gpu/drm/i915/i915_initial_plane.c
@@ -34,7 +34,9 @@ initial_plane_memory_type(struct drm_i915_private *i915)

static bool
initial_plane_phys(struct drm_i915_private *i915,
- struct intel_initial_plane_config *plane_config)
+ struct intel_initial_plane_config *plane_config,
+ resource_size_t *out_phys_base,
+ struct intel_memory_region **out_mem)
{
struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
struct intel_memory_region *mem;
@@ -77,8 +79,8 @@ initial_plane_phys(struct drm_i915_private *i915,
drm_dbg(&i915->drm, "Using dma_addr=%pa, based on initial plane programming\n",
&dma_addr);

- plane_config->phys_base = dma_addr - mem->region.start;
- plane_config->mem = mem;
+ *out_phys_base = dma_addr - mem->region.start;
+ *out_mem = mem;

return true;
}
@@ -99,12 +101,9 @@ initial_plane_vma(struct drm_i915_private *i915,
if (plane_config->size == 0)
return NULL;

- if (!initial_plane_phys(i915, plane_config))
+ if (!initial_plane_phys(i915, plane_config, &phys_base, &mem))
return NULL;

- phys_base = plane_config->phys_base;
- mem = plane_config->mem;
-
base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT);
size = round_up(plane_config->base + plane_config->size,
mem->min_page_size);
--
2.52.0