]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/format-helper: Normalize BT.601 factors to 256
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Jun 2025 16:11:50 +0000 (18:11 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Fri, 13 Jun 2025 06:52:29 +0000 (08:52 +0200)
commita979a54165c224f3a469b59dcbd2e9754e7e0f41
treea4c33184244feea6b70b1717a989e8586b679664
parente2944dc6587f39c3eefb15ee607e700314230a0b
drm/format-helper: Normalize BT.601 factors to 256

BT.601 weights RGB components by certain factors to convert the
color to grayscale. Normalize the constants to 256 instead of 10.
Allows for slightly more precise rounding. The division by 256 can
be compiled as an 8-bit shift, which might be faster on some hardware.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250603161158.423962-1-tzimmermann@suse.de
drivers/gpu/drm/drm_format_internal.h