From: Alexandre Demers <alexandre.f.demers@gmail.com>
To: amd-gfx@lists.freedesktop.org
Subject: [PATCH 3/6] drm/amdgpu: complete dce_v6_0_set_crtc_vline_interrupt_state() in DCE6
Date: Thu, 27 Feb 2025 00:22:38 -0500 [thread overview]
Message-ID: <20250227052241.171102-4-alexandre.f.demers@gmail.com> (raw)
In-Reply-To: <20250227052241.171102-1-alexandre.f.demers@gmail.com>
dce_v6_0_set_crtc_vline_interrupt_state() was empty without any info to
inform the user.
Based on DCE8 and DCE10 code.
Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 44 +++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index 254cb73324c6..e805c4f9222c 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -2957,7 +2957,51 @@ static void dce_v6_0_set_crtc_vline_interrupt_state(struct amdgpu_device *adev,
int crtc,
enum amdgpu_interrupt_state state)
{
+ u32 reg_block, lb_interrupt_mask;
+ if (crtc >= adev->mode_info.num_crtc) {
+ DRM_DEBUG("invalid crtc %d\n", crtc);
+ return;
+ }
+
+ switch (crtc) {
+ case 0:
+ reg_block = CRTC0_REGISTER_OFFSET;
+ break;
+ case 1:
+ reg_block = CRTC1_REGISTER_OFFSET;
+ break;
+ case 2:
+ reg_block = CRTC2_REGISTER_OFFSET;
+ break;
+ case 3:
+ reg_block = CRTC3_REGISTER_OFFSET;
+ break;
+ case 4:
+ reg_block = CRTC4_REGISTER_OFFSET;
+ break;
+ case 5:
+ reg_block = CRTC5_REGISTER_OFFSET;
+ break;
+ default:
+ DRM_DEBUG("invalid crtc %d\n", crtc);
+ return;
+ }
+
+ switch (state) {
+ case AMDGPU_IRQ_STATE_DISABLE:
+ lb_interrupt_mask = RREG32(mmINT_MASK + reg_block);
+ lb_interrupt_mask &= ~VLINE_INT_MASK;
+ WREG32(mmINT_MASK + reg_block, lb_interrupt_mask);
+ break;
+ case AMDGPU_IRQ_STATE_ENABLE:
+ lb_interrupt_mask = RREG32(mmINT_MASK + reg_block);
+ lb_interrupt_mask |= VLINE_INT_MASK;
+ WREG32(mmINT_MASK + reg_block, lb_interrupt_mask);
+ break;
+ default:
+ break;
+ }
}
static int dce_v6_0_set_hpd_interrupt_state(struct amdgpu_device *adev,
--
2.48.1
next prev parent reply other threads:[~2025-02-27 5:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 5:22 [PATCH 0/6] add missing DCE6 functions and uniformize value definitions Alexandre Demers
2025-02-27 5:22 ` [PATCH 1/6] drm/amdgpu: add or move defines for DCE6 in sid.h Alexandre Demers
2025-02-27 5:22 ` [PATCH 2/6] drm/amdgpu: add dce_v6_0_soft_reset() to DCE6 Alexandre Demers
2025-02-27 14:23 ` Alex Deucher
2025-02-27 18:51 ` Alexandre Demers
2025-02-27 19:01 ` Alex Deucher
2025-02-27 19:05 ` Alex Deucher
2025-02-27 19:11 ` Alexandre Demers
2025-02-28 14:32 ` Alex Deucher
2025-02-27 19:09 ` Alexandre Demers
2025-02-27 5:22 ` Alexandre Demers [this message]
2025-02-27 14:22 ` [PATCH 3/6] drm/amdgpu: complete dce_v6_0_set_crtc_vline_interrupt_state() in DCE6 Alex Deucher
2025-02-27 5:22 ` [PATCH 4/6] drm/amdgpu: add some comments " Alexandre Demers
2025-02-27 5:22 ` [PATCH 5/6] dmr/amdgpu: fix style " Alexandre Demers
2025-02-27 5:22 ` [PATCH 6/6] drm/amdgpu: add defines for pin_offsets in DCE8 Alexandre Demers
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=20250227052241.171102-4-alexandre.f.demers@gmail.com \
--to=alexandre.f.demers@gmail.com \
--cc=amd-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox