ascent12 / drm_info

Moved to https://gitlab.freedesktop.org/emersion/drm_info
MIT License
63 stars 13 forks source link

drm_info hangs on Raspberry Pi4 with dtoverlay=vc4-kms-v3d-pi4 #77

Closed docdude closed 3 years ago

docdude commented 3 years ago

Compiled newest linux kernel for raspberry is 5.10 from https://github.com/raspberrypi/linux

# lsmod |grep vc4
vc4                   270336  8
cec                    49152  1 vc4
drm_kms_helper        241664  3 vc4
drm                   524288  8 vc4,v3d,gpu_sched,drm_kms_helper
snd_soc_core          229376  2 snd_soc_hdmi_codec,vc4
# ls /dev/dri
card0  card1  renderD128

With dtoverlay=vc4-fkms-v3d-pi4 drm_info works:

 "\/dev\/dri\/card1": {
     "driver": {
       "name": "vc4",
       "desc": "Broadcom VC4 graphics",
       "version": {
         "major": 0,
         "minor": 0,
         "patch": 0,
         "date": "20140616"
       },
       "kernel": {
         "sysname": "Linux",
         "release": "5.10.52-v7l",
         "version": "#2 SMP Fri Aug 6 21:21:17 MDT 2021"
       },
       "client_caps": {
         "STEREO_3D": true,
         "UNIVERSAL_PLANES": true,
         "ATOMIC": true,
         "ASPECT_RATIO": true,
         "WRITEBACK_CONNECTORS": true
       },
       "caps": {
         "DUMB_BUFFER": 1,
         "VBLANK_HIGH_CRTC": 1,
         "DUMB_PREFERRED_DEPTH": 24,
         "DUMB_PREFER_SHADOW": 0,
         "PRIME": 3,
         "TIMESTAMP_MONOTONIC": 1,
         "ASYNC_PAGE_FLIP": 1,
         "CURSOR_WIDTH": 64,
         "CURSOR_HEIGHT": 64,
         "ADDFB2_MODIFIERS": 1,
         "PAGE_FLIP_TARGET": 0,
         "CRTC_IN_VBLANK_EVENT": 1,
         "SYNCOBJ": 1,
         "SYNCOBJ_TIMELINE": 0
       }
     },

Truncated for brevity. With dtoverlay=vc4-kms-v3d-pi4 drm_info hangs:

gdb output:

#0  0xb6e976cc in ioctl () at ../sysdeps/unix/syscall-template.S:81
#1  0xb6f84984 in drmIoctl (fd=fd@entry=7, request=request@entry=3226494119, arg=arg@entry=0xbefff9a8) at xf86drm.c:191
#2  0xb6f892f4 in _drmModeGetConnector (fd=7, connector_id=32, probe=1) at xf86drmMode.c:500
#3  0x000156c0 in connectors_info (fd=7, res=0x337c8) at ../json.c:515
#4  0x00016294 in node_info (path=0x3a258 "/dev/dri/card1") at ../json.c:734
#5  0x00016404 in drm_info (paths=0xbefffd28) at ../json.c:767
#6  0x000130e0 in main (argc=1, argv=0xbefffd24) at ../main.c:28

Trying to see what dtoverlay or whatever will give me the HDR metadata

Newest kernel 5.10, which apparently now has HDR metadata support now in vc4 : https://github.com/raspberrypi/linux/co ... 30a29e89a3 doesn't seem to work for HDR.

So far drm_info |grep HDR shows nothing

emersion commented 3 years ago

Sounds like a kernel bug to me.

docdude commented 3 years ago

Setting this in config.txt on the RPI4 boot partition, fixed the hanging issue. Actually it would eventually dump data after a minute or two but with this change in the config.txt now gives me HDR metadata. `

dtoverlay=vc4-kms-v3d,cma=512 dtoverlay=rpivid-v4l2 disable_overscan=1 disable_fw_kms_setup=1 `

` │ │ └───Properties │ │ ├───"EDID" (immutable): blob = 223 │ │ ├───"DPMS": enum {On, Standby, Suspend, Off} = On │ │ ├───"link-status": enum {Good, Bad} = Good │ │ ├───"non-desktop" (immutable): range [0, 1] = 0 │ │ ├───"TILE" (immutable): blob = 0 │ │ ├───"CRTC_ID" (atomic): object CRTC = 83 │ │ ├───"Colorspace": enum {Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater} = Default │ │ ├───"left margin": range [0, 100] = 0 │ │ ├───"right margin": range [0, 100] = 0 │ │ ├───"top margin": range [0, 100] = 0 │ │ ├───"bottom margin": range [0, 100] = 0 │ │ ├───"max bpc": range [8, 12] = 8 │ │ └───"HDR_OUTPUT_METADATA": blob = 0

`

Confirmed that newest kernel 5.10 for raspberry (vc4) has HDR metadata blobs and colorspace info :)

Thanks for your work!

emersion commented 3 years ago

Maybe https://github.com/ascent12/drm_info/pull/78 will help dealing with this buggy driver.

Glad it works, closing because this isn't a drm_info bug.