[Intel-gfx] [PATCH v2 05/21] drm: Minimally initialise drm_dp_aux

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 1 09:54:46 UTC 2016


On Wed, Jun 01, 2016 at 11:49:03AM +0200, Daniel Vetter wrote:
> On Mon, May 30, 2016 at 09:38:23AM +0100, Chris Wilson wrote:
> > When trying to split up the initialisation phase and the registration
> > phase, one immediate problem encountered is trying to use our own i2c
> > devices before registration with userspace. drm_dp_aux in particular
> > only offers an interface for setting up the device after we have exposed
> > the connector via sysfs. In order to break the chicken-and-egg problem,
> > export drm_dp_aux_init() to minimally prepare the i2c device for
> > internal use before drm_connector_register().
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Rafael Antognolli <rafael.antognolli at intel.com>
> > Cc: dri-devel at lists.freedesktop.org
> > ---
> >  drivers/gpu/drm/drm_dp_helper.c | 18 +++++++++++++-----
> >  include/drm/drm_dp_helper.h     |  1 +
> >  2 files changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > index eeaf5a7c3aa7..e1900d386685 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -774,6 +774,17 @@ static const struct i2c_algorithm drm_dp_i2c_algo = {
> >  	.master_xfer = drm_dp_i2c_xfer,
> >  };
> >  
> > +void drm_dp_aux_init(struct drm_dp_aux *aux)
> 
> Needs kerneldoc. Pleas also cross-reference to drm_dp_aux_register. Didn't
> read all the i2c code to make sure stuff really works with just that, but
> makes sense.

Already added the kerneldoc (mostly copy'pasted from
drm_dp_aux_register), but good job you didn't check the i2c code as it
changed in v4.7. However, it motivated a better patch as i2c now allows
for us to control the locking and so we can make the interaction between
i2c and the drm_dp_aux->hw_mutex (used for the DPCD bypass) much
clearer.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list