Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/sun4i: tcon: Add TRI finish interrupt for vblank

The "CPU" (or Intel 8080) interface uses a different interrupt called
TRI_FINISH (most likely TRI being for trigger) to notify the end of frames,
and hence the VBLANK period.

And that interrupt to the possible VBLANK interrupts source.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/de6d6ad8959da77ea3a974a31a4c0c8391178748.1522835818.git-series.maxime.ripard@bootlin.com

+10 -3
+6 -3
drivers/gpu/drm/sun4i/sun4i_tcon.c
··· 201 201 DRM_DEBUG_DRIVER("%sabling VBLANK interrupt\n", enable ? "En" : "Dis"); 202 202 203 203 mask = SUN4I_TCON_GINT0_VBLANK_ENABLE(0) | 204 - SUN4I_TCON_GINT0_VBLANK_ENABLE(1); 204 + SUN4I_TCON_GINT0_VBLANK_ENABLE(1) | 205 + SUN4I_TCON_GINT0_TCON0_TRI_FINISH_ENABLE; 205 206 206 207 if (enable) 207 208 val = mask; ··· 583 582 regmap_read(tcon->regs, SUN4I_TCON_GINT0_REG, &status); 584 583 585 584 if (!(status & (SUN4I_TCON_GINT0_VBLANK_INT(0) | 586 - SUN4I_TCON_GINT0_VBLANK_INT(1)))) 585 + SUN4I_TCON_GINT0_VBLANK_INT(1) | 586 + SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT))) 587 587 return IRQ_NONE; 588 588 589 589 drm_crtc_handle_vblank(&scrtc->crtc); ··· 593 591 /* Acknowledge the interrupt */ 594 592 regmap_update_bits(tcon->regs, SUN4I_TCON_GINT0_REG, 595 593 SUN4I_TCON_GINT0_VBLANK_INT(0) | 596 - SUN4I_TCON_GINT0_VBLANK_INT(1), 594 + SUN4I_TCON_GINT0_VBLANK_INT(1) | 595 + SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT, 597 596 0); 598 597 599 598 if (engine->ops->vblank_quirk)
+4
drivers/gpu/drm/sun4i/sun4i_tcon.h
··· 28 28 29 29 #define SUN4I_TCON_GINT0_REG 0x4 30 30 #define SUN4I_TCON_GINT0_VBLANK_ENABLE(pipe) BIT(31 - (pipe)) 31 + #define SUN4I_TCON_GINT0_TCON0_TRI_FINISH_ENABLE BIT(27) 32 + #define SUN4I_TCON_GINT0_TCON0_TRI_COUNTER_ENABLE BIT(26) 31 33 #define SUN4I_TCON_GINT0_VBLANK_INT(pipe) BIT(15 - (pipe)) 34 + #define SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT BIT(11) 35 + #define SUN4I_TCON_GINT0_TCON0_TRI_COUNTER_INT BIT(10) 32 36 33 37 #define SUN4I_TCON_GINT1_REG 0x8 34 38 #define SUN4I_TCON_FRM_CTL_REG 0x10