dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	dri-devel@lists.freedesktop.org,
	Gustavo Padovan <gustavo.padovan@collabora.com>
Subject: Re: [PATCH 3/8] drm/i915: use drm_for_each_connector_iter()
Date: Fri, 12 May 2017 20:05:38 +0300	[thread overview]
Message-ID: <20170512170538.GN12629@intel.com> (raw)
In-Reply-To: <20170512074220.mckecfpkavh2p5xn@phenom.ffwll.local>

On Fri, May 12, 2017 at 09:42:20AM +0200, Daniel Vetter wrote:
> On Thu, May 11, 2017 at 04:10:44PM -0300, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.com>
> > 
> > Drop legacy drm_for_each_connector() in favor of the race-free
> > drm_for_each_connector_iter().
> > 
> > Cc: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 3617927..207f144 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -11216,6 +11216,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
> >  {
> >  	struct drm_device *dev = state->dev;
> >  	struct drm_connector *connector;
> > +	struct drm_connector_list_iter conn_iter;
> >  	unsigned int used_ports = 0;
> >  	unsigned int used_mst_ports = 0;
> >  
> > @@ -11224,7 +11225,8 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
> >  	 * list to detect the problem on ddi platforms
> >  	 * where there's just one encoder per digital port.
> >  	 */
> > -	drm_for_each_connector(connector, dev) {
> > +	drm_connector_list_iter_begin(dev, &conn_iter);
> > +	drm_for_each_connector_iter(connector, &conn_iter) {
> 
> Since this checks an atomic state it'd probably be better to use
> for_each_new_connector_in_state (to make sure we check the same connectors
> as in the atomic state,

We need to check all ports here, not just the ones part of the state.

> and not something else due to hotplug changes
> meanwhile). But this is ok as the mechanical change, so
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> >  		struct drm_connector_state *connector_state;
> >  		struct intel_encoder *encoder;
> >  
> > @@ -11263,6 +11265,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
> >  			break;
> >  		}
> >  	}
> > +	drm_connector_list_iter_end(&conn_iter);
> >  
> >  	/* can't mix MST and SST/HDMI on the same port */
> >  	if (used_ports & used_mst_ports)
> > -- 
> > 2.9.3
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-12 17:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 19:10 [PATCH 0/8] remove unsafe drm_for_each_connector() Gustavo Padovan
2017-05-11 19:10 ` [PATCH 1/8] drm/exynos: use drm_for_each_connector_iter() Gustavo Padovan
2017-05-12  7:38   ` Daniel Vetter
2017-05-30  0:22   ` Inki Dae
2017-05-11 19:10 ` [PATCH 2/8] drm/rockchip: " Gustavo Padovan
2017-05-12  7:38   ` Daniel Vetter
2017-05-12 21:59   ` Sean Paul
2017-05-15 13:43   ` [PATCH v2] " Gustavo Padovan
2017-05-11 19:10 ` [PATCH 3/8] drm/i915: " Gustavo Padovan
2017-05-12  7:42   ` Daniel Vetter
2017-05-12 17:05     ` Ville Syrjälä [this message]
2017-05-11 19:10 ` [PATCH 4/8] drm/mediatek: " Gustavo Padovan
2017-05-12  7:44   ` Daniel Vetter
2017-05-11 19:10 ` [PATCH 5/8] drm/nouveau: " Gustavo Padovan
2017-05-12  7:45   ` Daniel Vetter
2017-05-11 19:10 ` [PATCH 6/8] drm/vc4: " Gustavo Padovan
2017-05-12  7:49   ` Daniel Vetter
2017-05-12 16:41   ` [PATCH v2] " Gustavo Padovan
2017-05-12 21:06     ` Eric Anholt
2017-05-11 19:10 ` [PATCH 7/8] drm: remove unsafe drm_for_each_connector() Gustavo Padovan
2017-05-12  7:51   ` Daniel Vetter
2017-05-11 19:10 ` [PATCH 8/8] drm: todo: remove task about switch to drm_connector_list_iter Gustavo Padovan
2017-05-12  7:51   ` Daniel Vetter
2017-05-26 23:17   ` Gustavo Padovan
2017-05-12  7:52 ` [PATCH 0/8] remove unsafe drm_for_each_connector() Daniel Vetter
2017-05-12 22:05 ` Sean Paul

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=20170512170538.GN12629@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.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