aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index c3ce103b6a33..b8fbbd7699e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -33,6 +33,7 @@
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <drm/drmP.h> 34#include <drm/drmP.h>
35#include <drm/amdgpu_drm.h> 35#include <drm/amdgpu_drm.h>
36#include <drm/drm_cache.h>
36#include "amdgpu.h" 37#include "amdgpu.h"
37#include "amdgpu_trace.h" 38#include "amdgpu_trace.h"
38 39
@@ -261,6 +262,13 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
261 AMDGPU_GEM_DOMAIN_OA); 262 AMDGPU_GEM_DOMAIN_OA);
262 263
263 bo->flags = flags; 264 bo->flags = flags;
265
266 /* For architectures that don't support WC memory,
267 * mask out the WC flag from the BO
268 */
269 if (!drm_arch_can_wc_memory())
270 bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
271
264 amdgpu_fill_placement_to_bo(bo, placement); 272 amdgpu_fill_placement_to_bo(bo, placement);
265 /* Kernel allocation are uninterruptible */ 273 /* Kernel allocation are uninterruptible */
266 r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type, 274 r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,
@@ -399,7 +407,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
399 } 407 }
400 if (fpfn > bo->placements[i].fpfn) 408 if (fpfn > bo->placements[i].fpfn)
401 bo->placements[i].fpfn = fpfn; 409 bo->placements[i].fpfn = fpfn;
402 if (lpfn && lpfn < bo->placements[i].lpfn) 410 if (!bo->placements[i].lpfn ||
411 (lpfn && lpfn < bo->placements[i].lpfn))
403 bo->placements[i].lpfn = lpfn; 412 bo->placements[i].lpfn = lpfn;
404 bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; 413 bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
405 } 414 }