From 065b7272ee5cb46cf6ec116dce424d072a99b9f4 Mon Sep 17 00:00:00 2001 From: Jay Cornwall Date: Tue, 17 Jan 2017 12:08:50 -0600 Subject: [PATCH 1215/4131] drm/amdkfd: Use volatile MTYPE in default/alternate apertures MTYPE_NC_NV (0) marks scalar/vector L1 cache lines as non-volatile. Cache lines loaded through these apertures are intended to be invalidated before (and sometimes during) a dispatch. The non-volatile qualifier prevents these cache lines from being distinguished from those loaded through the private aperture. Use MTYPE_NC (1) instead on both Gfx7 and Gfx8. This allows the compiler to use the BUFFER_WBINVL1_VOL instruction and is a precursor to automatic per-dispatch scalar/vector L1 volatile invalidation. Change-Id: Ic366945bfa50034935adf42009ea70cb1fce99c3 Signed-off-by: Jay Cornwall --- drivers/gpu/drm/amd/amdkfd/cik_regs.h | 3 ++- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/cik_regs.h b/drivers/gpu/drm/amd/amdkfd/cik_regs.h index 607fc5c..8c707dc 100644 --- a/drivers/gpu/drm/amd/amdkfd/cik_regs.h +++ b/drivers/gpu/drm/amd/amdkfd/cik_regs.h @@ -55,7 +55,8 @@ #define APE1_MTYPE(x) ((x) << 7) /* valid for both DEFAULT_MTYPE and APE1_MTYPE */ -#define MTYPE_CACHED 0 +#define MTYPE_CACHED_NV 0 +#define MTYPE_CACHED 1 #define MTYPE_NONCACHED 3 diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c index abd71c6..2629143 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c @@ -142,11 +142,11 @@ static bool set_cache_memory_policy_vi_tonga(struct device_queue_manager *dqm, default_mtype = (default_policy == cache_policy_coherent) ? MTYPE_UC : - MTYPE_NC_NV; + MTYPE_NC; ape1_mtype = (alternate_policy == cache_policy_coherent) ? MTYPE_UC : - MTYPE_NC_NV; + MTYPE_NC; qpd->sh_mem_config = SH_MEM_ALIGNMENT_MODE_UNALIGNED << -- 2.7.4