All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 6/6] drm/atomic: Remove drm_atomic_connectors_for_crtc.
Date: Tue, 5 Jan 2016 09:45:00 +0100	[thread overview]
Message-ID: <20160105084500.GJ8076@phenom.ffwll.local> (raw)
In-Reply-To: <1451908400-25147-6-git-send-email-maarten.lankhorst@linux.intel.com>

On Mon, Jan 04, 2016 at 12:53:20PM +0100, Maarten Lankhorst wrote:
> Now that connector_mask is reliable there's no need for this
> function any more.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Since this doesn't touch i915 I figured I can merge this one too. So
except for the previous i915 patch it's now all in drm-misc.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic.c        | 30 ------------------------------
>  drivers/gpu/drm/drm_atomic_helper.c | 10 ++++------
>  drivers/gpu/drm/vc4/vc4_crtc.c      |  2 +-
>  include/drm/drm_atomic.h            |  4 ----
>  4 files changed, 5 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 14b321580517..d3ed12447fbb 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1183,36 +1183,6 @@ drm_atomic_add_affected_planes(struct drm_atomic_state *state,
>  EXPORT_SYMBOL(drm_atomic_add_affected_planes);
>  
>  /**
> - * drm_atomic_connectors_for_crtc - count number of connected outputs
> - * @state: atomic state
> - * @crtc: DRM crtc
> - *
> - * This function counts all connectors which will be connected to @crtc
> - * according to @state. Useful to recompute the enable state for @crtc.
> - */
> -int
> -drm_atomic_connectors_for_crtc(struct drm_atomic_state *state,
> -			       struct drm_crtc *crtc)
> -{
> -	struct drm_connector *connector;
> -	struct drm_connector_state *conn_state;
> -
> -	int i, num_connected_connectors = 0;
> -
> -	for_each_connector_in_state(state, connector, conn_state, i) {
> -		if (conn_state->crtc == crtc)
> -			num_connected_connectors++;
> -	}
> -
> -	DRM_DEBUG_ATOMIC("State %p has %i connectors for [CRTC:%d:%s]\n",
> -			 state, num_connected_connectors,
> -			 crtc->base.id, crtc->name);
> -
> -	return num_connected_connectors;
> -}
> -EXPORT_SYMBOL(drm_atomic_connectors_for_crtc);
> -
> -/**
>   * drm_atomic_legacy_backoff - locking backoff for legacy ioctls
>   * @state: atomic state
>   *
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 27dd68f946e6..13b771cb0d35 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -464,7 +464,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>  	 * crtc only changed its mode but has the same set of connectors.
>  	 */
>  	for_each_crtc_in_state(state, crtc, crtc_state, i) {
> -		int num_connectors;
> +		bool has_connectors =
> +			!!crtc_state->connector_mask;
>  
>  		/*
>  		 * We must set ->active_changed after walking connectors for
> @@ -493,10 +494,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>  		if (ret != 0)
>  			return ret;
>  
> -		num_connectors = drm_atomic_connectors_for_crtc(state,
> -								crtc);
> -
> -		if (crtc_state->enable != !!num_connectors) {
> +		if (crtc_state->enable != has_connectors) {
>  			DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n",
>  					 crtc->base.id, crtc->name);
>  
> @@ -1755,7 +1753,7 @@ static int update_output_state(struct drm_atomic_state *state,
>  		if (crtc == set->crtc)
>  			continue;
>  
> -		if (!drm_atomic_connectors_for_crtc(state, crtc)) {
> +		if (!crtc_state->connector_mask) {
>  			ret = drm_atomic_set_mode_prop_for_crtc(crtc_state,
>  								NULL);
>  			if (ret < 0)
> diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
> index 2168a99d59aa..aa7ed24a41c7 100644
> --- a/drivers/gpu/drm/vc4/vc4_crtc.c
> +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
> @@ -327,7 +327,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc,
>  	/* The pixelvalve can only feed one encoder (and encoders are
>  	 * 1:1 with connectors.)
>  	 */
> -	if (drm_atomic_connectors_for_crtc(state->state, crtc) > 1)
> +	if (hweight32(state->connector_mask) > 1)
>  		return -EINVAL;
>  
>  	drm_atomic_crtc_state_for_each_plane(plane, state) {
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index d8576ac55693..d3eaa5df187a 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -130,10 +130,6 @@ int __must_check
>  drm_atomic_add_affected_planes(struct drm_atomic_state *state,
>  			       struct drm_crtc *crtc);
>  
> -int
> -drm_atomic_connectors_for_crtc(struct drm_atomic_state *state,
> -			       struct drm_crtc *crtc);
> -
>  void drm_atomic_legacy_backoff(struct drm_atomic_state *state);
>  
>  void
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-05  8:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 11:53 [PATCH v2 1/6] drm/i915: Set connector_state->connector using the helper Maarten Lankhorst
2016-01-04 11:53 ` [PATCH v2 2/6] drm/atomic: Add __drm_atomic_helper_connector_reset, v2 Maarten Lankhorst
2016-01-05  8:43   ` Daniel Vetter
2016-01-04 11:53 ` [PATCH v2 3/6] drm/tegra: Use __drm_atomic_helper_reset_connector for subclassing connector state, v2 Maarten Lankhorst
2016-01-04 11:53 ` [PATCH v2 4/6] drm/atomic: add connector mask to drm_crtc_state Maarten Lankhorst
2016-01-05  8:43   ` Daniel Vetter
2016-01-04 11:53 ` [PATCH v2 5/6] drm/i915: Update connector_mask during readout Maarten Lankhorst
2016-01-05  8:35   ` Daniel Vetter
2016-01-05  9:05     ` Maarten Lankhorst
2016-01-05  9:10       ` [Intel-gfx] " Daniel Vetter
2016-01-05  9:16         ` Maarten Lankhorst
2016-01-06 13:53         ` [PATCH v2.1 5/6] drm/i915: Update connector_mask during readout, v2 Maarten Lankhorst
2016-01-04 11:53 ` [PATCH v2 6/6] drm/atomic: Remove drm_atomic_connectors_for_crtc Maarten Lankhorst
2016-01-05  8:45   ` Daniel Vetter [this message]
2016-01-04 12:49 ` ✗ warning: Fi.CI.BAT 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=20160105084500.GJ8076@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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 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.