Skip to content

Commit 3004f75

Browse files
committed
drm/sun4i: engine: Add a VBLANK quirk callback
In some cases, the display engine needs to apply some quirks during the VBLANK event. In the Display Engine 1.0 case for example, we can only disable the frontend once the backend has been, which is at VBLANK. Let's introduce a callback that can be implemented by the various engines. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/7c298d43aa1500196aa5d15d7a7c0f228c7a6f3c.1516613040.git-series.maxime.ripard@free-electrons.com
1 parent 656e5f6 commit 3004f75

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private)
540540
struct sun4i_tcon *tcon = private;
541541
struct drm_device *drm = tcon->drm;
542542
struct sun4i_crtc *scrtc = tcon->crtc;
543+
struct sunxi_engine *engine = scrtc->engine;
543544
unsigned int status;
544545

545546
regmap_read(tcon->regs, SUN4I_TCON_GINT0_REG, &status);
@@ -557,6 +558,9 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private)
557558
SUN4I_TCON_GINT0_VBLANK_INT(1),
558559
0);
559560

561+
if (engine->ops->vblank_quirk)
562+
engine->ops->vblank_quirk(engine);
563+
560564
return IRQ_HANDLED;
561565
}
562566

drivers/gpu/drm/sun4i/sunxi_engine.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ struct sunxi_engine_ops {
8585
* This function is optional.
8686
*/
8787
void (*disable_color_correction)(struct sunxi_engine *engine);
88+
89+
/**
90+
* @vblank_quirk:
91+
*
92+
* This callback is used to implement engine-specific
93+
* behaviour part of the VBLANK event. It is run with all the
94+
* constraints of an interrupt (can't sleep, all local
95+
* interrupts disabled) and therefore should be as fast as
96+
* possible.
97+
*
98+
* This function is optional.
99+
*/
100+
void (*vblank_quirk)(struct sunxi_engine *engine);
88101
};
89102

90103
/**

0 commit comments

Comments
 (0)