]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vkms: add alpha-premultiplied color blending
authorMelissa Wen <melissa.srw@gmail.com>
Tue, 25 Aug 2020 11:45:32 +0000 (08:45 -0300)
committerRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Sun, 30 Aug 2020 13:23:26 +0000 (09:23 -0400)
commit69fae6c71e6f2c7ed7683224d91df4fe31639492
tree343323078c3d8c073c19b30a8b1e46397f404bcf
parentc5c1781fe04276f0add4f35c9a4fdedafd5b229d
drm/vkms: add alpha-premultiplied color blending

The VKMS blend function was ignoring the alpha channel and just
overwriting vaddr_src with vaddr_dst. This XRGB approach triggers a
warning when running the kms_cursor_crc/cursor-alpha-transparent test
case. In IGT, cairo_format_argb32 uses premultiplied alpha (according to
documentation). Also current DRM assumption is that alpha is
premultiplied. Therefore, this patch considers premultiplied alpha
blending eq to compose vaddr_src with vaddr_dst.

This change removes the following cursor-alpha-transparent warning:

 "Suspicious CRC: All values are 0."

V2:
- static for local functions
- const for the read-only variable argb_src
- replaces variable names
- drops unnecessary comment

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200825114532.abzdooluny2ekzvm@smtp.gmail.com
drivers/gpu/drm/vkms/vkms_composer.c