Skip to contentSkip to conversation

drm: Drop crtc argument from __drm_atomic_helper_crtc_destroy_state

PATCH In review Daniel Vetter 2 participants 4 messages May 9, 2016

Subsystems (14)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm: Drop crtc argument from __drm_atomic_helper_crtc_destroy_state

It's unused, and really this helper should only look at the state structure and nothing else.

v2: Rebase on top of rockchip changes

v3: Drop unrelated hunk, spotted by Laurent.

---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +-
 drivers/gpu/drm/drm_atomic_helper.c            | 8 +++-----
 drivers/gpu/drm/i915/intel_display.c           | 4 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c    | 2 +-
 drivers/gpu/drm/tegra/dc.c                     | 4 ++--
 drivers/gpu/drm/vc4/vc4_crtc.c                 | 2 +-
 include/drm/drm_atomic_helper.h                | 3 +--
 7 files changed, 11 insertions(+), 14 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 -1
index 8df0aaf98725..cf23a755f777 100644
@@ -430,7 +430,7 @@ static void atmel_hlcdc_crtc_destroy_state(struct drm_crtc *crtc,
 	struct atmel_hlcdc_crtc_state *state;
 
 	state = drm_crtc_state_to_atmel_hlcdc_crtc_state(s);
-	__drm_atomic_helper_crtc_destroy_state(crtc, s);
+	__drm_atomic_helper_crtc_destroy_state(s);
 	kfree(state);
 }
 
drivers/gpu/drm/drm_atomic_helper.c +3 -5
index 997fd21e5388..137bb51269c2 100644
@@ -2511,7 +2511,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc)
 {
 	if (crtc->state)
-		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
+		__drm_atomic_helper_crtc_destroy_state(crtc->state);
 
 	kfree(crtc->state);
 	crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL);
@@ -2576,15 +2576,13 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state);
 
 /**
  * __drm_atomic_helper_crtc_destroy_state - release CRTC state
- * @crtc: CRTC object
  * @state: CRTC state object to release
  *
  * Releases all resources stored in the CRTC state without actually freeing
  * the memory of the CRTC state. This is useful for drivers that subclass the
  * CRTC state.
  */
-void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
-					    struct drm_crtc_state *state)
+void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state)
 {
 	drm_property_unreference_blob(state->mode_blob);
 	drm_property_unreference_blob(state->degamma_lut);
@@ -2604,7 +2602,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state);
 void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
 					  struct drm_crtc_state *state)
 {
-	__drm_atomic_helper_crtc_destroy_state(crtc, state);
+	__drm_atomic_helper_crtc_destroy_state(state);
 	kfree(state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
drivers/gpu/drm/i915/intel_display.c +2 -2
index 6ba676f81bae..e880ed680bee 100644
@@ -12915,7 +12915,7 @@ verify_crtc_state(struct drm_crtc *crtc,
 	bool active;
 
 	old_state = old_crtc_state->state;
-	__drm_atomic_helper_crtc_destroy_state(crtc, old_crtc_state);
+	__drm_atomic_helper_crtc_destroy_state(old_crtc_state);
 	pipe_config = to_intel_crtc_state(old_crtc_state);
 	memset(pipe_config, 0, sizeof(*pipe_config));
 	pipe_config->base.crtc = crtc;
@@ -15751,7 +15751,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 		struct intel_crtc_state *crtc_state = crtc->config;
 		int pixclk = 0;
 
-		__drm_atomic_helper_crtc_destroy_state(&crtc->base, &crtc_state->base);
+		__drm_atomic_helper_crtc_destroy_state(&crtc_state->base);
 		memset(crtc_state, 0, sizeof(*crtc_state));
 		crtc_state->base.crtc = &crtc->base;
 
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1 -1
index bf55cda356ba..80d0f95820c4 100644
@@ -1065,7 +1065,7 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc,
 {
 	struct rockchip_crtc_state *s = to_rockchip_crtc_state(state);
 
-	__drm_atomic_helper_crtc_destroy_state(crtc, &s->base);
+	__drm_atomic_helper_crtc_destroy_state(&s->base);
 	kfree(s);
 }
 
drivers/gpu/drm/tegra/dc.c +2 -2
index 3b85a31b625d..39902bbfb3ce 100644
@@ -998,7 +998,7 @@ static void tegra_crtc_reset(struct drm_crtc *crtc)
 	struct tegra_dc_state *state;
 
 	if (crtc->state)
-		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
+		__drm_atomic_helper_crtc_destroy_state(crtc->state);
 
 	kfree(crtc->state);
 	crtc->state = NULL;
@@ -1034,7 +1034,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
 static void tegra_crtc_atomic_destroy_state(struct drm_crtc *crtc,
 					    struct drm_crtc_state *state)
 {
-	__drm_atomic_helper_crtc_destroy_state(crtc, state);
+	__drm_atomic_helper_crtc_destroy_state(state);
 	kfree(state);
 }
 
drivers/gpu/drm/vc4/vc4_crtc.c +1 -1
index 231356f42a04..904d0754ad78 100644
@@ -650,7 +650,7 @@ static void vc4_crtc_destroy_state(struct drm_crtc *crtc,
 
 	}
 
-	__drm_atomic_helper_crtc_destroy_state(crtc, state);
+	__drm_atomic_helper_crtc_destroy_state(state);
 }
 
 static const struct drm_crtc_funcs vc4_crtc_funcs = {
include/drm/drm_atomic_helper.h +1 -2
index 03642878bc51..5abbe1259a2a 100644
@@ -117,8 +117,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
 					      struct drm_crtc_state *state);
 struct drm_crtc_state *
 drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
-void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
-					    struct drm_crtc_state *state);
+void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
 void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
 					  struct drm_crtc_state *state);
 
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/3 drm: Drop plane argument from __drm_atomic_helper_plane_destroy_state

It's unused, and really this helper should only look at the state structure and nothing else.

v2: Fix commit message (Laurent).

---
 drivers/gpu/drm/drm_atomic_helper.c         | 8 +++-----
 drivers/gpu/drm/exynos/exynos_drm_plane.c   | 2 +-
 drivers/gpu/drm/omapdrm/omap_plane.c        | 2 +-
 drivers/gpu/drm/rcar-du/rcar_du_plane.c     | 2 +-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c       | 2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
 drivers/gpu/drm/tegra/dc.c                  | 4 ++--
 drivers/gpu/drm/vc4/vc4_plane.c             | 2 +-
 include/drm/drm_atomic_helper.h             | 3 +--
 9 files changed, 12 insertions(+), 15 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +3 -5
index 137bb51269c2..eb79073c0086 100644
@@ -2617,7 +2617,7 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
 void drm_atomic_helper_plane_reset(struct drm_plane *plane)
 {
 	if (plane->state)
-		__drm_atomic_helper_plane_destroy_state(plane, plane->state);
+		__drm_atomic_helper_plane_destroy_state(plane->state);
 
 	kfree(plane->state);
 	plane->state = kzalloc(sizeof(*plane->state), GFP_KERNEL);
@@ -2672,15 +2672,13 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_duplicate_state);
 
 /**
  * __drm_atomic_helper_plane_destroy_state - release plane state
- * @plane: plane object
  * @state: plane state object to release
  *
  * Releases all resources stored in the plane state without actually freeing
  * the memory of the plane state. This is useful for drivers that subclass the
  * plane state.
  */
-void __drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
-					     struct drm_plane_state *state)
+void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state)
 {
 	if (state->fb)
 		drm_framebuffer_unreference(state->fb);
@@ -2698,7 +2696,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);
 void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
 					   struct drm_plane_state *state)
 {
-	__drm_atomic_helper_plane_destroy_state(plane, state);
+	__drm_atomic_helper_plane_destroy_state(state);
 	kfree(state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state);
drivers/gpu/drm/exynos/exynos_drm_plane.c +1 -1
index 50185ac347b2..55f1d37c666a 100644
@@ -166,7 +166,7 @@ static void exynos_drm_plane_destroy_state(struct drm_plane *plane,
 {
 	struct exynos_drm_plane_state *old_exynos_state =
 					to_exynos_plane_state(old_state);
-	__drm_atomic_helper_plane_destroy_state(plane, old_state);
+	__drm_atomic_helper_plane_destroy_state(old_state);
 	kfree(old_exynos_state);
 }
 
drivers/gpu/drm/omapdrm/omap_plane.c +1 -1
index 93ee538a99f5..5252ab720e70 100644
@@ -245,7 +245,7 @@ omap_plane_atomic_duplicate_state(struct drm_plane *plane)
 static void omap_plane_atomic_destroy_state(struct drm_plane *plane,
 					    struct drm_plane_state *state)
 {
-	__drm_atomic_helper_plane_destroy_state(plane, state);
+	__drm_atomic_helper_plane_destroy_state(state);
 	kfree(to_omap_plane_state(state));
 }
 
drivers/gpu/drm/rcar-du/rcar_du_plane.c +1 -1
index 8460ae1ffa4b..d445e67f78e1 100644
@@ -635,7 +635,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
 static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane,
 					       struct drm_plane_state *state)
 {
-	__drm_atomic_helper_plane_destroy_state(plane, state);
+	__drm_atomic_helper_plane_destroy_state(state);
 	kfree(to_rcar_plane_state(state));
 }
 
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1 -1
index de7ef041182b..e671a7cd3463 100644
@@ -251,7 +251,7 @@ rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane)
 static void rcar_du_vsp_plane_atomic_destroy_state(struct drm_plane *plane,
 						   struct drm_plane_state *state)
 {
-	__drm_atomic_helper_plane_destroy_state(plane, state);
+	__drm_atomic_helper_plane_destroy_state(state);
 	kfree(to_rcar_vsp_plane_state(state));
 }
 
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1 -1
index 80d0f95820c4..1c4d5b5a70a2 100644
@@ -822,7 +822,7 @@ static void vop_atomic_plane_destroy_state(struct drm_plane *plane,
 {
 	struct vop_plane_state *vop_state = to_vop_plane_state(state);
 
-	__drm_atomic_helper_plane_destroy_state(plane, state);
+	__drm_atomic_helper_plane_destroy_state(state);
 
 	kfree(vop_state);
 }
drivers/gpu/drm/tegra/dc.c +2 -2
index 39902bbfb3ce..39940f5b7c91 100644
@@ -434,7 +434,7 @@ static void tegra_plane_reset(struct drm_plane *plane)
 	struct tegra_plane_state *state;
 
 	if (plane->state)
-		__drm_atomic_helper_plane_destroy_state(plane, plane->state);
+		__drm_atomic_helper_plane_destroy_state(plane->state);
 
 	kfree(plane->state);
 	plane->state = NULL;
@@ -466,7 +466,7 @@ static struct drm_plane_state *tegra_plane_atomic_duplicate_state(struct drm_pla
 static void tegra_plane_atomic_destroy_state(struct drm_plane *plane,
 					     struct drm_plane_state *state)
 {
-	__drm_atomic_helper_plane_destroy_state(plane, state);
+	__drm_atomic_helper_plane_destroy_state(state);
 	kfree(state);
 }
 
drivers/gpu/drm/vc4/vc4_plane.c +1 -1
index 7b0c72ae02a0..4037b52fde31 100644
@@ -208,7 +208,7 @@ static void vc4_plane_destroy_state(struct drm_plane *plane,
 	}
 
 	kfree(vc4_state->dlist);
-	__drm_atomic_helper_plane_destroy_state(plane, &vc4_state->base);
+	__drm_atomic_helper_plane_destroy_state(&vc4_state->base);
 	kfree(state);
 }
 
include/drm/drm_atomic_helper.h +1 -2
index 5abbe1259a2a..e9d661a8bd92 100644
@@ -126,8 +126,7 @@ void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
 					       struct drm_plane_state *state);
 struct drm_plane_state *
 drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane);
