]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: return plane_state from intel_reuse_initial_plane_obj()
authorJani Nikula <jani.nikula@intel.com>
Mon, 15 Dec 2025 15:28:22 +0000 (17:28 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 22 Dec 2025 13:09:23 +0000 (15:09 +0200)
Initialize fb and vma in the same level as the other code path.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/96985a18593408f07fba131cf49ca0f97bf8fb93.1765812266.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_initial_plane.c

index 57afe6e29ce3beae858ace140502fac83a3f8ca2..40b9f981c9acb825e0d03dbd75943d5069c076c2 100644 (file)
@@ -25,11 +25,9 @@ static void i915_initial_plane_vblank_wait(struct drm_crtc *crtc)
        intel_crtc_wait_for_next_vblank(to_intel_crtc(crtc));
 }
 
-static bool
+static const struct intel_plane_state *
 intel_reuse_initial_plane_obj(struct intel_crtc *this,
-                             const struct intel_initial_plane_config plane_configs[],
-                             struct drm_framebuffer **fb,
-                             struct i915_vma **vma)
+                             const struct intel_initial_plane_config plane_configs[])
 {
        struct intel_display *display = to_intel_display(this);
        struct intel_crtc *crtc;
@@ -48,14 +46,11 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this,
                if (!plane_state->ggtt_vma)
                        continue;
 
-               if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base) {
-                       *fb = plane_state->hw.fb;
-                       *vma = plane_state->ggtt_vma;
-                       return true;
-               }
+               if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base)
+                       return plane_state;
        }
 
-       return false;
+       return NULL;
 }
 
 static enum intel_memory_type
@@ -329,8 +324,15 @@ i915_find_initial_plane_obj(struct drm_crtc *_crtc,
        if (intel_alloc_initial_plane_obj(crtc, plane_config)) {
                fb = &plane_config->fb->base;
                vma = plane_config->vma;
-       } else if (!intel_reuse_initial_plane_obj(crtc, plane_configs, &fb, &vma)) {
-               return -EINVAL;
+       } else {
+               const struct intel_plane_state *other_plane_state;
+
+               other_plane_state = intel_reuse_initial_plane_obj(crtc, plane_configs);
+               if (!other_plane_state)
+                       return -EINVAL;
+
+               fb = other_plane_state->hw.fb;
+               vma = other_plane_state->ggtt_vma;
        }
 
        plane_state->uapi.rotation = plane_config->rotation;