Skip to content

Commit a493cea

Browse files
committed
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 <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/de6d6ad8959da77ea3a974a31a4c0c8391178748.1522835818.git-series.maxime.ripard@bootlin.com
1 parent 1d0397d commit a493cea

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable)
201201
DRM_DEBUG_DRIVER("%sabling VBLANK interrupt\n", enable ? "En" : "Dis");
202202

203203
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;
205206

206207
if (enable)
207208
val = mask;
@@ -582,7 +583,8 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private)
582583
regmap_read(tcon->regs, SUN4I_TCON_GINT0_REG, &status);
583584

584585
if (!(status & (SUN4I_TCON_GINT0_VBLANK_INT(0) |
585-
SUN4I_TCON_GINT0_VBLANK_INT(1))))
586+
SUN4I_TCON_GINT0_VBLANK_INT(1) |
587+
SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT)))
586588
return IRQ_NONE;
587589

588590
drm_crtc_handle_vblank(&scrtc->crtc);
@@ -591,7 +593,8 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private)
591593
/* Acknowledge the interrupt */
592594
regmap_update_bits(tcon->regs, SUN4I_TCON_GINT0_REG,
593595
SUN4I_TCON_GINT0_VBLANK_INT(0) |
594-
SUN4I_TCON_GINT0_VBLANK_INT(1),
596+
SUN4I_TCON_GINT0_VBLANK_INT(1) |
597+
SUN4I_TCON_GINT0_TCON0_TRI_FINISH_INT,
595598
0);
596599

597600
if (engine->ops->vblank_quirk)

drivers/gpu/drm/sun4i/sun4i_tcon.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828

2929
#define SUN4I_TCON_GINT0_REG 0x4
3030
#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)
3133
#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)
3236

3337
#define SUN4I_TCON_GINT1_REG 0x8
3438
#define SUN4I_TCON_FRM_CTL_REG 0x10

0 commit comments

Comments
 (0)