drm/amdgpu: Fix a false positive when pin non-VRAM memory
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix a false positive when pin non-VRAM memory
Flag TTM_PL_FLAG_CONTIGUOUS is only valid for VRAM domain. So fix the false positive by checking memory type too.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
@@ -919,7 +919,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,if (!(domain &amdgpu_mem_type_to_domain (mem_type)))return -EINVAL ; -if ((bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && +if ((mem_type ==TTM_PL_VRAM ) && + (bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && !(mem_flags &TTM_PL_FLAG_CONTIGUOUS ))return -EINVAL ;
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 30.01.21 um 02:00 schrieb xinhui pan:
Quoted 6 lines
Flag
TTM_PL_FLAG_CONTIGUOUSis only valid for VRAM domain. So fix the false positive by checking memory type too.Suggested-by Felix Kuehling <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by xinhui pan <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, · line 926
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2
-1@@ -919,7 +919,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,if (!(domain &amdgpu_mem_type_to_domain (mem_type)))return -EINVAL ; -if ((bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && +if ((mem_type ==TTM_PL_VRAM ) && + (bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && !(mem_flags &TTM_PL_FLAG_CONTIGUOUS ))return -EINVAL ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 7 lines · xinhui pan
Flag
TTM_PL_FLAG_CONTIGUOUSis only valid for VRAM domain. So fix the false positive by checking memory type too.Suggested-by Felix Kuehling <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by xinhui pan <[email protected]>
@Kuehling, Felix I presume this fixes the regression you noted last week?
Alex
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2
-2@@ -919,7 +919,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,if (!(domain &amdgpu_mem_type_to_domain (mem_type)))return -EINVAL ; -if ((bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && +if ((mem_type ==TTM_PL_VRAM ) && + (bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && !(mem_flags &TTM_PL_FLAG_CONTIGUOUS ))return -EINVAL ; --2.25.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 2021-02-02 um 11:17 a.m. schrieb Alex Deucher:
Quoted 8 lines · xinhui pan
Quoted 6 lines
Flag
TTM_PL_FLAG_CONTIGUOUSis only valid for VRAM domain. So fix the false positive by checking memory type too.Suggested-by Felix Kuehling <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by xinhui pan <[email protected]>@Kuehling, Felix I presume this fixes the regression you noted last week?
Yes. This is the fix I mentioned.
Thanks,
Felix
Quoted 22 lines
Alex
Quoted 18 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2
-1@@ -919,7 +919,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,if (!(domain &amdgpu_mem_type_to_domain (mem_type)))return -EINVAL ; -if ((bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && +if ((mem_type ==TTM_PL_VRAM ) && + (bo->flags &AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ) && !(mem_flags &TTM_PL_FLAG_CONTIGUOUS ))return -EINVAL ;
Quoted 7 lines
Quoted 7 lines
--
2.25.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx