diff mbox

[04/10] drm: make drm_vblank_{get,put}() static

Message ID 1465308482-15104-4-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan June 7, 2016, 2:07 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

As they are not used anywhere outside drm_irq.c make them static.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/drm_irq.c | 10 ++--------
 include/drm/drmP.h        |  2 --
 2 files changed, 2 insertions(+), 10 deletions(-)

Comments

Rodrigo Vivi Aug. 3, 2016, 6:30 a.m. UTC | #1
I was going to remove the legacy get/put versions right now, but
decided to check if there were any pending patch in mailing lists and
found this.

What about deleting the functions at all instead of having it internally?


On Tue, Jun 7, 2016 at 7:07 AM, Gustavo Padovan <gustavo@padovan.org> wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> As they are not used anywhere outside drm_irq.c make them static.
>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/drm_irq.c | 10 ++--------
>  include/drm/drmP.h        |  2 --
>  2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 38cc782..76e39c5 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -1108,7 +1108,7 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
>   * Returns:
>   * Zero on success or a negative error code on failure.
>   */
> -int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
> +static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
>  {
>         struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>         unsigned long irqflags;
> @@ -1134,7 +1134,6 @@ int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
>
>         return ret;
>  }
> -EXPORT_SYMBOL(drm_vblank_get);
>
>  /**
>   * drm_crtc_vblank_get - get a reference count on vblank events
> @@ -1143,8 +1142,6 @@ EXPORT_SYMBOL(drm_vblank_get);
>   * Acquire a reference count on vblank events to avoid having them disabled
>   * while in use.
>   *
> - * This is the native kms version of drm_vblank_get().
> - *
>   * Returns:
>   * Zero on success or a negative error code on failure.
>   */
> @@ -1164,7 +1161,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_get);
>   *
>   * This is the legacy version of drm_crtc_vblank_put().
>   */
> -void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
> +static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
>  {
>         struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>
> @@ -1185,7 +1182,6 @@ void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
>                                   jiffies + ((drm_vblank_offdelay * HZ)/1000));
>         }
>  }
> -EXPORT_SYMBOL(drm_vblank_put);
>
>  /**
>   * drm_crtc_vblank_put - give up ownership of vblank events
> @@ -1193,8 +1189,6 @@ EXPORT_SYMBOL(drm_vblank_put);
>   *
>   * Release ownership of a given vblank counter, turning off interrupts
>   * if possible. Disable interrupts after drm_vblank_offdelay milliseconds.
> - *
> - * This is the native kms version of drm_vblank_put().
>   */
>  void drm_crtc_vblank_put(struct drm_crtc *crtc)
>  {
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 924b4fd..23f79a5 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -975,8 +975,6 @@ extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
>                                       struct drm_pending_vblank_event *e);
>  extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
>  extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
> -extern int drm_vblank_get(struct drm_device *dev, unsigned int pipe);
> -extern void drm_vblank_put(struct drm_device *dev, unsigned int pipe);
>  extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
>  extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
>  extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
> --
> 2.5.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter Aug. 3, 2016, 7:22 a.m. UTC | #2
On Tue, Aug 02, 2016 at 11:30:21PM -0700, Rodrigo Vivi wrote:
> I was going to remove the legacy get/put versions right now, but
> decided to check if there were any pending patch in mailing lists and
> found this.
> 
> What about deleting the functions at all instead of having it internally?

There's (very few) users left, but if you can convert them over to
drm_crtc_ versions then sure, go ahead, it'd be great!
-Daniel

