All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] lib/igt_fb: Elimine repetitive verification
@ 2020-02-20  1:33 Gabriela Bittencourt
  2020-02-20  2:06 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gabriela Bittencourt @ 2020-02-20  1:33 UTC (permalink / raw)
  To: gabrielabittencourt00, rodrigosiqueiramelo, Rodrigo.Siqueira,
	manasi.d.navare, lkcamp, igt-dev

Clean return function by elimine repetitive verification on return
functions. The function is_ccs_modifier returns true either if fb->modifier
is equals I915_FORMAT_MOD_Y_TILED or I915_FORMAT_MOD_Yf_TILED. What makes
possible to eliminate this verification on the return of the function:
use_enginecopy. The function blitter_ok returns false whenever
is_ccs_modifier returns true, so it's possible to eliminate the
fb->modifier verifications on use_blitter also.

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
---
 lib/igt_fb.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 0c4fdc5d..34a91320 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2026,21 +2026,14 @@ static bool blitter_ok(const struct igt_fb *fb)
 
 static bool use_enginecopy(const struct igt_fb *fb)
 {
-	if (blitter_ok(fb))
-		return false;
-
-	return fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
-	       is_ccs_modifier(fb->modifier) ||
-	       !gem_has_mappable_ggtt(fb->fd);
+	return !blitter_ok(fb) &&
+	       (is_ccs_modifier(fb->modifier) ||
+		!gem_has_mappable_ggtt(fb->fd));
 }
 
 static bool use_blitter(const struct igt_fb *fb)
 {
-	if (!blitter_ok(fb))
-		return false;
-
-	return fb->modifier == I915_FORMAT_MOD_Y_TILED ||
-	       fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
+	return blitter_ok(fb) &&
 	       !gem_has_mappable_ggtt(fb->fd);
 }
 
-- 
2.25.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-02-22  2:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20  1:33 [igt-dev] [PATCH] lib/igt_fb: Elimine repetitive verification Gabriela Bittencourt
2020-02-20  2:06 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-02-20 23:00 ` [igt-dev] [PATCH] " Rodrigo Siqueira
2020-02-22  2:42 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.