public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dave Airlie <airlied@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/crtc: take references to connectors used in a modeset. (v2)
Date: Tue, 3 May 2016 10:00:34 +0200	[thread overview]
Message-ID: <20160503080034.GC14148@phenom.ffwll.local> (raw)
In-Reply-To: <1462249706-4759-4-git-send-email-airlied@gmail.com>

On Tue, May 03, 2016 at 02:28:24PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> This just takes a reference on the connector when we set a mode
> in the non-atomic paths.
> 
> v2: Follow Daniel Stone's suggestions on when to take/drop
> references.
> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>

I've already embarrassed myself once with a bonghits r-b, let's try this
again:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_crtc_helper.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
> index 66ca313..f47a252 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -456,6 +456,9 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
>  			 * between them is henceforth no longer available.
>  			 */
>  			connector->dpms = DRM_MODE_DPMS_OFF;
> +
> +			/* we keep a reference while the encoder is bound */
> +			drm_connector_unreference(connector);
>  		}
>  	}
>  
> @@ -606,6 +609,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
>  		mode_changed = true;
>  	}
>  
> +	/* take a reference on all connectors in set */
> +	for (ro = 0; ro < set->num_connectors; ro++) {
> +		drm_connector_reference(set->connectors[ro]);
> +	}
> +
>  	/* a) traverse passed in connector list and get encoders for them */
>  	count = 0;
>  	drm_for_each_connector(connector, dev) {
> @@ -724,6 +732,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
>  		}
>  	}
>  
> +	/* after fail drop reference on all connectors in save set */
> +	count = 0;
> +	drm_for_each_connector(connector, dev) {
> +		drm_connector_unreference(&save_connectors[count++]);
> +	}
> +
>  	kfree(save_connectors);
>  	kfree(save_encoders);
>  	return 0;
> @@ -740,6 +754,11 @@ fail:
>  		*connector = save_connectors[count++];
>  	}
>  
> +	/* after fail drop reference on all connectors in set */
> +	for (ro = 0; ro < set->num_connectors; ro++) {
> +		drm_connector_unreference(set->connectors[ro]);
> +	}
> +
>  	/* Try to restore the config */
>  	if (mode_changed &&
>  	    !drm_crtc_helper_set_mode(save_set.crtc, save_set.mode, save_set.x,
> -- 
> 2.5.5
> 
> _______________________________________________
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-05-03  8:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  4:28 [PATCH 1/6] drm/fb: fix missing /** in kerneldoc comment Dave Airlie
2016-05-03  4:28 ` [PATCH 2/6] drm/modes: add connector reference counting. (v2) Dave Airlie
2016-05-03  4:28 ` [PATCH 3/6] drm/fb_helper: " Dave Airlie
2016-05-03  7:56   ` [Intel-gfx] " Daniel Vetter
2016-05-03  4:28 ` [PATCH 4/6] drm/crtc: take references to connectors used in a modeset. (v2) Dave Airlie
2016-05-03  8:00   ` Daniel Vetter [this message]
2016-05-03  4:28 ` [PATCH 5/6] drm/atomic: use connector references (v2) Dave Airlie
2016-05-03  8:03   ` Daniel Vetter
2016-05-03 10:09     ` Dave Airlie
2016-05-03 12:26       ` Daniel Vetter
2016-05-03 14:02   ` Daniel Stone
2016-05-03  4:28 ` [PATCH 6/6] drm/i915/mst: use reference counted connectors. (v3) Dave Airlie
2016-05-03  7:55 ` [PATCH 1/6] drm/fb: fix missing /** in kerneldoc comment Daniel Vetter

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=20160503080034.GC14148@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox