linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback
@ 2020-03-31 20:57 Lyude Paul
  2020-03-31 20:57 ` [PATCH 1/4] drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying connectors Lyude Paul
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Lyude Paul @ 2020-03-31 20:57 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: Pankaj Bharadiya, Daniel Vetter, Alex Deucher, Leo Li,
	Mikita Lipski, David Airlie, Christian König, David Francis,
	linux-kernel, Nicholas Kazlauskas, Bhawanpreet Lakha,
	David (ChunMing) Zhou, Harry Wentland, Wenjing Liu, Lyude Paul,
	Rodrigo Siqueira, Maarten Lankhorst, Thomas Zimmermann,
	Maxime Ripard

This finishes up the work that Pankaj Bharadiya started in:

https://patchwork.freedesktop.org/series/74412/

And allows us to entirely remove ->destroy_connector()

Lyude Paul (4):
  drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying
    connectors
  drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback
  drm/amd/amdgpu_dm/mst: Stop printing extra messages in
    dm_dp_add_mst_connector()
  drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector

 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 45 +++++--------------
 drivers/gpu/drm/drm_dp_mst_topology.c         | 16 ++-----
 include/drm/drm_dp_mst_helper.h               |  2 -
 3 files changed, 15 insertions(+), 48 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying connectors
  2020-03-31 20:57 [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Lyude Paul
@ 2020-03-31 20:57 ` Lyude Paul
  2020-03-31 20:57 ` [PATCH 2/4] drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback Lyude Paul
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Lyude Paul @ 2020-03-31 20:57 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter,
	Mikita Lipski, Rodrigo Siqueira, David Francis, Pankaj Bharadiya,
	Wenjing Liu, linux-kernel

Doesn't do anything, noticed this while cleaning up some unrelated
stuff.

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 -
 1 file changed, 1 deletion(-)

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 e8208df420d9..7b3303efb1ff 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
@@ -140,7 +140,6 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector)
 	struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder;
 
 	kfree(amdgpu_dm_connector->edid);
-	amdgpu_dm_connector->edid = NULL;
 
 	drm_encoder_cleanup(&amdgpu_encoder->base);
 	kfree(amdgpu_encoder);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback
  2020-03-31 20:57 [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Lyude Paul
  2020-03-31 20:57 ` [PATCH 1/4] drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying connectors Lyude Paul
@ 2020-03-31 20:57 ` Lyude Paul
  2020-03-31 20:57 ` [PATCH 3/4] drm/amd/amdgpu_dm/mst: Stop printing extra messages in dm_dp_add_mst_connector() Lyude Paul
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Lyude Paul @ 2020-03-31 20:57 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: Pankaj Bharadiya, Harry Wentland, Leo Li, Alex Deucher,
	Christian König, David (ChunMing) Zhou, David Airlie,
	Daniel Vetter, Mikita Lipski, Nicholas Kazlauskas, David Francis,
	Wenjing Liu, linux-kernel

Pankaj Bharadiya started cleaning up the MST connector callbacks a while
ago, as I pointed out that they are the same across every driver and
don't serve much purpose. There was one callback that was left over
though from amdgpu, that we delayed removing due to not being completely
sure as to whether or not it was needed.

So, I've read through said callback and can confirm it's not at all
needed. Pretty much all of the work that is done in
dm_dp_destroy_mst_connector() can be done in
dm_dp_mst_connector_destroy(). Additionally, I've removed some bits that
didn't actually do anything:

* Removed DRM_INFO message we were printing, this shouldn't be info
  level and there's more appropriate drm debugging flags that should be
  used instead
* Removed amdgpu_dm_update_freesync_caps() - reading into this function,
  it doesn't actually do anything important and I'm not sure why it was
  ever being called here
* Stop clearing aconnector->dc_sink - this also doesn't do anything
* Stop clearing link settings in dc_link - this also doesn't do anything
* Also, use shorter variable

Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
---
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 39 ++++++-------------
 1 file changed, 12 insertions(+), 27 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 7b3303efb1ff..09025ccc68ca 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
@@ -136,16 +136,23 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
 static void
 dm_dp_mst_connector_destroy(struct drm_connector *connector)
 {
-	struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
-	struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder;
+	struct amdgpu_dm_connector *aconnector =
+		to_amdgpu_dm_connector(connector);
+	struct amdgpu_encoder *amdgpu_encoder = aconnector->mst_encoder;
 
-	kfree(amdgpu_dm_connector->edid);
+	if (aconnector->dc_sink) {
+		dc_link_remove_remote_sink(aconnector->dc_link,
+					   aconnector->dc_sink);
+		dc_sink_release(aconnector->dc_sink);
+	}
+
+	kfree(aconnector->edid);
 
 	drm_encoder_cleanup(&amdgpu_encoder->base);
 	kfree(amdgpu_encoder);
 	drm_connector_cleanup(connector);
-	drm_dp_mst_put_port_malloc(amdgpu_dm_connector->port);
-	kfree(amdgpu_dm_connector);
+	drm_dp_mst_put_port_malloc(aconnector->port);
+	kfree(aconnector);
 }
 
 static int
@@ -436,30 +443,8 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
 	return connector;
 }
 
-static void dm_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
-					struct drm_connector *connector)
-{
-	struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
-
-	DRM_INFO("DM_MST: Disabling connector: %p [id: %d] [master: %p]\n",
-		 aconnector, connector->base.id, aconnector->mst_port);
-
-	if (aconnector->dc_sink) {
-		amdgpu_dm_update_freesync_caps(connector, NULL);
-		dc_link_remove_remote_sink(aconnector->dc_link,
-					   aconnector->dc_sink);
-		dc_sink_release(aconnector->dc_sink);
-		aconnector->dc_sink = NULL;
-		aconnector->dc_link->cur_link_settings.lane_count = 0;
-	}
-
-	drm_connector_unregister(connector);
-	drm_connector_put(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,
 };
 
 void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] drm/amd/amdgpu_dm/mst: Stop printing extra messages in dm_dp_add_mst_connector()
  2020-03-31 20:57 [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Lyude Paul
  2020-03-31 20:57 ` [PATCH 1/4] drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying connectors Lyude Paul
  2020-03-31 20:57 ` [PATCH 2/4] drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback Lyude Paul
@ 2020-03-31 20:57 ` Lyude Paul
  2020-03-31 20:57 ` [PATCH 4/4] drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector Lyude Paul
  2020-04-01 18:32 ` [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Alex Deucher
  4 siblings, 0 replies; 6+ messages in thread
From: Lyude Paul @ 2020-03-31 20:57 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter,
	Mikita Lipski, Nicholas Kazlauskas, Bhawanpreet Lakha,
	David Francis, Pankaj Bharadiya, Wenjing Liu, linux-kernel

You can already trace the creation and destruction of connectors using
DRM, and we definitely don't need to be printing info messages on
connector hotplugs as well. So, get rid of these.

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 -----
 1 file changed, 5 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 09025ccc68ca..d56b758bcce5 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
@@ -433,13 +433,8 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
 	 */
 	amdgpu_dm_connector_funcs_reset(connector);
 
-	DRM_INFO("DM_MST: added connector: %p [id: %d] [master: %p]\n",
-		 aconnector, connector->base.id, aconnector->mst_port);
-
 	drm_dp_mst_get_port_malloc(port);
 
-	DRM_DEBUG_KMS(":%d\n", connector->base.id);
-
 	return connector;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector
  2020-03-31 20:57 [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Lyude Paul
                   ` (2 preceding siblings ...)
  2020-03-31 20:57 ` [PATCH 3/4] drm/amd/amdgpu_dm/mst: Stop printing extra messages in dm_dp_add_mst_connector() Lyude Paul
@ 2020-03-31 20:57 ` Lyude Paul
  2020-04-01 18:32 ` [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Alex Deucher
  4 siblings, 0 replies; 6+ messages in thread
From: Lyude Paul @ 2020-03-31 20:57 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: Pankaj Bharadiya, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, linux-kernel

Now that we've removed the last user of this callback, get rid of it and
drm_dp_destroy_connector().

Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 16 +++-------------
 include/drm/drm_dp_mst_helper.h       |  2 --
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 31b7a8f5309d..e235b2b29f59 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -4692,23 +4692,13 @@ static void drm_dp_tx_work(struct work_struct *work)
 	mutex_unlock(&mgr->qlock);
 }
 
-static inline void drm_dp_destroy_connector(struct drm_dp_mst_port *port)
+static inline void
+drm_dp_delayed_destroy_port(struct drm_dp_mst_port *port)
 {
-	if (!port->connector)
-		return;
-
-	if (port->mgr->cbs->destroy_connector) {
-		port->mgr->cbs->destroy_connector(port->mgr, port->connector);
-	} else {
+	if (port->connector) {
 		drm_connector_unregister(port->connector);
 		drm_connector_put(port->connector);
 	}
-}
-
-static inline void
-drm_dp_delayed_destroy_port(struct drm_dp_mst_port *port)
-{
-	drm_dp_destroy_connector(port);
 
 	drm_dp_port_set_pdt(port, DP_PEER_DEVICE_NONE, port->mcs);
 	drm_dp_mst_put_port_malloc(port);
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index 13461db1444a..7af51c947b81 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -488,8 +488,6 @@ struct drm_dp_mst_topology_mgr;
 struct drm_dp_mst_topology_cbs {
 	/* create a connector for a port */
 	struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *path);
-	void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr,
-				  struct drm_connector *connector);
 };
 
 #define DP_MAX_PAYLOAD (sizeof(unsigned long) * 8)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback
  2020-03-31 20:57 [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Lyude Paul
                   ` (3 preceding siblings ...)
  2020-03-31 20:57 ` [PATCH 4/4] drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector Lyude Paul
@ 2020-04-01 18:32 ` Alex Deucher
  4 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2020-04-01 18:32 UTC (permalink / raw)
  To: Lyude Paul
  Cc: amd-gfx list, Maling list - DRI developers, Thomas Zimmermann,
	Leo Li, Pankaj Bharadiya, David Francis, Wenjing Liu, LKML,
	Nicholas Kazlauskas, David Airlie, Alex Deucher,
	Rodrigo Siqueira, Mikita Lipski, Bhawanpreet Lakha,
	Christian König

On Tue, Mar 31, 2020 at 4:58 PM Lyude Paul <lyude@redhat.com> wrote:
>
> This finishes up the work that Pankaj Bharadiya started in:
>
> https://patchwork.freedesktop.org/series/74412/
>
> And allows us to entirely remove ->destroy_connector()
>
> Lyude Paul (4):
>   drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying
>     connectors
>   drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback
>   drm/amd/amdgpu_dm/mst: Stop printing extra messages in
>     dm_dp_add_mst_connector()
>   drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector

I noticed this as well when I was sorting out the load and unload
callback removal.  Thanks for finishing this up.  This series looks
good to me, assuming none of the display folks have any concerns:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>


>
>  .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 45 +++++--------------
>  drivers/gpu/drm/drm_dp_mst_topology.c         | 16 ++-----
>  include/drm/drm_dp_mst_helper.h               |  2 -
>  3 files changed, 15 insertions(+), 48 deletions(-)
>
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-01 18:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 20:57 [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Lyude Paul
2020-03-31 20:57 ` [PATCH 1/4] drm/amd/amdgpu_dm/mst: Remove unneeded edid assignment when destroying connectors Lyude Paul
2020-03-31 20:57 ` [PATCH 2/4] drm/amd/amdgpu_dm/mst: Remove ->destroy_connector() callback Lyude Paul
2020-03-31 20:57 ` [PATCH 3/4] drm/amd/amdgpu_dm/mst: Stop printing extra messages in dm_dp_add_mst_connector() Lyude Paul
2020-03-31 20:57 ` [PATCH 4/4] drm/dp_mst: Remove drm_dp_mst_topology_cbs.destroy_connector Lyude Paul
2020-04-01 18:32 ` [PATCH 0/4] drm/dp_mst: Remove ->destroy_connector() callback Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).