Registered User mNo edit summary Tag: 2017 source edit |
Registered User mNo edit summary Tag: 2017 source edit |
||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{ApplicableFor | {{ApplicableFor | ||
|MPUs list=STM32MP13x, STM32MP15x, STM32MP25x | |MPUs list=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | ||
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP25x | |MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | ||
}} | }} | ||
</noinclude> | </noinclude> | ||
Line 8: | Line 8: | ||
== Basic usage == | == Basic usage == | ||
When an animation is running on the display, the related framerate can be monitored from the display driver<ref name=drm>[[DRM KMS overview | DRM/KMS framework for display drivers]]</ref> level thanks to the command: | When an animation is running on the display, the related framerate can be monitored from the display driver<ref name=drm>[[DRM KMS overview | DRM/KMS framework for display drivers]]</ref> level thanks to the command: | ||
{{ | {{board$}}(while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) & | ||
The display framerate is then periodically output in the user console in "fps" ('''f'''rames '''p'''er '''s'''econd): | The display framerate is then periodically output in the user console in "fps" ('''f'''rames '''p'''er '''s'''econd): | ||
Line 19: | Line 19: | ||
== Advanced usage == | == Advanced usage == | ||
The display can be composed of '''several layers''' which can be refreshed independently. Associated framerates can be monitored from the display driver<ref name=drm/> level thanks to the command: | The display can be composed of '''several layers''' which can be refreshed independently. Associated framerates can be monitored from the display driver<ref name=drm/> level thanks to the command: | ||
{{ | {{board$}}(while true; do cat /sys/kernel/debug/dri/0/state | sed -nE '/user|plane-/p' | sed -e ':a;N;$!ba;s/\n\t//g;s/user_updates=/ /g;s/plane-/display layer/g;' | sed -e 's/^.\{,11\}//g'; sleep 4; done) & | ||
The display layer framerates are then periodically output in the user console in "fps" ('''f'''rames '''p'''er '''s'''econd): | The display layer framerates are then periodically output in the user console in "fps" ('''f'''rames '''p'''er '''s'''econd): |
Latest revision as of 09:43, 8 October 2024
1. Basic usage
When an animation is running on the display, the related framerate can be monitored from the display driver[1] level thanks to the command:
(while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) &
The display framerate is then periodically output in the user console in "fps" (frames per second):
display 50fps
display 50fps
display 50fps
2. Advanced usage
The display can be composed of several layers which can be refreshed independently. Associated framerates can be monitored from the display driver[1] level thanks to the command:
(while true; do cat /sys/kernel/debug/dri/0/state | sed -nE '/user|plane-/p' | sed -e ':a;N;$!ba;s/\n\t//g;s/user_updates=/ /g;s/plane-/display layer/g;' | sed -e 's/^.\{,11\}//g'; sleep 4; done) &
The display layer framerates are then periodically output in the user console in "fps" (frames per second):
display layer0 60fps
display layer1 25fps
display layer2 30fps
3. Tips
- Stop monitoring the display framerate with the command "kill -9 `ps -o ppid= -C sleep`". This command may not work depending on your system configuration (busybox ps features, sh shell configuration...). Alternative method is to use the command "fg" followed by "CTRL+C" in your terminal.
- Debugfs[2] configuration needs to be enabled in order to be able to monitor the display framerate thanks to the DRM/KMS framework[1] debug directory "/sys/kernel/debug/dri".
- Adjust the display framerate update period by modifying the "sleep" value (4 seconds in the above examples).
- Use the dmesg[3] command "dmesg -n8" to mix both user and kernel console outputs.
4. References