[PATCH v2] drm: Pass along the hotplug connector to the uevent

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 21 10:05:20 UTC 2016


On Fri, Oct 21, 2016 at 12:46:53PM +0300, Ville Syrjälä wrote:
> On Fri, Oct 21, 2016 at 10:14:21AM +0100, Chris Wilson wrote:
> > If we know which connector was plugged/unplugged or
> > connected/disconnected, we can pass that information along to userspace
> > inside the uevent to reduce the amount of work userspace has to perform
> > after the event (i.e. instead of looking over all connectors, it can
> > just reprobe the affected one).
> > 
> > v2: Don't convert intel_hotplug.c, it does a light probe and doesn't
> > need the force.
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Villle Syrjälä <ville.syrjala at linux.intel.com>
> > Cc: Manasi Navare <manasi.d.navare at intel.com>
> > ---
> >  drivers/gpu/drm/drm_probe_helper.c     | 10 ++++++----
> >  drivers/gpu/drm/drm_sysfs.c            | 19 +++++++++++++++----
> >  drivers/gpu/drm/i2c/tda998x_drv.c      |  2 +-
> >  drivers/gpu/drm/i915/intel_dp.c        |  3 ++-
> >  drivers/gpu/drm/i915/intel_dp_mst.c    |  2 +-
> >  drivers/gpu/drm/i915/intel_hotplug.c   |  2 +-
> >  drivers/gpu/drm/qxl/qxl_display.c      |  2 +-
> >  drivers/gpu/drm/radeon/radeon_dp_mst.c |  2 +-
> >  drivers/gpu/drm/virtio/virtgpu_vq.c    |  2 +-
> >  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c    |  2 +-
> >  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c    |  2 +-
> >  include/drm/drmP.h                     |  3 ++-
> >  include/drm/drm_crtc_helper.h          |  3 ++-
> >  13 files changed, 35 insertions(+), 19 deletions(-)
> > 
> <snip>
> > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> > index 3ffbd69e4551..2bd48a987934 100644
> > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > @@ -493,7 +493,7 @@ static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
> >  	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> >  	struct drm_device *dev = intel_dig_port->base.base.dev;
> >  
> > -	drm_kms_helper_hotplug_event(dev);
> > +	drm_kms_helper_hotplug_event(dev, &intel_dp->attached_connector->base);
> >  }
> >  
> >  static const struct drm_dp_mst_topology_cbs mst_cbs = {
> > diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> > index 334d47b5811a..da0649aff734 100644
> > --- a/drivers/gpu/drm/i915/intel_hotplug.c
> > +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> > @@ -340,7 +340,7 @@ static void i915_hotplug_work_func(struct work_struct *work)
> >  	mutex_unlock(&mode_config->mutex);
> >  
> >  	if (changed)
> > -		drm_kms_helper_hotplug_event(dev);
> > +		drm_kms_helper_hotplug_event(dev, NULL);
> >  }
> 
> So basically this patch deals with all the weird cases but doesn't do
> anything for the normal case of a connector being connected/disconnected?

Yes. We can expand it to the lightweight hotplug events, but where it
was just checking the current connector->status I didn't feel it merited
the extra work in sending per-connector hotplug events.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list