public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 7/7] drm/atomic: Clean up update_connector_routing.
Date: Tue, 8 Mar 2016 13:20:48 +0100	[thread overview]
Message-ID: <20160308122048.GE14170@phenom.ffwll.local> (raw)
In-Reply-To: <20160304132903.GT10446@intel.com>

On Fri, Mar 04, 2016 at 03:29:03PM +0200, Ville Syrjälä wrote:
> On Thu, Mar 03, 2016 at 10:17:42AM +0100, Maarten Lankhorst wrote:
> > connector_state->crtc can no longer be unset by accident,
> > so that check can be removed. The other code open-codes
> > drm_atomic_get_existing_crtc_state, so use that.
> > 
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > ---
> >  drivers/gpu/drm/drm_atomic_helper.c | 17 ++++-------------
> >  1 file changed, 4 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index 2395201eb7ab..9f0d16eb04b2 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -265,7 +265,7 @@ update_connector_routing(struct drm_atomic_state *state,
> >  	const struct drm_connector_helper_funcs *funcs;
> >  	struct drm_encoder *new_encoder;
> >  	struct drm_crtc_state *crtc_state;
> > -	int idx, ret;
> > +	int ret;
> >  
> >  	DRM_DEBUG_ATOMIC("Updating routing for [CONNECTOR:%d:%s]\n",
> >  			 connector->base.id,
> > @@ -273,16 +273,12 @@ update_connector_routing(struct drm_atomic_state *state,
> >  
> >  	if (connector->state->crtc != connector_state->crtc) {
> >  		if (connector->state->crtc) {
> > -			idx = drm_crtc_index(connector->state->crtc);
> > -
> > -			crtc_state = state->crtc_states[idx];
> > +			crtc_state = drm_atomic_get_existing_crtc_state(state, connector->state->crtc);
> >  			crtc_state->connectors_changed = true;
> >  		}
> >  
> >  		if (connector_state->crtc) {
> > -			idx = drm_crtc_index(connector_state->crtc);
> > -
> > -			crtc_state = state->crtc_states[idx];
> > +			crtc_state = drm_atomic_get_existing_crtc_state(state, connector_state->crtc);
> >  			crtc_state->connectors_changed = true;
> >  		}
> >  	}
> > @@ -336,14 +332,9 @@ update_connector_routing(struct drm_atomic_state *state,
> >  
> >  	steal_encoder(state, new_encoder);
> >  
> > -	if (WARN_ON(!connector_state->crtc))
> > -		return -EINVAL;
> > -
> 
> I was going to suggest just this when I read the code previously.
> 
> >  	set_best_encoder(state, connector_state, new_encoder);
> >  
> > -	idx = drm_crtc_index(connector_state->crtc);
> > -
> > -	crtc_state = state->crtc_states[idx];
> > +	crtc_state = drm_atomic_get_existing_crtc_state(state, connector_state->crtc);
> 
> These could have been a separate patch, but no biggie
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Remaining patches applied to drm-misc, thanks.
-Daniel

> 
> >  	crtc_state->connectors_changed = true;
> >  
> >  	DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n",
> > -- 
> > 2.1.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://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
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-03-08 12:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03  9:17 [PATCH v3 0/7] drm/atomic: Fix encoder stealing, v3 Maarten Lankhorst
2016-03-03  9:17 ` [PATCH v3 1/7] drm/atomic: Clean up update_output_state Maarten Lankhorst
2016-03-03  9:17 ` [PATCH v3 2/7] drm/atomic: Pass connector and state to update_connector_routing Maarten Lankhorst
2016-03-03  9:17 ` [PATCH v3 3/7] drm/atomic: Always call steal_encoder, v2 Maarten Lankhorst
2016-03-03  9:17 ` [PATCH v3 4/7] drm/atomic: Handle encoder stealing from set_config better Maarten Lankhorst
2016-03-03  9:17 ` [PATCH v3 5/7] drm/atomic: Handle encoder assignment conflicts in a separate check, v3 Maarten Lankhorst
2016-03-04 13:24   ` Ville Syrjälä
2016-03-03  9:17 ` [PATCH v3 6/7] drm/atomic: Clean up steal_encoder, v2 Maarten Lankhorst
2016-03-03  9:41   ` [Intel-gfx] " kbuild test robot
2016-03-04 13:27   ` Ville Syrjälä
2016-03-03  9:17 ` [PATCH v3 7/7] drm/atomic: Clean up update_connector_routing Maarten Lankhorst
2016-03-04 13:29   ` [Intel-gfx] " Ville Syrjälä
2016-03-08 12:20     ` Daniel Vetter [this message]
2016-03-03  9:25 ` ✗ Fi.CI.BAT: failure for drm/atomic: Fix encoder stealing, v3 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=20160308122048.GE14170@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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