Check Supported Monitor Resolutions


Is there a way to easily check supported monitor resolutions (HDMI) (no GUI, from a shell) with the Jetson TX2, similar to how I can do something like this on a normal Ubuntu x86 system:

cat  /sys/devices/pci0000:00/0000:00:03.0/0000:02:00.0/drm/card0/card0-DVI-I-1/modes

My natural inclination is to use xrandr / XRR interface or SDL interface, but that isn’t fool proof because X doesn’t unset the current resolution when you unplug a monitor, so if you have a monitor that’s 3840x2160 and boot the Jetson with that, X will set native resolution of 3840x2160 as expected, but if you hot plug it and plug in a 1920x1080 monitor the monitor will get out of range error.

At that point if you list all resolutions with XRR/xrandr/SDL it’ll list all supported resolutions PLUS the invalid, unsupported, currently selected 3840x2160 resolution. There seems to be no way to get X to forget the selected resolution, even if you restart it, so I’m thinking maybe it’s stored in the Jetson display driver?

Unless I can somehow force X to forget that selected resolution, the resolution output of any interface to X isn’t trusted to be valid.

So I turn to /sys, hoping I can check supported resolutions directly, but there seems to be nothing of interest there on the Jetson, unlike more traditional x86 PC setups.

The only remaining option is to parse EDID directly via the EDID /sys file, but this is a pain as not all resolutions (ie. 2560x1440) have standard VICs, so you have to piece it together from the standard table + detailed resolution extensions, feels very tedious, but may be only option.

Alternatively, if there’s any way to force the Jetson display driver to always select the native resolution on hot plug, that would be a great solution. I’m only hoping to use the native resolution for a given monitor.


Please try

sudo -s
cat /sys/kernel/debug/tegradc.X/modes  #X=0~2.

Is the file name mode or modes?

I don’t have a “modes” file (BSP 28.3), I’m presuming it was added after and there was nothing similar on earlier BSP’s?

I have a ‘mode’ file there which lists following info. Useful, but affected by which resolution is chosen (ie. if I select 1280x1024 those values will be set in the ‘mode’ file, so not purely accurate in terms of capabilities.

cat /sys/kernel/debug/tegradc.0/mode
pclk: 148500000
h_ref_to_sync: 1
v_ref_to_sync: 3
h_sync_width: 44
v_sync_width: 5
h_back_porch: 148
v_back_porch: 36
h_active: 1920
v_active: 1080
h_front_porch: 88
v_front_porch: 4
flags: 0x0
stereo_mode: 0
avi_m: 0x2
vmode: 0x600000

Hi greg2,

Sorry for my mistake. If you want the mode list, you could go to

cat /sys/class/grpahics/fbX/modes X=0~2.

1 Like

Spelling error (“graphics”), but this works as expected, thank you.

The resolution handling for hot swapping HDMI doesn’t work well in earlier BSP’s, but it works well in later ones, so I’m thinking there may have been some issues with display driver which were fixed.

But this file seems reliable on all BSP’s, so works well for probing monitor caps.

cat /sys/class/graphics/fbX/mode

Works well for querying native resolution.

Thanks again.