Skip to contentSkip to conversation

drm/ttm: check with temporary GTT memory in BO validation

PATCH In review Lang Yu 2 participants 3 messages May 31, 2021

Subsystems (3)
lore
Share & tools
lore

Lang Yu

author
#0 lore raw

PATCH v2 2/2 drm/ttm: check with temporary GTT memory in BO validation

If a BO's backing store is temporary GTT memory, we should move it in BO validation.

v2: move the check outside of for loop

---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +3 -0
index c32a37d0a460..1802fc77cfcb 100644
@@ -938,6 +938,9 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
 {
 	unsigned i;
 
+	if (mem->placement & TTM_PL_FLAG_TEMPORARY)
+		return false;
+
 	for (i = 0; i < num_placement; i++) {
 		const struct ttm_place *heap = &places[i];
 
Signature · 6 lines
2.25.1

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

Am 31.05.21 um 13:30 schrieb Lang Yu:

Quoted 6 lines

If a BO's backing store is temporary GTT memory, we should move it in BO validation.

v2: move the check outside of for loop

In general those patches now have my rb, but let me add some more documentation to them to better explain why we do this.

Thanks,
Christian.

Quoted 9 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index c32a37d0a460..1802fc77cfcb 100644

drivers/gpu/drm/ttm/ttm_bo.c static bool ttm_bo_places_compat(const struct ttm_place *places, · line 946

Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo.c +3 -0
@@ -938,6 +938,9 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
  {
  	unsigned i;
 
+	if (mem->placement & TTM_PL_FLAG_TEMPORARY)
+		return false;
+
  	for (i = 0; i < num_placement; i++) {
  		const struct ttm_place *heap = &places[i];
 

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

author
#2 lore raw

[AMD Official Use Only]

Quoted 15 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Monday, May 31, 2021 7:55 PM
To: Yu, Lang <[email protected]>; [email protected]; dri- [email protected]
Cc: Thomas Hellströ <[email protected]>; Olsak, Marek <[email protected]>; Huang, Ray <[email protected]>; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH v2 2/2] drm/ttm: check with temporary GTT memory in BO validation

Am 31.05.21 um 13:30 schrieb Lang Yu:

Quoted 3 lines

If a BO's backing store is temporary GTT memory, we should move it in BO validation.

Quoted 7 lines
Quoted 3 lines

v2: move the check outside of for loop

In general those patches now have my rb, but let me add some more documentation to them to better explain why we do this.

[Yu, Lang]
Thanks for your review and advice. Happy to see that!

Regards,
Lang

Quoted 22 lines

Thanks,
Christian.

drivers/gpu/drm/ttm/ttm_bo.c static bool ttm_bo_places_compat(const struct

Quoted 9 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 +++
  1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/ttm/ttm_bo.c index c32a37d0a460..1802fc77cfcb 100644

drivers/gpu/drm/ttm/ttm_bo.c +0 -0
@@ -938,6 +938,9 @@ static bool ttm_bo_places_compat(const struct

ttm_place *places,

Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo.c +3 -0
  {
  	unsigned i;
 
+	if (mem->placement & TTM_PL_FLAG_TEMPORARY)
+		return false;
+
  	for (i = 0; i < num_placement; i++) {
  		const struct ttm_place *heap = &places[i];