Skip to content

Commit 40dad89

Browse files
Jessica ZhangAbhinav Kumar
authored andcommitted
drm/msm/dpu: Don't always set merge_3d pending flush
Don't set the merge_3d pending flush bits if the mode_3d is BLEND_3D_NONE. Always flushing merge_3d can cause timeout issues when there are multiple commits with concurrent writeback enabled. This is because the video phys enc waits for the hw_ctl flush register to be completely cleared [1] in its wait_for_commit_done(), but the WB encoder always sets the merge_3d pending flush during each commit regardless of if the merge_3d is actually active. This means that the hw_ctl flush register will never be 0 when there are multiple CWB commits and the video phys enc will hit vblank timeout errors after the first CWB commit. [1] commit fe9df3f ("drm/msm/dpu: add real wait_for_commit_done()") Fixes: 3e79527 ("drm/msm/dpu: enable merge_3d support on sm8150/sm8250") Fixes: d7d0e73 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Signed-off-by: Jessica Zhang <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/619092/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent e4a4558 commit 40dad89

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,12 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
440440
struct dpu_hw_ctl *ctl;
441441
const struct msm_format *fmt;
442442
u32 fmt_fourcc;
443+
u32 mode_3d;
443444

444445
ctl = phys_enc->hw_ctl;
445446
fmt_fourcc = dpu_encoder_get_drm_fmt(phys_enc);
446447
fmt = mdp_get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0);
448+
mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
447449

448450
DPU_DEBUG_VIDENC(phys_enc, "\n");
449451

@@ -466,7 +468,8 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
466468
goto skip_flush;
467469

468470
ctl->ops.update_pending_flush_intf(ctl, phys_enc->hw_intf->idx);
469-
if (ctl->ops.update_pending_flush_merge_3d && phys_enc->hw_pp->merge_3d)
471+
if (mode_3d && ctl->ops.update_pending_flush_merge_3d &&
472+
phys_enc->hw_pp->merge_3d)
470473
ctl->ops.update_pending_flush_merge_3d(ctl, phys_enc->hw_pp->merge_3d->idx);
471474

472475
if (ctl->ops.update_pending_flush_cdm && phys_enc->hw_cdm)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc)
275275
struct dpu_hw_pingpong *hw_pp;
276276
struct dpu_hw_cdm *hw_cdm;
277277
u32 pending_flush = 0;
278+
u32 mode_3d;
278279

279280
if (!phys_enc)
280281
return;
@@ -283,6 +284,7 @@ static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc)
283284
hw_pp = phys_enc->hw_pp;
284285
hw_ctl = phys_enc->hw_ctl;
285286
hw_cdm = phys_enc->hw_cdm;
287+
mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
286288

287289
DPU_DEBUG("[wb:%d]\n", hw_wb->idx - WB_0);
288290

@@ -294,7 +296,8 @@ static void _dpu_encoder_phys_wb_update_flush(struct dpu_encoder_phys *phys_enc)
294296
if (hw_ctl->ops.update_pending_flush_wb)
295297
hw_ctl->ops.update_pending_flush_wb(hw_ctl, hw_wb->idx);
296298

297-
if (hw_ctl->ops.update_pending_flush_merge_3d && hw_pp && hw_pp->merge_3d)
299+
if (mode_3d && hw_ctl->ops.update_pending_flush_merge_3d &&
300+
hw_pp && hw_pp->merge_3d)
298301
hw_ctl->ops.update_pending_flush_merge_3d(hw_ctl,
299302
hw_pp->merge_3d->idx);
300303

0 commit comments

Comments
 (0)