@@ -720,6 +720,39 @@ static void ibx_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir)
720720 intel_pch_fifo_underrun_irq_handler (display , PIPE_B );
721721}
722722
723+ static u32 ivb_err_int_pipe_fault_mask (enum pipe pipe )
724+ {
725+ switch (pipe ) {
726+ case PIPE_A :
727+ return ERR_INT_SPRITE_A_FAULT |
728+ ERR_INT_PRIMARY_A_FAULT |
729+ ERR_INT_CURSOR_A_FAULT ;
730+ case PIPE_B :
731+ return ERR_INT_SPRITE_B_FAULT |
732+ ERR_INT_PRIMARY_B_FAULT |
733+ ERR_INT_CURSOR_B_FAULT ;
734+ case PIPE_C :
735+ return ERR_INT_SPRITE_C_FAULT |
736+ ERR_INT_PRIMARY_C_FAULT |
737+ ERR_INT_CURSOR_C_FAULT ;
738+ default :
739+ return 0 ;
740+ }
741+ }
742+
743+ static const struct pipe_fault_handler ivb_pipe_fault_handlers [] = {
744+ { .fault = ERR_INT_SPRITE_A_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_SPRITE0 , },
745+ { .fault = ERR_INT_PRIMARY_A_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_PRIMARY , },
746+ { .fault = ERR_INT_CURSOR_A_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_CURSOR , },
747+ { .fault = ERR_INT_SPRITE_B_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_SPRITE0 , },
748+ { .fault = ERR_INT_PRIMARY_B_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_PRIMARY , },
749+ { .fault = ERR_INT_CURSOR_B_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_CURSOR , },
750+ { .fault = ERR_INT_SPRITE_C_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_SPRITE0 , },
751+ { .fault = ERR_INT_PRIMARY_C_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_PRIMARY , },
752+ { .fault = ERR_INT_CURSOR_C_FAULT , .handle = handle_plane_fault , .plane_id = PLANE_CURSOR , },
753+ {}
754+ };
755+
723756static void ivb_err_int_handler (struct drm_i915_private * dev_priv )
724757{
725758 struct intel_display * display = & dev_priv -> display ;
@@ -729,7 +762,15 @@ static void ivb_err_int_handler(struct drm_i915_private *dev_priv)
729762 if (err_int & ERR_INT_POISON )
730763 drm_err (& dev_priv -> drm , "Poison interrupt\n" );
731764
765+ if (err_int & ERR_INT_INVALID_GTT_PTE )
766+ drm_err_ratelimited (display -> drm , "Invalid GTT PTE\n" );
767+
768+ if (err_int & ERR_INT_INVALID_PTE_DATA )
769+ drm_err_ratelimited (display -> drm , "Invalid PTE data\n" );
770+
732771 for_each_pipe (dev_priv , pipe ) {
772+ u32 fault_errors ;
773+
733774 if (err_int & ERR_INT_FIFO_UNDERRUN (pipe ))
734775 intel_cpu_fifo_underrun_irq_handler (display , pipe );
735776
@@ -739,6 +780,11 @@ static void ivb_err_int_handler(struct drm_i915_private *dev_priv)
739780 else
740781 hsw_pipe_crc_irq_handler (dev_priv , pipe );
741782 }
783+
784+ fault_errors = err_int & ivb_err_int_pipe_fault_mask (pipe );
785+ if (fault_errors )
786+ intel_pipe_fault_irq_handler (display , ivb_pipe_fault_handlers ,
787+ pipe , fault_errors );
742788 }
743789
744790 intel_de_write (display , GEN7_ERR_INT , err_int );
0 commit comments