> 
> 
> On Tue, Jun 7, 2016 at 7:07 AM, Gustavo Padovan <gustavo@padovan.org> wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> >
> > As they are not used anywhere outside drm_irq.c make them static.
> >
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > ---
> >  drivers/gpu/drm/drm_irq.c | 10 ++--------
> >  include/drm/drmP.h        |  2 --
> >  2 files changed, 2 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> > index 38cc782..76e39c5 100644
> > --- a/drivers/gpu/drm/drm_irq.c
> > +++ b/drivers/gpu/drm/drm_irq.c
> > @@ -1108,7 +1108,7 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
> >   * Returns:
> >   * Zero on success or a negative error code on failure.
> >   */
> > -int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
> > +static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
> >  {
> >         struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> >         unsigned long irqflags;
> > @@ -1134,7 +1134,6 @@ int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
> >
> >         return ret;
> >  }
> > -EXPORT_SYMBOL(drm_vblank_get);
> >
> >  /**
> >   * drm_crtc_vblank_get - get a reference count on vblank events
> > @@ -1143,8 +1142,6 @@ EXPORT_SYMBOL(drm_vblank_get);
> >   * Acquire a reference count on vblank events to avoid having them disabled
> >   * while in use.
> >   *
> > - * This is the native kms version of drm_vblank_get().
> > - *
> >   * Returns:
> >   * Zero on success or a negative error code on failure.
> >   */
> > @@ -1164,7 +1161,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_get);
> >   *
> >   * This is the legacy version of drm_crtc_vblank_put().
> >   */
> > -void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
> > +static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
> >  {
> >         struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> >
> > @@ -1185,7 +1182,6 @@ void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
> >                                   jiffies + ((drm_vblank_offdelay * HZ)/1000));
> >         }
> >  }
> > -EXPORT_SYMBOL(drm_vblank_put);
> >
> >  /**
> >   * drm_crtc_vblank_put - give up ownership of vblank events
> > @@ -1193,8 +1189,6 @@ EXPORT_SYMBOL(drm_vblank_put);
> >   *
> >   * Release ownership of a given vblank counter, turning off interrupts
> >   * if possible. Disable interrupts after drm_vblank_offdelay milliseconds.
> > - *
> > - * This is the native kms version of drm_vblank_put().
> >   */
> >  void drm_crtc_vblank_put(struct drm_crtc *crtc)
> >  {
> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > index 924b4fd..23f79a5 100644
> > --- a/include/drm/drmP.h
> > +++ b/include/drm/drmP.h
> > @@ -975,8 +975,6 @@ extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
> >                                       struct drm_pending_vblank_event *e);
> >  extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
> >  extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
> > -extern int drm_vblank_get(struct drm_device *dev, unsigned int pipe);
> > -extern void drm_vblank_put(struct drm_device *dev, unsigned int pipe);
> >  extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
> >  extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
> >  extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
> > --
> > 2.5.5
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> 
> 
> -- 
> Rodrigo Vivi
> Blog: http://blog.vivi.eng.br
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Rodrigo Vivi Aug. 3, 2016, 6:15 p.m. UTC | #3
Oh, nevermind... I saw the places that depends on changes on other
legacy usage like drm_wait_on_vblank...  (not trivial on intel_crt)
and other cases...

So better to just go with the static for now.

Feel free to use:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>


