All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: John Keeping <john@metanate.com>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 3/3] drm/rockchip: explain why we can't wait_for_vblanks
Date: Thu, 14 Jan 2016 15:57:05 +0100	[thread overview]
Message-ID: <20160114145705.GA24005@ulmo> (raw)
In-Reply-To: <107bbc36a316ed0ddc7b5a8bcd9b6db6cbc71d4f.1452782114.git.john@metanate.com>


[-- Attachment #1.1: Type: text/plain, Size: 1433 bytes --]

On Thu, Jan 14, 2016 at 02:39:42PM +0000, John Keeping wrote:
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 679d23a..b267ce4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -177,6 +177,12 @@ static void rockchip_crtc_wait_for_update(struct drm_crtc *crtc)
>  		crtc_funcs->wait_for_update(crtc);
>  }
>  
> +/*
> + * We can't use drm_atomic_helper_wait_for_vblanks() because rk3288 and rk3066
> + * have hardware counters for neither vblanks nor scanlines.  This function is
> + * equivalent but uses rockchip_crtc_wait_for_update() instead of waiting for
> + * vblank_count to change.
> + */

This is kind of misleading. From reading earlier parts of the thread the
reason why drm_atomic_helper_wait_for_vblanks() won't work is because it
has a potential race condition that can't be detected unless you also
have a vblank counter. However, the above comment makes it work like
drm_atomic_helper_wait_for_vblanks() doesn't work in the absence of a
vblank counter, which isn't quite true.

Perhaps also the drm_atomic_helper_wait_for_vblanks() kerneldoc needs to
be updated with these restrictions on its use?

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] drm/rockchip: explain why we can't wait_for_vblanks
Date: Thu, 14 Jan 2016 15:57:05 +0100	[thread overview]
Message-ID: <20160114145705.GA24005@ulmo> (raw)
In-Reply-To: <107bbc36a316ed0ddc7b5a8bcd9b6db6cbc71d4f.1452782114.git.john@metanate.com>

On Thu, Jan 14, 2016 at 02:39:42PM +0000, John Keeping wrote:
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 679d23a..b267ce4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -177,6 +177,12 @@ static void rockchip_crtc_wait_for_update(struct drm_crtc *crtc)
>  		crtc_funcs->wait_for_update(crtc);
>  }
>  
> +/*
> + * We can't use drm_atomic_helper_wait_for_vblanks() because rk3288 and rk3066
> + * have hardware counters for neither vblanks nor scanlines.  This function is
> + * equivalent but uses rockchip_crtc_wait_for_update() instead of waiting for
> + * vblank_count to change.
> + */

This is kind of misleading. From reading earlier parts of the thread the
reason why drm_atomic_helper_wait_for_vblanks() won't work is because it
has a potential race condition that can't be detected unless you also
have a vblank counter. However, the above comment makes it work like
drm_atomic_helper_wait_for_vblanks() doesn't work in the absence of a
vblank counter, which isn't quite true.

Perhaps also the drm_atomic_helper_wait_for_vblanks() kerneldoc needs to
be updated with these restrictions on its use?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160114/20fef853/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: John Keeping <john@metanate.com>
Cc: Mark yao <mark.yao@rock-chips.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] drm/rockchip: explain why we can't wait_for_vblanks
Date: Thu, 14 Jan 2016 15:57:05 +0100	[thread overview]
Message-ID: <20160114145705.GA24005@ulmo> (raw)
In-Reply-To: <107bbc36a316ed0ddc7b5a8bcd9b6db6cbc71d4f.1452782114.git.john@metanate.com>

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

On Thu, Jan 14, 2016 at 02:39:42PM +0000, John Keeping wrote:
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 679d23a..b267ce4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -177,6 +177,12 @@ static void rockchip_crtc_wait_for_update(struct drm_crtc *crtc)
>  		crtc_funcs->wait_for_update(crtc);
>  }
>  
> +/*
> + * We can't use drm_atomic_helper_wait_for_vblanks() because rk3288 and rk3066
> + * have hardware counters for neither vblanks nor scanlines.  This function is
> + * equivalent but uses rockchip_crtc_wait_for_update() instead of waiting for
> + * vblank_count to change.
> + */

This is kind of misleading. From reading earlier parts of the thread the
reason why drm_atomic_helper_wait_for_vblanks() won't work is because it
has a potential race condition that can't be detected unless you also
have a vblank counter. However, the above comment makes it work like
drm_atomic_helper_wait_for_vblanks() doesn't work in the absence of a
vblank counter, which isn't quite true.

Perhaps also the drm_atomic_helper_wait_for_vblanks() kerneldoc needs to
be updated with these restrictions on its use?

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-01-14 14:57 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 12:53 [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping
2016-01-13 12:53 ` John Keeping
2016-01-13 12:53 ` John Keeping
2016-01-13 14:23 ` Daniel Vetter
2016-01-13 14:23   ` Daniel Vetter
2016-01-13 14:23   ` Daniel Vetter
2016-01-13 14:34   ` John Keeping
2016-01-13 14:34     ` John Keeping
2016-01-13 14:34     ` John Keeping
2016-01-13 15:40     ` Daniel Vetter
2016-01-13 15:40       ` Daniel Vetter
2016-01-13 15:40       ` Daniel Vetter
2016-01-13 15:55       ` John Keeping
2016-01-13 15:55         ` John Keeping
2016-01-13 15:55         ` John Keeping
2016-01-13 16:21         ` Daniel Vetter
2016-01-13 16:21           ` Daniel Vetter
2016-01-13 16:21           ` Daniel Vetter
2016-01-13 16:40           ` John Keeping
2016-01-13 16:40             ` John Keeping
2016-01-13 16:40             ` John Keeping
2016-01-13 17:19             ` Daniel Vetter
2016-01-13 17:19               ` Daniel Vetter
2016-01-13 17:19               ` Daniel Vetter
2016-01-13 17:39               ` John Keeping
2016-01-13 17:39                 ` John Keeping
2016-01-13 17:39                 ` John Keeping
2016-01-14  1:16                 ` Mark yao
2016-01-14  1:16                   ` Mark yao
2016-01-14  1:16                   ` Mark yao
2016-01-14  8:32                   ` Daniel Vetter
2016-01-14  8:32                     ` Daniel Vetter
2016-01-14  8:32                     ` Daniel Vetter
2016-01-14  8:46                     ` Mark yao
2016-01-14  8:46                       ` Mark yao
2016-01-14  8:46                       ` Mark yao
2016-01-14 14:20                       ` Daniel Vetter
2016-01-14 14:20                         ` Daniel Vetter
2016-01-14 14:20                         ` Daniel Vetter
2016-01-14 14:39                         ` [PATCH 0/3] drm/rockchip: fix cursor performance with atomic John Keeping
2016-01-14 14:39                           ` John Keeping
2016-01-14 14:39                           ` John Keeping
2016-01-14 14:39                           ` [PATCH 1/3] drm/atomic-helper: Export framebuffer_changed() John Keeping
2016-01-14 14:39                             ` John Keeping
2016-01-14 14:39                             ` John Keeping
2016-01-14 14:56                             ` Daniel Vetter
2016-01-14 14:56                               ` Daniel Vetter
2016-01-14 14:56                               ` Daniel Vetter
2016-01-14 14:39                           ` [PATCH 2/3] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping
2016-01-14 14:39                             ` John Keeping
2016-01-14 14:39                           ` [PATCH 3/3] drm/rockchip: explain why we can't wait_for_vblanks John Keeping
2016-01-14 14:39                             ` John Keeping
2016-01-14 14:39                             ` John Keeping
2016-01-14 14:57                             ` Thierry Reding [this message]
2016-01-14 14:57                               ` Thierry Reding
2016-01-14 14:57                               ` Thierry Reding
2016-01-14 16:26                               ` John Keeping
2016-01-14 16:26                                 ` John Keeping
2016-01-14 16:26                                 ` John Keeping
2016-01-18  1:40                                 ` Mark yao
2016-01-18  1:40                                   ` Mark yao
2016-01-18  1:40                                   ` Mark yao
2016-01-19 10:46                           ` [PATCH v2 0/3] drm/rockchip: fix cursor performance with atomic John Keeping
2016-01-19 10:46                             ` John Keeping
2016-01-19 10:46                             ` John Keeping
2016-01-19 10:46                             ` [PATCH v2 1/3] drm/atomic-helper: Export framebuffer_changed() John Keeping
2016-01-19 10:46                               ` John Keeping
2016-01-19 10:46                               ` John Keeping
2016-01-19 11:03                               ` Daniel Vetter
2016-01-19 11:03                                 ` Daniel Vetter
2016-01-19 11:03                                 ` Daniel Vetter
2016-01-19 10:46                             ` [PATCH v2 2/3] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping
2016-01-19 10:46                               ` John Keeping
2016-01-19 10:46                               ` John Keeping
2016-01-19 10:47                             ` [PATCH v2 3/3] drm/rockchip: explain why we can't wait_for_vblanks John Keeping
2016-01-19 10:47                               ` John Keeping
2016-01-19 10:47                               ` John Keeping
2016-01-21  0:51                             ` [PATCH v2 0/3] drm/rockchip: fix cursor performance with atomic Mark yao
2016-01-21  0:51                               ` Mark yao
2016-01-21  0:51                               ` Mark yao
2016-01-17 15:21 ` [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed Heiko Stuebner
2016-01-17 15:21   ` Heiko Stuebner
2016-01-17 15:21   ` Heiko Stuebner

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=20160114145705.GA24005@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john@metanate.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.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 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.