MMAL support has been removed with the RPi Linux 6.18 update. You need to use the modern libcamera API, which is toggled in dietpi-config display options > RPi Camera since v10.5.
motion however does not support libcamera yet, so you need to use libcamerify as wrapper to emulate a regular V4L2 interface on top of libcamera:
Then add the RPi camera as V4L2 camera, the “unicam” from the list.
However, on 32-bit systems, we still face issues (segmentation faults) since latest kernel and libcamera package. Still need to investigate. But on 64-bit above should work fine.