[Intel-gfx] [PATCH] drm/dp-mst-helper: Remove hotplug callback
Daniel Vetter
daniel at ffwll.ch
Mon Dec 10 10:01:03 UTC 2018
On Thu, Nov 29, 2018 at 01:30:59PM -0500, Lyude Paul wrote:
> Reviewed-by: Lyude Paul <lyude at redhat.com>
Applied, thanks for your review.
-Daniel
>
> On Wed, 2018-11-28 at 23:12 +0100, Daniel Vetter wrote:
> > When everyone implements it exactly the same way, among all 4
> > implementations, there's not really a need to overwrite this at all.
> >
> > Aside: drm_kms_helper_hotplug_event is pretty much core functionality
> > at this point. Probably should move it there.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > ---
> > .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 9 ---------
> > drivers/gpu/drm/drm_dp_mst_topology.c | 7 ++++---
> > drivers/gpu/drm/i915/intel_dp_mst.c | 10 ----------
> > drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 --------
> > drivers/gpu/drm/radeon/radeon_dp_mst.c | 9 ---------
> > include/drm/drm_dp_mst_helper.h | 2 --
> > 6 files changed, 4 insertions(+), 41 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> > index d02c32a1039c..9fdeca096407 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> > @@ -396,14 +396,6 @@ static void dm_dp_destroy_mst_connector(struct
> > drm_dp_mst_topology_mgr *mgr,
> > drm_connector_put(connector);
> > }
> >
> > -static void dm_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
> > -{
> > - struct amdgpu_dm_connector *master = container_of(mgr, struct
> > amdgpu_dm_connector, mst_mgr);
> > - struct drm_device *dev = master->base.dev;
> > -
> > - drm_kms_helper_hotplug_event(dev);
> > -}
> > -
> > static void dm_dp_mst_register_connector(struct drm_connector *connector)
> > {
> > struct drm_device *dev = connector->dev;
> > @@ -420,7 +412,6 @@ static void dm_dp_mst_register_connector(struct
> > drm_connector *connector)
> > static const struct drm_dp_mst_topology_cbs dm_mst_cbs = {
> > .add_connector = dm_dp_add_mst_connector,
> > .destroy_connector = dm_dp_destroy_mst_connector,
> > - .hotplug = dm_dp_mst_hotplug,
> > .register_connector = dm_dp_mst_register_connector
> > };
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 08978ad72f33..639552918b44 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -33,6 +33,7 @@
> > #include <drm/drm_fixed.h>
> > #include <drm/drm_atomic.h>
> > #include <drm/drm_atomic_helper.h>
> > +#include <drm/drm_crtc_helper.h>
> >
> > /**
> > * DOC: dp mst helper
> > @@ -1650,7 +1651,7 @@ static void drm_dp_send_link_address(struct
> > drm_dp_mst_topology_mgr *mgr,
> > for (i = 0; i < txmsg->reply.u.link_addr.nports; i++)
> > {
> > drm_dp_add_port(mstb, mgr->dev, &txmsg-
> > >reply.u.link_addr.ports[i]);
> > }
> > - (*mgr->cbs->hotplug)(mgr);
> > + drm_kms_helper_hotplug_event(mgr->dev);
> > }
> > } else {
> > mstb->link_address_sent = false;
> > @@ -2423,7 +2424,7 @@ static int drm_dp_mst_handle_up_req(struct
> > drm_dp_mst_topology_mgr *mgr)
> > drm_dp_update_port(mstb, &msg.u.conn_stat);
> >
> > DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs:
> > %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number,
> > msg.u.conn_stat.legacy_device_plug_status,
> > msg.u.conn_stat.displayport_device_plug_status,
> > msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port,
> > msg.u.conn_stat.peer_device_type);
> > - (*mgr->cbs->hotplug)(mgr);
> > + drm_kms_helper_hotplug_event(mgr->dev);
> >
> > } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) {
> > drm_dp_send_up_ack_reply(mgr, mgr->mst_primary,
> > msg.req_type, seqno, false);
> > @@ -3120,7 +3121,7 @@ static void drm_dp_destroy_connector_work(struct
> > work_struct *work)
> > send_hotplug = true;
> > }
> > if (send_hotplug)
> > - (*mgr->cbs->hotplug)(mgr);
> > + drm_kms_helper_hotplug_event(mgr->dev);
> > }
> >
> > static struct drm_private_state *
> > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> > b/drivers/gpu/drm/i915/intel_dp_mst.c
> > index 4de247ddf05f..f05427b74e34 100644
> > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > @@ -517,20 +517,10 @@ static void intel_dp_destroy_mst_connector(struct
> > drm_dp_mst_topology_mgr *mgr,
> > drm_connector_put(connector);
> > }
> >
> > -static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
> > -{
> > - struct intel_dp *intel_dp = container_of(mgr, struct intel_dp,
> > mst_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);
> > -}
> > -
> > static const struct drm_dp_mst_topology_cbs mst_cbs = {
> > .add_connector = intel_dp_add_mst_connector,
> > .register_connector = intel_dp_register_mst_connector,
> > .destroy_connector = intel_dp_destroy_mst_connector,
> > - .hotplug = intel_dp_mst_hotplug,
> > };
> >
> > static struct intel_dp_mst_encoder *
> > diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> > b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> > index 6cbbae3f438b..4a56841958c8 100644
> > --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> > +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> > @@ -1055,13 +1055,6 @@ nv50_mstm_prepare(struct nv50_mstm *mstm)
> > }
> > }
> >
> > -static void
> > -nv50_mstm_hotplug(struct drm_dp_mst_topology_mgr *mgr)
> > -{
> > - struct nv50_mstm *mstm = nv50_mstm(mgr);
> > - drm_kms_helper_hotplug_event(mstm->outp->base.base.dev);
> > -}
> > -
> > static void
> > nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr,
> > struct drm_connector *connector)
> > @@ -1113,7 +1106,6 @@ nv50_mstm = {
> > .add_connector = nv50_mstm_add_connector,
> > .register_connector = nv50_mstm_register_connector,
> > .destroy_connector = nv50_mstm_destroy_connector,
> > - .hotplug = nv50_mstm_hotplug,
> > };
> >
> > void
> > diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> > b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> > index 84b3ad2172a3..a0c70e27ab65 100644
> > --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> > +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> > @@ -320,19 +320,10 @@ static void radeon_dp_destroy_mst_connector(struct
> > drm_dp_mst_topology_mgr *mgr,
> > DRM_DEBUG_KMS("\n");
> > }
> >
> > -static void radeon_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
> > -{
> > - struct radeon_connector *master = container_of(mgr, struct
> > radeon_connector, mst_mgr);
> > - struct drm_device *dev = master->base.dev;
> > -
> > - drm_kms_helper_hotplug_event(dev);
> > -}
> > -
> > static const struct drm_dp_mst_topology_cbs mst_cbs = {
> > .add_connector = radeon_dp_add_mst_connector,
> > .register_connector = radeon_dp_register_mst_connector,
> > .destroy_connector = radeon_dp_destroy_mst_connector,
> > - .hotplug = radeon_dp_mst_hotplug,
> > };
> >
> > static struct
> > diff --git a/include/drm/drm_dp_mst_helper.h
> > b/include/drm/drm_dp_mst_helper.h
> > index 59f005b419cf..371cc2816477 100644
> > --- a/include/drm/drm_dp_mst_helper.h
> > +++ b/include/drm/drm_dp_mst_helper.h
> > @@ -387,8 +387,6 @@ struct drm_dp_mst_topology_cbs {
> > void (*register_connector)(struct drm_connector *connector);
> > void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr,
> > struct drm_connector *connector);
> > - void (*hotplug)(struct drm_dp_mst_topology_mgr *mgr);
> > -
> > };
> >
> > #define DP_MAX_PAYLOAD (sizeof(unsigned long) * 8)
> --
> Cheers,
> Lyude Paul
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list