Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076AbdLSFJ7 (ORCPT ); Tue, 19 Dec 2017 00:09:59 -0500 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:41882 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841AbdLSFJ6 (ORCPT ); Tue, 19 Dec 2017 00:09:58 -0500 X-Google-Smtp-Source: ACJfBovEo8Cq9KBiCrHZDxq6tm0CCckfDYxSoDmCO9QNgie7D3sAQgGd1E5rhJw0WetmnEqonnMu3ujqD/CPFkaUGe8= MIME-Version: 1.0 In-Reply-To: <63abbe22845c3332e032053a26948486a3514fa8.1513609024.git-series.maxime.ripard@free-electrons.com> References: <63abbe22845c3332e032053a26948486a3514fa8.1513609024.git-series.maxime.ripard@free-electrons.com> From: Chen-Yu Tsai Date: Tue, 19 Dec 2017 13:09:33 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 05/12] drm/sun4i: engine: Add a VBLANK quirk callback To: Maxime Ripard Cc: Daniel Vetter , David Airlie , Chen-Yu Tsai , dri-devel , linux-kernel , linux-arm-kernel , Thomas Petazzoni , Neil Armstrong , thomas@vitsch.nl Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2558 Lines: 68 On Mon, Dec 18, 2017 at 10:57 PM, Maxime Ripard wrote: > 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. > > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++++ > drivers/gpu/drm/sun4i/sunxi_engine.h | 12 ++++++++++++ > 2 files changed, 16 insertions(+) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c > index e122f5b2a395..55f54b54293c 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > @@ -368,6 +368,7 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private) > struct sun4i_tcon *tcon = private; > struct drm_device *drm = tcon->drm; > struct sun4i_crtc *scrtc = tcon->crtc; > + struct sunxi_engine *engine = scrtc->engine; > unsigned int status; > > regmap_read(tcon->regs, SUN4I_TCON_GINT0_REG, &status); > @@ -385,6 +386,9 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private) > SUN4I_TCON_GINT0_VBLANK_INT(1), > 0); > > + if (engine->ops->vblank_quirk) > + engine->ops->vblank_quirk(engine); > + > return IRQ_HANDLED; > } > > diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h > index da2dd36dfbb6..b810c26d78bb 100644 > --- a/drivers/gpu/drm/sun4i/sunxi_engine.h > +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h > @@ -86,6 +86,18 @@ struct sunxi_engine_ops { > struct drm_plane **(*layers_init)(struct drm_device *drm, > struct sunxi_engine *engine); > > + /** > + * @vblank_quirk: > + * > + * This callback is used to implement backend-specific ^ engine Otherwise, Reviewed-by: Chen-Yu Tsai > + * behaviour part of the VBLANK event. It is run with all the > + * constraints of an interrupt (can't sleep, all local > + * interrupts disabled) and therefore should be as fast as > + * possible. > + * > + * This function is optional. > + */ > + void (*vblank_quirk)(struct sunxi_engine *engine); > }; > > /** > -- > git-series 0.9.1