OSDN Git Service

drm/i915/cmdparser: Improve hash function
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Aug 2016 16:17:14 +0000 (17:17 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 18 Aug 2016 21:36:59 +0000 (22:36 +0100)
commitd6a4ead7a38666b9acdb098012a178c4c4950eca
tree08d6739686d1e032d8586ac081561df0cddf0cd7
parented13033f0287051577bc1678cde63a42fa419f3c
drm/i915/cmdparser: Improve hash function

The existing code's hashfunction is very suboptimal (most 3D commands
use the same bucket degrading the hash to a long list). The code even
acknowledge that the issue was known and the fix simple:

/*
 * If we attempt to generate a perfect hash, we should be able to look at bits
 * 31:29 of a command from a batch buffer and use the full mask for that
 * client. The existing INSTR_CLIENT_MASK/SHIFT defines can be used for this.
 */

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-35-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_cmd_parser.c