[Intel-gfx] [PATCH 4/5] drm/atomic: use connector references

Daniel Vetter daniel at ffwll.ch
Wed Apr 27 07:47:31 UTC 2016


On Wed, Apr 27, 2016 at 08:13:04AM +0100, Daniel Stone wrote:
> 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?

Yeah, that's more in line with how we refcount other stuff in atomic. With
that bikeshed:

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

> 
> Cheers,
> Daniel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list