Skip to content

Commit 4be445f

Browse files
committed
drm/msm/dpu: capture snapshot on the first commit_done timeout
In order to debug commit_done timeouts, capture the devcoredump state when the first timeout occurs after the encoder has been enabled. Reviewed-by: Abhinav Kumar <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/579850/ Link: https://lore.kernel.org/r/[email protected]
1 parent d72a3d3 commit 4be445f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ enum dpu_enc_rc_states {
126126
* @base: drm_encoder base class for registration with DRM
127127
* @enc_spinlock: Virtual-Encoder-Wide Spin Lock for IRQ purposes
128128
* @enabled: True if the encoder is active, protected by enc_lock
129+
* @commit_done_timedout: True if there has been a timeout on commit after
130+
* enabling the encoder.
129131
* @num_phys_encs: Actual number of physical encoders contained.
130132
* @phys_encs: Container of physical encoders managed.
131133
* @cur_master: Pointer to the current master in this mode. Optimization
@@ -172,6 +174,7 @@ struct dpu_encoder_virt {
172174
spinlock_t enc_spinlock;
173175

174176
bool enabled;
177+
bool commit_done_timedout;
175178

176179
unsigned int num_phys_encs;
177180
struct dpu_encoder_phys *phys_encs[MAX_PHYS_ENCODERS_PER_VIRTUAL];
@@ -1269,6 +1272,9 @@ static void dpu_encoder_virt_atomic_enable(struct drm_encoder *drm_enc,
12691272
atomic_set(&dpu_enc->frame_done_timeout_cnt, 0);
12701273

12711274
mutex_lock(&dpu_enc->enc_lock);
1275+
1276+
dpu_enc->commit_done_timedout = false;
1277+
12721278
cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
12731279

12741280
dpu_enc->wide_bus_en = dpu_encoder_is_widebus_enabled(drm_enc);
@@ -2553,6 +2559,10 @@ int dpu_encoder_wait_for_commit_done(struct drm_encoder *drm_enc)
25532559
DPU_ATRACE_BEGIN("wait_for_commit_done");
25542560
ret = phys->ops.wait_for_commit_done(phys);
25552561
DPU_ATRACE_END("wait_for_commit_done");
2562+
if (ret == -ETIMEDOUT && !dpu_enc->commit_done_timedout) {
2563+
dpu_enc->commit_done_timedout = true;
2564+
msm_disp_snapshot_state(drm_enc->dev);
2565+
}
25562566
if (ret)
25572567
return ret;
25582568
}

0 commit comments

Comments
 (0)