[Intel-gfx] [PATCH 4/5] drm/atomic: use connector references
Daniel Stone
daniel at fooishbar.org
Wed Apr 27 07:13:04 UTC 2016
Hi,
On 27 April 2016 at 03:03, Dave Airlie <airlied at gmail.com> wrote:
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 9d5e3c8..d899dac 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1179,6 +1179,15 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
>
> conn_state->crtc = crtc;
>
> + /* If we had no crtc then got one, add a reference,
> + * if we had a crtc and are going to none, drop a reference,
> + * otherwise just keep the reference we have.
> + */
> + if (!had_crtc && crtc)
> + drm_connector_reference(conn_state->connector);
> + else if (!crtc && had_crtc)
> + drm_connector_unreference(conn_state->connector);
Similarly to the non-atomic comments, can you drop the had_crtc test
here, and always ref if crtc, and unref if !crtc?
Cheers,
Daniel
More information about the Intel-gfx
mailing list