Skip to content

Commit 2ad52bd

Browse files
MarijnS95robclark
authored andcommitted
drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal
Leaving this at a close-to-maximum register value 0xFFF0 means it takes very long for the MDSS to generate a software vsync interrupt when the hardware TE interrupt doesn't arrive. Configuring this to double the vtotal (like some downstream kernels) leads to a frame to take at most twice before the vsync signal, until hardware TE comes up. In this case the hardware interrupt responsible for providing this signal - "disp-te" gpio - is not hooked up to the mdp5 vsync/pp logic at all. This solves severe panel update issues observed on at least the Xperia Loire and Tone series, until said gpio is properly hooked up to an irq. Suggested-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Marijn Suijten <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent dc8a497 commit 2ad52bd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,17 @@ static int pingpong_tearcheck_setup(struct drm_encoder *encoder,
4949
| MDP5_PP_SYNC_CONFIG_VSYNC_IN_EN;
5050
cfg |= MDP5_PP_SYNC_CONFIG_VSYNC_COUNT(vclks_line);
5151

52+
/*
53+
* Tearcheck emits a blanking signal every vclks_line * vtotal * 2 ticks on
54+
* the vsync_clk equating to roughly half the desired panel refresh rate.
55+
* This is only necessary as stability fallback if interrupts from the
56+
* panel arrive too late or not at all, but is currently used by default
57+
* because these panel interrupts are not wired up yet.
58+
*/
5259
mdp5_write(mdp5_kms, REG_MDP5_PP_SYNC_CONFIG_VSYNC(pp_id), cfg);
5360
mdp5_write(mdp5_kms,
54-
REG_MDP5_PP_SYNC_CONFIG_HEIGHT(pp_id), 0xfff0);
61+
REG_MDP5_PP_SYNC_CONFIG_HEIGHT(pp_id), (2 * mode->vtotal));
62+
5563
mdp5_write(mdp5_kms,
5664
REG_MDP5_PP_VSYNC_INIT_VAL(pp_id), mode->vdisplay);
5765
mdp5_write(mdp5_kms, REG_MDP5_PP_RD_PTR_IRQ(pp_id), mode->vdisplay + 1);

0 commit comments

Comments
 (0)