[PATCH 3/7] drm/i915: Return just the 'fb' from intel_reuse_initial_plane_obj()

Ville Syrjala <[email protected]>
Newsgroups org.freedesktop.lists.intel-gfx,org.freedesktop.lists.intel-xe
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland
Message-ID <[email protected]>
From: Ville Syrjälä <[email protected]>

Now that we no longer need to shuttle the vma around in
intel_find_initial_plane_obj() intel_reuse_initial_plane_obj()
can return just the fb instead of the whole plane state.

And to make things a bit less confusing rename
intel_reuse_initial_plane_obj() to intel_reuse_initial_plane_fb().

Signed-off-by: Ville Syrjälä <[email protected]>
---
 .../gpu/drm/i915/display/intel_initial_plane.c   | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_initial_plane.c b/drivers/gpu/drm/i915/display/intel_initial_plane.c
index ea3defcc760b..a19c5487ccf3 100644
--- a/drivers/gpu/drm/i915/display/intel_initial_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_initial_plane.c
@@ -43,9 +43,9 @@ void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
 			 crtc->base.base.id, crtc->base.name);
 }
 
-static const struct intel_plane_state *
-intel_reuse_initial_plane_obj(struct intel_crtc *this,
-			      const struct intel_initial_plane_configs *all_plane_configs)
+static struct drm_framebuffer *
+intel_reuse_initial_plane_fb(struct intel_crtc *this,
+			     const struct intel_initial_plane_configs *all_plane_configs)
 {
 	struct intel_display *display = to_intel_display(this);
 	struct intel_crtc *crtc;
@@ -66,7 +66,7 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this,
 
 		if (all_plane_configs->config[this->pipe].base ==
 		    all_plane_configs->config[crtc->pipe].base)
-			return plane_state;
+			return plane_state->hw.fb;
 	}
 
 	return NULL;
@@ -135,13 +135,9 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
 	if (intel_alloc_initial_plane_obj(display, plane_config)) {
 		fb = plane_config->fb;
 	} else {
-		const struct intel_plane_state *other_plane_state;
-
-		other_plane_state = intel_reuse_initial_plane_obj(crtc, all_plane_configs);
-		if (!other_plane_state)
+		fb = intel_reuse_initial_plane_fb(crtc, all_plane_configs);
+		if (!fb)
 			goto nofb;
-
-		fb = other_plane_state->hw.fb;
 	}
 
 	plane_state->uapi.rotation = plane_config->rotation;
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.