@@ -8717,7 +8717,16 @@ static int amdgpu_dm_encoder_init(struct drm_device *dev,
87178717static void manage_dm_interrupts (struct amdgpu_device * adev ,
87188718 struct amdgpu_crtc * acrtc ,
87198719 struct dm_crtc_state * acrtc_state )
8720- {
8720+ { /*
8721+ * We cannot be sure that the frontend index maps to the same
8722+ * backend index - some even map to more than one.
8723+ * So we have to go through the CRTC to find the right IRQ.
8724+ */
8725+ int irq_type = amdgpu_display_crtc_idx_to_irq_type (
8726+ adev ,
8727+ acrtc -> crtc_id );
8728+ struct drm_device * dev = adev_to_drm (adev );
8729+
87218730 struct drm_vblank_crtc_config config = {0 };
87228731 struct dc_crtc_timing * timing ;
87238732 int offdelay ;
@@ -8770,7 +8779,35 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
87708779
87718780 drm_crtc_vblank_on_config (& acrtc -> base ,
87728781 & config );
8782+ /* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_get.*/
8783+ switch (amdgpu_ip_version (adev , DCE_HWIP , 0 )) {
8784+ case IP_VERSION (3 , 0 , 0 ):
8785+ case IP_VERSION (3 , 0 , 2 ):
8786+ case IP_VERSION (3 , 0 , 3 ):
8787+ case IP_VERSION (3 , 2 , 0 ):
8788+ if (amdgpu_irq_get (adev , & adev -> pageflip_irq , irq_type ))
8789+ drm_err (dev , "DM_IRQ: Cannot get pageflip irq!\n" );
8790+ #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )
8791+ if (amdgpu_irq_get (adev , & adev -> vline0_irq , irq_type ))
8792+ drm_err (dev , "DM_IRQ: Cannot get vline0 irq!\n" );
8793+ #endif
8794+ }
8795+
87738796 } else {
8797+ /* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_put.*/
8798+ switch (amdgpu_ip_version (adev , DCE_HWIP , 0 )) {
8799+ case IP_VERSION (3 , 0 , 0 ):
8800+ case IP_VERSION (3 , 0 , 2 ):
8801+ case IP_VERSION (3 , 0 , 3 ):
8802+ case IP_VERSION (3 , 2 , 0 ):
8803+ #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )
8804+ if (amdgpu_irq_put (adev , & adev -> vline0_irq , irq_type ))
8805+ drm_err (dev , "DM_IRQ: Cannot put vline0 irq!\n" );
8806+ #endif
8807+ if (amdgpu_irq_put (adev , & adev -> pageflip_irq , irq_type ))
8808+ drm_err (dev , "DM_IRQ: Cannot put pageflip irq!\n" );
8809+ }
8810+
87748811 drm_crtc_vblank_off (& acrtc -> base );
87758812 }
87768813}
0 commit comments