[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZsS-X_ANCKfqHtAY@fedora>
Date: Tue, 20 Aug 2024 18:03:43 +0200
From: José Expósito <jose.exposito89@...il.com>
To: Daniel Stone <daniel@...ishbar.org>
Cc: rodrigosiqueiramelo@...il.com, melissa.srw@...il.com,
mairacanal@...eup.net, hamohammed.sa@...il.com, daniel@...ll.ch,
maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
tzimmermann@...e.de, airlied@...il.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
louis.chauvet@...tlin.com
Subject: Re: [RFC PATCH 00/17] VKMS: Add configfs support
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@...il.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
Powered by blists - more mailing lists