All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Sean Paul <seanpaul@chromium.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/atomic: debug output for EBUSY
Date: Fri, 25 Sep 2020 11:27:50 +0300	[thread overview]
Message-ID: <20200925112750.130f25a6@eldfell> (raw)
In-Reply-To: <20200923105737.2943649-2-daniel.vetter@ffwll.ch>


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

On Wed, 23 Sep 2020 12:57:37 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> Hopefully we'll have the drm crash recorder RSN, but meanwhile
> compositors would like to know a bit better why they get an EBUSY.
> 

These debug messages will be especially useful with the flight
recorder, but also without. :-)

...

> ---
>  drivers/gpu/drm/drm_atomic.c        |  4 ++--
>  drivers/gpu/drm/drm_atomic_helper.c | 20 +++++++++++++++++---
>  2 files changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index e22669b64521..6864e520269d 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1272,7 +1272,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
>  
>  	DRM_DEBUG_ATOMIC("checking %p\n", state);
>  
> -	for_each_new_crtc_in_state(state, crtc, old_crtc_state, i)
> +	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
>  		requested_crtc |= drm_crtc_mask(crtc);
>  
>  	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
> @@ -1322,7 +1322,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
>  		}
>  	}
>  
> -	for_each_new_crtc_in_state(state, crtc, old_crtc_state, i)
> +	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
>  		affected_crtc |= drm_crtc_mask(crtc);

Oops, these belong in the previous patch?

>  
>  	/*
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index e8abaaaa7fd1..6b3bfabac26c 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1740,8 +1740,11 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
>  	 * overridden by a previous synchronous update's state.
>  	 */
>  	if (old_plane_state->commit &&
> -	    !try_wait_for_completion(&old_plane_state->commit->hw_done))
> +	    !try_wait_for_completion(&old_plane_state->commit->hw_done)) {
> +		DRM_DEBUG_ATOMIC("[PLANE:%d:%s] inflight previous commit preventing async commit\n",
> +			plane->base.id, plane->name);
>  		return -EBUSY;
> +	}
>  
>  	return funcs->atomic_async_check(plane, new_plane_state);
>  }
> @@ -1964,6 +1967,9 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock)
>  			 * commit with nonblocking ones. */
>  			if (!completed && nonblock) {
>  				spin_unlock(&crtc->commit_lock);
> +				DRM_DEBUG_ATOMIC("[CRTC:%d:%s] busy with a previous commit\n",
> +					crtc->base.id, crtc->name);
> +
>  				return -EBUSY;
>  			}
>  		} else if (i == 1) {
> @@ -2132,8 +2138,12 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
>  		/* Userspace is not allowed to get ahead of the previous
>  		 * commit with nonblocking ones. */
>  		if (nonblock && old_conn_state->commit &&
> -		    !try_wait_for_completion(&old_conn_state->commit->flip_done))
> +		    !try_wait_for_completion(&old_conn_state->commit->flip_done)) {
> +			DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] busy with a previous commit\n",
> +				conn->base.id, conn->name);
> +
>  			return -EBUSY;
> +		}
>  
>  		/* Always track connectors explicitly for e.g. link retraining. */
>  		commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc);
> @@ -2147,8 +2157,12 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
>  		/* Userspace is not allowed to get ahead of the previous
>  		 * commit with nonblocking ones. */
>  		if (nonblock && old_plane_state->commit &&
> -		    !try_wait_for_completion(&old_plane_state->commit->flip_done))
> +		    !try_wait_for_completion(&old_plane_state->commit->flip_done)) {
> +			DRM_DEBUG_ATOMIC("[PLANE:%d:%s] busy with a previous commit\n",
> +				plane->base.id, plane->name);
> +
>  			return -EBUSY;
> +		}
>  
>  		/* Always track planes explicitly for async pageflip support. */
>  		commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc);

The new debug messages sound good to me.


Thanks,
pq

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Sean Paul <seanpaul@chromium.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/atomic: debug output for EBUSY
Date: Fri, 25 Sep 2020 11:27:50 +0300	[thread overview]
Message-ID: <20200925112750.130f25a6@eldfell> (raw)
In-Reply-To: <20200923105737.2943649-2-daniel.vetter@ffwll.ch>


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

On Wed, 23 Sep 2020 12:57:37 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> Hopefully we'll have the drm crash recorder RSN, but meanwhile
> compositors would like to know a bit better why they get an EBUSY.
> 

These debug messages will be especially useful with the flight
recorder, but also without. :-)

...

> ---
>  drivers/gpu/drm/drm_atomic.c        |  4 ++--
>  drivers/gpu/drm/drm_atomic_helper.c | 20 +++++++++++++++++---
>  2 files changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index e22669b64521..6864e520269d 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1272,7 +1272,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
>  
>  	DRM_DEBUG_ATOMIC("checking %p\n", state);
>  
> -	for_each_new_crtc_in_state(state, crtc, old_crtc_state, i)
> +	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
>  		requested_crtc |= drm_crtc_mask(crtc);
>  
>  	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
> @@ -1322,7 +1322,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
>  		}
>  	}
>  
> -	for_each_new_crtc_in_state(state, crtc, old_crtc_state, i)
> +	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
>  		affected_crtc |= drm_crtc_mask(crtc);

Oops, these belong in the previous patch?

>  
>  	/*
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index e8abaaaa7fd1..6b3bfabac26c 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1740,8 +1740,11 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
>  	 * overridden by a previous synchronous update's state.
>  	 */
>  	if (old_plane_state->commit &&
> -	    !try_wait_for_completion(&old_plane_state->commit->hw_done))
> +	    !try_wait_for_completion(&old_plane_state->commit->hw_done)) {
> +		DRM_DEBUG_ATOMIC("[PLANE:%d:%s] inflight previous commit preventing async commit\n",
> +			plane->base.id, plane->name);
>  		return -EBUSY;
> +	}
>  
>  	return funcs->atomic_async_check(plane, new_plane_state);
>  }
> @@ -1964,6 +1967,9 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock)
>  			 * commit with nonblocking ones. */
>  			if (!completed && nonblock) {
>  				spin_unlock(&crtc->commit_lock);
> +				DRM_DEBUG_ATOMIC("[CRTC:%d:%s] busy with a previous commit\n",
> +					crtc->base.id, crtc->name);
> +
>  				return -EBUSY;
>  			}
>  		} else if (i == 1) {
> @@ -2132,8 +2138,12 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
>  		/* Userspace is not allowed to get ahead of the previous
>  		 * commit with nonblocking ones. */
>  		if (nonblock && old_conn_state->commit &&
> -		    !try_wait_for_completion(&old_conn_state->commit->flip_done))
> +		    !try_wait_for_completion(&old_conn_state->commit->flip_done)) {
> +			DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] busy with a previous commit\n",
> +				conn->base.id, conn->name);
> +
>  			return -EBUSY;
> +		}
>  
>  		/* Always track connectors explicitly for e.g. link retraining. */
>  		commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc);
> @@ -2147,8 +2157,12 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
>  		/* Userspace is not allowed to get ahead of the previous
>  		 * commit with nonblocking ones. */
>  		if (nonblock && old_plane_state->commit &&
> -		    !try_wait_for_completion(&old_plane_state->commit->flip_done))
> +		    !try_wait_for_completion(&old_plane_state->commit->flip_done)) {
> +			DRM_DEBUG_ATOMIC("[PLANE:%d:%s] busy with a previous commit\n",
> +				plane->base.id, plane->name);
> +
>  			return -EBUSY;
> +		}
>  
>  		/* Always track planes explicitly for async pageflip support. */
>  		commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc);

The new debug messages sound good to me.


Thanks,
pq

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

  reply	other threads:[~2020-09-25  8:27 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 10:57 [Intel-gfx] [PATCH 1/2] drm/atomic: document and enforce rules around "spurious" EBUSY Daniel Vetter
2020-09-23 10:57 ` Daniel Vetter
2020-09-23 10:57 ` [Intel-gfx] [PATCH 2/2] drm/atomic: debug output for EBUSY Daniel Vetter
2020-09-23 10:57   ` Daniel Vetter
2020-09-25  8:27   ` Pekka Paalanen [this message]
2020-09-25  8:27     ` Pekka Paalanen
2020-09-23 11:03 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/atomic: document and enforce rules around "spurious" EBUSY Patchwork
2020-09-23 11:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-23 14:33 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-09-23 15:18 ` [Intel-gfx] [PATCH] " Daniel Vetter
2020-09-23 15:18   ` Daniel Vetter
2020-09-23 19:17   ` [Intel-gfx] " Marius Vlad
2020-09-23 19:17     ` Marius Vlad
2020-09-23 20:01     ` [Intel-gfx] " Daniel Vetter
2020-09-23 20:01       ` Daniel Vetter
2020-09-24  7:41       ` [Intel-gfx] " Pekka Paalanen
2020-09-24  7:41         ` Pekka Paalanen
2020-09-24  8:04         ` [Intel-gfx] " Daniel Vetter
2020-09-24  8:04           ` Daniel Vetter
2020-09-24 10:10           ` [Intel-gfx] " Pekka Paalanen
2020-09-24 10:10             ` Pekka Paalanen
2020-09-24 11:01             ` [Intel-gfx] " Ville Syrjälä
2020-09-24 11:01               ` Ville Syrjälä
2020-09-24 11:13               ` [Intel-gfx] " Daniel Vetter
2020-09-24 11:13                 ` Daniel Vetter
2020-09-24 11:32                 ` [Intel-gfx] " Ville Syrjälä
2020-09-24 11:32                   ` Ville Syrjälä
2020-09-25  8:24   ` [Intel-gfx] " Pekka Paalanen
2020-09-25  8:24     ` Pekka Paalanen
2020-09-25  8:45     ` [Intel-gfx] " Daniel Vetter
2020-09-25  8:45       ` Daniel Vetter
2020-09-23 15:47 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with drm/atomic: document and enforce rules around "spurious" EBUSY (rev2) Patchwork
2020-09-23 16:16 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-09-25  8:46 [Intel-gfx] [PATCH 1/2] drm/atomic: document and enforce rules around "spurious" EBUSY Daniel Vetter
2020-09-25  8:46 ` [Intel-gfx] [PATCH 2/2] drm/atomic: debug output for EBUSY Daniel Vetter
2020-09-25  9:11   ` Pekka Paalanen
2020-09-29 15:48   ` Daniel Stone
2020-10-08  9:31     ` Daniel Vetter

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=20200925112750.130f25a6@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=seanpaul@chromium.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.