Skip to content
Snippets Groups Projects
Commit 7258e264 authored by Leo Li's avatar Leo Li Committed by Linux Infrastructure
Browse files

drm/amdgpu: Check BO's requested pinning domains against its preferred_domains


When pinning a buffer, we should check to see if there are any
additional restrictions imposed by bo->preferred_domains. This will
prevent the BO from being moved to an invalid domain when pinning.

For example, this can happen if the user requests to create a BO in GTT
domain for display scanout. amdgpu_dm will allow pinning to either VRAM
or GTT domains, since DCN can scanout from either or. However, in
amdgpu_bo_pin_restricted(), pinning to VRAM is preferred if there is
adequate carveout. This can lead to pinning to VRAM despite the user
requesting GTT placement for the BO.

v2: Allow the kernel to override the domain, which can happen when
    exporting a BO to a V4L camera (for example).

Change-Id: I0fe4b8e1a7afbdc9b27b28b996be2bfe1cf96ad1
Signed-off-by: Leo Li's avatarLeo Li <sunpeng.li@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent caea7442
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment