[43/59] drm/ttm: rename manager variable to make sure wrapper is used.
diff mbox series

Message ID 20200804025632.3868079-44-airlied@gmail.com
State New
Headers show
Series
  • ttm misc cleanups, mem refactoring, rename objects. (v2)
Related show

Commit Message

Dave Airlie Aug. 4, 2020, 2:56 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

Other users of this should notice this change and switch to wrapper.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c    | 2 +-
 include/drm/ttm/ttm_bo_driver.h | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Christian König Aug. 4, 2020, 11:29 a.m. UTC | #1
Am 04.08.20 um 04:56 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> Other users of this should notice this change and switch to wrapper.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c    | 2 +-
>   include/drm/ttm/ttm_bo_driver.h | 7 +++++--
>   2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 8777c323e7de..3a3a4dfb0fff 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -1617,7 +1617,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,
>   
>   	bdev->driver = driver;
>   
> -	memset(bdev->man, 0, sizeof(bdev->man));
> +	memset(bdev->man_priv, 0, sizeof(bdev->man_priv));
>   
>   	ttm_bo_init_sysman(bdev);
>   
> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> index e80deee3ae99..03b253d14e6a 100644
> --- a/include/drm/ttm/ttm_bo_driver.h
> +++ b/include/drm/ttm/ttm_bo_driver.h
> @@ -415,7 +415,10 @@ struct ttm_bo_device {
>   	 */
>   	struct list_head device_list;
>   	struct ttm_bo_driver *driver;
> -	struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
> +	/*
> +	 * access via ttm_manager_type.
> +	 */
> +	struct ttm_mem_type_manager man_priv[TTM_NUM_MEM_TYPES];
>   
>   	/*
>   	 * Protected by internal locks.
> @@ -447,7 +450,7 @@ struct ttm_bo_device {
>   static inline struct ttm_mem_type_manager *ttm_manager_type(struct ttm_bo_device *bdev,
>   							    int mem_type)
>   {
> -	return &bdev->man[mem_type];
> +	return &bdev->man_priv[mem_type];
>   }
>   
>   /**
Ben Skeggs Aug. 5, 2020, 5:49 a.m. UTC | #2
On Tue, 4 Aug 2020 at 21:30, Christian König <christian.koenig@amd.com> wrote:
>
> Am 04.08.20 um 04:56 schrieb Dave Airlie:
> > From: Dave Airlie <airlied@redhat.com>
> >
> > Other users of this should notice this change and switch to wrapper.
> >
> > Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>

>
> > ---
> >   drivers/gpu/drm/ttm/ttm_bo.c    | 2 +-
> >   include/drm/ttm/ttm_bo_driver.h | 7 +++++--
> >   2 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> > index 8777c323e7de..3a3a4dfb0fff 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> > @@ -1617,7 +1617,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,
> >
> >       bdev->driver = driver;
> >
> > -     memset(bdev->man, 0, sizeof(bdev->man));
> > +     memset(bdev->man_priv, 0, sizeof(bdev->man_priv));
> >
> >       ttm_bo_init_sysman(bdev);
> >
> > diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> > index e80deee3ae99..03b253d14e6a 100644
> > --- a/include/drm/ttm/ttm_bo_driver.h
> > +++ b/include/drm/ttm/ttm_bo_driver.h
> > @@ -415,7 +415,10 @@ struct ttm_bo_device {
> >        */
> >       struct list_head device_list;
> >       struct ttm_bo_driver *driver;
> > -     struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
> > +     /*
> > +      * access via ttm_manager_type.
> > +      */
> > +     struct ttm_mem_type_manager man_priv[TTM_NUM_MEM_TYPES];
> >
> >       /*
> >        * Protected by internal locks.
> > @@ -447,7 +450,7 @@ struct ttm_bo_device {
> >   static inline struct ttm_mem_type_manager *ttm_manager_type(struct ttm_bo_device *bdev,
> >                                                           int mem_type)
> >   {
> > -     return &bdev->man[mem_type];
> > +     return &bdev->man_priv[mem_type];
> >   }
> >
> >   /**
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch
diff mbox series

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 8777c323e7de..3a3a4dfb0fff 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1617,7 +1617,7 @@  int ttm_bo_device_init(struct ttm_bo_device *bdev,
 
 	bdev->driver = driver;
 
-	memset(bdev->man, 0, sizeof(bdev->man));
+	memset(bdev->man_priv, 0, sizeof(bdev->man_priv));
 
 	ttm_bo_init_sysman(bdev);
 
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index e80deee3ae99..03b253d14e6a 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -415,7 +415,10 @@  struct ttm_bo_device {
 	 */
 	struct list_head device_list;
 	struct ttm_bo_driver *driver;
-	struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
+	/*
+	 * access via ttm_manager_type.
+	 */
+	struct ttm_mem_type_manager man_priv[TTM_NUM_MEM_TYPES];
 
 	/*
 	 * Protected by internal locks.
@@ -447,7 +450,7 @@  struct ttm_bo_device {
 static inline struct ttm_mem_type_manager *ttm_manager_type(struct ttm_bo_device *bdev,
 							    int mem_type)
 {
-	return &bdev->man[mem_type];
+	return &bdev->man_priv[mem_type];
 }
 
 /**