AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Kazlauskas, Nicholas" <nicholas.kazlauskas@amd.com>
To: Aurabindo Pillai <aurabindo.pillai@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/amd/display: Move disable interrupt into commit tail
Date: Wed, 9 Sep 2020 11:01:52 -0400	[thread overview]
Message-ID: <18942f18-96aa-7a22-c296-aae68e53a4dc@amd.com> (raw)
In-Reply-To: <20200909142854.105032-4-aurabindo.pillai@amd.com>

On 2020-09-09 10:28 a.m., Aurabindo Pillai wrote:
> [Why&How]
> Since there is no need for accessing crtc state in the interrupt
> handler, interrupts need not be disabled well in advance, and
> can be moved to commit_tail where it should be.
> 
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>

This patch is fine in idea, but it'll need the reference counting fixed 
in patch #2 first and be adjusted after.

Regards,
Nicholas Kazlauskas

> ---
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 38 +++++--------------
>   1 file changed, 10 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 0603436a3313..a40de242e04a 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7488,34 +7488,6 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev,
>   				   struct drm_atomic_state *state,
>   				   bool nonblock)
>   {
> -	struct drm_crtc *crtc;
> -	struct drm_crtc_state *old_crtc_state, *new_crtc_state;
> -	struct amdgpu_device *adev = drm_to_adev(dev);
> -	int i;
> -
> -	/*
> -	 * We evade vblank and pflip interrupts on CRTCs that are undergoing
> -	 * a modeset, being disabled, or have no active planes.
> -	 *
> -	 * It's done in atomic commit rather than commit tail for now since
> -	 * some of these interrupt handlers access the current CRTC state and
> -	 * potentially the stream pointer itself.
> -	 *
> -	 * Since the atomic state is swapped within atomic commit and not within
> -	 * commit tail this would leave to new state (that hasn't been committed yet)
> -	 * being accesssed from within the handlers.
> -	 *
> -	 * TODO: Fix this so we can do this in commit tail and not have to block
> -	 * in atomic check.
> -	 */
> -	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
> -		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
> -
> -		if (old_crtc_state->active &&
> -		    (!new_crtc_state->active ||
> -		     drm_atomic_crtc_needs_modeset(new_crtc_state)))
> -			manage_dm_interrupts(adev, acrtc, false);
> -	}
>   	/*
>   	 * Add check here for SoC's that support hardware cursor plane, to
>   	 * unset legacy_cursor_update
> @@ -7566,6 +7538,16 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
>   		dc_resource_state_copy_construct_current(dm->dc, dc_state);
>   	}
>   
> +	for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state,
> +				       new_crtc_state, i) {
> +		acrtc = to_amdgpu_crtc(crtc);
> +
> +		if (old_crtc_state->active &&
> +		    (!new_crtc_state->active ||
> +		     drm_atomic_crtc_needs_modeset(new_crtc_state)))
> +			manage_dm_interrupts(adev, acrtc, false);
> +	}
> +
>   	/* update changed items */
>   	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
>   		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
> 

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

      reply	other threads:[~2020-09-09 15:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 14:28 [PATCH 0/3] Refactor DM IRQ handling Aurabindo Pillai
2020-09-09 14:28 ` [PATCH 1/3] drm/amdgpu: Move existing pflip fields into separate struct Aurabindo Pillai
2020-09-09 14:58   ` Kazlauskas, Nicholas
2020-09-09 14:28 ` [PATCH 2/3] drm/amd/display: Refactor to prevent crtc state access in DM IRQ handler Aurabindo Pillai
2020-09-09 15:00   ` Kazlauskas, Nicholas
2020-09-11 16:28     ` Aurabindo Pillai
2020-09-09 14:28 ` [PATCH 3/3] drm/amd/display: Move disable interrupt into commit tail Aurabindo Pillai
2020-09-09 15:01   ` Kazlauskas, Nicholas [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=18942f18-96aa-7a22-c296-aae68e53a4dc@amd.com \
    --to=nicholas.kazlauskas@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    /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