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

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/47d3272cff13dc8f5d7323c32bfb3cc34c0c977d.1765812266.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/xe/display/xe_initial_plane.c

index ddf22631240ee512725e7c9eed0517b8961b85d7..42d2c2f8138e5adf3cd3e3b746d387eaf33f066e 100644 (file)
@@ -45,10 +45,9 @@ static void xe_initial_plane_vblank_wait(struct drm_crtc *_crtc)
                drm_warn(&xe->drm, "waiting for early vblank failed with %i\n", ret);
 }
 
-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)
+                             const struct intel_initial_plane_config plane_configs[])
 {
        struct xe_device *xe = to_xe_device(this->base.dev);
        struct intel_crtc *crtc;
@@ -67,13 +66,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;
-                       return true;
-               }
+               if (plane_configs[this->pipe].base == plane_configs[crtc->pipe].base)
+                       return plane_state;
        }
 
-       return false;
+       return NULL;
 }
 
 static struct xe_bo *
@@ -217,10 +214,17 @@ xe_find_initial_plane_obj(struct drm_crtc *_crtc,
        struct drm_framebuffer *fb;
        struct i915_vma *vma;
 
-       if (intel_alloc_initial_plane_obj(crtc, plane_config))
+       if (intel_alloc_initial_plane_obj(crtc, plane_config)) {
                fb = &plane_config->fb->base;
-       else if (!intel_reuse_initial_plane_obj(crtc, plane_configs, &fb))
-               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;
+       }
 
        plane_state->uapi.rotation = plane_config->rotation;
        intel_fb_fill_view(to_intel_framebuffer(fb),