Skip to contentSkip to conversation

drm/ttm: clean up the inteface which is not used

PATCH In review Huang Rui 4 participants 5 messages Mar 25, 2020 – Mar 26, 2020

Subsystems (7)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/ttm: clean up the inteface which is not used

invalidate_caches is actually not used, so clean it up.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    |  6 ------
 drivers/gpu/drm/nouveau/nouveau_bo.c       |  7 -------
 drivers/gpu/drm/qxl/qxl_ttm.c              |  6 ------
 drivers/gpu/drm/radeon/radeon_ttm.c        |  6 ------
 drivers/gpu/drm/ttm/ttm_bo.c               |  8 +-------
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c |  6 ------
 include/drm/ttm/ttm_bo_driver.h            | 13 -------------
 7 files changed, 1 insertion(+), 51 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -6
index cd2bde6..b397148 100644
@@ -62,11 +62,6 @@
 
 #define AMDGPU_TTM_VRAM_MAX_DW_READ	(size_t)128
 
-static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
 /**
  * amdgpu_init_mem_type - Initialize a memory manager for a specific type of
  * memory request.
@@ -1746,7 +1741,6 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
 	.ttm_tt_create = &amdgpu_ttm_tt_create,
 	.ttm_tt_populate = &amdgpu_ttm_tt_populate,
 	.ttm_tt_unpopulate = &amdgpu_ttm_tt_unpopulate,
-	.invalidate_caches = &amdgpu_invalidate_caches,
 	.init_mem_type = &amdgpu_init_mem_type,
 	.eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
 	.evict_flags = &amdgpu_evict_flags,
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -7
index 1b62ccc..7dd94e6 100644
@@ -647,13 +647,6 @@ nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
 }
 
 static int
-nouveau_bo_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	/* We'll do this from user space. */
-	return 0;
-}
-
-static int
 nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 			 struct ttm_mem_type_manager *man)
 {
drivers/gpu/drm/qxl/qxl_ttm.c +0 -6
index 16a5e90..62a5e42 100644
@@ -48,11 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
 	return qdev;
 }
 
-static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
 static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 			     struct ttm_mem_type_manager *man)
 {
@@ -256,7 +251,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
 
 static struct ttm_bo_driver qxl_bo_driver = {
 	.ttm_tt_create = &qxl_ttm_tt_create,
-	.invalidate_caches = &qxl_invalidate_caches,
 	.init_mem_type = &qxl_init_mem_type,
 	.eviction_valuable = ttm_bo_eviction_valuable,
 	.evict_flags = &qxl_evict_flags,
drivers/gpu/drm/radeon/radeon_ttm.c +0 -6
index f4af6703..40282bf 100644
@@ -66,11 +66,6 @@ static struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
 	return rdev;
 }
 
-static int radeon_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
 static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 				struct ttm_mem_type_manager *man)
 {
@@ -774,7 +769,6 @@ static struct ttm_bo_driver radeon_bo_driver = {
 	.ttm_tt_create = &radeon_ttm_tt_create,
 	.ttm_tt_populate = &radeon_ttm_tt_populate,
 	.ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
-	.invalidate_caches = &radeon_invalidate_caches,
 	.init_mem_type = &radeon_init_mem_type,
 	.eviction_valuable = ttm_bo_eviction_valuable,
 	.evict_flags = &radeon_evict_flags,
drivers/gpu/drm/ttm/ttm_bo.c +1 -7
index 2445e2b..fd09bbb 100644
@@ -343,14 +343,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 	}
 
 moved:
-	if (bo->evicted) {
-		if (bdev->driver->invalidate_caches) {
-			ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement);
-			if (ret)
-				pr_err("Can not flush read caches\n");
-		}
+	if (bo->evicted)
 		bo->evicted = false;
-	}
 
 	if (bo->mem.mm_node)
 		bo->offset = (bo->mem.start << PAGE_SHIFT) +
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -6
index d8ea3dd..3f3b2c7 100644
@@ -736,11 +736,6 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
 	return NULL;
 }
 
-static int vmw_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
 static int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
 		      struct ttm_mem_type_manager *man)
 {
@@ -866,7 +861,6 @@ struct ttm_bo_driver vmw_bo_driver = {
 	.ttm_tt_create = &vmw_ttm_tt_create,
 	.ttm_tt_populate = &vmw_ttm_populate,
 	.ttm_tt_unpopulate = &vmw_ttm_unpopulate,
-	.invalidate_caches = vmw_invalidate_caches,
 	.init_mem_type = vmw_init_mem_type,
 	.eviction_valuable = ttm_bo_eviction_valuable,
 	.evict_flags = vmw_evict_flags,
include/drm/ttm/ttm_bo_driver.h +0 -13
index cac7a8a..5f60c1e 100644
@@ -256,19 +256,6 @@ struct ttm_bo_driver {
 	 */
 	void (*ttm_tt_unpopulate)(struct ttm_tt *ttm);
 
-	/**
-	 * struct ttm_bo_driver member invalidate_caches
-	 *
-	 * @bdev: the buffer object device.
-	 * @flags: new placement of the rebound buffer object.
-	 *
-	 * A previosly evicted buffer has been rebound in a
-	 * potentially new location. Tell the driver that it might
-	 * consider invalidating read (texture) caches on the next command
-	 * submission as a consequence.
-	 */
-
-	int (*invalidate_caches)(struct ttm_bo_device *bdev, uint32_t flags);
 	int (*init_mem_type)(struct ttm_bo_device *bdev, uint32_t type,
 			     struct ttm_mem_type_manager *man);
 
Signature · 6 lines
2.7.4

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

Am 25.03.20 um 16:34 schrieb Huang Rui:

Quoted 3 lines

invalidate_caches is actually not used, so clean it up.

Already had the same patch around for a while, looks like I've just forgot to commit it.

Quoted 158 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    |  6 ------
  drivers/gpu/drm/nouveau/nouveau_bo.c       |  7 -------
  drivers/gpu/drm/qxl/qxl_ttm.c              |  6 ------
  drivers/gpu/drm/radeon/radeon_ttm.c        |  6 ------
  drivers/gpu/drm/ttm/ttm_bo.c               |  8 +-------
  drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c |  6 ------
  include/drm/ttm/ttm_bo_driver.h            | 13 -------------
  7 files changed, 1 insertion(+), 51 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -6
index cd2bde6..b397148 100644
@@ -62,11 +62,6 @@
 
  #define AMDGPU_TTM_VRAM_MAX_DW_READ	(size_t)128
 
-static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
  /**
   * amdgpu_init_mem_type - Initialize a memory manager for a specific type of
   * memory request.
@@ -1746,7 +1741,6 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
  	.ttm_tt_create = &amdgpu_ttm_tt_create,
  	.ttm_tt_populate = &amdgpu_ttm_tt_populate,
  	.ttm_tt_unpopulate = &amdgpu_ttm_tt_unpopulate,
-	.invalidate_caches = &amdgpu_invalidate_caches,
  	.init_mem_type = &amdgpu_init_mem_type,
  	.eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
  	.evict_flags = &amdgpu_evict_flags,
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -7
index 1b62ccc..7dd94e6 100644
@@ -647,13 +647,6 @@ nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
  }
 
  static int
-nouveau_bo_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	/* We'll do this from user space. */
-	return 0;
-}
-
-static int
  nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
  			 struct ttm_mem_type_manager *man)
  {
drivers/gpu/drm/qxl/qxl_ttm.c +0 -6
index 16a5e90..62a5e42 100644
@@ -48,11 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
  	return qdev;
  }
 
-static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
  static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
  			     struct ttm_mem_type_manager *man)
  {
@@ -256,7 +251,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
 
  static struct ttm_bo_driver qxl_bo_driver = {
  	.ttm_tt_create = &qxl_ttm_tt_create,
-	.invalidate_caches = &qxl_invalidate_caches,
  	.init_mem_type = &qxl_init_mem_type,
  	.eviction_valuable = ttm_bo_eviction_valuable,
  	.evict_flags = &qxl_evict_flags,
drivers/gpu/drm/radeon/radeon_ttm.c +0 -6
index f4af6703..40282bf 100644
@@ -66,11 +66,6 @@ static struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
  	return rdev;
  }
 
-static int radeon_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
  static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
  				struct ttm_mem_type_manager *man)
  {
@@ -774,7 +769,6 @@ static struct ttm_bo_driver radeon_bo_driver = {
  	.ttm_tt_create = &radeon_ttm_tt_create,
  	.ttm_tt_populate = &radeon_ttm_tt_populate,
  	.ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
-	.invalidate_caches = &radeon_invalidate_caches,
  	.init_mem_type = &radeon_init_mem_type,
  	.eviction_valuable = ttm_bo_eviction_valuable,
  	.evict_flags = &radeon_evict_flags,
drivers/gpu/drm/ttm/ttm_bo.c +1 -7
index 2445e2b..fd09bbb 100644
@@ -343,14 +343,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
  	}
 
  moved:
-	if (bo->evicted) {
-		if (bdev->driver->invalidate_caches) {
-			ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement);
-			if (ret)
-				pr_err("Can not flush read caches\n");
-		}
+	if (bo->evicted)
  		bo->evicted = false;
-	}
 
  	if (bo->mem.mm_node)
  		bo->offset = (bo->mem.start << PAGE_SHIFT) +
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -6
index d8ea3dd..3f3b2c7 100644
@@ -736,11 +736,6 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
  	return NULL;
  }
 
-static int vmw_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-	return 0;
-}
-
  static int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
  		      struct ttm_mem_type_manager *man)
  {
@@ -866,7 +861,6 @@ struct ttm_bo_driver vmw_bo_driver = {
  	.ttm_tt_create = &vmw_ttm_tt_create,
  	.ttm_tt_populate = &vmw_ttm_populate,
  	.ttm_tt_unpopulate = &vmw_ttm_unpopulate,
-	.invalidate_caches = vmw_invalidate_caches,
  	.init_mem_type = vmw_init_mem_type,
  	.eviction_valuable = ttm_bo_eviction_valuable,
  	.evict_flags = vmw_evict_flags,
include/drm/ttm/ttm_bo_driver.h +0 -6
index cac7a8a..5f60c1e 100644
@@ -256,19 +256,6 @@ struct ttm_bo_driver {
  	 */
  	void (*ttm_tt_unpopulate)(struct ttm_tt *ttm);
 
-	/**
-	 * struct ttm_bo_driver member invalidate_caches
-	 *
-	 * @bdev: the buffer object device.
-	 * @flags: new placement of the rebound buffer object.
-	 *

include/drm/ttm/ttm_bo_driver.h struct ttm_bo_driver { · line 261

Quoted 10 lines
include/drm/ttm/ttm_bo_driver.h +0 -7
-	 * A previosly evicted buffer has been rebound in a
-	 * potentially new location. Tell the driver that it might
-	 * consider invalidating read (texture) caches on the next command
-	 * submission as a consequence.
-	 */
-
-	int (*invalidate_caches)(struct ttm_bo_device *bdev, uint32_t flags);
  	int (*init_mem_type)(struct ttm_bo_device *bdev, uint32_t type,
  			     struct ttm_mem_type_manager *man);
 

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

#2 lore raw
Quoted 11 lines · Christian König

Am 25.03.20 um 16:34 schrieb Huang Rui:

Quoted 3 lines

invalidate_caches is actually not used, so clean it up.

Already had the same patch around for a while, looks like I've just forgot to commit it.

Is it already in drm-misc and just hasn't made it into amd-staging-drm-next yet? I can try and rebase next week if so.

Alex

Quoted 165 lines
Quoted 165 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    |  6 ------
  drivers/gpu/drm/nouveau/nouveau_bo.c       |  7 -------
  drivers/gpu/drm/qxl/qxl_ttm.c              |  6 ------
  drivers/gpu/drm/radeon/radeon_ttm.c        |  6 ------
  drivers/gpu/drm/ttm/ttm_bo.c               |  8 +-------
  drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c |  6 ------
  include/drm/ttm/ttm_bo_driver.h            | 13 -------------
  7 files changed, 1 insertion(+), 51 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -6
index cd2bde6..b397148 100644
@@ -62,11 +62,6 @@
 
  #define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128
 
-static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
  /**
   * amdgpu_init_mem_type - Initialize a memory manager for a specific type of
   * memory request.
@@ -1746,7 +1741,6 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
      .ttm_tt_create = &amdgpu_ttm_tt_create,
      .ttm_tt_populate = &amdgpu_ttm_tt_populate,
      .ttm_tt_unpopulate = &amdgpu_ttm_tt_unpopulate,
-     .invalidate_caches = &amdgpu_invalidate_caches,
      .init_mem_type = &amdgpu_init_mem_type,
      .eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
      .evict_flags = &amdgpu_evict_flags,
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -7
index 1b62ccc..7dd94e6 100644
@@ -647,13 +647,6 @@ nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
  }
 
  static int
-nouveau_bo_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     /* We'll do this from user space. */
-     return 0;
-}
-
-static int
  nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                       struct ttm_mem_type_manager *man)
  {
drivers/gpu/drm/qxl/qxl_ttm.c +0 -6
index 16a5e90..62a5e42 100644
@@ -48,11 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
      return qdev;
  }
 
-static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
  static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                           struct ttm_mem_type_manager *man)
  {
@@ -256,7 +251,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
 
  static struct ttm_bo_driver qxl_bo_driver = {
      .ttm_tt_create = &qxl_ttm_tt_create,
-     .invalidate_caches = &qxl_invalidate_caches,
      .init_mem_type = &qxl_init_mem_type,
      .eviction_valuable = ttm_bo_eviction_valuable,
      .evict_flags = &qxl_evict_flags,
drivers/gpu/drm/radeon/radeon_ttm.c +0 -6
index f4af6703..40282bf 100644
@@ -66,11 +66,6 @@ static struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
      return rdev;
  }
 
-static int radeon_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
  static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                              struct ttm_mem_type_manager *man)
  {
@@ -774,7 +769,6 @@ static struct ttm_bo_driver radeon_bo_driver = {
      .ttm_tt_create = &radeon_ttm_tt_create,
      .ttm_tt_populate = &radeon_ttm_tt_populate,
      .ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
-     .invalidate_caches = &radeon_invalidate_caches,
      .init_mem_type = &radeon_init_mem_type,
      .eviction_valuable = ttm_bo_eviction_valuable,
      .evict_flags = &radeon_evict_flags,
drivers/gpu/drm/ttm/ttm_bo.c +1 -7
index 2445e2b..fd09bbb 100644
@@ -343,14 +343,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
      }
 
  moved:
-     if (bo->evicted) {
-             if (bdev->driver->invalidate_caches) {
-                     ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement);
-                     if (ret)
-                             pr_err("Can not flush read caches\n");
-             }
+     if (bo->evicted)
              bo->evicted = false;
-     }
 
      if (bo->mem.mm_node)
              bo->offset = (bo->mem.start << PAGE_SHIFT) +
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -6
index d8ea3dd..3f3b2c7 100644
@@ -736,11 +736,6 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
      return NULL;
  }
 
-static int vmw_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
  static int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                    struct ttm_mem_type_manager *man)
  {
@@ -866,7 +861,6 @@ struct ttm_bo_driver vmw_bo_driver = {
      .ttm_tt_create = &vmw_ttm_tt_create,
      .ttm_tt_populate = &vmw_ttm_populate,
      .ttm_tt_unpopulate = &vmw_ttm_unpopulate,
-     .invalidate_caches = vmw_invalidate_caches,
      .init_mem_type = vmw_init_mem_type,
      .eviction_valuable = ttm_bo_eviction_valuable,
      .evict_flags = vmw_evict_flags,
include/drm/ttm/ttm_bo_driver.h +0 -13
index cac7a8a..5f60c1e 100644
@@ -256,19 +256,6 @@ struct ttm_bo_driver {
       */
      void (*ttm_tt_unpopulate)(struct ttm_tt *ttm);
 
-     /**
-      * struct ttm_bo_driver member invalidate_caches
-      *
-      * @bdev: the buffer object device.
-      * @flags: new placement of the rebound buffer object.
-      *
-      * A previosly evicted buffer has been rebound in a
-      * potentially new location. Tell the driver that it might
-      * consider invalidating read (texture) caches on the next command
-      * submission as a consequence.
-      */
-
-     int (*invalidate_caches)(struct ttm_bo_device *bdev, uint32_t flags);
Quoted 8 lines

include/drm/ttm/ttm_bo_driver.h struct ttm_bo_driver { · line 261

Quoted 3 lines
include/drm/ttm/ttm_bo_driver.h +0 -0
      int (*init_mem_type)(struct ttm_bo_device *bdev, uint32_t type,
                           struct ttm_mem_type_manager *man);
 

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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw

Am 25.03.20 um 18:27 schrieb Alex Deucher:

Quoted 5 lines
Quoted 3 lines · Christian König

Am 25.03.20 um 16:34 schrieb Huang Rui:

Quoted 2 lines

invalidate_caches is actually not used, so clean it up.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Already had the same patch around for a while, looks like I've just forgot to commit it.

Is it already in drm-misc and just hasn't made it into amd-staging-drm-next yet? I can try and rebase next week if so.

Ah! Yeah there it is:

Quoted 11 lines

commit 5e791166d377c539db0f889e7793204912c374da
Author: Christian König <[email protected]> Date:   Fri Jan 10 16:09:54 2020 +0100

    drm/ttm: nuke invalidate_caches callback

    Another completely unused feature.

Looks like we haven't merged that into amd-staging-drm-next yet.

Christian.

Quoted 176 lines

Alex

Quoted 164 lines
Quoted 164 lines
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    |  6 ------
   drivers/gpu/drm/nouveau/nouveau_bo.c       |  7 -------
   drivers/gpu/drm/qxl/qxl_ttm.c              |  6 ------
   drivers/gpu/drm/radeon/radeon_ttm.c        |  6 ------
   drivers/gpu/drm/ttm/ttm_bo.c               |  8 +-------
   drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c |  6 ------
   include/drm/ttm/ttm_bo_driver.h            | 13 -------------
   7 files changed, 1 insertion(+), 51 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -6
index cd2bde6..b397148 100644
@@ -62,11 +62,6 @@
 
   #define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128
 
-static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   /**
    * amdgpu_init_mem_type - Initialize a memory manager for a specific type of
    * memory request.
@@ -1746,7 +1741,6 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
       .ttm_tt_create = &amdgpu_ttm_tt_create,
       .ttm_tt_populate = &amdgpu_ttm_tt_populate,
       .ttm_tt_unpopulate = &amdgpu_ttm_tt_unpopulate,
-     .invalidate_caches = &amdgpu_invalidate_caches,
       .init_mem_type = &amdgpu_init_mem_type,
       .eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
       .evict_flags = &amdgpu_evict_flags,
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -7
index 1b62ccc..7dd94e6 100644
@@ -647,13 +647,6 @@ nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
   }
 
   static int
-nouveau_bo_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     /* We'll do this from user space. */
-     return 0;
-}
-
-static int
   nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                        struct ttm_mem_type_manager *man)
   {
drivers/gpu/drm/qxl/qxl_ttm.c +0 -6
index 16a5e90..62a5e42 100644
@@ -48,11 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
       return qdev;
   }
 
-static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                            struct ttm_mem_type_manager *man)
   {
@@ -256,7 +251,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
 
   static struct ttm_bo_driver qxl_bo_driver = {
       .ttm_tt_create = &qxl_ttm_tt_create,
-     .invalidate_caches = &qxl_invalidate_caches,
       .init_mem_type = &qxl_init_mem_type,
       .eviction_valuable = ttm_bo_eviction_valuable,
       .evict_flags = &qxl_evict_flags,
drivers/gpu/drm/radeon/radeon_ttm.c +0 -6
index f4af6703..40282bf 100644
@@ -66,11 +66,6 @@ static struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
       return rdev;
   }
 
-static int radeon_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                               struct ttm_mem_type_manager *man)
   {
@@ -774,7 +769,6 @@ static struct ttm_bo_driver radeon_bo_driver = {
       .ttm_tt_create = &radeon_ttm_tt_create,
       .ttm_tt_populate = &radeon_ttm_tt_populate,
       .ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
-     .invalidate_caches = &radeon_invalidate_caches,
       .init_mem_type = &radeon_init_mem_type,
       .eviction_valuable = ttm_bo_eviction_valuable,
       .evict_flags = &radeon_evict_flags,
drivers/gpu/drm/ttm/ttm_bo.c +1 -7
index 2445e2b..fd09bbb 100644
@@ -343,14 +343,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
       }
 
   moved:
-     if (bo->evicted) {
-             if (bdev->driver->invalidate_caches) {
-                     ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement);
-                     if (ret)
-                             pr_err("Can not flush read caches\n");
-             }
+     if (bo->evicted)
               bo->evicted = false;
-     }
 
       if (bo->mem.mm_node)
               bo->offset = (bo->mem.start << PAGE_SHIFT) +
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -6
index d8ea3dd..3f3b2c7 100644
@@ -736,11 +736,6 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
       return NULL;
   }
 
-static int vmw_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   static int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                     struct ttm_mem_type_manager *man)
   {
@@ -866,7 +861,6 @@ struct ttm_bo_driver vmw_bo_driver = {
       .ttm_tt_create = &vmw_ttm_tt_create,
       .ttm_tt_populate = &vmw_ttm_populate,
       .ttm_tt_unpopulate = &vmw_ttm_unpopulate,
-     .invalidate_caches = vmw_invalidate_caches,
       .init_mem_type = vmw_init_mem_type,
       .eviction_valuable = ttm_bo_eviction_valuable,
       .evict_flags = vmw_evict_flags,
include/drm/ttm/ttm_bo_driver.h +0 -12
index cac7a8a..5f60c1e 100644
@@ -256,19 +256,6 @@ struct ttm_bo_driver {
        */
       void (*ttm_tt_unpopulate)(struct ttm_tt *ttm);
 
-     /**
-      * struct ttm_bo_driver member invalidate_caches
-      *
-      * @bdev: the buffer object device.
-      * @flags: new placement of the rebound buffer object.
-      *
-      * A previosly evicted buffer has been rebound in a
-      * potentially new location. Tell the driver that it might
-      * consider invalidating read (texture) caches on the next command
-      * submission as a consequence.
-      */
-
Quoted 8 lines

include/drm/ttm/ttm_bo_driver.h struct ttm_bo_driver { · line 261

Quoted 4 lines
include/drm/ttm/ttm_bo_driver.h +0 -1
-     int (*invalidate_caches)(struct ttm_bo_device *bdev, uint32_t flags);
       int (*init_mem_type)(struct ttm_bo_device *bdev, uint32_t type,
                            struct ttm_mem_type_manager *man);
 

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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

author
#4 lore raw
Quoted 23 lines · Christian König

Am 25.03.20 um 18:27 schrieb Alex Deucher:

Quoted 5 lines
Quoted 3 lines · Christian König

Am 25.03.20 um 16:34 schrieb Huang Rui:

Quoted 2 lines

invalidate_caches is actually not used, so clean it up.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Already had the same patch around for a while, looks like I've just forgot to commit it.

Is it already in drm-misc and just hasn't made it into amd-staging-drm-next yet? I can try and rebase next week if so.

Ah! Yeah there it is:

Quoted 6 lines

commit 5e791166d377c539db0f889e7793204912c374da
Author: Christian König <[email protected]> Date:   Fri Jan 10 16:09:54 2020 +0100

    drm/ttm: nuke invalidate_caches callback

Quoted 7 lines
Quoted 5 lines

    Another completely unused feature.

Looks like we haven't merged that into amd-staging-drm-next yet.

I also forgot to look at this patch before. :-)
OK, let's use your orignal patch.

Thanks,
Ray

Quoted 184 lines

Christian.

Quoted 180 lines

Alex

Quoted 164 lines
Quoted 164 lines
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    |  6 ------
   drivers/gpu/drm/nouveau/nouveau_bo.c       |  7 -------
   drivers/gpu/drm/qxl/qxl_ttm.c              |  6 ------
   drivers/gpu/drm/radeon/radeon_ttm.c        |  6 ------
   drivers/gpu/drm/ttm/ttm_bo.c               |  8 +-------
   drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c |  6 ------
   include/drm/ttm/ttm_bo_driver.h            | 13 -------------
   7 files changed, 1 insertion(+), 51 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -6
index cd2bde6..b397148 100644
@@ -62,11 +62,6 @@
 
   #define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128
 
-static int amdgpu_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   /**
    * amdgpu_init_mem_type - Initialize a memory manager for a specific type of
    * memory request.
@@ -1746,7 +1741,6 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
       .ttm_tt_create = &amdgpu_ttm_tt_create,
       .ttm_tt_populate = &amdgpu_ttm_tt_populate,
       .ttm_tt_unpopulate = &amdgpu_ttm_tt_unpopulate,
-     .invalidate_caches = &amdgpu_invalidate_caches,
       .init_mem_type = &amdgpu_init_mem_type,
       .eviction_valuable = amdgpu_ttm_bo_eviction_valuable,
       .evict_flags = &amdgpu_evict_flags,
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -7
index 1b62ccc..7dd94e6 100644
@@ -647,13 +647,6 @@ nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
   }
 
   static int
-nouveau_bo_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     /* We'll do this from user space. */
-     return 0;
-}
-
-static int
   nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                        struct ttm_mem_type_manager *man)
   {
drivers/gpu/drm/qxl/qxl_ttm.c +0 -6
index 16a5e90..62a5e42 100644
@@ -48,11 +48,6 @@ static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
       return qdev;
   }
 
-static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                            struct ttm_mem_type_manager *man)
   {
@@ -256,7 +251,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
 
   static struct ttm_bo_driver qxl_bo_driver = {
       .ttm_tt_create = &qxl_ttm_tt_create,
-     .invalidate_caches = &qxl_invalidate_caches,
       .init_mem_type = &qxl_init_mem_type,
       .eviction_valuable = ttm_bo_eviction_valuable,
       .evict_flags = &qxl_evict_flags,
drivers/gpu/drm/radeon/radeon_ttm.c +0 -6
index f4af6703..40282bf 100644
@@ -66,11 +66,6 @@ static struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev)
       return rdev;
   }
 
-static int radeon_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                               struct ttm_mem_type_manager *man)
   {
@@ -774,7 +769,6 @@ static struct ttm_bo_driver radeon_bo_driver = {
       .ttm_tt_create = &radeon_ttm_tt_create,
       .ttm_tt_populate = &radeon_ttm_tt_populate,
       .ttm_tt_unpopulate = &radeon_ttm_tt_unpopulate,
-     .invalidate_caches = &radeon_invalidate_caches,
       .init_mem_type = &radeon_init_mem_type,
       .eviction_valuable = ttm_bo_eviction_valuable,
       .evict_flags = &radeon_evict_flags,
drivers/gpu/drm/ttm/ttm_bo.c +1 -7
index 2445e2b..fd09bbb 100644
@@ -343,14 +343,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
       }
 
   moved:
-     if (bo->evicted) {
-             if (bdev->driver->invalidate_caches) {
-                     ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement);
-                     if (ret)
-                             pr_err("Can not flush read caches\n");
-             }
+     if (bo->evicted)
               bo->evicted = false;
-     }
 
       if (bo->mem.mm_node)
               bo->offset = (bo->mem.start << PAGE_SHIFT) +
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -6
index d8ea3dd..3f3b2c7 100644
@@ -736,11 +736,6 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
       return NULL;
   }
 
-static int vmw_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
-{
-     return 0;
-}
-
   static int vmw_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
                     struct ttm_mem_type_manager *man)
   {
@@ -866,7 +861,6 @@ struct ttm_bo_driver vmw_bo_driver = {
       .ttm_tt_create = &vmw_ttm_tt_create,
       .ttm_tt_populate = &vmw_ttm_populate,
       .ttm_tt_unpopulate = &vmw_ttm_unpopulate,
-     .invalidate_caches = vmw_invalidate_caches,
       .init_mem_type = vmw_init_mem_type,
       .eviction_valuable = ttm_bo_eviction_valuable,
       .evict_flags = vmw_evict_flags,
include/drm/ttm/ttm_bo_driver.h +0 -12
index cac7a8a..5f60c1e 100644
@@ -256,19 +256,6 @@ struct ttm_bo_driver {
        */
       void (*ttm_tt_unpopulate)(struct ttm_tt *ttm);
 
-     /**
-      * struct ttm_bo_driver member invalidate_caches
-      *
-      * @bdev: the buffer object device.
-      * @flags: new placement of the rebound buffer object.
-      *
-      * A previosly evicted buffer has been rebound in a
-      * potentially new location. Tell the driver that it might
-      * consider invalidating read (texture) caches on the next command
-      * submission as a consequence.
-      */
-
Quoted 8 lines

include/drm/ttm/ttm_bo_driver.h struct ttm_bo_driver { · line 261

Quoted 4 lines
include/drm/ttm/ttm_bo_driver.h +0 -1
-     int (*invalidate_caches)(struct ttm_bo_device *bdev, uint32_t flags);
       int (*init_mem_type)(struct ttm_bo_device *bdev, uint32_t type,
                            struct ttm_mem_type_manager *man);
 

_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cray.huang%40amd.com%7C544ea2a584b94dd75d8808d7d0e23993%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637207542363429381&amp;sdata=U%2FQma6upKeuE1czmXpMlRcdnBmITvQZ9UyKsrA7sqs0%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cray.huang%40amd.com%7C544ea2a584b94dd75d8808d7d0e23993%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637207542363429381&amp;sdata=g4ARa0zkuyQp8HgGyv%2BMD3892AbuYeXmHXCSfQN7dxs%3D&amp;reserved=0

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