From: Maxime Ripard Date: Wed, 7 Dec 2022 11:53:19 +0000 (+0100) Subject: drm/vc4: hvs: Ignore atomic_flush if we're disabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=92c17d16476c71329a2978f80f23ce1009c69c55;p=linux.git drm/vc4: hvs: Ignore atomic_flush if we're disabled atomic_flush will be called for each CRTC even if they aren't enabled. The whole code we have there will thus run without a properly affected channel, which can then result in all sorts of weird behaviour. Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20221207-rpi-hvs-crtc-misc-v1-8-1f8e0770798b@cerno.tech Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 260efd44a8218..4da66ef967835 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -579,6 +579,9 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, return; } + if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) + return; + if (debug_dump_regs) { DRM_INFO("CRTC %d HVS before:\n", drm_crtc_index(crtc)); vc4_hvs_dump_state(hvs);