All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument.
@ 2020-07-28  3:42 Dave Airlie
  2020-07-28  7:37 ` Christian König
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dave Airlie @ 2020-07-28  3:42 UTC (permalink / raw)
  To: dri-devel; +Cc: sroland, linux-graphics-maintainer, christian.koenig

From: Dave Airlie <airlied@redhat.com>

Just drop the argument from this.

This does ask the question if this is the function vmwgfx
should be using or should it be doing an evict all like
the other drivers.

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

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b03747717ec7..f297fd5e02d4 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1838,7 +1838,7 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx)
 }
 EXPORT_SYMBOL(ttm_bo_swapout);
 
-void ttm_bo_swapout_all(struct ttm_bo_device *bdev)
+void ttm_bo_swapout_all(void)
 {
 	struct ttm_operation_ctx ctx = {
 		.interruptible = false,
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 470428387878..fb39826f72c1 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1352,7 +1352,7 @@ static int vmw_pm_freeze(struct device *kdev)
 	vmw_execbuf_release_pinned_bo(dev_priv);
 	vmw_resource_evict_all(dev_priv);
 	vmw_release_device_early(dev_priv);
-	ttm_bo_swapout_all(&dev_priv->bdev);
+	ttm_bo_swapout_all();
 	if (dev_priv->enable_fb)
 		vmw_fifo_resource_dec(dev_priv);
 	if (atomic_read(&dev_priv->num_fifo_resources) != 0) {
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index b1c705a93517..a9e13b252820 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -692,7 +692,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
 
 int ttm_bo_swapout(struct ttm_bo_global *glob,
 			struct ttm_operation_ctx *ctx);
-void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
+void ttm_bo_swapout_all(void);
 
 /**
  * ttm_bo_uses_embedded_gem_object - check if the given bo uses the
-- 
2.26.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument.
  2020-07-28  3:42 [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument Dave Airlie
@ 2020-07-28  7:37 ` Christian König
  2020-07-30 15:45   ` Roland Scheidegger
  2020-07-28  9:14 ` daniel
  2020-07-28 23:47 ` Zack Rusin
  2 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2020-07-28  7:37 UTC (permalink / raw)
  To: Dave Airlie, dri-devel; +Cc: sroland, linux-graphics-maintainer

Am 28.07.20 um 05:42 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> Just drop the argument from this.
>
> This does ask the question if this is the function vmwgfx
> should be using or should it be doing an evict all like
> the other drivers.
>
> 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 +-
>   drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
>   include/drm/ttm/ttm_bo_api.h        | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index b03747717ec7..f297fd5e02d4 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -1838,7 +1838,7 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx)
>   }
>   EXPORT_SYMBOL(ttm_bo_swapout);
>   
> -void ttm_bo_swapout_all(struct ttm_bo_device *bdev)
> +void ttm_bo_swapout_all(void)
>   {
>   	struct ttm_operation_ctx ctx = {
>   		.interruptible = false,
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 470428387878..fb39826f72c1 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -1352,7 +1352,7 @@ static int vmw_pm_freeze(struct device *kdev)
>   	vmw_execbuf_release_pinned_bo(dev_priv);
>   	vmw_resource_evict_all(dev_priv);
>   	vmw_release_device_early(dev_priv);
> -	ttm_bo_swapout_all(&dev_priv->bdev);
> +	ttm_bo_swapout_all();
>   	if (dev_priv->enable_fb)
>   		vmw_fifo_resource_dec(dev_priv);
>   	if (atomic_read(&dev_priv->num_fifo_resources) != 0) {
> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
> index b1c705a93517..a9e13b252820 100644
> --- a/include/drm/ttm/ttm_bo_api.h
> +++ b/include/drm/ttm/ttm_bo_api.h
> @@ -692,7 +692,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
>   
>   int ttm_bo_swapout(struct ttm_bo_global *glob,
>   			struct ttm_operation_ctx *ctx);
> -void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
> +void ttm_bo_swapout_all(void);
>   
>   /**
>    * ttm_bo_uses_embedded_gem_object - check if the given bo uses the

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument.
  2020-07-28  3:42 [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument Dave Airlie
  2020-07-28  7:37 ` Christian König
@ 2020-07-28  9:14 ` daniel
  2020-07-28 23:47 ` Zack Rusin
  2 siblings, 0 replies; 5+ messages in thread
From: daniel @ 2020-07-28  9:14 UTC (permalink / raw)
  Cc: linux-graphics-maintainer, sroland, christian.koenig, dri-devel

On Tue, Jul 28, 2020 at 01:42:54PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> Just drop the argument from this.
> 
> This does ask the question if this is the function vmwgfx
> should be using or should it be doing an evict all like
> the other drivers.

Yeah this looks a bit like ttm_bo_swapout_all shouldn't even be exported
really, it's part of the internal shrinker stuff.
-Daniel

> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/ttm/ttm_bo.c        | 2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
>  include/drm/ttm/ttm_bo_api.h        | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index b03747717ec7..f297fd5e02d4 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -1838,7 +1838,7 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx)
>  }
>  EXPORT_SYMBOL(ttm_bo_swapout);
>  
> -void ttm_bo_swapout_all(struct ttm_bo_device *bdev)
> +void ttm_bo_swapout_all(void)
>  {
>  	struct ttm_operation_ctx ctx = {
>  		.interruptible = false,
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 470428387878..fb39826f72c1 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -1352,7 +1352,7 @@ static int vmw_pm_freeze(struct device *kdev)
>  	vmw_execbuf_release_pinned_bo(dev_priv);
>  	vmw_resource_evict_all(dev_priv);
>  	vmw_release_device_early(dev_priv);
> -	ttm_bo_swapout_all(&dev_priv->bdev);
> +	ttm_bo_swapout_all();
>  	if (dev_priv->enable_fb)
>  		vmw_fifo_resource_dec(dev_priv);
>  	if (atomic_read(&dev_priv->num_fifo_resources) != 0) {
> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
> index b1c705a93517..a9e13b252820 100644
> --- a/include/drm/ttm/ttm_bo_api.h
> +++ b/include/drm/ttm/ttm_bo_api.h
> @@ -692,7 +692,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
>  
>  int ttm_bo_swapout(struct ttm_bo_global *glob,
>  			struct ttm_operation_ctx *ctx);
> -void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
> +void ttm_bo_swapout_all(void);
>  
>  /**
>   * ttm_bo_uses_embedded_gem_object - check if the given bo uses the
> -- 
> 2.26.2
> 
> _______________________________________________
> 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument.
  2020-07-28  3:42 [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument Dave Airlie
  2020-07-28  7:37 ` Christian König
  2020-07-28  9:14 ` daniel
@ 2020-07-28 23:47 ` Zack Rusin
  2 siblings, 0 replies; 5+ messages in thread
From: Zack Rusin @ 2020-07-28 23:47 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Roland Scheidegger, Linux-graphics-maintainer, christian.koenig,
	dri-devel


> On Jul 27, 2020, at 11:42 PM, Dave Airlie <airlied@gmail.com> wrote:
> 
> From: Dave Airlie <airlied@redhat.com>
> 
> Just drop the argument from this.
> 
> This does ask the question if this is the function vmwgfx
> should be using or should it be doing an evict all like
> the other drivers.

Yea, it really should. This code is really old. Over the next year we’ll spend some time making our driver a little less special so that we can make those symbols private again (we’ll have to reevaulate whether we still need the private ttm_lock code, because ideally we’d bring all of that inline with the other drivers).

For the patch:
Reviewed-by: Zack Rusin <zackr@vmware.com>

z
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument.
  2020-07-28  7:37 ` Christian König
@ 2020-07-30 15:45   ` Roland Scheidegger
  0 siblings, 0 replies; 5+ messages in thread
From: Roland Scheidegger @ 2020-07-30 15:45 UTC (permalink / raw)
  To: Christian König, Dave Airlie, dri-devel; +Cc: linux-graphics-maintainer

Patch looks good to me too.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>

Seems indeed like we should do some cleanup.

Roland

Am 28.07.20 um 09:37 schrieb Christian König:
> Am 28.07.20 um 05:42 schrieb Dave Airlie:
>> From: Dave Airlie <airlied@redhat.com>
>>
>> Just drop the argument from this.
>>
>> This does ask the question if this is the function vmwgfx
>> should be using or should it be doing an evict all like
>> the other drivers.
>>
>> 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 +-
>>   drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
>>   include/drm/ttm/ttm_bo_api.h        | 2 +-
>>   3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
>> index b03747717ec7..f297fd5e02d4 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
>> @@ -1838,7 +1838,7 @@ int ttm_bo_swapout(struct ttm_bo_global *glob,
>> struct ttm_operation_ctx *ctx)
>>   }
>>   EXPORT_SYMBOL(ttm_bo_swapout);
>>   -void ttm_bo_swapout_all(struct ttm_bo_device *bdev)
>> +void ttm_bo_swapout_all(void)
>>   {
>>       struct ttm_operation_ctx ctx = {
>>           .interruptible = false,
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> index 470428387878..fb39826f72c1 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> @@ -1352,7 +1352,7 @@ static int vmw_pm_freeze(struct device *kdev)
>>       vmw_execbuf_release_pinned_bo(dev_priv);
>>       vmw_resource_evict_all(dev_priv);
>>       vmw_release_device_early(dev_priv);
>> -    ttm_bo_swapout_all(&dev_priv->bdev);
>> +    ttm_bo_swapout_all();
>>       if (dev_priv->enable_fb)
>>           vmw_fifo_resource_dec(dev_priv);
>>       if (atomic_read(&dev_priv->num_fifo_resources) != 0) {
>> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
>> index b1c705a93517..a9e13b252820 100644
>> --- a/include/drm/ttm/ttm_bo_api.h
>> +++ b/include/drm/ttm/ttm_bo_api.h
>> @@ -692,7 +692,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev,
>> struct file *filp,
>>     int ttm_bo_swapout(struct ttm_bo_global *glob,
>>               struct ttm_operation_ctx *ctx);
>> -void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
>> +void ttm_bo_swapout_all(void);
>>     /**
>>    * ttm_bo_uses_embedded_gem_object - check if the given bo uses the
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-30 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  3:42 [PATCH] ttm: ttm_bo_swapout_all doesn't use it's argument Dave Airlie
2020-07-28  7:37 ` Christian König
2020-07-30 15:45   ` Roland Scheidegger
2020-07-28  9:14 ` daniel
2020-07-28 23:47 ` Zack Rusin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.