drm/amdgpu: Remove VRAM from shared bo domains.
Subsystems (2)
PATCH 2/3 drm/amdgpu: Remove VRAM from shared bo domains.
Signed-off-by Samuel Li <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6 -2
@@ -689,8 +689,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,return -EINVAL ;/* A shared bo cannot be migrated to VRAM */ -if (bo->prime_shared_count && (domain ==AMDGPU_GEM_DOMAIN_VRAM )) -return -EINVAL ; +if (bo->prime_shared_count) { +if (domain &AMDGPU_GEM_DOMAIN_GTT ) + domain =AMDGPU_GEM_DOMAIN_GTT ; +else +return -EINVAL ; + }if (bo->pin_count) {uint32_t mem_type = bo->tbo.mem.mem_type;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
Reviewed-byQuoted 1 line · Samuel Li
Signed-off-by Samuel Li <[email protected]>
Please add a commit message. E.g.,
This fixes a potential regression introduced when SG display support was initially added which could lead to a shared
buffer ending up pinned in vram. Check if GTT is allowed in the domain and use that if so, otherwise return an error.
With that fixed:
Reviewed-by Alex Deucher <[email protected]>
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6
-3@@ -689,8 +689,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,return -EINVAL ;/* A shared bo cannot be migrated to VRAM */ -if (bo->prime_shared_count && (domain ==AMDGPU_GEM_DOMAIN_VRAM )) -return -EINVAL ; +if (bo->prime_shared_count) { +if (domain &AMDGPU_GEM_DOMAIN_GTT ) + domain =AMDGPU_GEM_DOMAIN_GTT ; +else +return -EINVAL ; + }if (bo->pin_count) {uint32_t mem_type = bo->tbo.mem.mem_type; --2.7.4
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