All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Maxime Ripard <maxime@cerno.tech>,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v2 6/7] drm/vc4: kms: Ignore atomic_flush if we're disabled
Date: Thu, 31 Mar 2022 16:37:43 +0200	[thread overview]
Message-ID: <20220331143744.777652-7-maxime@cerno.tech> (raw)
In-Reply-To: <20220331143744.777652-1-maxime@cerno.tech>

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.

Fortunately, the DRM_PLANE_COMMIT_ACTIVE_ONLY flag will skip the CRTC
atomic_begin and atomic_flush, and the planes atomic_update, if they
aren't enabled.

Our plane atomic_update is a nop, and atomic_begin will copy the current
HVS channel to the vc4_crtc structure for the interrupt handler to
consume, but the handler won't run if the CRTC is disabled. So in the
end, it will only skip our CRTC atomic_flush, which is what we want.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_kms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index 992d6a240002..928657c736b7 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -401,7 +401,8 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
 	else
 		vc4_hvs_pv_muxing_commit(vc4, state);
 
-	drm_atomic_helper_commit_planes(dev, state, 0);
+	drm_atomic_helper_commit_planes(dev, state,
+					DRM_PLANE_COMMIT_ACTIVE_ONLY);
 
 	drm_atomic_helper_commit_modeset_enables(dev, state);
 
-- 
2.35.1


  parent reply	other threads:[~2022-03-31 14:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 14:37 [PATCH v2 0/7] drm/vc4: hvs: Various improvements Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 1/7] drm/vc4: kms: Take old state core clock rate into account Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 2/7] drm/vc4: hvs: Fix frame count register readout Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 3/7] drm/vc4: hvs: Store channel in variable Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 4/7] drm/vc4: hvs: Remove dlist setup duplication Maxime Ripard
2022-03-31 14:37 ` [PATCH v2 5/7] drm/vc4: hvs: Move the dlist setup to its own function Maxime Ripard
2022-04-06 10:41   ` Thomas Zimmermann
2022-03-31 14:37 ` Maxime Ripard [this message]
2022-03-31 14:37 ` [PATCH v2 7/7] drm/vc4: hvs: Use pointer to HVS in HVS_READ and HVS_WRITE macros Maxime Ripard
2022-04-06 10:44 ` [PATCH v2 0/7] drm/vc4: hvs: Various improvements Thomas Zimmermann
2022-04-06 13:26 ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331143744.777652-7-maxime@cerno.tech \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.