From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Robert Beckett <bob.beckett@collabora.com>
Cc: dri-devel@lists.freedesktop.org,
Maxime Ripard <maxime.ripard@bootlin.com>,
linux-kernel@vger.kernel.org, David Airlie <airlied@linux.ie>,
Sean Paul <sean@poorly.run>
Subject: Re: [PATCH v4 2/2] Revert "drm/vblank: Do not update vblank count if interrupts are already disabled."
Date: Fri, 28 Jun 2019 15:13:15 +0300 [thread overview]
Message-ID: <20190628121315.GH5942@intel.com> (raw)
In-Reply-To: <fc4a6e587e4570227f67a82f2d0e9520934e717e.1561722822.git.bob.beckett@collabora.com>
On Fri, Jun 28, 2019 at 01:05:32PM +0100, Robert Beckett wrote:
> If interrupts are already disabled, then the timestamp for the vblank
> does not get updated, causing a stale timestamp to be reported to
> userland while disabling crtcs.
>
> This reverts commit 68036b08b91bc491ccc308f902616a570a49227c.
Please cc the people involved in that. And I'd drop the lkml cc.
>
> Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
> ---
> drivers/gpu/drm/drm_vblank.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
> index 7dabb2bdb733..aeb9734d7799 100644
> --- a/drivers/gpu/drm/drm_vblank.c
> +++ b/drivers/gpu/drm/drm_vblank.c
> @@ -371,25 +371,23 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
> spin_lock_irqsave(&dev->vblank_time_lock, irqflags);
>
> /*
> - * Update vblank count and disable vblank interrupts only if the
> - * interrupts were enabled. This avoids calling the ->disable_vblank()
> - * operation in atomic context with the hardware potentially runtime
> - * suspended.
> + * Only disable vblank interrupts if they're enabled. This avoids
> + * calling the ->disable_vblank() operation in atomic context with the
> + * hardware potentially runtime suspended.
> */
> - if (!vblank->enabled)
> - goto out;
> + if (vblank->enabled) {
> + __disable_vblank(dev, pipe);
> + vblank->enabled = false;
> + }
>
> /*
> - * Update the count and timestamp to maintain the
> + * Always update the count and timestamp to maintain the
> * appearance that the counter has been ticking all along until
> * this time. This makes the count account for the entire time
> * between drm_crtc_vblank_on() and drm_crtc_vblank_off().
> */
> drm_update_vblank_count(dev, pipe, false);
> - __disable_vblank(dev, pipe);
> - vblank->enabled = false;
>
> -out:
> spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags);
> }
>
> --
> 2.18.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
prev parent reply other threads:[~2019-06-28 12:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 12:05 [PATCH v4 0/2] handle vblank when disabling ctc with interrupt disabled Robert Beckett
2019-06-28 12:05 ` [PATCH v4 1/2] drm/vblank: warn on sending stale event Robert Beckett
2019-06-28 12:10 ` Robert Beckett
2019-06-28 12:05 ` [PATCH v4 2/2] Revert "drm/vblank: Do not update vblank count if interrupts are already disabled." Robert Beckett
2019-06-28 12:13 ` Ville Syrjälä [this message]
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=20190628121315.GH5942@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@linux.ie \
--cc=bob.beckett@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=sean@poorly.run \
/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
all inboxes | Powered by JetHome®