All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Dave Airlie <airlied@redhat.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Gabriel Feceoru <gabriel.feceoru@intel.com>
Subject: Re: [PATCH] drm/i915: Correctly refcount connectors in hw state readou
Date: Fri, 6 May 2016 17:07:09 +0300	[thread overview]
Message-ID: <20160506140709.GC4329@intel.com> (raw)
In-Reply-To: <1462541943-19620-1-git-send-email-daniel.vetter@ffwll.ch>

On Fri, May 06, 2016 at 03:39:03PM +0200, Daniel Vetter wrote:
> This was forgotten when adding the the refcounting to
> drm_connector_state.
> 
> v2: Don't forget to unreference existing connectors. This isn't
> relevant on driver load, but this code also runs on resume, and there
> we already have an atomic state. Spotted by Chris Wilson.
> 
> Cc: Gabriel Feceoru <gabriel.feceoru@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Marius Vlad <marius.c.vlad@intel.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Fixes: d2307dea14a4 ("drm/atomic: use connector references (v3)")
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 45c218db86be..6ba676f81bae 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12023,11 +12023,16 @@ static void intel_modeset_update_connector_atomic_state(struct drm_device *dev)
>  	struct intel_connector *connector;
>  
>  	for_each_intel_connector(dev, connector) {
> +		if (connector->base.state->crtc)
> +			drm_connector_unreference(&connector->base);
> +
>  		if (connector->base.encoder) {
>  			connector->base.state->best_encoder =
>  				connector->base.encoder;
>  			connector->base.state->crtc =
>  				connector->base.encoder->crtc;
> +
> +			drm_connector_reference(&connector->base);

Is it safe to unref before ref?

>  		} else {
>  			connector->base.state->best_encoder = NULL;
>  			connector->base.state->crtc = NULL;
> -- 
> 2.5.0
> 
> _______________________________________________
> 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

  parent reply	other threads:[~2016-05-06 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 13:39 [PATCH] drm/i915: Correctly refcount connectors in hw state readou Daniel Vetter
2016-05-06 14:01 ` Chris Wilson
2016-05-06 14:09   ` Daniel Vetter
2016-05-06 14:07 ` Ville Syrjälä [this message]
2016-05-06 14:19   ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2016-05-06 13:09 Daniel Vetter
2016-05-06 13:20 ` Chris Wilson

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=20160506140709.GC4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gabriel.feceoru@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.