diff mbox

[02/15] drm: Move sg functions into drm_legacy.h

Message ID 1410345840-3326-3-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Sept. 10, 2014, 10:43 a.m. UTC
Also sprinkle the drm_legacy_ prefix where missing.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_ioctl.c   | 4 ++--
 drivers/gpu/drm/drm_legacy.h  | 7 +++++++
 drivers/gpu/drm/drm_scatter.c | 8 ++++----
 include/drm/drmP.h            | 7 -------
 4 files changed, 13 insertions(+), 13 deletions(-)

Comments

David Herrmann Sept. 10, 2014, 2:43 p.m. UTC | #1
Hi

On Wed, Sep 10, 2014 at 12:43 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Also sprinkle the drm_legacy_ prefix where missing.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_ioctl.c   | 4 ++--
>  drivers/gpu/drm/drm_legacy.h  | 7 +++++++
>  drivers/gpu/drm/drm_scatter.c | 8 ++++----
>  include/drm/drmP.h            | 7 -------
>  4 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index bfb3b85dbe2d..7d6df78bb25d 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -108,8 +108,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
>         DRM_IOCTL_DEF(DRM_IOCTL_AGP_UNBIND, drm_agp_unbind_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
>  #endif
>
> -       DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> -       DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> +       DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_legacy_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> +       DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_legacy_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
>
>         DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank, DRM_UNLOCKED),
>
> diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
> index 36755ac4f244..d8bc895bc376 100644
> --- a/drivers/gpu/drm/drm_legacy.h
> +++ b/drivers/gpu/drm/drm_legacy.h
> @@ -100,4 +100,11 @@ extern void drm_legacy_free_buffer(struct drm_device *dev,
>  extern void drm_legacy_core_reclaim_buffers(struct drm_device *dev,
>                                             struct drm_file *filp);
>
> +/* Scatter Gather Support */
> +extern void drm_legacy_sg_cleanup(struct drm_device *dev);
> +extern int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
> +                              struct drm_file *file_priv);
> +extern int drm_legacy_sg_free(struct drm_device *dev, void *data,
> +                             struct drm_file *file_priv);
> +
>  #endif /* __DRM_LEGACY_H__ */
> diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
> index 1c78406f6e71..a02605c96224 100644
> --- a/drivers/gpu/drm/drm_scatter.c
> +++ b/drivers/gpu/drm/drm_scatter.c
> @@ -78,8 +78,8 @@ void drm_legacy_sg_cleanup(struct drm_device *dev)

Can you include "drm_legacy.h" from drm_scatter.c, please? Otherwise,
we will not catch wrong function declarations in the header file.

Thanks
David

>  # define ScatterHandle(x) (unsigned int)(x)
>  #endif
>
> -int drm_sg_alloc(struct drm_device *dev, void *data,
> -                struct drm_file *file_priv)
> +int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
> +                       struct drm_file *file_priv)
>  {
>         struct drm_scatter_gather *request = data;
>         struct drm_sg_mem *entry;
> @@ -194,8 +194,8 @@ int drm_sg_alloc(struct drm_device *dev, void *data,
>         return -ENOMEM;
>  }
>
> -int drm_sg_free(struct drm_device *dev, void *data,
> -               struct drm_file *file_priv)
> +int drm_legacy_sg_free(struct drm_device *dev, void *data,
> +                      struct drm_file *file_priv)
>  {
>         struct drm_scatter_gather *request = data;
>         struct drm_sg_mem *entry;
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 574e325d6b69..1d1468bcd69f 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -1316,13 +1316,6 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr
>
>  extern int drm_vma_info(struct seq_file *m, void *data);
>
> -                               /* Scatter Gather Support (drm_scatter.h) */
> -extern void drm_legacy_sg_cleanup(struct drm_device *dev);
> -extern int drm_sg_alloc(struct drm_device *dev, void *data,
> -                       struct drm_file *file_priv);
> -extern int drm_sg_free(struct drm_device *dev, void *data,
> -                      struct drm_file *file_priv);
> -
>                                /* ATI PCIGART support (ati_pcigart.h) */
>  extern int drm_ati_pcigart_init(struct drm_device *dev,
>                                 struct drm_ati_pcigart_info * gart_info);
> --
> 1.9.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter Sept. 11, 2014, 6:29 a.m. UTC | #2
On Wed, Sep 10, 2014 at 04:43:31PM +0200, David Herrmann wrote:
> Hi
> 
> On Wed, Sep 10, 2014 at 12:43 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Also sprinkle the drm_legacy_ prefix where missing.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/drm_ioctl.c   | 4 ++--
> >  drivers/gpu/drm/drm_legacy.h  | 7 +++++++
> >  drivers/gpu/drm/drm_scatter.c | 8 ++++----
> >  include/drm/drmP.h            | 7 -------
> >  4 files changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> > index bfb3b85dbe2d..7d6df78bb25d 100644
> > --- a/drivers/gpu/drm/drm_ioctl.c
> > +++ b/drivers/gpu/drm/drm_ioctl.c
> > @@ -108,8 +108,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
> >         DRM_IOCTL_DEF(DRM_IOCTL_AGP_UNBIND, drm_agp_unbind_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> >  #endif
> >
> > -       DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> > -       DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> > +       DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_legacy_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> > +       DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_legacy_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> >
> >         DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank, DRM_UNLOCKED),
> >
> > diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
> > index 36755ac4f244..d8bc895bc376 100644
> > --- a/drivers/gpu/drm/drm_legacy.h
> > +++ b/drivers/gpu/drm/drm_legacy.h
> > @@ -100,4 +100,11 @@ extern void drm_legacy_free_buffer(struct drm_device *dev,
> >  extern void drm_legacy_core_reclaim_buffers(struct drm_device *dev,
> >                                             struct drm_file *filp);
> >
> > +/* Scatter Gather Support */
> > +extern void drm_legacy_sg_cleanup(struct drm_device *dev);
> > +extern int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
> > +                              struct drm_file *file_priv);
> > +extern int drm_legacy_sg_free(struct drm_device *dev, void *data,
> > +                             struct drm_file *file_priv);
> > +
> >  #endif /* __DRM_LEGACY_H__ */
> > diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
> > index 1c78406f6e71..a02605c96224 100644
> > --- a/drivers/gpu/drm/drm_scatter.c
> > +++ b/drivers/gpu/drm/drm_scatter.c
> > @@ -78,8 +78,8 @@ void drm_legacy_sg_cleanup(struct drm_device *dev)
> 
> Can you include "drm_legacy.h" from drm_scatter.c, please? Otherwise,
> we will not catch wrong function declarations in the header file.

Some later patches adds that ;-) But I've noticed that my include rules
are a bit inconsistent, the new ones are:
- All drm.ko source files that need legacy stuff include "drm_legacy.h".
  That file in turn then includes <drm/drm_legacy.h>
- Drivers only ever include <drm/drm_legacy.c>

Thanks, Daniel
> 
> Thanks
> David
> 
> >  # define ScatterHandle(x) (unsigned int)(x)
> >  #endif
> >
> > -int drm_sg_alloc(struct drm_device *dev, void *data,
> > -                struct drm_file *file_priv)
> > +int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
> > +                       struct drm_file *file_priv)
> >  {
> >         struct drm_scatter_gather *request = data;
> >         struct drm_sg_mem *entry;
> > @@ -194,8 +194,8 @@ int drm_sg_alloc(struct drm_device *dev, void *data,
> >         return -ENOMEM;
> >  }
> >
> > -int drm_sg_free(struct drm_device *dev, void *data,
> > -               struct drm_file *file_priv)
> > +int drm_legacy_sg_free(struct drm_device *dev, void *data,
> > +                      struct drm_file *file_priv)
> >  {
> >         struct drm_scatter_gather *request = data;
> >         struct drm_sg_mem *entry;
> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > index 574e325d6b69..1d1468bcd69f 100644
> > --- a/include/drm/drmP.h
> > +++ b/include/drm/drmP.h
> > @@ -1316,13 +1316,6 @@ void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr
> >
> >  extern int drm_vma_info(struct seq_file *m, void *data);
> >
> > -                               /* Scatter Gather Support (drm_scatter.h) */
> > -extern void drm_legacy_sg_cleanup(struct drm_device *dev);
> > -extern int drm_sg_alloc(struct drm_device *dev, void *data,
> > -                       struct drm_file *file_priv);
> > -extern int drm_sg_free(struct drm_device *dev, void *data,
> > -                      struct drm_file *file_priv);
> > -
> >                                /* ATI PCIGART support (ati_pcigart.h) */
> >  extern int drm_ati_pcigart_init(struct drm_device *dev,
> >                                 struct drm_ati_pcigart_info * gart_info);
> > --
> > 1.9.3
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index bfb3b85dbe2d..7d6df78bb25d 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -108,8 +108,8 @@  static const struct drm_ioctl_desc drm_ioctls[] = {
 	DRM_IOCTL_DEF(DRM_IOCTL_AGP_UNBIND, drm_agp_unbind_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 #endif
 
-	DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-	DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
+	DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_legacy_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
+	DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_legacy_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 
 	DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank, DRM_UNLOCKED),
 
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index 36755ac4f244..d8bc895bc376 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -100,4 +100,11 @@  extern void drm_legacy_free_buffer(struct drm_device *dev,
 extern void drm_legacy_core_reclaim_buffers(struct drm_device *dev,
 					    struct drm_file *filp);
 
+/* Scatter Gather Support */
+extern void drm_legacy_sg_cleanup(struct drm_device *dev);
+extern int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
+			       struct drm_file *file_priv);
+extern int drm_legacy_sg_free(struct drm_device *dev, void *data,
+			      struct drm_file *file_priv);
+
 #endif /* __DRM_LEGACY_H__ */
diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
index 1c78406f6e71..a02605c96224 100644
--- a/drivers/gpu/drm/drm_scatter.c
+++ b/drivers/gpu/drm/drm_scatter.c
@@ -78,8 +78,8 @@  void drm_legacy_sg_cleanup(struct drm_device *dev)
 # define ScatterHandle(x) (unsigned int)(x)
 #endif
 
-int drm_sg_alloc(struct drm_device *dev, void *data,
-		 struct drm_file *file_priv)
+int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
+			struct drm_file *file_priv)
 {
 	struct drm_scatter_gather *request = data;
 	struct drm_sg_mem *entry;
@@ -194,8 +194,8 @@  int drm_sg_alloc(struct drm_device *dev, void *data,
 	return -ENOMEM;
 }
 
-int drm_sg_free(struct drm_device *dev, void *data,
-		struct drm_file *file_priv)
+int drm_legacy_sg_free(struct drm_device *dev, void *data,
+		       struct drm_file *file_priv)
 {
 	struct drm_scatter_gather *request = data;
 	struct drm_sg_mem *entry;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 574e325d6b69..1d1468bcd69f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1316,13 +1316,6 @@  void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpr
 
 extern int drm_vma_info(struct seq_file *m, void *data);
 
-				/* Scatter Gather Support (drm_scatter.h) */
-extern void drm_legacy_sg_cleanup(struct drm_device *dev);
-extern int drm_sg_alloc(struct drm_device *dev, void *data,
-			struct drm_file *file_priv);
-extern int drm_sg_free(struct drm_device *dev, void *data,
-		       struct drm_file *file_priv);
-
 			       /* ATI PCIGART support (ati_pcigart.h) */
 extern int drm_ati_pcigart_init(struct drm_device *dev,
 				struct drm_ati_pcigart_info * gart_info);