-void __drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
-					     struct drm_plane_state *state);
+void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state);
 void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
 					  struct drm_plane_state *state);
 
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 3/3 drm: Drop connector argument from __drm_atomic_helper_connector_destroy_state

In reply to Daniel Vetter

It's unused, and really this helper should only look at the state structure and nothing else. Note that this conflicts with a patch from Dave that adds refcounting to drm_connectors. It's not yet clear whether the check Dave adds for connector != NULL is really needed or the right check.

v2: Fix commmit message (Laurent).

---
 drivers/gpu/drm/drm_atomic_helper.c | 9 +++------
 include/drm/drm_atomic_helper.h     | 3 +--
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +3 -6
index eb79073c0086..70a50f746863 100644
@@ -2737,8 +2737,7 @@ void drm_atomic_helper_connector_reset(struct drm_connector *connector)
 		kzalloc(sizeof(*conn_state), GFP_KERNEL);
 
 	if (connector->state)
-		__drm_atomic_helper_connector_destroy_state(connector,
-							    connector->state);
+		__drm_atomic_helper_connector_destroy_state(connector->state);
 
 	kfree(connector->state);
 	__drm_atomic_helper_connector_reset(connector, conn_state);
@@ -2871,7 +2870,6 @@ EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
 
 /**
  * __drm_atomic_helper_connector_destroy_state - release connector state
- * @connector: connector object
  * @state: connector state object to release
  *
  * Releases all resources stored in the connector state without actually
@@ -2879,8 +2877,7 @@ EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
  * subclass the connector state.
  */
 void
-__drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
-					    struct drm_connector_state *state)
+__drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state)
 {
 	/*
 	 * This is currently a placeholder so that drivers that subclass the
@@ -2903,7 +2900,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_connector_destroy_state);
 void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
 					  struct drm_connector_state *state)
 {
-	__drm_atomic_helper_connector_destroy_state(connector, state);
+	__drm_atomic_helper_connector_destroy_state(state);
 	kfree(state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
include/drm/drm_atomic_helper.h +1 -2
index e9d661a8bd92..3db202e8f270 100644
@@ -142,8 +142,7 @@ struct drm_atomic_state *
 drm_atomic_helper_duplicate_state(struct drm_device *dev,
 				  struct drm_modeset_acquire_ctx *ctx);
 void
-__drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
-					    struct drm_connector_state *state);
+__drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state);
 void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
 					  struct drm_connector_state *state);
 void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/3
#3 lore raw
In reply to Daniel Vetter
Quoted 6 lines · Daniel Vetter

It's unused, and really this helper should only look at the state structure and nothing else.

v2: Rebase on top of rockchip changes

v3: Drop unrelated hunk, spotted by Laurent.

As far as vc4 is concerned, this series is:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel