All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/6] drm/i915: Reduce arithmetic operations during cmd parser lookup
Date: Thu,  1 Oct 2015 12:57:13 +0100	[thread overview]
Message-ID: <1443700635-4849-4-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1443700635-4849-1-git-send-email-chris@chris-wilson.co.uk>

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index f4d4c3132932..4fc995b2729d 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -798,10 +798,7 @@ find_cmd_in_table(struct intel_engine_cs *ring,
 	hash_for_each_possible(ring->cmd_hash, desc_node, node,
 			       cmd_header & CMD_HASH_MASK) {
 		const struct drm_i915_cmd_descriptor *desc = desc_node->desc;
-		u32 masked_cmd = desc->cmd.mask & cmd_header;
-		u32 masked_value = desc->cmd.value & desc->cmd.mask;
-
-		if (masked_cmd == masked_value)
+		if (((cmd_header ^ desc->cmd.value) & desc->cmd.mask) == 0)
 			return desc;
 	}
 
-- 
2.6.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-10-01 12:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 11:57 [PATCH 1/6] drm/i915: Eliminate vmap overhead for cmd parser Chris Wilson
2015-10-01 11:57 ` [PATCH 2/6] drm/i915: Cache last cmd descriptor when parsing Chris Wilson
2015-10-01 11:57 ` [PATCH 3/6] drm/i915: Use WC copies on !llc platforms for the command parser Chris Wilson
2015-10-01 11:57 ` Chris Wilson [this message]
2015-10-01 11:57 ` [PATCH 5/6] drm/i915: Reduce pointer indirection during cmd parser lookup Chris Wilson
2015-10-01 11:57 ` [PATCH 6/6] drm/i915: Improve hash function for the command parser Chris Wilson
2015-10-01 12:37 ` [PATCH 1/6] drm/i915: Eliminate vmap overhead for cmd parser Ville Syrjälä
2015-10-01 13:24   ` Chris Wilson
2015-10-01 13:29     ` Ville Syrjälä
2015-10-01 13:39       ` Chris Wilson
2015-10-06 12:44 ` Daniel Vetter
2015-10-06 13:00   ` Chris Wilson

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=1443700635-4849-4-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.