Re: [PATCH 1/3] drm/dp: Keep a list of drm_dp_aux helper.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 15, 2015 at 07:57:19PM +0300, Ville Syrjälä wrote:
> On Tue, Sep 15, 2015 at 09:27:27AM -0700, Rafael Antognolli wrote:
> > On Tue, Sep 15, 2015 at 10:46:43AM +0300, Ville Syrjälä wrote:
> > > On Mon, Sep 14, 2015 at 04:12:30PM -0700, Rafael Antognolli wrote:
> > > > This list will be used to get the aux channels registered through the
> > > > helpers. Two functions are provided to register/unregister notifier
> > > > listeners on the list, and another functiont to iterate over the list of
> > > > aux channels.
> > > > 
> > > > Signed-off-by: Rafael Antognolli <rafael.antognolli@xxxxxxxxx>
> > > > ---
> > > >  drivers/gpu/drm/drm_dp_helper.c | 71 +++++++++++++++++++++++++++++++++++++++++
> > > >  include/drm/drm_dp_helper.h     |  6 ++++
> > > >  2 files changed, 77 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > > > index 291734e..01a1489 100644
> > > > --- a/drivers/gpu/drm/drm_dp_helper.c
> > > > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > > > @@ -710,6 +710,54 @@ static const struct i2c_algorithm drm_dp_i2c_algo = {
> > > >  	.master_xfer = drm_dp_i2c_xfer,
> > > >  };
> > > >  
> > > > +struct drm_dp_aux_node {
> > > > +	struct klist_node list;
> > > > +	struct drm_dp_aux *aux;
> > > > +};
> > > > +
> > > > +static DEFINE_KLIST(drm_dp_aux_list, NULL, NULL);
> > > > +
> > > > +static BLOCKING_NOTIFIER_HEAD(aux_notifier);
> > > > +
> > > > +int drm_dp_aux_register_notifier(struct notifier_block *nb)
> > > > +{
> > > > +	return blocking_notifier_chain_register(&aux_notifier, nb);
> > > > +}
> > > > +EXPORT_SYMBOL(drm_dp_aux_register_notifier);
> > > 
> > > Why is this notifier stuff needed? Why not just register/unregister the
> > > aux-dev directly?
> > > 
> > 
> > I am not sure it's needed, I was just looking for the best way of
> > informing aux-dev that a new aux channel was added.
> > 
> > By register/unregister the aux-dev directly, do you mean making this
> > drm_dp_helper aware of the aux dev, when it's registered, and directly
> > calling some callback to inform that new aux channels were added?
> 
> That was my thought, yes. It would mean the auxdev module can't be
> unloaded like i2c-dev, but I'm not sure that's a use case worth
> worrying about.

Yeah imo notifiers are evil because of locking inversion issues that
usually grop up, and having a use-case to unload dp_aux-dev seems
unlikely. Maybe we can do a Kconfig knob or something like that if some
people want to make the dev nodes optional.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux