All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 02/10] drm/amd/amdgpu: cleanup gfx_v9_0_set_priv_inst_fault_state()
Date: Wed, 5 Apr 2017 09:26:02 -0400	[thread overview]
Message-ID: <20170405132610.26075-2-tom.stdenis@amd.com> (raw)
In-Reply-To: <20170405132610.26075-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>

Use new WREG32_FIELD15 macro.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 3888743bc868..714fd0f228cf 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3473,21 +3473,12 @@ static int gfx_v9_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
 					      unsigned type,
 					      enum amdgpu_interrupt_state state)
 {
-	u32 cp_int_cntl;
-
 	switch (state) {
 	case AMDGPU_IRQ_STATE_DISABLE:
-		cp_int_cntl = RREG32(SOC15_REG_OFFSET(GC, 0, mmCP_INT_CNTL_RING0));
-		cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0,
-					    PRIV_INSTR_INT_ENABLE, 0);
-		WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_INT_CNTL_RING0), cp_int_cntl);
-		break;
 	case AMDGPU_IRQ_STATE_ENABLE:
-		cp_int_cntl = RREG32(SOC15_REG_OFFSET(GC, 0, mmCP_INT_CNTL_RING0));
-		cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0,
-					    PRIV_INSTR_INT_ENABLE, 1);
-		WREG32(SOC15_REG_OFFSET(GC, 0, mmCP_INT_CNTL_RING0), cp_int_cntl);
-		break;
+		WREG32_FIELD15(GC, 0, CP_INT_CNTL_RING0,
+			       PRIV_INSTR_INT_ENABLE,
+			       state == AMDGPU_IRQ_STATE_ENABLE ? 1 : 0);
 	default:
 		break;
 	}
-- 
2.12.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-04-05 13:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 13:26 [PATCH 01/10] drm/amd/amdgpu: cleanup gfx_v9_0_init_queue() Tom St Denis
     [not found] ` <20170405132610.26075-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-04-05 13:26   ` Tom St Denis [this message]
2017-04-05 13:26   ` [PATCH 03/10] drm/amd/amdgpu: cleanup gfx_v9_0_set_priv_reg_fault_state() Tom St Denis
2017-04-05 13:26   ` [PATCH 04/10] drm/amd/amdgpu: cleanup gfx_v9_0_set_gfx_eop_interrupt_state() Tom St Denis
2017-04-05 13:26   ` [PATCH 05/10] drm/amd/amdgpu: Drop gfx_v9_0_print_status() Tom St Denis
2017-04-05 13:26   ` [PATCH 06/10] drm/amd/amdgpu: cleanup gfx_v9_0_kiq_init_register() Tom St Denis
2017-04-05 13:26   ` [PATCH 07/10] drm/amd/amdgpu: simplify gfx_v9_0_cp_gfx_enable() Tom St Denis
2017-04-05 13:26   ` [PATCH 08/10] drm/amd/amdgpu: cleanup gfx_v9_0_rlc_start() Tom St Denis
2017-04-05 13:26   ` [PATCH 09/10] drm/amd/amdgpu: cleanup gfx_v9_0_rlc_reset() Tom St Denis
2017-04-05 13:26   ` [PATCH 10/10] drm/amd/amdgpu: cleanup gfx_v9_0_gpu_init() Tom St Denis
     [not found]     ` <20170405132610.26075-10-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-04-05 18:08       ` Alex Deucher
2017-04-05 14:15   ` [PATCH 01/10] drm/amd/amdgpu: cleanup gfx_v9_0_init_queue() Christian König
     [not found]     ` <a78ee9e1-11eb-7702-ad13-188d9827cf0b-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-05 16:28       ` Tom St Denis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170405132610.26075-2-tom.stdenis@amd.com \
    --to=tom.stdenis-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.