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
Signed-off-by: Lang Yu Lang.Yu@amd.com --- drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c32a37d0a460..1802fc77cfcb 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -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];
Am 31.05.21 um 13:30 schrieb Lang Yu:
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
Signed-off-by: Lang Yu Lang.Yu@amd.com
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.
drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c32a37d0a460..1802fc77cfcb 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -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 Official Use Only]
-----Original Message----- From: Koenig, Christian Christian.Koenig@amd.com Sent: Monday, May 31, 2021 7:55 PM To: Yu, Lang Lang.Yu@amd.com; amd-gfx@lists.freedesktop.org; dri- devel@lists.freedesktop.org Cc: Thomas Hellströ thomas_os@shipmail.org; Olsak, Marek Marek.Olsak@amd.com; Huang, Ray Ray.Huang@amd.com; Deucher, Alexander Alexander.Deucher@amd.com 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:
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
Signed-off-by: Lang Yu Lang.Yu@amd.com
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
Thanks, Christian.
drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c32a37d0a460..1802fc77cfcb 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -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];
dri-devel@lists.freedesktop.org