All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
@ 2021-04-07  8:34 Jude Shih
  2021-04-07 14:52 ` Harry Wentland
  0 siblings, 1 reply; 11+ messages in thread
From: Jude Shih @ 2021-04-07  8:34 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexander.deucher, Jude Shih, cruise.hung, nicholas.kazlauskas,
	wayne.lin

[Why & How]
We use outbox interrupt that allows us to do the AUX via DMUB
Therefore, we need to add some irq source related definition
in the header files;

Signed-off-by: Jude Shih <shenshih@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 1 +
 drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 963ecfd84347..480e07d83492 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -923,6 +923,7 @@ struct amdgpu_device {
 	struct amdgpu_irq_src		pageflip_irq;
 	struct amdgpu_irq_src		hpd_irq;
 	struct amdgpu_irq_src		dmub_trace_irq;
+	struct amdgpu_irq_src		dmub_outbox_irq;
 
 	/* rings */
 	u64				fence_context;
diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
index e2bffcae273a..754170a86ea4 100644
--- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
+++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
@@ -1132,5 +1132,7 @@
 
 #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
 #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
+#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
+#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
 
 #endif // __IRQSRCS_DCN_1_0_H__
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
  2021-04-07  8:34 [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag Jude Shih
@ 2021-04-07 14:52 ` Harry Wentland
  0 siblings, 0 replies; 11+ messages in thread
From: Harry Wentland @ 2021-04-07 14:52 UTC (permalink / raw)
  To: Jude Shih, amd-gfx
  Cc: alexander.deucher, wayne.lin, cruise.hung, nicholas.kazlauskas

On 2021-04-07 4:34 a.m., Jude Shih wrote:
> [Why & How]
> We use outbox interrupt that allows us to do the AUX via DMUB
> Therefore, we need to add some irq source related definition
> in the header files;
> 
> Signed-off-by: Jude Shih <shenshih@amd.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 1 +
>   drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
>   2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 963ecfd84347..480e07d83492 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -923,6 +923,7 @@ struct amdgpu_device {
>   	struct amdgpu_irq_src		pageflip_irq;
>   	struct amdgpu_irq_src		hpd_irq;
>   	struct amdgpu_irq_src		dmub_trace_irq;
> +	struct amdgpu_irq_src		dmub_outbox_irq;
>   
>   	/* rings */
>   	u64				fence_context;
> diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> index e2bffcae273a..754170a86ea4 100644
> --- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> +++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> @@ -1132,5 +1132,7 @@
>   
>   #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
>   #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
> +#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
> +#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
>   
>   #endif // __IRQSRCS_DCN_1_0_H__
> 

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
@ 2021-04-07  1:18 صالح المسعودي
  0 siblings, 0 replies; 11+ messages in thread
From: صالح المسعودي @ 2021-04-07  1:18 UTC (permalink / raw)
  To: amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 10 bytes --]

771763840

[-- Attachment #1.2: Type: text/html, Size: 84 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
  2021-04-06 14:30     ` Kazlauskas, Nicholas
@ 2021-04-06 15:01       ` Shih, Jude
  0 siblings, 0 replies; 11+ messages in thread
From: Shih, Jude @ 2021-04-06 15:01 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, amd-gfx
  Cc: Deucher, Alexander, Hung, Cruise, Lin, Wayne

[AMD Official Use Only - Internal Distribution Only]

Hi Nicholas,

Let me summarize the suggestion. Please correct me if I misunderstood.

1. for dmub_aux_transfer_done, move it to amdgpu_display_manager in amdgpu_dm.h instead of amdgpu.h
2. Remove DC_ENABLE_DMUB_AUX from amd_shared.h at current stage since we don't have a mechanism to check the firmware yet. We just hardcore this flag when testing.
3. Keep the irq source change in irqsrcs_dcn_1_0.h at current stage since we don't have irqsrc_dcn_2_1.h

=> So I will just keep the change in irqsrcs_dcn_1_0.h and dmub_outbox_irq in amdgpu.h?

Thanks!

Best Regards,

Jude
-----Original Message-----
From: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com> 
Sent: Tuesday, April 6, 2021 10:30 PM
To: Shih, Jude <Jude.Shih@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Hung, Cruise <Cruise.Hung@amd.com>
Subject: Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag

On 2021-04-06 10:22 a.m., Shih, Jude wrote:
> [AMD Official Use Only - Internal Distribution Only]
> 
> Hi Nicholas,
> 
> Does this completion need to be on the amdgpu device itself?
> 
> I would prefer if we keep this as needed within DM itself if possible.
> 
> => do you mean move it to amdgpu_display_manager in amdgpu_dm.h as global variable?

There's a amdgpu_display_manager per device, but yes, it should be contained in there if possible since it's display code.

> 
> My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't require the user to have to flip this on by default later. I think I'd prefer this still as a DISABLE option if we want to leave it for users to debug any potential issues.
> => do you mean DC_ENABLE_DMUB_AUX = 0x10 => DC_DISABLE_DMUB_AUX = 0x10 
> and amdgpu_dc_debug_mask = 0x10 as default to turn it off?

Don't modify the default debug mask and leave it alone. We can still have DC_DISABLE_DMUB_AUX = 0x10 as a user debug option if they have firmware that supports this.

Flag or not, we need a mechanism from driver to firmware to query whether the firmware supports it in the first place. It's not sufficient to fully control this feature with just a debug flag, there needs to be a cap check regardless with the firmware for support.

Older firmware won't implement this check and therefore won't enable the feature.

Newer (or test) firmware could enable this feature and report back to driver that it does support it.

Driver can then decide to enable this based on 
dc->debug.dmub_aux_support or something similar to that - it can be
false or ASIC that we won't be supporting this on, but for ASIC that we do we can leave it off by default until it's production ready.

For developer testing we can hardcode the flag = true, I think the DC debug flags here in AMDGPU base driver only have value if we want general end user or validation to use this to debug potential issues.

Regards,
Nicholas Kazlauskas

> 
> Thanks,
> 
> Best Regards,
> 
> Jude
> 
> -----Original Message-----
> From: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>
> Sent: Tuesday, April 6, 2021 10:04 PM
> To: Shih, Jude <Jude.Shih@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lin, Wayne 
> <Wayne.Lin@amd.com>; Hung, Cruise <Cruise.Hung@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source 
> define/complete/debug flag
> 
> On 2021-04-06 9:40 a.m., Jude Shih wrote:
>> [Why & How]
>> We use outbox interrupt that allows us to do the AUX via DMUB 
>> Therefore, we need to add some irq source related definition in the 
>> header files; Also, I added debug flag that allows us to turn it 
>> on/off for testing purpose.
>>
>> Signed-off-by: Jude Shih <shenshih@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
>>    drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
>>    drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
>>    3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 963ecfd84347..7e64fc5e0dcd 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -923,6 +923,7 @@ struct amdgpu_device {
>>    	struct amdgpu_irq_src		pageflip_irq;
>>    	struct amdgpu_irq_src		hpd_irq;
>>    	struct amdgpu_irq_src		dmub_trace_irq;
>> +	struct amdgpu_irq_src		dmub_outbox_irq;
>>    
>>    	/* rings */
>>    	u64				fence_context;
>> @@ -1077,6 +1078,7 @@ struct amdgpu_device {
>>    
>>    	bool                            in_pci_err_recovery;
>>    	struct pci_saved_state          *pci_state;
>> +	struct completion dmub_aux_transfer_done;
> 
> Does this completion need to be on the amdgpu device itself?
> 
> I would prefer if we keep this as needed within DM itself if possible.
> 
>>    };
>>    
>>    static inline struct amdgpu_device *drm_to_adev(struct drm_device
>> *ddev) diff --git a/drivers/gpu/drm/amd/include/amd_shared.h
>> b/drivers/gpu/drm/amd/include/amd_shared.h
>> index 43ed6291b2b8..097672cc78a1 100644
>> --- a/drivers/gpu/drm/amd/include/amd_shared.h
>> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
>> @@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
>>    	DC_DISABLE_PIPE_SPLIT = 0x1,
>>    	DC_DISABLE_STUTTER = 0x2,
>>    	DC_DISABLE_DSC = 0x4,
>> -	DC_DISABLE_CLOCK_GATING = 0x8
>> +	DC_DISABLE_CLOCK_GATING = 0x8,
>> +	DC_ENABLE_DMUB_AUX = 0x10,
> 
> My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't require the user to have to flip this on by default later. I think I'd prefer this still as a DISABLE option if we want to leave it for users to debug any potential issues.
> 
> If there's no value in having end users debug issues by setting this bit then we should keep it as a dc->debug default in DCN resource.
> 
> Regards,
> Nicholas Kazlauskas
> 
>>    };
>>    
>>    enum amd_dpm_forced_level;
>> diff --git 
>> a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> index e2bffcae273a..754170a86ea4 100644
>> --- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> +++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> @@ -1132,5 +1132,7 @@
>>    
>>    #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
>>    #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
>> +#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
>> +#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
>>    
>>    #endif // __IRQSRCS_DCN_1_0_H__
>>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
  2021-04-06 14:22   ` Shih, Jude
@ 2021-04-06 14:30     ` Kazlauskas, Nicholas
  2021-04-06 15:01       ` Shih, Jude
  0 siblings, 1 reply; 11+ messages in thread
From: Kazlauskas, Nicholas @ 2021-04-06 14:30 UTC (permalink / raw)
  To: Shih, Jude, amd-gfx; +Cc: Deucher, Alexander, Hung, Cruise, Lin, Wayne

On 2021-04-06 10:22 a.m., Shih, Jude wrote:
> [AMD Official Use Only - Internal Distribution Only]
> 
> Hi Nicholas,
> 
> Does this completion need to be on the amdgpu device itself?
> 
> I would prefer if we keep this as needed within DM itself if possible.
> 
> => do you mean move it to amdgpu_display_manager in amdgpu_dm.h as global variable?

There's a amdgpu_display_manager per device, but yes, it should be 
contained in there if possible since it's display code.

> 
> My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't require the user to have to flip this on by default later. I think I'd prefer this still as a DISABLE option if we want to leave it for users to debug any potential issues.
> => do you mean DC_ENABLE_DMUB_AUX = 0x10 => DC_DISABLE_DMUB_AUX = 0x10
> and amdgpu_dc_debug_mask = 0x10 as default to turn it off?

Don't modify the default debug mask and leave it alone. We can still 
have DC_DISABLE_DMUB_AUX = 0x10 as a user debug option if they have 
firmware that supports this.

Flag or not, we need a mechanism from driver to firmware to query 
whether the firmware supports it in the first place. It's not sufficient 
to fully control this feature with just a debug flag, there needs to be 
a cap check regardless with the firmware for support.

Older firmware won't implement this check and therefore won't enable the 
feature.

Newer (or test) firmware could enable this feature and report back to 
driver that it does support it.

Driver can then decide to enable this based on 
dc->debug.dmub_aux_support or something similar to that - it can be 
false or ASIC that we won't be supporting this on, but for ASIC that we 
do we can leave it off by default until it's production ready.

For developer testing we can hardcode the flag = true, I think the DC 
debug flags here in AMDGPU base driver only have value if we want 
general end user or validation to use this to debug potential issues.

Regards,
Nicholas Kazlauskas

> 
> Thanks,
> 
> Best Regards,
> 
> Jude
> 
> -----Original Message-----
> From: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>
> Sent: Tuesday, April 6, 2021 10:04 PM
> To: Shih, Jude <Jude.Shih@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Hung, Cruise <Cruise.Hung@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
> 
> On 2021-04-06 9:40 a.m., Jude Shih wrote:
>> [Why & How]
>> We use outbox interrupt that allows us to do the AUX via DMUB
>> Therefore, we need to add some irq source related definition in the
>> header files; Also, I added debug flag that allows us to turn it
>> on/off for testing purpose.
>>
>> Signed-off-by: Jude Shih <shenshih@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
>>    drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
>>    drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
>>    3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 963ecfd84347..7e64fc5e0dcd 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -923,6 +923,7 @@ struct amdgpu_device {
>>    	struct amdgpu_irq_src		pageflip_irq;
>>    	struct amdgpu_irq_src		hpd_irq;
>>    	struct amdgpu_irq_src		dmub_trace_irq;
>> +	struct amdgpu_irq_src		dmub_outbox_irq;
>>    
>>    	/* rings */
>>    	u64				fence_context;
>> @@ -1077,6 +1078,7 @@ struct amdgpu_device {
>>    
>>    	bool                            in_pci_err_recovery;
>>    	struct pci_saved_state          *pci_state;
>> +	struct completion dmub_aux_transfer_done;
> 
> Does this completion need to be on the amdgpu device itself?
> 
> I would prefer if we keep this as needed within DM itself if possible.
> 
>>    };
>>    
>>    static inline struct amdgpu_device *drm_to_adev(struct drm_device
>> *ddev) diff --git a/drivers/gpu/drm/amd/include/amd_shared.h
>> b/drivers/gpu/drm/amd/include/amd_shared.h
>> index 43ed6291b2b8..097672cc78a1 100644
>> --- a/drivers/gpu/drm/amd/include/amd_shared.h
>> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
>> @@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
>>    	DC_DISABLE_PIPE_SPLIT = 0x1,
>>    	DC_DISABLE_STUTTER = 0x2,
>>    	DC_DISABLE_DSC = 0x4,
>> -	DC_DISABLE_CLOCK_GATING = 0x8
>> +	DC_DISABLE_CLOCK_GATING = 0x8,
>> +	DC_ENABLE_DMUB_AUX = 0x10,
> 
> My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't require the user to have to flip this on by default later. I think I'd prefer this still as a DISABLE option if we want to leave it for users to debug any potential issues.
> 
> If there's no value in having end users debug issues by setting this bit then we should keep it as a dc->debug default in DCN resource.
> 
> Regards,
> Nicholas Kazlauskas
> 
>>    };
>>    
>>    enum amd_dpm_forced_level;
>> diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> index e2bffcae273a..754170a86ea4 100644
>> --- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> +++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
>> @@ -1132,5 +1132,7 @@
>>    
>>    #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
>>    #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
>> +#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
>> +#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
>>    
>>    #endif // __IRQSRCS_DCN_1_0_H__
>>

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
  2021-04-06 14:03 ` Kazlauskas, Nicholas
@ 2021-04-06 14:22   ` Shih, Jude
  2021-04-06 14:30     ` Kazlauskas, Nicholas
  0 siblings, 1 reply; 11+ messages in thread
From: Shih, Jude @ 2021-04-06 14:22 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, amd-gfx
  Cc: Deucher, Alexander, Hung, Cruise, Lin, Wayne

[AMD Official Use Only - Internal Distribution Only]

Hi Nicholas,

Does this completion need to be on the amdgpu device itself?

I would prefer if we keep this as needed within DM itself if possible.

=> do you mean move it to amdgpu_display_manager in amdgpu_dm.h as global variable?

My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't require the user to have to flip this on by default later. I think I'd prefer this still as a DISABLE option if we want to leave it for users to debug any potential issues.
=> do you mean DC_ENABLE_DMUB_AUX = 0x10 => DC_DISABLE_DMUB_AUX = 0x10
and amdgpu_dc_debug_mask = 0x10 as default to turn it off?

Thanks,

Best Regards,

Jude

-----Original Message-----
From: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com> 
Sent: Tuesday, April 6, 2021 10:04 PM
To: Shih, Jude <Jude.Shih@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Hung, Cruise <Cruise.Hung@amd.com>
Subject: Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag

On 2021-04-06 9:40 a.m., Jude Shih wrote:
> [Why & How]
> We use outbox interrupt that allows us to do the AUX via DMUB 
> Therefore, we need to add some irq source related definition in the 
> header files; Also, I added debug flag that allows us to turn it 
> on/off for testing purpose.
> 
> Signed-off-by: Jude Shih <shenshih@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
>   drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
>   drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
>   3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 963ecfd84347..7e64fc5e0dcd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -923,6 +923,7 @@ struct amdgpu_device {
>   	struct amdgpu_irq_src		pageflip_irq;
>   	struct amdgpu_irq_src		hpd_irq;
>   	struct amdgpu_irq_src		dmub_trace_irq;
> +	struct amdgpu_irq_src		dmub_outbox_irq;
>   
>   	/* rings */
>   	u64				fence_context;
> @@ -1077,6 +1078,7 @@ struct amdgpu_device {
>   
>   	bool                            in_pci_err_recovery;
>   	struct pci_saved_state          *pci_state;
> +	struct completion dmub_aux_transfer_done;

Does this completion need to be on the amdgpu device itself?

I would prefer if we keep this as needed within DM itself if possible.

>   };
>   
>   static inline struct amdgpu_device *drm_to_adev(struct drm_device 
> *ddev) diff --git a/drivers/gpu/drm/amd/include/amd_shared.h 
> b/drivers/gpu/drm/amd/include/amd_shared.h
> index 43ed6291b2b8..097672cc78a1 100644
> --- a/drivers/gpu/drm/amd/include/amd_shared.h
> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
> @@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
>   	DC_DISABLE_PIPE_SPLIT = 0x1,
>   	DC_DISABLE_STUTTER = 0x2,
>   	DC_DISABLE_DSC = 0x4,
> -	DC_DISABLE_CLOCK_GATING = 0x8
> +	DC_DISABLE_CLOCK_GATING = 0x8,
> +	DC_ENABLE_DMUB_AUX = 0x10,

My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't require the user to have to flip this on by default later. I think I'd prefer this still as a DISABLE option if we want to leave it for users to debug any potential issues.

If there's no value in having end users debug issues by setting this bit then we should keep it as a dc->debug default in DCN resource.

Regards,
Nicholas Kazlauskas

>   };
>   
>   enum amd_dpm_forced_level;
> diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h 
> b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> index e2bffcae273a..754170a86ea4 100644
> --- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> +++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> @@ -1132,5 +1132,7 @@
>   
>   #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
>   #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
> +#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
> +#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
>   
>   #endif // __IRQSRCS_DCN_1_0_H__
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
  2021-04-06 13:40 Jude Shih
@ 2021-04-06 14:03 ` Kazlauskas, Nicholas
  2021-04-06 14:22   ` Shih, Jude
  0 siblings, 1 reply; 11+ messages in thread
From: Kazlauskas, Nicholas @ 2021-04-06 14:03 UTC (permalink / raw)
  To: Jude Shih, amd-gfx; +Cc: alexander.deucher, cruise.hung, wayne.lin

On 2021-04-06 9:40 a.m., Jude Shih wrote:
> [Why & How]
> We use outbox interrupt that allows us to do the AUX via DMUB
> Therefore, we need to add some irq source related definition
> in the header files;
> Also, I added debug flag that allows us to turn it on/off
> for testing purpose.
> 
> Signed-off-by: Jude Shih <shenshih@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
>   drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
>   drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
>   3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 963ecfd84347..7e64fc5e0dcd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -923,6 +923,7 @@ struct amdgpu_device {
>   	struct amdgpu_irq_src		pageflip_irq;
>   	struct amdgpu_irq_src		hpd_irq;
>   	struct amdgpu_irq_src		dmub_trace_irq;
> +	struct amdgpu_irq_src		dmub_outbox_irq;
>   
>   	/* rings */
>   	u64				fence_context;
> @@ -1077,6 +1078,7 @@ struct amdgpu_device {
>   
>   	bool                            in_pci_err_recovery;
>   	struct pci_saved_state          *pci_state;
> +	struct completion dmub_aux_transfer_done;

Does this completion need to be on the amdgpu device itself?

I would prefer if we keep this as needed within DM itself if possible.

>   };
>   
>   static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
> index 43ed6291b2b8..097672cc78a1 100644
> --- a/drivers/gpu/drm/amd/include/amd_shared.h
> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
> @@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
>   	DC_DISABLE_PIPE_SPLIT = 0x1,
>   	DC_DISABLE_STUTTER = 0x2,
>   	DC_DISABLE_DSC = 0x4,
> -	DC_DISABLE_CLOCK_GATING = 0x8
> +	DC_DISABLE_CLOCK_GATING = 0x8,
> +	DC_ENABLE_DMUB_AUX = 0x10,

My problem with still leaving this as DC_ENABLE_DMUB_AUX is we shouldn't 
require the user to have to flip this on by default later. I think I'd 
prefer this still as a DISABLE option if we want to leave it for users 
to debug any potential issues.

If there's no value in having end users debug issues by setting this bit 
then we should keep it as a dc->debug default in DCN resource.

Regards,
Nicholas Kazlauskas

>   };
>   
>   enum amd_dpm_forced_level;
> diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> index e2bffcae273a..754170a86ea4 100644
> --- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> +++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> @@ -1132,5 +1132,7 @@
>   
>   #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
>   #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
> +#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
> +#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
>   
>   #endif // __IRQSRCS_DCN_1_0_H__
> 

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
@ 2021-04-06 13:40 Jude Shih
  2021-04-06 14:03 ` Kazlauskas, Nicholas
  0 siblings, 1 reply; 11+ messages in thread
From: Jude Shih @ 2021-04-06 13:40 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexander.deucher, Jude Shih, cruise.hung, nicholas.kazlauskas,
	wayne.lin

[Why & How]
We use outbox interrupt that allows us to do the AUX via DMUB
Therefore, we need to add some irq source related definition
in the header files;
Also, I added debug flag that allows us to turn it on/off
for testing purpose.

Signed-off-by: Jude Shih <shenshih@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
 drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
 drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 963ecfd84347..7e64fc5e0dcd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -923,6 +923,7 @@ struct amdgpu_device {
 	struct amdgpu_irq_src		pageflip_irq;
 	struct amdgpu_irq_src		hpd_irq;
 	struct amdgpu_irq_src		dmub_trace_irq;
+	struct amdgpu_irq_src		dmub_outbox_irq;
 
 	/* rings */
 	u64				fence_context;
@@ -1077,6 +1078,7 @@ struct amdgpu_device {
 
 	bool                            in_pci_err_recovery;
 	struct pci_saved_state          *pci_state;
+	struct completion dmub_aux_transfer_done;
 };
 
 static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 43ed6291b2b8..097672cc78a1 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
 	DC_DISABLE_PIPE_SPLIT = 0x1,
 	DC_DISABLE_STUTTER = 0x2,
 	DC_DISABLE_DSC = 0x4,
-	DC_DISABLE_CLOCK_GATING = 0x8
+	DC_DISABLE_CLOCK_GATING = 0x8,
+	DC_ENABLE_DMUB_AUX = 0x10,
 };
 
 enum amd_dpm_forced_level;
diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
index e2bffcae273a..754170a86ea4 100644
--- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
+++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
@@ -1132,5 +1132,7 @@
 
 #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
 #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
+#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
+#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
 
 #endif // __IRQSRCS_DCN_1_0_H__
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
  2021-04-01  3:21 Jude Shih
@ 2021-04-06 13:15 ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 11+ messages in thread
From: Kazlauskas, Nicholas @ 2021-04-06 13:15 UTC (permalink / raw)
  To: Jude Shih, amd-gfx; +Cc: alexander.deucher

On 2021-03-31 11:21 p.m., Jude Shih wrote:
> [Why & How]
> We use outbox interrupt that allows us to do the AUX via DMUB
> Therefore, we need to add some irq source related definition
> in the header files;
> Also, I added debug flag that allows us to turn it on/off
> for testing purpose.

Missing your signed-off-by here, please recommit with

git commit --amend --sign

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c                   | 2 +-
>   drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
>   drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
>   4 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 963ecfd84347..479c8a28a3a9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -923,6 +923,7 @@ struct amdgpu_device {
>   	struct amdgpu_irq_src		pageflip_irq;
>   	struct amdgpu_irq_src		hpd_irq;
>   	struct amdgpu_irq_src		dmub_trace_irq;
> +	struct amdgpu_irq_src		outbox_irq;
>   
>   	/* rings */
>   	u64				fence_context;
> @@ -1077,6 +1078,7 @@ struct amdgpu_device {
>   
>   	bool                            in_pci_err_recovery;
>   	struct pci_saved_state          *pci_state;
> +	struct completion dmub_aux_transfer_done;
>   };
>   
>   static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 6a06234dbcad..0b88e13f5a7b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -159,7 +159,7 @@ int amdgpu_smu_pptable_id = -1;
>    * PSR (bit 3) disabled by default
>    */
>   uint amdgpu_dc_feature_mask = 2;
> -uint amdgpu_dc_debug_mask;
> +uint amdgpu_dc_debug_mask = 0x10;

If this is intended to be enabled by default then it shouldn't be a 
debug flag. Please either leave the default alone or fully switch over 
to DMCUB AUX support for ASIC that support it.

If you don't already have a check from driver to DMCUB firmware to 
ensure that the firmware itself supports it you'd need that as well - 
users can be running older firmware (like the firmware that originally 
released with DCN2.1/DCN3.0 support) and that wouldn't support this feature.

My recommendation:
- Add a command to check for DMUB AUX capability or add bits to the 
metadata to indicate that the firmware does support it
- Assume that the DMUB AUX implementation is solid and a complete 
replacement for existing AUX support on firmware that does support it
- Add a debug flag like DC_DISABLE_DMUB_AUX for optionally debugging 
issues if they arise

>   int amdgpu_async_gfx_ring = 1;
>   int amdgpu_mcbp;
>   int amdgpu_discovery = -1;
> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
> index 43ed6291b2b8..097672cc78a1 100644
> --- a/drivers/gpu/drm/amd/include/amd_shared.h
> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
> @@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
>   	DC_DISABLE_PIPE_SPLIT = 0x1,
>   	DC_DISABLE_STUTTER = 0x2,
>   	DC_DISABLE_DSC = 0x4,
> -	DC_DISABLE_CLOCK_GATING = 0x8
> +	DC_DISABLE_CLOCK_GATING = 0x8,
> +	DC_ENABLE_DMUB_AUX = 0x10,
>   };
>   
>   enum amd_dpm_forced_level;
> diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> index e2bffcae273a..754170a86ea4 100644
> --- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> +++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
> @@ -1132,5 +1132,7 @@
>   
>   #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
>   #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
> +#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
> +#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8

This technically isn't on DCN_1_0 but I guess we've been using this file 
for all the DCNs.

I do wish this was labeled DCN_2_1 instead to make it more explicit but 
I guess this is fine for now.

Regards,
Nicholas Kazlauskas

>   
>   #endif // __IRQSRCS_DCN_1_0_H__
> 

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
@ 2021-04-06  6:42 Jude Shih
  0 siblings, 0 replies; 11+ messages in thread
From: Jude Shih @ 2021-04-06  6:42 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, Jude Shih, nicholas.kazlauskas, wayne.lin

[Why & How]
We use outbox interrupt that allows us to do the AUX via DMUB
Therefore, we need to add some irq source related definition
in the header files;
Also, I added debug flag that allows us to turn it on/off
for testing purpose.
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
 drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
 drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 963ecfd84347..7e64fc5e0dcd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -923,6 +923,7 @@ struct amdgpu_device {
 	struct amdgpu_irq_src		pageflip_irq;
 	struct amdgpu_irq_src		hpd_irq;
 	struct amdgpu_irq_src		dmub_trace_irq;
+	struct amdgpu_irq_src		dmub_outbox_irq;
 
 	/* rings */
 	u64				fence_context;
@@ -1077,6 +1078,7 @@ struct amdgpu_device {
 
 	bool                            in_pci_err_recovery;
 	struct pci_saved_state          *pci_state;
+	struct completion dmub_aux_transfer_done;
 };
 
 static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 43ed6291b2b8..097672cc78a1 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
 	DC_DISABLE_PIPE_SPLIT = 0x1,
 	DC_DISABLE_STUTTER = 0x2,
 	DC_DISABLE_DSC = 0x4,
-	DC_DISABLE_CLOCK_GATING = 0x8
+	DC_DISABLE_CLOCK_GATING = 0x8,
+	DC_ENABLE_DMUB_AUX = 0x10,
 };
 
 enum amd_dpm_forced_level;
diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
index e2bffcae273a..754170a86ea4 100644
--- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
+++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
@@ -1132,5 +1132,7 @@
 
 #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
 #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
+#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
+#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
 
 #endif // __IRQSRCS_DCN_1_0_H__
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag
@ 2021-04-01  3:21 Jude Shih
  2021-04-06 13:15 ` Kazlauskas, Nicholas
  0 siblings, 1 reply; 11+ messages in thread
From: Jude Shih @ 2021-04-01  3:21 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, Jude Shih

[Why & How]
We use outbox interrupt that allows us to do the AUX via DMUB
Therefore, we need to add some irq source related definition
in the header files;
Also, I added debug flag that allows us to turn it on/off
for testing purpose.
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h                       | 2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c                   | 2 +-
 drivers/gpu/drm/amd/include/amd_shared.h                  | 3 ++-
 drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h | 2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 963ecfd84347..479c8a28a3a9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -923,6 +923,7 @@ struct amdgpu_device {
 	struct amdgpu_irq_src		pageflip_irq;
 	struct amdgpu_irq_src		hpd_irq;
 	struct amdgpu_irq_src		dmub_trace_irq;
+	struct amdgpu_irq_src		outbox_irq;
 
 	/* rings */
 	u64				fence_context;
@@ -1077,6 +1078,7 @@ struct amdgpu_device {
 
 	bool                            in_pci_err_recovery;
 	struct pci_saved_state          *pci_state;
+	struct completion dmub_aux_transfer_done;
 };
 
 static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 6a06234dbcad..0b88e13f5a7b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -159,7 +159,7 @@ int amdgpu_smu_pptable_id = -1;
  * PSR (bit 3) disabled by default
  */
 uint amdgpu_dc_feature_mask = 2;
-uint amdgpu_dc_debug_mask;
+uint amdgpu_dc_debug_mask = 0x10;
 int amdgpu_async_gfx_ring = 1;
 int amdgpu_mcbp;
 int amdgpu_discovery = -1;
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 43ed6291b2b8..097672cc78a1 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -227,7 +227,8 @@ enum DC_DEBUG_MASK {
 	DC_DISABLE_PIPE_SPLIT = 0x1,
 	DC_DISABLE_STUTTER = 0x2,
 	DC_DISABLE_DSC = 0x4,
-	DC_DISABLE_CLOCK_GATING = 0x8
+	DC_DISABLE_CLOCK_GATING = 0x8,
+	DC_ENABLE_DMUB_AUX = 0x10,
 };
 
 enum amd_dpm_forced_level;
diff --git a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
index e2bffcae273a..754170a86ea4 100644
--- a/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
+++ b/drivers/gpu/drm/amd/include/ivsrcid/dcn/irqsrcs_dcn_1_0.h
@@ -1132,5 +1132,7 @@
 
 #define DCN_1_0__SRCID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       0x68
 #define DCN_1_0__CTXID__DMCUB_OUTBOX_HIGH_PRIORITY_READY_INT       6
+#define DCN_1_0__SRCID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        0x68 // DMCUB_IHC_outbox1_ready_int IHC_DMCUB_outbox1_ready_int_ack DMCUB_OUTBOX_LOW_PRIORITY_READY_INTERRUPT DISP_INTERRUPT_STATUS_CONTINUE24 Level/Pulse
+#define DCN_1_0__CTXID__DMCUB_OUTBOX_LOW_PRIORITY_READY_INT        8
 
 #endif // __IRQSRCS_DCN_1_0_H__
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-07 14:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  8:34 [PATCH] drm/amdgpu: add DMUB outbox event IRQ source define/complete/debug flag Jude Shih
2021-04-07 14:52 ` Harry Wentland
  -- strict thread matches above, loose matches on Subject: below --
2021-04-07  1:18 صالح المسعودي
2021-04-06 13:40 Jude Shih
2021-04-06 14:03 ` Kazlauskas, Nicholas
2021-04-06 14:22   ` Shih, Jude
2021-04-06 14:30     ` Kazlauskas, Nicholas
2021-04-06 15:01       ` Shih, Jude
2021-04-06  6:42 Jude Shih
2021-04-01  3:21 Jude Shih
2021-04-06 13:15 ` Kazlauskas, Nicholas

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.