]> Gentwo Git Trees - linux/.git/commit
drm/tests: Add a few tests around drm_fixed.h
authorHarry Wentland <harry.wentland@amd.com>
Sat, 15 Nov 2025 00:01:46 +0000 (17:01 -0700)
committerSimon Ser <contact@emersion.fr>
Wed, 26 Nov 2025 22:03:33 +0000 (23:03 +0100)
commitb7f513803bdff4d509093b9bfad881ff57ede321
tree514f2ac784adc60ed521d875b81ce41455b9edc3
parentea3f6baf3196c35b1a26dfd96f0578bb15ed07c1
drm/tests: Add a few tests around drm_fixed.h

While working on the CTM implementation of VKMS I had to ascertain
myself of a few assumptions. One of those is whether drm_fixed.h
treats its numbers using signed-magnitude or twos-complement. It is
twos-complement.

In order to make someone else's day easier I am adding the
drm_test_int2fixp test that validates the above assumption.

I am also adding a test for the new sm2fixp function that converts
from a signed-magnitude fixed point to the twos-complement fixed
point.

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-22-alex.hung@amd.com
drivers/gpu/drm/tests/Makefile
drivers/gpu/drm/tests/drm_fixp_test.c [new file with mode: 0644]