Skip to contentSkip to conversation

drm/amdgpu: add system interrupt register offset header

PATCH In review [email protected] 5 participants 13 messages Jul 18, 2018 – Aug 9, 2018 8 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 drm/amdgpu: add system interrupt register offset header

From: Boyuan Zhang <[email protected]>

Add new register offset for enabling system interrupt.

---
 drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_1_0_offset.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_1_0_offset.h +2 -0
index fe0cbaa..216a401 100644
@@ -307,6 +307,8 @@
 #define mmUVD_LMI_CTRL2_BASE_IDX                                                                       1
 #define mmUVD_MASTINT_EN                                                                               0x0540
 #define mmUVD_MASTINT_EN_BASE_IDX                                                                      1
+#define mmUVD_SYS_INT_EN                                                                               0x0541
+#define mmUVD_SYS_INT_EN_BASE_IDX                                                                      1
 #define mmJPEG_CGC_CTRL                                                                                0x0565
 #define mmJPEG_CGC_CTRL_BASE_IDX                                                                       1
 #define mmUVD_LMI_CTRL                                                                                 0x0566
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1531946355-17488-1-git-send-email-boyuan.zhang-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/5 drm/amdgpu: add system interrupt mask for jrbc

From: Boyuan Zhang <[email protected]>

Add new mask for enabling system interrupt for jrbc.

---
 drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_1_0_sh_mask.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/vcn/vcn_1_0_sh_mask.h +2 -0
index d6ba269..124383d 100644
@@ -982,6 +982,8 @@
 #define UVD_MASTINT_EN__VCPU_EN_MASK                                                                          0x00000002L
 #define UVD_MASTINT_EN__SYS_EN_MASK                                                                           0x00000004L
 #define UVD_MASTINT_EN__INT_OVERRUN_MASK                                                                      0x007FFFF0L
+//UVD_SYS_INT_EN
+#define UVD_SYS_INT_EN__UVD_JRBC_EN_MASK                                                                      0x00000010L
 //JPEG_CGC_CTRL
 #define JPEG_CGC_CTRL__DYN_CLOCK_MODE__SHIFT                                                                  0x0
 #define JPEG_CGC_CTRL__JPEG2_MODE__SHIFT                                                                      0x1
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 3/5 drm/amdgpu: enable system interrupt for jrbc

In reply to a message not in the archive

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +7 -1
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
 	struct amdgpu_ring *ring = &adev->vcn.ring_dec;
 	uint32_t rb_bufsz, tmp;
 	uint32_t lmi_swap_cntl;
+	uint32_t reg_temp;
 	int i, j, r;
 
 	/* disable byte swapping */
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
 		(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
 		~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+	/* enable system interrupt for JRBC*/
+	reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+	reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+	WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+
 	/* clear the bit 4 of VCN_STATUS */
 	WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
 			~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = {
 
 static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
 {
-	adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+	adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
 	adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1531946355-17488-3-git-send-email-boyuan.zhang-5C7GfCeVMHo@public.gmane.org

Acked-by
#5 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Quoted 22 lines · On 07/18/2018 04:39 PM, [email protected] wrote:

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
  	struct amdgpu_ring *ring = &adev->vcn.ring_dec;
  	uint32_t rb_bufsz, tmp;
  	uint32_t lmi_swap_cntl;
+	uint32_t reg_temp;
  	int i, j, r;
 
  	/* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device *adev) · line 707

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +4 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
  		(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
  		~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+	/* enable system interrupt for JRBC*/
+	reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+	reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+	WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);

Here you could use below instead.
WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), UVD_SYS_INT_EN__UVD_JRBC_EN_MASK,

	~UVD_SYS_INT_EN__UVD_JRBC_EN_MASK);

Ether way, the whole series are

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = { · line 1766

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -1
+
  	/* clear the bit 4 of VCN_STATUS */
  	WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
  			~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = {
 
  static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
  {
-	adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+	adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
  	adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
  }
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 7ff97103-bd17-3011-103d-a4e2e77099a6-5C7GfCeVMHo@public.gmane.org

author Acked-by Leo Liu
#7 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Yes, agree! It's better to use that existing function. Will change it accordingly.

Thanks,

Boyuan

________________________________
From: Liu, Leo
Sent: July 19, 2018 2:13:50 PM
To: Zhang, Boyuan; [email protected]
Subject: Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Quoted 22 lines · On 07/18/2018 04:39 PM, [email protected] wrote:

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
       struct amdgpu_ring *ring = &adev->vcn.ring_dec;
       uint32_t rb_bufsz, tmp;
       uint32_t lmi_swap_cntl;
+     uint32_t reg_temp;
       int i, j, r;
 
       /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device *adev) · line 707

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +4 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
               (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
               ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+     /* enable system interrupt for JRBC*/
+     reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+     reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+     WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);

Here you could use below instead.
WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), UVD_SYS_INT_EN__UVD_JRBC_EN_MASK,

        ~UVD_SYS_INT_EN__UVD_JRBC_EN_MASK);

Ether way, the whole series are

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = { · line 1766

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -1
+
       /* clear the bit 4 of VCN_STATUS */
       WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
                       ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = {
 
  static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
  {
-     adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+     adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
       adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
  }
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

In reply to a message not in the archive
Quoted 22 lines · On Wed, Jul 18, 2018 at 4:39 PM, <[email protected]> wrote:

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
        struct amdgpu_ring *ring = &adev->vcn.ring_dec;
        uint32_t rb_bufsz, tmp;
        uint32_t lmi_swap_cntl;
+       uint32_t reg_temp;
        int i, j, r;
 
        /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device *adev) · line 708

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
                (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
                ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+       /* enable system interrupt for JRBC*/
+       reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+       reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+       WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+

Shouldn't we move the setting of these interrupts into vcn_v1_0_set_interrupt_state()? Same for the mastint. that way they will get enabled/disabled as part of the fence driver sequence I think. Or do they need to happen in a specific sequence?

Alex

Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -2
        /* clear the bit 4 of VCN_STATUS */
        WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
                        ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = {
 
 static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
 {
-       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
        adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
 }
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_NFgHpv4Z_2scvRC8y6EYPqUtnsvGXF6g2mD4yEKuQGOw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#10 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Quoted 36 lines · Alex Deucher
Quoted 22 lines · On Wed, Jul 18, 2018 at 4:39 PM, <[email protected]> wrote:

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
         struct amdgpu_ring *ring = &adev->vcn.ring_dec;
         uint32_t rb_bufsz, tmp;
         uint32_t lmi_swap_cntl;
+       uint32_t reg_temp;
         int i, j, r;
 
         /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device *adev) · line 708

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device *adev)
                 (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
                 ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+       /* enable system interrupt for JRBC*/
+       reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+       reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+       WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+

Shouldn't we move the setting of these interrupts into vcn_v1_0_set_interrupt_state()? Same for the mastint. that way they will get enabled/disabled as part of the fence driver sequence I think. Or do they need to happen in a specific sequence?

Quoted 1 line

Alex

Hmm... at least for this JPEG specific case, interrupt won't be raised during those times that we don't care about the interrupt. This is not like other system component where interrupt might still be raised even if we don't care about it. So my feeling is that whether we disable it at the beginning and enable it later on, or we just enable it at the beginning doesn't really matter in the practical sense.

Regards,
Boyuan

Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
         /* clear the bit 4 of VCN_STATUS */
         WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
                         ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = {
 
  static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
  {
-       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
         adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
  }
 
Quoted 7 lines
Quoted 7 lines

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 763a42d3-c83b-2272-ec01-e11a14bdaf43-5C7GfCeVMHo@public.gmane.org

#12 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Am 23.07.2018 um 21:53 schrieb Boyuan Zhang:

Quoted 41 lines · Alex Deucher
Quoted 38 lines · On Wed, Jul 18, 2018 at 4:39 PM, <[email protected]> wrote:
Quoted 23 lines

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device 
 *adev)
          struct amdgpu_ring *ring = &adev->vcn.ring_dec;
          uint32_t rb_bufsz, tmp;
          uint32_t lmi_swap_cntl;
+       uint32_t reg_temp;
          int i, j, r;
 

         /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device · line 709

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device 
 *adev)
 (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
 ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+       /* enable system interrupt for JRBC*/
+       reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+       reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+       WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+

Shouldn't we move the setting of these interrupts into vcn_v1_0_set_interrupt_state()? Same for the mastint.  that way they will get enabled/disabled as part of the fence driver sequence I think.  Or do they need to happen in a specific sequence?

Quoted 3 lines
Quoted 1 line

Alex

Hmm... at least for this JPEG specific case, interrupt won't be raised during those times that we don't care about the interrupt. This is not like other system component where interrupt might still be raised even if we don't care about it. So my feeling is that whether we disable it at the beginning and enable it later on, or we just enable it at the beginning doesn't really matter in the practical sense.

I agree with Alex here. While we currently don't use that much we would still like to be able to control interrupts and not just silently enable them all the time.

Regards,
Christian.

Quoted 21 lines

Regards,
Boyuan

Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0 -0
          /* clear the bit 4 of VCN_STATUS */
          WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,

                         ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs 
 vcn_v1_0_irq_funcs = {
 
   static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
   {
-       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
          adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
   }
Signature · 2 lines
-- 
2.7.4
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 720bdbc9-eed9-42de-2547-654713e0d20b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#14 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Quoted 42 lines · Christian König

Am 23.07.2018 um 21:53 schrieb Boyuan Zhang:

Quoted 41 lines · Alex Deucher
Quoted 38 lines · On Wed, Jul 18, 2018 at 4:39 PM, <[email protected]> wrote:
Quoted 23 lines

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device 
 *adev)
          struct amdgpu_ring *ring = &adev->vcn.ring_dec;
          uint32_t rb_bufsz, tmp;
          uint32_t lmi_swap_cntl;
+       uint32_t reg_temp;
          int i, j, r;
 

         /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device · line 709

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device 
 *adev)
 (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
 ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+       /* enable system interrupt for JRBC*/
+       reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+       reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+       WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+

Shouldn't we move the setting of these interrupts into vcn_v1_0_set_interrupt_state()? Same for the mastint.  that way they will get enabled/disabled as part of the fence driver sequence I think.  Or do they need to happen in a specific sequence?

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Alex

Hmm... at least for this JPEG specific case, interrupt won't be raised during those times that we don't care about the interrupt. This is not like other system component where interrupt might still be raised even if we don't care about it. So my feeling is that whether we disable it at the beginning and enable it later on, or we just enable it at the beginning doesn't really matter in the practical sense.

I agree with Alex here. While we currently don't use that much we would still like to be able to control interrupts and not just silently enable them all the time.

Regards,
Christian.

Yes, I agree with you and Alex in terms of controlling interrupts. I did a quick try from my side yesterday, it seems that "vcn_v1_0_set_interrupt_state()" is not being called in fence driver sequence, and not only for jpeg but for vcn in general. I saw that the current "vcn_v1_0_set_interrupt_state()" just returns 0, is there any reason that we didn't use this function before? Seems like this is on purpose to me. Any information regarding to this?

Regards,
Boyuan

Quoted 22 lines
Quoted 22 lines

Regards,
Boyuan

Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0 -0
          /* clear the bit 4 of VCN_STATUS */
          WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,

                         ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs 
 vcn_v1_0_irq_funcs = {
 
   static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
   {
-       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
          adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
   }
Signature · 2 lines
-- 
2.7.4
Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 7b6ce506-ec36-6f91-cdef-3e0b21969018-5C7GfCeVMHo@public.gmane.org

#16 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Quoted 70 lines · Boyuan Zhang
Quoted 59 lines · Christian König

Am 23.07.2018 um 21:53 schrieb Boyuan Zhang:

Quoted 49 lines · Alex Deucher
Quoted 42 lines · On Wed, Jul 18, 2018 at 4:39 PM, <[email protected]> wrote:
Quoted 25 lines

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device
 *adev)
         struct amdgpu_ring *ring = &adev->vcn.ring_dec;
         uint32_t rb_bufsz, tmp;
         uint32_t lmi_swap_cntl;
+       uint32_t reg_temp;
         int i, j, r;
 
         /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device · line 709

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device
 *adev)
 (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
 ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+       /* enable system interrupt for JRBC*/
+       reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+       reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+       WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+

Shouldn't we move the setting of these interrupts into vcn_v1_0_set_interrupt_state()? Same for the mastint. that way they will get enabled/disabled as part of the fence driver sequence I think. Or do they need to happen in a specific sequence?

Quoted 1 line

Alex

Quoted 6 lines

Hmm... at least for this JPEG specific case, interrupt won't be raised during those times that we don't care about the interrupt. This is not like other system component where interrupt might still be raised even if we don't care about it. So my feeling is that whether we disable it at the beginning and enable it later on, or we just enable it at the beginning doesn't really matter in the practical sense.

Quoted 6 lines

I agree with Alex here. While we currently don't use that much we would still like to be able to control interrupts and not just silently enable them all the time.

Regards,
Christian.

Quoted 7 lines

Yes, I agree with you and Alex in terms of controlling interrupts. I did a quick try from my side yesterday, it seems that "vcn_v1_0_set_interrupt_state()" is not being called in fence driver sequence, and not only for jpeg but for vcn in general. I saw that the current "vcn_v1_0_set_interrupt_state()" just returns 0, is there any reason that we didn't use this function before? Seems like this is on purpose to me. Any information regarding to this?

IIRC, on older versions of UVD there was no control bit for the UVD
fence interrupt so it was always enabled. Also, you may want to add
an irq type so that you can pass that to amdgpu_ring_init() so we can enable/disable each irq source independently.

Alex

Quoted 40 lines

Regards,
Boyuan

Quoted 34 lines
Quoted 32 lines

Regards,
Boyuan

Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0 -0
         /* clear the bit 4 of VCN_STATUS */
         WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
                         ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs
 vcn_v1_0_irq_funcs = {
 
  static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
  {
-       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
         adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
  }
Quoted 7 lines
Quoted 7 lines

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_NoOnf2211EuaPB4vbgSt92seoJViArJtPmc72W=e7a8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#18 lore raw

Re: [PATCH 3/5] drm/amdgpu: enable system interrupt for jrbc

Quoted 69 lines · Alex Deucher
Quoted 61 lines · Boyuan Zhang
Quoted 52 lines · Christian König

Am 23.07.2018 um 21:53 schrieb Boyuan Zhang:

Quoted 42 lines · Alex Deucher
Quoted 39 lines · On Wed, Jul 18, 2018 at 4:39 PM, <[email protected]> wrote:
Quoted 24 lines

From: Boyuan Zhang <[email protected]>

Enable system interrupt for jrbc during engine starting time.

---
   drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 +++++++-
   1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -0
index 4fccb21..22c1588 100644
@@ -595,6 +595,7 @@ static int vcn_v1_0_start(struct amdgpu_device
 *adev)
          struct amdgpu_ring *ring = &adev->vcn.ring_dec;
          uint32_t rb_bufsz, tmp;
          uint32_t lmi_swap_cntl;
+       uint32_t reg_temp;
          int i, j, r;
 
          /* disable byte swapping */

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_start(struct amdgpu_device · line 709

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -0
@@ -700,6 +701,11 @@ static int vcn_v1_0_start(struct amdgpu_device
 *adev)
 (UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK),
 ~(UVD_MASTINT_EN__VCPU_EN_MASK|UVD_MASTINT_EN__SYS_EN_MASK));
 
+       /* enable system interrupt for JRBC*/
+       reg_temp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN));
+       reg_temp |= UVD_SYS_INT_EN__UVD_JRBC_EN_MASK;
+       WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SYS_INT_EN), reg_temp);
+

Shouldn't we move the setting of these interrupts into vcn_v1_0_set_interrupt_state()? Same for the mastint. that way they will get enabled/disabled as part of the fence driver sequence I think. Or do they need to happen in a specific sequence?

Quoted 8 lines
Quoted 1 line

Alex

Hmm... at least for this JPEG specific case, interrupt won't be raised during those times that we don't care about the interrupt. This is not like other system component where interrupt might still be raised even if we don't care about it. So my feeling is that whether we disable it at the beginning and enable it later on, or we just enable it at the beginning doesn't really matter in the practical sense.

Quoted 6 lines

I agree with Alex here. While we currently don't use that much we would still like to be able to control interrupts and not just silently enable them all the time.

Regards,
Christian.

Quoted 7 lines

Yes, I agree with you and Alex in terms of controlling interrupts. I did a quick try from my side yesterday, it seems that "vcn_v1_0_set_interrupt_state()" is not being called in fence driver sequence, and not only for jpeg but for vcn in general. I saw that the current "vcn_v1_0_set_interrupt_state()" just returns 0, is there any reason that we didn't use this function before? Seems like this is on purpose to me. Any information regarding to this?

Quoted 6 lines

IIRC, on older versions of UVD there was no control bit for the UVD
fence interrupt so it was always enabled. Also, you may want to add
an irq type so that you can pass that to amdgpu_ring_init() so we can enable/disable each irq source independently.

Alex

As discussed, the codes will be leave as it for now. Will add TODO comment for future cleanup, and do more test on iqr_put/iqr_get to see the possibility of moving both master interrupt and system interrupt to set_interrupt call.

Thanks,
Boyuan

Quoted 24 lines
Quoted 24 lines

Regards,
Boyuan

Quoted 19 lines
Quoted 19 lines

Regards,
Boyuan

Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +0 -0
          /* clear the bit 4 of VCN_STATUS */
          WREG32_P(SOC15_REG_OFFSET(UVD, 0, mmUVD_STATUS), 0,
                          ~(2 << UVD_STATUS__VCPU_REPORT__SHIFT));
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -2
@@ -1754,7 +1760,7 @@ static const struct amdgpu_irq_src_funcs
 vcn_v1_0_irq_funcs = {
 
   static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev)
   {
-       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 1;
+       adev->vcn.irq.num_types = adev->vcn.num_enc_rings + 2;
          adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs;
   }
 
--

2.7.4

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#19 lore raw

PATCH 4/5 drm/amdgpu: add emit trap for vcn jpeg

In reply to a message not in the archive

From: Boyuan Zhang <[email protected]>

Add emit trap command in jpeg emit fence call.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +4 -0
index 22c1588..745c9ae 100644
@@ -1317,6 +1317,10 @@ static void vcn_v1_0_jpeg_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u6
 	amdgpu_ring_write(ring,
 		PACKETJ(0, 0, 0, PACKETJ_TYPE0));
 	amdgpu_ring_write(ring, 0x1);
+
+	/* emit trap */
+	amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE7));
+	amdgpu_ring_write(ring, 0);
 }
 
 /**
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#20 lore raw

PATCH 5/5 drm/amdgpu: fix emit frame size and comments for jpeg

In reply to a message not in the archive

From: Boyuan Zhang <[email protected]>

Fix vcn jpeg ring emit fence size in dword, and fix the naming in comments.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +3 -3
index 745c9ae..79fc76c 100644
@@ -1715,10 +1715,10 @@ static const struct amdgpu_ring_funcs vcn_v1_0_jpeg_ring_vm_funcs = {
 		6 + 6 + /* hdp invalidate / flush */
 		SOC15_FLUSH_GPU_TLB_NUM_WREG * 6 +
 		SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 8 +
-		8 + /* vcn_v1_0_dec_ring_emit_vm_flush */
-		14 + 14 + /* vcn_v1_0_dec_ring_emit_fence x2 vm fence */
+		8 + /* vcn_v1_0_jpeg_ring_emit_vm_flush */
+		26 + 26 + /* vcn_v1_0_jpeg_ring_emit_fence x2 vm fence */
 		6,
-	.emit_ib_size = 22, /* vcn_v1_0_dec_ring_emit_ib */
+	.emit_ib_size = 22, /* vcn_v1_0_jpeg_ring_emit_ib */
 	.emit_ib = vcn_v1_0_jpeg_ring_emit_ib,
 	.emit_fence = vcn_v1_0_jpeg_ring_emit_fence,
 	.emit_vm_flush = vcn_v1_0_jpeg_ring_emit_vm_flush,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx