Skip to contentSkip to conversation

drm/ttm: fix the warning for hit_low and evict_low

PATCH In review Sunil Khatri 3 participants 5 messages Apr 17, 2025 – Apr 18, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/ttm: fix the warning for hit_low and evict_low

fix the below warning messages:
ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'hit_low' not described in 'ttm_bo_swapout_walk' ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'evict_low' not described in 'ttm_bo_swapout_walk'

---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index 95b86003c50d..33fefdcc6323 100644
@@ -1093,7 +1093,8 @@ struct ttm_bo_swapout_walk {
 	struct ttm_lru_walk walk;
 	/** @gfp_flags: The gfp flags to use for ttm_tt_swapout() */
 	gfp_t gfp_flags;
-
+	/** @hit_low: flag to mark low */
+	/** @evict_low:  flag for low eviction */
 	bool hit_low, evict_low;
 };
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 drm/radeon: fix the warning for radeon_cs_parser_fini

Fix the below warning message.
radeon/radeon_cs.c:418: warning: Excess function parameter 'backoff' description in 'radeon_cs_parser_fini'

---
 drivers/gpu/drm/radeon/radeon_cs.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cs.c +0 -1
index 64b26bfeafc9..b8e6202f1d5b 100644
@@ -409,7 +409,6 @@ static int cmp_size_smaller_first(void *priv, const struct list_head *a,
  * radeon_cs_parser_fini() - clean parser states
  * @parser:	parser structure holding parsing context.
  * @error:	error number
- * @backoff:	indicator to backoff the reservation
  *
  * If error is set than unvalidate buffer, otherwise just free memory
  * used by parsing context.
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/radeon: fix the warning for radeon_cs_parser_fini

Quoted 13 lines · Sunil Khatri

Fix the below warning message.
radeon/radeon_cs.c:418: warning: Excess function parameter 'backoff' description in 'radeon_cs_parser_fini'

---
  drivers/gpu/drm/radeon/radeon_cs.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cs.c +0 -0
index 64b26bfeafc9..b8e6202f1d5b 100644

drivers/gpu/drm/radeon/radeon_cs.c static int cmp_size_smaller_first(void *priv, const struct list_head *a, · line 414

Quoted 7 lines
drivers/gpu/drm/radeon/radeon_cs.c +0 -1
@@ -409,7 +409,6 @@ static int cmp_size_smaller_first(void *priv, const struct list_head *a,
   * radeon_cs_parser_fini() - clean parser states
   * @parser:	parser structure holding parsing context.
   * @error:	error number
- * @backoff:	indicator to backoff the reservation
   *
   * If error is set than unvalidate buffer, otherwise just free memory
   * used by parsing context.

Regards,

Tvrtko

#3 lore raw
In reply to Sunil Khatri
Quoted 14 lines · Sunil Khatri

fix the below warning messages:
ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'hit_low' not described in 'ttm_bo_swapout_walk' ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'evict_low' not described in 'ttm_bo_swapout_walk'

---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index 95b86003c50d..33fefdcc6323 100644

drivers/gpu/drm/ttm/ttm_bo.c struct ttm_bo_swapout_walk { · line 1100

Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -1093,7 +1093,8 @@ struct ttm_bo_swapout_walk {
  	struct ttm_lru_walk walk;
  	/** @gfp_flags: The gfp flags to use for ttm_tt_swapout() */
  	gfp_t gfp_flags;
-
+	/** @hit_low: flag to mark low */
+	/** @evict_low:  flag for low eviction */
  	bool hit_low, evict_low;
  };
 

Hm, could you check if you could copy and adapt more detailed comments from struct ttm_bo_evict_walk?

	/** @try_low: Whether we should attempt to evict BO's with low 
watermark threshold */
	bool try_low;
	/** @hit_low: If we cannot evict a bo when @try_low is false (first 
pass) */
	bool hit_low;
};

Regards,

Tvrtko

#4 lore raw
Quoted 11 lines · Tvrtko Ursulin
Quoted 9 lines · Sunil Khatri

fix the below warning messages:
ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'hit_low' not described in 'ttm_bo_swapout_walk' ttm/ttm_bo.c:1098: warning: Function parameter or struct member 'evict_low' not described in 'ttm_bo_swapout_walk'

---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 15 lines

drivers/gpu/drm/ttm/ttm_bo.c struct ttm_bo_swapout_walk { · line 1099

Quoted 13 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index 95b86003c50d..33fefdcc6323 100644
@@ -1093,7 +1093,8 @@ struct ttm_bo_swapout_walk {
       struct ttm_lru_walk walk;
       /** @gfp_flags: The gfp flags to use for ttm_tt_swapout() */
       gfp_t gfp_flags;
-
+    /** @hit_low: flag to mark low */
+    /** @evict_low:  flag for low eviction */
       bool hit_low, evict_low;
   };

Hm, could you check if you could copy and adapt more detailed comments from struct ttm_bo_evict_walk?

Even i doubt how to put it and i could not find that appropriate message. Let me add the original owner also for review if the comment could be made better. Regards
Sunil Khatri

Quoted 11 lines

    /** @try_low: Whether we should attempt to evict BO's with low watermark threshold */ bool try_low;
    /** @hit_low: If we cannot evict a bo when @try_low is false (first pass) */ bool hit_low;
};

Regards,

Tvrtko