What pass `connector_id` in `lv_linux_drm_set_file` on first time setup?
Closed this issue Β· 14 comments
LVGL version
v9.1.0
What happened?
lv_linux_drm_set_file
is need connector_id
, but I can't get it anywhere, it's design defects?
I try 0, itn's work.
How to reproduce?
lv_init();
lv_display_t * display = lv_linux_drm_create();
lv_linux_drm_set_file(display, "/dev/dri/card0", 0);
If there is no first call to lv_linux_drm_set_file
, then fb is -1, and the connector_id
cannot be obtained. Only after calling lv_linux_drm_set_file
can fb have a value and the connector_id
can be obtained, so I don't know how much this value should be passed in.
The DRM driver was contributed @MiSimon. Michael, could you take a look at this issue?
I found that my device can pass 113, and this value will not change.
But I encountered a more strange problem.
VID_20240430_083854.1.mp4
But I encountered a more strange problem.
It's interesting because this issue usually happens in LV_DISPLAY_RENDER_MODE_PARTIAL
when the rendered image is copied incorrectly. However the DRM driver uses LV_DISPLAY_RENDER_MODE_DIRECT
.
Maybe a color format mismatch? In lv_linux_drm_set_file
please call lv_display_set_color_fromat(disp, LV_COLOR_FORMAT_...)
explicitly to be sure that the LVGL display's color format is correct.
Only LV_COLOR_FORMAT_NATIVE
display and refresh, other fromat can only display the first frame, or not display it, and there will be the situation I saw in my previous video.
The DRM driver was contributed @MiSimon. Michael, could you take a look at this issue?
@kisvegabor I was just the last one who touched it as I prepared the UEFI CI makefile. I think the code comes from the lv_drivers repo.
Hi. In most cases usage will look like:
lv_display_t * display = lv_linux_drm_create();
lv_linux_drm_set_file(display, "/dev/dri/card0", -1 /* use first connector */);
If that's not good, drm_info
is a nice tool to enumerate connectors and their modes and properties. For example, the output might look like:
Node: /dev/dri/card0 <-- path
ββββDriver: vc4 (Broadcom VC4 graphics) version 0.0.0 (20140616)
β ββββDRM_CLIENT_CAP_STEREO_3D supported
β ββββDRM_CLIENT_CAP_UNIVERSAL_PLANES supported
β ββββDRM_CLIENT_CAP_ATOMIC supported
[...]
β ββββDRM_CAP_ADDFB2_MODIFIERS = 1
β ββββDRM_CAP_PAGE_FLIP_TARGET = 0
β ββββDRM_CAP_CRTC_IN_VBLANK_EVENT = 1
β ββββDRM_CAP_SYNCOBJ = 1
β ββββDRM_CAP_SYNCOBJ_TIMELINE = 0
ββββDevice: platform brcm,bcm2835-vc4
ββββFramebuffer size
β ββββWidth: [0, 2048]
β ββββHeight: [0, 2048]
ββββConnectors
β ββββConnector 0
β β ββββObject ID: 32 <-- the connector id i could have used instead of -1
β β ββββType: HDMI-A
β β ββββStatus: connected
β β ββββPhysical size: 530x300 mm
β β ββββSubpixel: unknown
β β ββββEncoders: {0}
β β ββββModes
β β β ββββ1920x1080@60.00 preferred driver phsync pvsync
β β β ββββ1920x1080@60.00 driver phsync pvsync 16:9
[...]
β β β ββββ720x400@70.08 driver nhsync pvsync
β β ββββProperties
β β ββββ"EDID" (immutable): blob = 294
β β ββββ"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 = 90
β β ββββ"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
β β ββββ"Broadcast RGB": enum {Automatic, Full, Limited 16:235} = Automatic
β β ββββ"Output format": enum {Automatic, RGB, YCbCr 4:2:2, YCbCr 4:4:4} = Automatic
β ββββConnector 1
β ββββObject ID: 57
[...]
Thank you for the info! I think it would be important to document for the future DRM users. Would you mind adding a brief guide about it here?
Thanks, -1 is work, but still like this.
But I encountered a more strange problem.
VID_20240430_083854.1.mp4
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
As there was no activity here for a while we close this issue. But don't worry, the conversation is still here and you can get back to it at any time.
So feel free to comment if you have remarks or ideas on this topic.