]> git.baikalelectronics.ru Git - kernel.git/commit
fbdev: Improve performance of cfb_imageblit()
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 23 Feb 2022 19:38:03 +0000 (20:38 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 2 Mar 2022 19:22:33 +0000 (20:22 +0100)
commit14fe71b7ba59a67b6c893f352f0fde7365bc0768
tree5730baad2f6dd3c954e923837ffe731f6135f3ba
parent7d140759111cc7dbee2dff1c86f9b58228b5a716
fbdev: Improve performance of cfb_imageblit()

Improve the performance of cfb_imageblit() by manually unrolling
the inner blitting loop and moving some invariants out. The compiler
failed to do this automatically. This change keeps cfb_imageblit()
in sync with sys_imagebit().

A microbenchmark measures the average number of CPU cycles
for cfb_imageblit() after a stabilizing period of a few minutes
(i7-4790, FullHD, simpledrm, kernel with debugging).

cfb_imageblit(), new: 15724 cycles
cfb_imageblit(): old: 30566 cycles

In the optimized case, cfb_imageblit() is now ~2x faster than before.

v3:
* fix commit description (Pekka)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220223193804.18636-5-tzimmermann@suse.de
drivers/video/fbdev/core/cfbimgblt.c