From: Jani Nikula Date: Mon, 15 Dec 2025 15:28:23 +0000 (+0200) Subject: drm/xe: return plane_state from intel_reuse_initial_plane_obj() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a864b5487c6f819488f64bb5ad3f5efcb720330;p=thirdparty%2Fkernel%2Flinux.git drm/xe: return plane_state from intel_reuse_initial_plane_obj() Initialize fb in the same level as the other code path. Reviewed-by: Ville Syrjälä Link: https://patch.msgid.link/47d3272cff13dc8f5d7323c32bfb3cc34c0c977d.1765812266.git.jani.nikula@intel.com Signed-off-by: Jani Nikula --- diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c index ddf22631240e..42d2c2f8138e 100644 --- a/drivers/gpu/drm/xe/display/xe_initial_plane.c +++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c @@ -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),