diff mbox series

[v1,1/1] drm: drop unused drm_crtc callback

Message ID 20200215173342.GA7458@ravnborg.org (mailing list archive)
State New, archived
Headers show
Series [v1,1/1] drm: drop unused drm_crtc callback | expand

Commit Message

Sam Ravnborg Feb. 15, 2020, 5:33 p.m. UTC
struct drm_encoder_helper_funcs included a callback
named drm_crtc.

There are no users left - so drop it.
There was one reference in drm_crtc_helper.c,
which checked if the value was not NULL.
As it was never assigned this check could be dropped.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---

Stumbled upon this and dediced to check if it was used.
Build tested with allyesconfig, allmodconfig for relevant architectures.

	Sam


 drivers/gpu/drm/drm_crtc_helper.c        |  4 ----
 include/drm/drm_modeset_helper_vtables.h | 16 ----------------
 2 files changed, 20 deletions(-)

Comments

Daniel Vetter Feb. 15, 2020, 7:09 p.m. UTC | #1
On Sat, Feb 15, 2020 at 6:33 PM Sam Ravnborg <sam@ravnborg.org> wrote:
>
> struct drm_encoder_helper_funcs included a callback
> named drm_crtc.
>
> There are no users left - so drop it.
> There was one reference in drm_crtc_helper.c,
> which checked if the value was not NULL.
> As it was never assigned this check could be dropped.
>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>
> Stumbled upon this and dediced to check if it was used.
> Build tested with allyesconfig, allmodconfig for relevant architectures.

Nice catch!

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

>
>         Sam
>
>
>  drivers/gpu/drm/drm_crtc_helper.c        |  4 ----
>  include/drm/drm_modeset_helper_vtables.h | 16 ----------------
>  2 files changed, 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
> index 93a4eec429e8..a4d36aca45ea 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -244,10 +244,6 @@ drm_crtc_prepare_encoders(struct drm_device *dev)
>                 /* Disable unused encoders */
>                 if (encoder->crtc == NULL)
>                         drm_encoder_disable(encoder);
> -               /* Disable encoders whose CRTC is about to change */
> -               if (encoder_funcs->get_crtc &&
> -                   encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
> -                       drm_encoder_disable(encoder);
>         }
>  }
>
> diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
> index 0afaf58da40d..7c20b1c8b6a7 100644
> --- a/include/drm/drm_modeset_helper_vtables.h
> +++ b/include/drm/drm_modeset_helper_vtables.h
> @@ -692,22 +692,6 @@ struct drm_encoder_helper_funcs {
>                                 struct drm_crtc_state *crtc_state,
>                                 struct drm_connector_state *conn_state);
>
> -       /**
> -        * @get_crtc:
> -        *
> -        * This callback is used by the legacy CRTC helpers to work around
> -        * deficiencies in its own book-keeping.
> -        *
> -        * Do not use, use atomic helpers instead, which get the book keeping
> -        * right.
> -        *
> -        * FIXME:
> -        *
> -        * Currently only nouveau is using this, and as soon as nouveau is
> -        * atomic we can ditch this hook.
> -        */
> -       struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder);
> -
>         /**
>          * @detect:
>          *
> --
> 2.20.1
>
Sam Ravnborg Feb. 15, 2020, 9:12 p.m. UTC | #2
On Sat, Feb 15, 2020 at 08:09:40PM +0100, Daniel Vetter wrote:
> On Sat, Feb 15, 2020 at 6:33 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > struct drm_encoder_helper_funcs included a callback
> > named drm_crtc.
> >
> > There are no users left - so drop it.
> > There was one reference in drm_crtc_helper.c,
> > which checked if the value was not NULL.
> > As it was never assigned this check could be dropped.
> >
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >
> > Stumbled upon this and dediced to check if it was used.
> > Build tested with allyesconfig, allmodconfig for relevant architectures.
> 
> Nice catch!
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Thanks for the quick review.

Applied and pushed out.

	Sam
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 93a4eec429e8..a4d36aca45ea 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -244,10 +244,6 @@  drm_crtc_prepare_encoders(struct drm_device *dev)
 		/* Disable unused encoders */
 		if (encoder->crtc == NULL)
 			drm_encoder_disable(encoder);
-		/* Disable encoders whose CRTC is about to change */
-		if (encoder_funcs->get_crtc &&
-		    encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
-			drm_encoder_disable(encoder);
 	}
 }
 
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index 0afaf58da40d..7c20b1c8b6a7 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -692,22 +692,6 @@  struct drm_encoder_helper_funcs {
 				struct drm_crtc_state *crtc_state,
 				struct drm_connector_state *conn_state);
 
-	/**
-	 * @get_crtc:
-	 *
-	 * This callback is used by the legacy CRTC helpers to work around
-	 * deficiencies in its own book-keeping.
-	 *
-	 * Do not use, use atomic helpers instead, which get the book keeping
-	 * right.
-	 *
-	 * FIXME:
-	 *
-	 * Currently only nouveau is using this, and as soon as nouveau is
-	 * atomic we can ditch this hook.
-	 */
-	struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder);
-
 	/**
 	 * @detect:
 	 *