Skip to contentSkip to conversation

ttm: ttm_bo_swapout_all doesn't use it's argument.

PATCH In review Dave Airlie 5 participants 5 messages Jul 28, 2020 – Jul 30, 2020

Subsystems (4)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 ttm: ttm_bo_swapout_all doesn't use it's argument.

From: Dave Airlie <[email protected]>

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.

---
 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(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index b03747717ec7..f297fd5e02d4 100644
@@ -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,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
index 470428387878..fb39826f72c1 100644
@@ -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) {
include/drm/ttm/ttm_bo_api.h +1 -1
index b1c705a93517..a9e13b252820 100644
@@ -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
Signature · 6 lines
2.26.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Am 28.07.20 um 05:42 schrieb Dave Airlie:

Quoted 9 lines

From: Dave Airlie <[email protected]>

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.

Quoted 37 lines
---
  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(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index b03747717ec7..f297fd5e02d4 100644
@@ -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,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
index 470428387878..fb39826f72c1 100644
@@ -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) {
include/drm/ttm/ttm_bo_api.h +0 -0
index b1c705a93517..a9e13b252820 100644

include/drm/ttm/ttm_bo_api.h ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp, · line 698

Quoted 8 lines
include/drm/ttm/ttm_bo_api.h +1 -1
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#2 lore raw

Patch looks good to me too.

Seems indeed like we should do some cleanup.

Roland

Am 28.07.20 um 09:37 schrieb Christian König:

Quoted 50 lines

Am 28.07.20 um 05:42 schrieb Dave Airlie:

Quoted 9 lines

From: Dave Airlie <[email protected]>

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.

Quoted 37 lines

---
  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(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -0
index b03747717ec7..f297fd5e02d4 100644
@@ -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,

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
index 470428387878..fb39826f72c1 100644
@@ -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) {
include/drm/ttm/ttm_bo_api.h +0 -0
index b1c705a93517..a9e13b252820 100644
Quoted 9 lines

include/drm/ttm/ttm_bo_api.h ssize_t ttm_bo_io(struct ttm_bo_device *bdev, · line 697

Quoted 8 lines
include/drm/ttm/ttm_bo_api.h +1 -1
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Dave Airlie
Quoted 7 lines · Dave Airlie

From: Dave Airlie <[email protected]>

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

Quoted 54 lines
---
 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(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index b03747717ec7..f297fd5e02d4 100644
@@ -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,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
index 470428387878..fb39826f72c1 100644
@@ -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) {
include/drm/ttm/ttm_bo_api.h +1 -1
index b1c705a93517..a9e13b252820 100644
@@ -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
Signature · 6 lines
2.26.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#4 lore raw
In reply to Dave Airlie
Quoted 10 lines · Dave Airlie

From: Dave Airlie <[email protected]>

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:

z
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel