mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/simpledrm: Drop superfluous primary plane .atomic_check return logic
@ 2022-08-31 11:12 Javier Martinez Canillas
  2022-09-05 10:57 ` Thomas Zimmermann
  0 siblings, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2022-08-31 11:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Daniel Vetter, David Airlie,
	Thomas Zimmermann, dri-devel

The simpledrm_primary_plane_helper_atomic_check() function is more complex
than needed. It first checks drm_atomic_helper_check_plane_state() returns
value to decide whether to return this or zero.

But it could just return that function return value directly. It also does
a check if new_plane_state->visible isn't set, but returns zero regardless.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 drivers/gpu/drm/tiny/simpledrm.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index a81f91814595..0be47f40247a 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -485,21 +485,14 @@ static int simpledrm_primary_plane_helper_atomic_check(struct drm_plane *plane,
 	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(new_state, plane);
 	struct drm_crtc *new_crtc = new_plane_state->crtc;
 	struct drm_crtc_state *new_crtc_state = NULL;
-	int ret;
 
 	if (new_crtc)
 		new_crtc_state = drm_atomic_get_new_crtc_state(new_state, new_crtc);
 
-	ret = drm_atomic_helper_check_plane_state(new_plane_state, new_crtc_state,
-						  DRM_PLANE_NO_SCALING,
-						  DRM_PLANE_NO_SCALING,
-						  false, false);
-	if (ret)
-		return ret;
-	else if (!new_plane_state->visible)
-		return 0;
-
-	return 0;
+	return drm_atomic_helper_check_plane_state(new_plane_state, new_crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
 }
 
 static void simpledrm_primary_plane_helper_atomic_update(struct drm_plane *plane,
-- 
2.37.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-05 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 11:12 [PATCH] drm/simpledrm: Drop superfluous primary plane .atomic_check return logic Javier Martinez Canillas
2022-09-05 10:57 ` Thomas Zimmermann
2022-09-05 11:06   ` Javier Martinez Canillas
2022-09-05 11:37     ` Thomas Zimmermann
2022-09-05 11:45       ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®