OSDN Git Service

drm: Optimise power-of-two alignments in drm_mm_scan_add_block()
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 22 Dec 2016 08:36:34 +0000 (08:36 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 28 Dec 2016 10:51:52 +0000 (11:51 +0100)
commit9a956b1548794033d5b893d6d6fcc00b197cfc9b
tree8b8cfbe1b61e48ac2a8a7aca0620a16bc29fcd15
parent0b04d474a611e2831d142e246422a03a10998ae1
drm: Optimise power-of-two alignments in drm_mm_scan_add_block()

For power-of-two alignments, we can avoid the 64bit divide and do a
simple bitwise add instead.

v2: s/alignment_mask/remainder_mask/

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161222083641.2691-32-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_mm.c
include/drm/drm_mm.h