Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.6, 5.14.0
-
None
-
Raspberry Pi4B, Qt 5.9.6 (KMS), Debian streetch (+ libdrm and other packages from booster for compatiblity Rpi4)
-
-
bd4a1b98b813dfbbb4a9db35a380bed8dd5f0ce3
Description
We have several Raspberry Pi4 and TVs connected to them.
We have a TV, LG 49UJ6307-ZA, which for some reason does not return the mode marked with the flag DRM_MODE_TYPE_PREFERRED via LibDRM.
Interestingly, the Raspberry Pi tvservice utility returns the preferred mode of 1920x1080 60Hz.
`(prefer) mode 16: 1920x1080 @ 60Hz 16: 9, clock: 148MHz progressive`
When I looked at the Qt code, I realized that DRM_MODE_TYPE_PREFERRED is initially selected, then, if it is not specified, the current mode is selected.
If the current mode is not received, `best` is selected - that is, with the highest resolution.
The problem is that with this monitor, 4096 x 2160 30Hz is the maximum, (however the matrix is 3840x2160!), And the Raspberry Pi cannot work correctly with such a high resolution, at all.
Another problem was that in the source code of Qt, an error was made in the eglfs kms module.
Because of which, in some cases it is impossible to get the current screen resolution.
src / platformsupport / kmsconvenience / qkmsdevice.cpp When calling drmModeGetEncoder, `connector-> connector_id`=1 is specified, although I think` connector-> encoder_id`=50 should be specified in this case.
Becouse `drmModeGetEncoder` at all received `encoder_id` in second argument.
There is an error in all versions of Qt.
After changing to `encoder_id`, the resolution of 1920x1080 60hz is selected, i.e. current resolution.
I attach patch fixbug.diff for Qt 5.9.6 sources, and resolution list over libdrm, montor_modes_overlibdrm.txt and tvservice output tvserviceoutput.txt .