[RFC PATCH 00/17] VKMS: Add configfs support

José Expósito jose.exposito89 at gmail.com
Tue Aug 20 16:03:43 UTC 2024


Hi Daniel,

Thanks a lot for looking into this.
On Wed, Aug 14, 2024 at 10:10:39AM +0100, Daniel Stone wrote:
> Hi José,
> 
> On Tue, 13 Aug 2024 at 11:51, José Expósito <jose.exposito89 at gmail.com> wrote:
> >  - When a CRTC is added and removed before device creation, there
> >    is a vblank warning.
> >    The issue is caused because vblanks are referenced using the
> >    CRTC index but, because one of the CRTCs is removed, the
> >    indices are not consecutives and drm_crtc_vblank_crtc() tries to
> >    access and invalid index
> >    I'm not sure if CRTC's indices *must* start at 0 and be
> >    consecutives or if this is a bug in the drm_crtc_vblank_crtc()
> >    implementation.
> 
> CRTCs and planes are not hotpluggable. I recommend you just create a
> lot of each of them statically at startup, and hotplug only
> connectors.

Yes, it is an issue creating them before the device is active. Once the VKMS
device is active, it is not possible to delete them.

Because of how the CRTC index is handled, it is possible create 3 CRTCs
(indices 0, 1 and 2), delete the second one and end up with 2 CRTCs: The
first one with index 0 and the second one with index 2.

This is handled nicelly in the possible_crtcs bitmask, but drm_crtc_vblank_crtc()
tries to access index 2 of an array of size 2.

This case is not possible with actual HW, so I need to fix it on the VKMS
side and make indices start at 0 and be consecutive.
A check on the drm_crtc_vblank_crtc() side won't hurt us though.

For extra context, see Louis message on the topic. It looks like
we are having similar issues:
https://lore.kernel.org/dri-devel/ZsS7x2y_HKgqGUFR@fedora/T/#mccf9a9748ae67a07a7e6ad694c42afc2ccd3c7f1

Best wishes,
Jose
 
> Cheers,
> Daniel


More information about the dri-devel mailing list