[PATCH 1/8] drm/amd/display: Introduce KUnit tests for fixed31_32 library

Daniel Latypov dlatypov at google.com
Thu Aug 11 03:04:52 UTC 2022


On Wed, Aug 10, 2022 at 5:40 PM Tales Aparecida
<tales.aparecida at gmail.com> wrote:
>
> The fixed31_32 library performs a lot of the mathematical operations
> involving fixed-point arithmetic and the conversion of integers to
> fixed-point representation.
>
> This unit tests intend to assure the proper functioning of the basic
> mathematical operations of fixed-point arithmetic, such as
> multiplication, conversion from fractional to fixed-point number,
> and more. Use kunit_tool to run:
>
> $ ./tools/testing/kunit/kunit.py run --arch=x86_64 \
>         --kunitconfig=drivers/gpu/drm/amd/display/tests/

Nice, thanks for including a kunitconfig, that'll help a lot.

Just as an FYI: if you're working on top of torvalds/master, I think
you would no longer need --arch=x86_64.
Before, CONFIG_PCI=y was tricky to enable on UML, but commit
6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML")
landed for 6.0.

I.e. I can run this command on torvalds/master w/ no other patches applied:

$ ./tools/testing/kunit/kunit.py config --kunitconfig=/dev/stdin <<EOF
CONFIG_KUNIT=y
CONFIG_PCI=y
CONFIG_DRM=y
CONFIG_DRM_AMDGPU=y
CONFIG_DRM_AMD_DC=y
EOF

I haven't tried to apply this series locally yet to double-check, but
I'm pretty sure that means these tests should work as well.
Running under UML would hopefully have faster compile times and be
less resource heavy than a QEMU VM (but I've not measured to verify
that).

Daniel


More information about the amd-gfx mailing list