From: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
To: gabrielabittencourt00@gmail.com, rodrigosiqueiramelo@gmail.com,
Rodrigo.Siqueira@amd.com, manasi.d.navare@intel.com,
lkcamp@listslibreplanetbr.org, igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH] lib/igt_fb: Elimine repetitive verification
Date: Wed, 19 Feb 2020 22:33:36 -0300 [thread overview]
Message-ID: <20200220013336.1979-1-gabrielabittencourt00@gmail.com> (raw)
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
next reply other threads:[~2020-02-20 1:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 1:33 Gabriela Bittencourt [this message]
2020-02-20 2:06 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Elimine repetitive verification Patchwork
2020-02-20 23:00 ` [igt-dev] [PATCH] " Rodrigo Siqueira
2020-02-22 2:42 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200220013336.1979-1-gabrielabittencourt00@gmail.com \
--to=gabrielabittencourt00@gmail.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lkcamp@listslibreplanetbr.org \
--cc=manasi.d.navare@intel.com \
--cc=rodrigosiqueiramelo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.