alanbork
Posts: 195
Joined: Thu Apr 23, 2020 11:18 pm

easy test for whether kms or Fkms are loaded on pi4?

Fri May 07, 2021 4:37 am

I've been switching back and forth between these a lot, and I'd like a way to make sure from within my bash scripts that the scripts I'm running are under the proper kms/drm driver. I can grep config.txt but that's only correct as long as the machine's been rebooted and seems kind of like a hack. is there something under /dev or /proc that I can check?
retired neuroscientist. raspberry pi hacking and monitor input lag methods: https://alantechreview.blogspot.com/

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11226
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: easy test for whether kms or Fkms are loaded on pi4?

Fri May 07, 2021 7:59 am

/proc/device-tree/soc/hvs@7e400000/status will be "disabled" for fkms, "okay" for kms.
You could look at the pixelvalve, hdmi, or dsi nodes, but there are a number of options there which may or may not be enabled, whereas the HVS is required in all cases.

Note this is actually whether it is configured in device tree. It is possible that the driver failed to load and it would still report "okay" in DT.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

alanbork
Posts: 195
Joined: Thu Apr 23, 2020 11:18 pm

Re: easy test for whether kms or Fkms are loaded on pi4?

Sat May 08, 2021 3:55 pm

awesome. in case anybody else wants to do this, the one-liners are

Code: Select all

fgrep -q disabled /proc/device-tree/soc/hvs@7e400000/status && echo Fkms loaded

fgrep -q okay /proc/device-tree/soc/hvs@7e400000/status && echo Kms loaded

retired neuroscientist. raspberry pi hacking and monitor input lag methods: https://alantechreview.blogspot.com/

Return to “Graphics programming”