drm/i915/cmdparser: Compare against the previous command descriptor
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Aug 2016 16:17:15 +0000 (17:17 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Aug 2016 21:37:00 +0000 (22:37 +0100)
commitefdfd91f9b234638705d79a2b2f0a6ac8a5f99e8
tree8544bd0aab615c71850514d0d61d59a229b8fd4c
parentd6a4ead7a38666b9acdb098012a178c4c4950eca
drm/i915/cmdparser: Compare against the previous command descriptor

On the blitter (and in test code), we see long sequences of repeated
commands, e.g. XY_PIXEL_BLT, XY_SCANLINE_BLT, or XY_SRC_COPY. For these,
we can skip the hashtable lookup by remembering the previous command
descriptor and doing a straightforward compare of the command header.
The corollary is that we need to do one extra comparison before lookup
up new commands.

v2: Less magic mask (ok, it is still magic, but now you cannot see!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160818161718.27187-36-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_cmd_parser.c