On Wed, Aug 3, 2016 at 12:22 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Tue, Aug 02, 2016 at 11:30:21PM -0700, Rodrigo Vivi wrote:
>> I was going to remove the legacy get/put versions right now, but
>> decided to check if there were any pending patch in mailing lists and
>> found this.
>>
>> What about deleting the functions at all instead of having it internally?
>
> There's (very few) users left, but if you can convert them over to
> drm_crtc_ versions then sure, go ahead, it'd be great!
> -Daniel
>
>>
>>
>> On Tue, Jun 7, 2016 at 7:07 AM, Gustavo Padovan <gustavo@padovan.org> wrote:
>> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>> >
>> > As they are not used anywhere outside drm_irq.c make them static.
>> >
>> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>> > ---
>> >  drivers/gpu/drm/drm_irq.c | 10 ++--------
>> >  include/drm/drmP.h        |  2 --
>> >  2 files changed, 2 insertions(+), 10 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>> > index 38cc782..76e39c5 100644
>> > --- a/drivers/gpu/drm/drm_irq.c
>> > +++ b/drivers/gpu/drm/drm_irq.c
>> > @@ -1108,7 +1108,7 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
>> >   * Returns:
>> >   * Zero on success or a negative error code on failure.
>> >   */
>> > -int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
>> > +static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
>> >  {
>> >         struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>> >         unsigned long irqflags;
>> > @@ -1134,7 +1134,6 @@ int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
>> >
>> >         return ret;
>> >  }
>> > -EXPORT_SYMBOL(drm_vblank_get);
>> >
>> >  /**
>> >   * drm_crtc_vblank_get - get a reference count on vblank events
>> > @@ -1143,8 +1142,6 @@ EXPORT_SYMBOL(drm_vblank_get);
>> >   * Acquire a reference count on vblank events to avoid having them disabled
>> >   * while in use.
>> >   *
>> > - * This is the native kms version of drm_vblank_get().
>> > - *
>> >   * Returns:
>> >   * Zero on success or a negative error code on failure.
>> >   */
>> > @@ -1164,7 +1161,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_get);
>> >   *
>> >   * This is the legacy version of drm_crtc_vblank_put().
>> >   */
>> > -void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
>> > +static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
>> >  {
>> >         struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>> >
>> > @@ -1185,7 +1182,6 @@ void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
>> >                                   jiffies + ((drm_vblank_offdelay * HZ)/1000));
>> >         }
>> >  }
>> > -EXPORT_SYMBOL(drm_vblank_put);
>> >
>> >  /**
>> >   * drm_crtc_vblank_put - give up ownership of vblank events
>> > @@ -1193,8 +1189,6 @@ EXPORT_SYMBOL(drm_vblank_put);
>> >   *
>> >   * Release ownership of a given vblank counter, turning off interrupts
>> >   * if possible. Disable interrupts after drm_vblank_offdelay milliseconds.
>> > - *
>> > - * This is the native kms version of drm_vblank_put().
>> >   */
>> >  void drm_crtc_vblank_put(struct drm_crtc *crtc)
>> >  {
>> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
>> > index 924b4fd..23f79a5 100644
>> > --- a/include/drm/drmP.h
>> > +++ b/include/drm/drmP.h
>> > @@ -975,8 +975,6 @@ extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
>> >                                       struct drm_pending_vblank_event *e);
>> >  extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
>> >  extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
>> > -extern int drm_vblank_get(struct drm_device *dev, unsigned int pipe);
>> > -extern void drm_vblank_put(struct drm_device *dev, unsigned int pipe);
>> >  extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
>> >  extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
>> >  extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
>> > --
>> > 2.5.5
>> >
>> > _______________________________________________
>> > dri-devel mailing list
>> > dri-devel@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>>
>>
>> --
>> Rodrigo Vivi
>> Blog: http://blog.vivi.eng.br
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 38cc782..76e39c5 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1108,7 +1108,7 @@  static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
  * Returns:
  * Zero on success or a negative error code on failure.
  */
-int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
+static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
 {
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 	unsigned long irqflags;
@@ -1134,7 +1134,6 @@  int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
 
 	return ret;
 }
-EXPORT_SYMBOL(drm_vblank_get);
 
 /**
  * drm_crtc_vblank_get - get a reference count on vblank events
@@ -1143,8 +1142,6 @@  EXPORT_SYMBOL(drm_vblank_get);
  * Acquire a reference count on vblank events to avoid having them disabled
  * while in use.
  *
- * This is the native kms version of drm_vblank_get().
- *
  * Returns:
  * Zero on success or a negative error code on failure.
  */
@@ -1164,7 +1161,7 @@  EXPORT_SYMBOL(drm_crtc_vblank_get);
  *
  * This is the legacy version of drm_crtc_vblank_put().
  */
-void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
+static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
 {
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
@@ -1185,7 +1182,6 @@  void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
 				  jiffies + ((drm_vblank_offdelay * HZ)/1000));
 	}
 }
-EXPORT_SYMBOL(drm_vblank_put);
 
 /**
  * drm_crtc_vblank_put - give up ownership of vblank events
@@ -1193,8 +1189,6 @@  EXPORT_SYMBOL(drm_vblank_put);
  *
  * Release ownership of a given vblank counter, turning off interrupts
  * if possible. Disable interrupts after drm_vblank_offdelay milliseconds.
- *
- * This is the native kms version of drm_vblank_put().
  */
 void drm_crtc_vblank_put(struct drm_crtc *crtc)
 {
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 924b4fd..23f79a5 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -975,8 +975,6 @@  extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
 				      struct drm_pending_vblank_event *e);
 extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
 extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
-extern int drm_vblank_get(struct drm_device *dev, unsigned int pipe);
-extern void drm_vblank_put(struct drm_device *dev, unsigned int pipe);
 extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
 extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);