drm/i915: collect per ring page fault info on error
Subsystems (2)
PATCH 1/2 drm/i915: collect per ring page fault info on error
--- drivers/gpu/drm/i915/i915_debugfs.c | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_irq.c | 3 +++ drivers/gpu/drm/i915/i915_reg.h | 3 +++ 4 files changed, 10 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -750,6 +750,9 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"EIR: 0x%08x\n" , error->eir);seq_printf (m,"PGTBL_ER: 0x%08x\n" , error->pgtbl_er);if (INTEL_INFO (dev)->gen >=6 ) { +seq_printf (m,"GFX Page Fault: 0x%08x\n" , error->page_fault[RCS ]); +seq_printf (m,"Media Page Fault: 0x%08x\n" , error->page_fault[VCS ]); +seq_printf (m,"Blitter Page Fault: 0x%08x\n" , error->page_fault[BCS ]);seq_printf (m,"ERROR: 0x%08x\n" , error->error);seq_printf (m,"Blitter command stream:\n" );seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd);
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -153,6 +153,7 @@ struct drm_i915_error_state {u32 ipehr;u32 instdone;u32 acthd; +u32 page_fault[I915_NUM_RINGS ];u32 error;/* gen6+ */ u32 bcs_acthd;/* gen6+ blt engine */ u32 bcs_ipehr;
drivers/gpu/drm/i915/i915_irq.c +3 -0
@@ -914,6 +914,9 @@ static void i915_capture_error_state(struct drm_device *dev) error->instpm =I915_READ (INSTPM ); error->error =0 ;if (INTEL_INFO (dev)->gen >=6 ) { + error->page_fault[RCS ] =I915_READ (GEN6_GFX_FAULT ); + error->page_fault[VCS ] =I915_READ (GEN6_MED_FAULT ); + error->page_fault[BCS ] =I915_READ (GEN6_BLT_FAULT ); error->error =I915_READ (ERROR_GEN6 ); error->bcs_acthd =I915_READ (BCS_ACTHD );
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -355,6 +355,9 @@#define BCS_IPEHR 0x22068#define BCS_ACTHD 0x22074 +#define GEN6_GFX_FAULT 0x04094 +#define GEN6_MED_FAULT 0x04194 +#define GEN6_BLT_FAULT 0x04294#define ERROR_GEN6 0x040a0/* GM45+ chicken bits -- debug workaround bits that may be required
Signature · 1 line
1.7.6.1
PATCH 2/2 drm/i915: check acthd for all rings
On Gen6+ we have other rings which may be in use. We haven't hung if the blit or media ring is still going
--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/i915_irq.c | 113 +++++++++++++++++++++-------------- 3 files changed, 73 insertions(+), 52 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -3
@@ -755,20 +755,20 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"Blitter Page Fault: 0x%08x\n" , error->page_fault[BCS ]);seq_printf (m,"ERROR: 0x%08x\n" , error->error);seq_printf (m,"Blitter command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[BCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->bcs_ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->bcs_ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->bcs_instdone);seq_printf (m," seqno: 0x%08x\n" , error->bcs_seqno);seq_printf (m,"Video (BSD) command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->vcs_acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[VCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->vcs_ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->vcs_ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->vcs_instdone);seq_printf (m," seqno: 0x%08x\n" , error->vcs_seqno); }seq_printf (m,"Render command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[RCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->instdone);
drivers/gpu/drm/i915/i915_drv.h +2 -4
@@ -152,15 +152,13 @@ struct drm_i915_error_state {u32 ipeir;u32 ipehr;u32 instdone; -u32 acthd; +u32 acthd[I915_NUM_RINGS ];u32 page_fault[I915_NUM_RINGS ];u32 error;/* gen6+ */ -u32 bcs_acthd;/* gen6+ blt engine */ u32 bcs_ipehr;u32 bcs_ipeir;u32 bcs_instdone;u32 bcs_seqno; -u32 vcs_acthd;/* gen6+ bsd engine */ u32 vcs_ipehr;u32 vcs_ipeir;u32 vcs_instdone;
@@ -330,7 +328,7 @@ typedef struct drm_i915_private {#define DRM_I915_HANGCHECK_PERIOD 1500/* in ms */ struct timer_list hangcheck_timer;int hangcheck_count; -uint32_t last_acthd; +uint32_t last_acthd[I915_NUM_RINGS ];uint32_t last_instdone;uint32_t last_instdone1;
drivers/gpu/drm/i915/i915_irq.c +66 -43
156 lines not on this page · raw message
Signature · 1 line
1.7.6.1
PATCH 2/2 drm/i915: check acthd for all rings
On Gen6+ we have other rings which may be in use. We haven't hung if the blit or media ring is still going
--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/i915_irq.c | 113 +++++++++++++++++++++-------------- 3 files changed, 73 insertions(+), 52 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -3
@@ -755,20 +755,20 @@ static int i915_error_state(struct seq_file *m, void *unused)seq_printf (m,"Blitter Page Fault: 0x%08x\n" , error->page_fault[BCS ]);seq_printf (m,"ERROR: 0x%08x\n" , error->error);seq_printf (m,"Blitter command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->bcs_acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[BCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->bcs_ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->bcs_ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->bcs_instdone);seq_printf (m," seqno: 0x%08x\n" , error->bcs_seqno);seq_printf (m,"Video (BSD) command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->vcs_acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[VCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->vcs_ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->vcs_ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->vcs_instdone);seq_printf (m," seqno: 0x%08x\n" , error->vcs_seqno); }seq_printf (m,"Render command stream:\n" ); -seq_printf (m," ACTHD: 0x%08x\n" , error->acthd); +seq_printf (m," ACTHD: 0x%08x\n" , error->acthd[RCS ]);seq_printf (m," IPEIR: 0x%08x\n" , error->ipeir);seq_printf (m," IPEHR: 0x%08x\n" , error->ipehr);seq_printf (m," INSTDONE: 0x%08x\n" , error->instdone);
drivers/gpu/drm/i915/i915_drv.h +2 -4
@@ -152,15 +152,13 @@ struct drm_i915_error_state {u32 ipeir;u32 ipehr;u32 instdone; -u32 acthd; +u32 acthd[I915_NUM_RINGS ];u32 page_fault[I915_NUM_RINGS ];u32 error;/* gen6+ */ -u32 bcs_acthd;/* gen6+ blt engine */ u32 bcs_ipehr;u32 bcs_ipeir;u32 bcs_instdone;u32 bcs_seqno; -u32 vcs_acthd;/* gen6+ bsd engine */ u32 vcs_ipehr;u32 vcs_ipeir;u32 vcs_instdone;
@@ -330,7 +328,7 @@ typedef struct drm_i915_private {#define DRM_I915_HANGCHECK_PERIOD 1500/* in ms */ struct timer_list hangcheck_timer;int hangcheck_count; -uint32_t last_acthd; +uint32_t last_acthd[I915_NUM_RINGS ];uint32_t last_instdone;uint32_t last_instdone1;
drivers/gpu/drm/i915/i915_irq.c +66 -43
156 lines not on this page · raw message
Signature · 1 line
1.7.6.1
Quoted 1 line · Ben Widawsky
Signed-off-by Ben Widawsky <[email protected]>
These are a nice set of cleanups and the extra fault reporting may come in handy. (I thought that fault register was to be used in conjunction with ppgtt in order for the gpu to fault in pages...)
As Daniel mentioned we need to include the VCS for the acthd_stuck() check. I mentioned that I thought the general ERROR register was actually per-ring, but checking the specs I don't see it replicated. The only silly thing is that this introduces an array of register values for only some of the per-ring registers, hence a bit of inconsistency and just calling out for a complete overhaul of those per-ring structures and hopefully code reduction ;-)
Per-ring per-gen hangcheck/error recording/error reporting may be useful. More likely overkill. ;-)
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre