intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Move modeset state checker calls.
Date: Thu, 7 Apr 2016 16:23:36 -0700	[thread overview]
Message-ID: <20160407232336.GH22764@intel.com> (raw)
In-Reply-To: <1458741487-23801-3-git-send-email-maarten.lankhorst@linux.intel.com>

On Wed, Mar 23, 2016 at 02:58:07PM +0100, Maarten Lankhorst wrote:
> The modeset state checker no longer has full access to the hardware,
> instead it should only check affected crtc's.
> 
> Looking for disabled stuff can be checked immediately after all crtc
> disables have completed, while each enabled crtc can be checked right
> after being enabled.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 24 +++++-------------------
>  1 file changed, 5 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4148b262f2a7..b6a75aa32e5a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13027,28 +13027,13 @@ check_disabled_dpll_state(struct drm_device *dev)
>  }
>  
>  static void
> -intel_modeset_check_disabled(struct drm_device *dev,
> -			     struct drm_atomic_state *old_state)
> +intel_modeset_check_disabled(struct drm_device *dev)
>  {
>  	check_encoder_state(dev);
>  	check_connector_state(dev, NULL);
>  	check_disabled_dpll_state(dev);
>  }
>  
> -static void
> -intel_modeset_check_state(struct drm_device *dev,
> -			  struct drm_atomic_state *old_state)
> -{
> -	struct drm_crtc_state *old_crtc_state;
> -	struct drm_crtc *crtc;
> -	int i;
> -
> -	for_each_crtc_in_state(old_state, crtc, old_crtc_state, i)
> -		intel_modeset_check_crtc(crtc, old_crtc_state, crtc->state);
> -
> -	intel_modeset_check_disabled(dev, old_state);
> -}
> -
>  static void update_scanline_offset(struct intel_crtc *crtc)
>  {
>  	struct drm_device *dev = crtc->base.dev;
> @@ -13616,6 +13601,8 @@ static int intel_atomic_commit(struct drm_device *dev,
>  		if (dev_priv->display.modeset_commit_cdclk &&
>  		    intel_state->dev_cdclk != dev_priv->cdclk_freq)
>  			dev_priv->display.modeset_commit_cdclk(state);
> +
> +		intel_modeset_check_disabled(dev);

As noted on patch #1, since we're checking all disabled state (and not
just the things that are newly-disabled by this transaction), we may not
hold full locks over everything that's disabled here and might be racing
with other updates.  But we're no worse off than we were before.

As a minor behavior change, it looks like we're also no longer calling
this when we're doing non-modeset pipe updates, but that should be fine.


Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

>  	}
>  
>  	/* Now enable the clocks, plane, pipe, and connectors that we set up. */
> @@ -13682,6 +13669,8 @@ static int intel_atomic_commit(struct drm_device *dev,
>  
>  		if (put_domains[i])
>  			modeset_put_power_domains(dev_priv, put_domains[i]);
> +
> +		intel_modeset_check_crtc(crtc, old_crtc_state, crtc->state);
>  	}
>  
>  	if (intel_state->modeset)
> @@ -13691,9 +13680,6 @@ static int intel_atomic_commit(struct drm_device *dev,
>  	drm_atomic_helper_cleanup_planes(dev, state);
>  	mutex_unlock(&dev->struct_mutex);
>  
> -	if (hw_check)
> -		intel_modeset_check_state(dev, state);
> -
>  	drm_atomic_state_free(state);
>  
>  	/* As one of the primary mmio accessors, KMS has a high likelihood
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-07 23:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 13:58 [PATCH 0/2] drm/i915: Split up modeset state checker Maarten Lankhorst
2016-03-23 13:58 ` [PATCH 1/2] drm/i915: Make modeset state checker take crtc as argument Maarten Lankhorst
2016-04-07 23:22   ` Matt Roper
2016-03-23 13:58 ` [PATCH 2/2] drm/i915: Move modeset state checker calls Maarten Lankhorst
2016-04-07 23:23   ` Matt Roper [this message]
2016-04-08  9:38     ` Maarten Lankhorst
2016-03-25 16:59 ` [PATCH 0/2] drm/i915: Split up modeset state checker Matt Roper
2016-03-29  7:33   ` Maarten Lankhorst
2016-03-30  8:00   ` [PATCH 3/2] drm/i915: Rename hw state checker to hw state verifier Maarten Lankhorst
2016-03-30 11:26     ` Daniel Vetter
2016-04-07 23:24     ` Matt Roper

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=20160407232336.GH22764@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@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).