mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
drm/amdgpu: Allow more flags to be set on gem create.
The GEM create flag AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE specifies that gem memory contains sensitive information and should be cleared to prevent snooping. The COHERENT and UNCACHED gem create flags enable memory features related to sharing memory across devices. For CRIU we need to re-create KFD BOs through the GEM_CREATE IOCTL, so allow those KFD specific flags here as well. This will also aid us in the future and allows to move the KFD components over using the render node for allocations. Signed-off-by: David Francis <David.Francis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
4bf83dd6e3
commit
0317e0e224
|
|
@ -442,15 +442,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
|
|||
int r;
|
||||
|
||||
/* reject invalid gem flags */
|
||||
if (flags & ~(AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
|
||||
AMDGPU_GEM_CREATE_NO_CPU_ACCESS |
|
||||
AMDGPU_GEM_CREATE_CPU_GTT_USWC |
|
||||
AMDGPU_GEM_CREATE_VRAM_CLEARED |
|
||||
AMDGPU_GEM_CREATE_VM_ALWAYS_VALID |
|
||||
AMDGPU_GEM_CREATE_EXPLICIT_SYNC |
|
||||
AMDGPU_GEM_CREATE_ENCRYPTED |
|
||||
AMDGPU_GEM_CREATE_GFX12_DCC |
|
||||
AMDGPU_GEM_CREATE_DISCARDABLE))
|
||||
if (flags & ~AMDGPU_GEM_CREATE_SETTABLE_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
/* reject invalid gem domains */
|
||||
|
|
|
|||
|
|
@ -71,4 +71,18 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
|
|||
int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *filp);
|
||||
|
||||
#define AMDGPU_GEM_CREATE_SETTABLE_MASK (AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED | \
|
||||
AMDGPU_GEM_CREATE_NO_CPU_ACCESS | \
|
||||
AMDGPU_GEM_CREATE_CPU_GTT_USWC | \
|
||||
AMDGPU_GEM_CREATE_VRAM_CLEARED | \
|
||||
AMDGPU_GEM_CREATE_VM_ALWAYS_VALID | \
|
||||
AMDGPU_GEM_CREATE_EXPLICIT_SYNC | \
|
||||
AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE | \
|
||||
AMDGPU_GEM_CREATE_ENCRYPTED | \
|
||||
AMDGPU_GEM_CREATE_GFX12_DCC | \
|
||||
AMDGPU_GEM_CREATE_DISCARDABLE | \
|
||||
AMDGPU_GEM_CREATE_COHERENT | \
|
||||
AMDGPU_GEM_CREATE_UNCACHED | \
|
||||
AMDGPU_GEM_CREATE_EXT_COHERENT)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user