Description
In the current vc4 driver each CRTC is using 3 planes (one of each type) each created with possible_crtcs=0xff
That value comes from the 3rd argument of
linux/drivers/gpu/drm/vc4/vc4_firmware_kms.c
Line 759 in cc39f1c
This is incorrect for 2 reasons.
First, some unused bits are sets. This is unexpected and that could potentially confuse some client implementations that rely on the detection of the last possible crtcs.
Second, and this is the most important, having multiple bits means that the client can freely associate each plane to each CRTC. This is clearly not the intention here. For example, I used a modified version of sway/wlroots to assign the 1st crtc to the 2nd cursor plane and the 2nd crtc to the 1st cursor plane. This is supposed to be a PERFECTLY LEGAL interpretation of the DRM api. On my rpi4 with 2 monitors, the result was that my left screen was showing the right screen cursor (and the other way around).
So my advice is to change vc4_firmware_kms.c
as follow:
- Add an argument
uint32_t possible_crtcs
tovc4_fkms_plane_init
. - Replace
0xff
bypossible_crtcs
in the call ofdrm_universal_plane_init
. - In each call of
vc4_fkms_plane_init
, usedrm_crtc_mask(ctrc)
for thepossible_crtrs
argument.
See also:
swaywm/wlroots#2333
swaywm/wlroots#1943