dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Cc: Liviu Dudau <Liviu.Dudau@arm.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Boris Brezillon <boris.brezillon@bootlin.com>
Subject: [PATCH v3 4/9] drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks()
Date: Mon,  2 Jul 2018 14:20:15 +0200	[thread overview]
Message-ID: <20180702122020.5921-5-boris.brezillon@bootlin.com> (raw)
In-Reply-To: <20180702122020.5921-1-boris.brezillon@bootlin.com>

drm_atomic_helper_wait_for_vblanks() assumes the CRTC will continuously
generate VBLANK events and the vblank counter will keep increasing.
While this work for a regular pipeline, it doesn't when you have the
CRTC is feeding the transposer block, because this block works in
oneshot mode, and, by the time we reach
drm_atomic_helper_wait_for_vblanks() the only VBLANK event might have
already been sent and the VBLANK counter will stay unchanged, thus
triggering a timeout.

Luckily, we can replace the drm_atomic_helper_wait_for_vblanks() call
by drm_atomic_helper_wait_for_flip_done() because the only thing we
want to check when calling drm_atomic_helper_wait_for_vblanks() from
vc4_atomic_complete_commit() is that new FBs are in use and the old
ones can be safely released.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
---
Changes in v3:
- Add Eric's and Liviu's R-b

Changes in v2:
- None
---
 drivers/gpu/drm/vc4/vc4_kms.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index 8a411e5f8776..91239b0a4fa0 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -153,18 +153,9 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)
 
 	drm_atomic_helper_commit_modeset_enables(dev, state);
 
-	/* Make sure that drm_atomic_helper_wait_for_vblanks()
-	 * actually waits for vblank.  If we're doing a full atomic
-	 * modeset (as opposed to a vc4_update_plane() short circuit),
-	 * then we need to wait for scanout to be done with our
-	 * display lists before we free it and potentially reallocate
-	 * and overwrite the dlist memory with a new modeset.
-	 */
-	state->legacy_cursor_update = false;
-
 	drm_atomic_helper_commit_hw_done(state);
 
-	drm_atomic_helper_wait_for_vblanks(dev, state);
+	drm_atomic_helper_wait_for_flip_done(dev, state);
 
 	drm_atomic_helper_cleanup_planes(dev, state);
 
-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-07-02 12:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 12:20 [PATCH v3 0/9] drm/vc4: Add support for the transposer IP Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 1/9] drm/atomic: Avoid connector to writeback_connector casts Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 2/9] drm/connector: Pass a drm_connector_state to ->atomic_commit() Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 3/9] drm/connector: Make ->atomic_commit() optional Boris Brezillon
2018-07-02 12:56   ` Liviu Dudau
2018-07-02 15:30   ` kbuild test robot
2018-07-02 15:30   ` kbuild test robot
2018-07-02 16:41     ` Boris Brezillon
2018-07-02 12:20 ` Boris Brezillon [this message]
2018-07-02 12:20 ` [PATCH v3 5/9] drm/crtc: Add a generic infrastructure to fake VBLANK events Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 6/9] drm/atomic: Call fake_vblank() from the generic commit_tail() helpers Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 7/9] drm/vc4: Call drm_atomic_helper_fake_vblank() in the commit path Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 8/9] drm/vc4: Add support for the transposer block Boris Brezillon
2018-07-02 18:52   ` Eric Anholt
2018-07-02 19:10     ` Boris Brezillon
2018-07-02 12:20 ` [PATCH v3 9/9] ARM: dts: bcm283x: Add Transposer block Boris Brezillon
2018-07-02 19:51   ` Eric Anholt

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=20180702122020.5921-5-boris.brezillon@bootlin.com \
    --to=boris.brezillon@bootlin.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=airlied@linux.ie \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox