Skip to content

Commit 112a031

Browse files
committed
drm/i915: Hook in display GTT faults for IVB/HSW
Dump out the display fault information from the IVB/HSW error interrupt handler. Bspec: 8203 Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250217070047.953-5-ville.syrjala@linux.intel.com
1 parent f13011a commit 112a031

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

drivers/gpu/drm/i915/display/intel_display_irq.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
723756
static 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);

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,17 @@
374374

375375
#define GEN7_ERR_INT _MMIO(0x44040)
376376
#define ERR_INT_POISON (1 << 31)
377+
#define ERR_INT_INVALID_GTT_PTE (1 << 29)
378+
#define ERR_INT_INVALID_PTE_DATA (1 << 28)
379+
#define ERR_INT_SPRITE_C_FAULT (1 << 23)
380+
#define ERR_INT_PRIMARY_C_FAULT (1 << 22)
381+
#define ERR_INT_CURSOR_C_FAULT (1 << 21)
382+
#define ERR_INT_SPRITE_B_FAULT (1 << 20)
383+
#define ERR_INT_PRIMARY_B_FAULT (1 << 19)
384+
#define ERR_INT_CURSOR_B_FAULT (1 << 18)
385+
#define ERR_INT_SPRITE_A_FAULT (1 << 17)
386+
#define ERR_INT_PRIMARY_A_FAULT (1 << 16)
387+
#define ERR_INT_CURSOR_A_FAULT (1 << 15)
377388
#define ERR_INT_MMIO_UNCLAIMED (1 << 13)
378389
#define ERR_INT_PIPE_CRC_DONE_C (1 << 8)
379390
#define ERR_INT_FIFO_UNDERRUN_C (1 << 6)

0 commit comments

Comments
 (0)