From c6252390fccdd768d1250a45cbd2a7e3610a1283 Mon Sep 17 00:00:00 2001 From: Luben Tuikov Date: Thu, 19 Mar 2020 16:47:51 -0400 Subject: drm/amdgpu: implement TMZ accessor (v3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement an accessor of adev->tmz.enabled. Let not code around access it as "if (adev->tmz.enabled)" as the organization may change. Instead... Recruit "bool amdgpu_is_tmz(adev)" to return exactly this Boolean value. That is, this function is now an accessor of an already initialized and set adev and adev->tmz. Add "void amdgpu_gmc_tmz_set(adev)" to check and set adev->gmc.tmz_enabled at initialization time. After which one uses "bool amdgpu_is_tmz(adev)" to query whether adev supports TMZ. Also, remove circular header file include. v2: Remove amdgpu_tmz.[ch] as requested. v3: Move TMZ into GMC. Signed-off-by: Luben Tuikov Acked-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c') diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 9f78c00f4319..bae5dd6ea348 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -5451,7 +5451,7 @@ static void gfx_v9_0_ring_emit_tmz(struct amdgpu_ring *ring, bool start, * cmd = 1: frame end */ amdgpu_ring_write(ring, - ((ring->adev->tmz.enabled && trusted) ? FRAME_TMZ : 0) + ((amdgpu_is_tmz(ring->adev) && trusted) ? FRAME_TMZ : 0) | FRAME_CMD(start ? 0 : 1)); } -- cgit