diff options
author | Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> | 2019-03-08 10:38:16 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 15:36:57 -0500 |
commit | 95b1346872f80c0645e0a60b30a4e9dd37e66d0f (patch) | |
tree | 0af9b96273f1f4e95c0434597045eaa65f3bee21 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | 289d513b17e7484f21853f39a2df59ac6ed7994d (diff) | |
download | linux-95b1346872f80c0645e0a60b30a4e9dd37e66d0f.tar.gz linux-95b1346872f80c0645e0a60b30a4e9dd37e66d0f.tar.bz2 linux-95b1346872f80c0645e0a60b30a4e9dd37e66d0f.zip |
drm/amdgpu: Clear VRAM for DRM dumb_create buffers
The dumb_create API isn't intended for high performance rendering
and it's more useful for userspace (ie. IGT) to have them precleared.
The bonus here is that we also won't needlessly leak whatever was
previously in VRAM, but it also probably wasn't sensitive if it was
going through this API.
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index fcaaac30e84b..a58072bbc9b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -743,7 +743,8 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv, domain = amdgpu_bo_get_preferred_pin_domain(adev, amdgpu_display_supported_domains(adev)); r = amdgpu_gem_object_create(adev, args->size, 0, domain, - AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED, + AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED | + AMDGPU_GEM_CREATE_VRAM_CLEARED, ttm_bo_type_device, NULL, &gobj); if (r) return -ENOMEM; |