intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Extract intel_atomic_swap_state()
Date: Mon, 15 Jan 2024 13:10:18 +0200	[thread overview]
Message-ID: <ZaUSmtMpqJWFlrC3@intel.com> (raw)
In-Reply-To: <20231219130756.25986-4-ville.syrjala@linux.intel.com>

On Tue, Dec 19, 2023 at 03:07:56PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Pull all the state swap stuff into its own function to declutter
> intel_atomic_commit() a bit.
> 
> Note that currently the state swap is spread across both
> sides of the unprepare branch in intel_atomic_commit(), but
> we can pull all of it ahead a bit since we bail on the first
> error, and thus there is no change in behaviour from the
> reordering.

For that one, guess can give r-b rightaway, will check
global state serialize then, seems to be major change..

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 23 +++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 46eff0ee5519..bf37bfcf350e 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7311,6 +7311,23 @@ static int intel_atomic_setup_commit(struct intel_atomic_state *state, bool nonb
>  	return 0;
>  }
>  
> +static int intel_atomic_swap_state(struct intel_atomic_state *state)
> +{
> +	int ret;
> +
> +	ret = drm_atomic_helper_swap_state(&state->base, true);
> +	if (ret)
> +		return ret;
> +
> +	intel_atomic_swap_global_state(state);
> +
> +	intel_shared_dpll_swap_state(state);
> +
> +	intel_atomic_track_fbs(state);
> +
> +	return 0;
> +}
> +
>  int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
>  			bool nonblock)
>  {
> @@ -7358,9 +7375,7 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
>  
>  	ret = intel_atomic_setup_commit(state, nonblock);
>  	if (!ret)
> -		ret = drm_atomic_helper_swap_state(&state->base, true);
> -	if (!ret)
> -		intel_atomic_swap_global_state(state);
> +		ret = intel_atomic_swap_state(state);
>  
>  	if (ret) {
>  		struct intel_crtc_state *new_crtc_state;
> @@ -7374,8 +7389,6 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
>  		intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref);
>  		return ret;
>  	}
> -	intel_shared_dpll_swap_state(state);
> -	intel_atomic_track_fbs(state);
>  
>  	drm_atomic_state_get(&state->base);
>  	INIT_WORK(&state->base.commit_work, intel_atomic_commit_work);
> -- 
> 2.41.0
> 

  reply	other threads:[~2024-01-15 11:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 13:07 [PATCH 0/3] drm/i915: Rework global state serialization Ville Syrjala
2023-12-19 13:07 ` [PATCH 1/3] drm/i915: Compute use_sagv_wm differently Ville Syrjala
2024-02-01  8:17   ` Lisovskiy, Stanislav
2023-12-19 13:07 ` [PATCH 2/3] drm/i915: Rework global state serializaiton Ville Syrjala
2024-02-01  8:48   ` Lisovskiy, Stanislav
2023-12-19 13:07 ` [PATCH 3/3] drm/i915: Extract intel_atomic_swap_state() Ville Syrjala
2024-01-15 11:10   ` Lisovskiy, Stanislav [this message]
2023-12-19 13:39 ` ✗ Fi.CI.SPARSE: warning for drm/i915: Rework global state serialization Patchwork
2023-12-19 13:52 ` ✓ Fi.CI.BAT: success " Patchwork
2023-12-19 15:25 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-10 18:17 ` ✗ Fi.CI.SPARSE: warning for drm/i915: Rework global state serialization (rev2) Patchwork
2024-01-10 18:30 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-10 22:20 ` ✗ Fi.CI.IGT: failure " Patchwork

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=ZaUSmtMpqJWFlrC3@intel.com \
    --to=stanislav.lisovskiy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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;
as well as URLs for NNTP newsgroup(s).