[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
- To: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
- From: Louis Chauvet <louis.chauvet@xxxxxxxxxxx>
- Date: Thu, 3 Oct 2024 17:07:35 +0200
- Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, Liviu Dudau <liviu.dudau@xxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Inki Dae <inki.dae@xxxxxxxxxxx>, Patrik Jakobsson <patrik.r.jakobsson@xxxxxxxxx>, Alain Volmat <alain.volmat@xxxxxxxxxxx>, Sandy Huang <hjc@xxxxxxxxxxxxxx>, Jyri Sarha <jyri.sarha@xxxxxx>, Alexey Brodkin <abrodkin@xxxxxxxxxxxx>, Hans de Goede <hdegoede@xxxxxxxxxx>, Maíra Canal <mairacanal@xxxxxxxxxx>, Zack Rusin <zack.rusin@xxxxxxxxxxxx>, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, linux-amlogic@xxxxxxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, freedreno@xxxxxxxxxxxxxxxxxxxxx, nouveau@xxxxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, spice-devel@xxxxxxxxxxxxxxxxxxxxx, linux-renesas-soc@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 03 Oct 2024 15:07:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Mail-followup-to: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>, dri-devel@xxxxxxxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, Liviu Dudau <liviu.dudau@xxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Inki Dae <inki.dae@xxxxxxxxxxx>, Patrik Jakobsson <patrik.r.jakobsson@xxxxxxxxx>, Alain Volmat <alain.volmat@xxxxxxxxxxx>, Sandy Huang <hjc@xxxxxxxxxxxxxx>, Jyri Sarha <jyri.sarha@xxxxxx>, Alexey Brodkin <abrodkin@xxxxxxxxxxxx>, Hans de Goede <hdegoede@xxxxxxxxxx>, Maíra Canal <mairacanal@xxxxxxxxxx>, Zack Rusin <zack.rusin@xxxxxxxxxxxx>, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, linux-amlogic@xxxxxxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, freedreno@xxxxxxxxxxxxxxxxxxxxx, nouveau@xxxxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, spice-devel@xxxxxxxxxxxxxxxxxxxxx, linux-renesas-soc@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
> > > diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c
> > > b/drivers/gpu/drm/vkms/vkms_crtc.c
> > > index a40295c18b48..780681ea77e4 100644
> > > --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> > > +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> > > @@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)
> > > struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
> > > struct vkms_output *out = drm_crtc_to_vkms_output(crtc);
> > >
> > > - drm_calc_timestamping_constants(crtc, &crtc->mode);
> > > + drm_calc_timestamping_constants(crtc, &crtc->legacy.mode);
> >
> > drm_calc_timestamping_constants(crtc, &crtc->state->mode);
>
> This one doesn't look safe. You want to call that during your atomic
> commit already.
>
This was already not safe with the previous implementation? Or it is only
unsafe because now I use state->mode instead of legacy.mode?
After inspecting the code, I think I don't need to call it as:
In `vkms_atomic_commit_tail` (used in
`@vkms_mode_config_helpers.atomic_commit_tail`), we call
`drm_atomic_helper_commit_modeset_disables`, which call
`drm_atomic_helper_calc_timestamping_constants` which call
`drm_calc_timestamping_constants` for every CRTC.
I tested kms_vblank, all of them are SUCCESS/SKIP, do you know other tests
that can trigger bugs?
--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
|