Received: by 10.223.176.46 with SMTP id f43csp2684807wra; Mon, 22 Jan 2018 01:33:31 -0800 (PST) X-Google-Smtp-Source: AH8x227eV2yyREjFqsCMBpzIGYj82FM0U29xiJtDwL1SqTroxyrg4970lCPjHxUUTYtlWD29TUxO X-Received: by 2002:a17:902:b2c7:: with SMTP id x7-v6mr3021211plw.94.1516613610945; Mon, 22 Jan 2018 01:33:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516613610; cv=none; d=google.com; s=arc-20160816; b=i6PQiHmvMwonDdZZBo6cuufcvqI+dzCFqGubob+zPKUcP8kgiPjwFo3t2KCnApEL+9 nmtnjgIusrYVwiOCaq75940KbdGwTIGBNFl+5ZnbdXcROhriqtNBWDRa23YBYHKok4CZ Kx/ZU//VsZ4zrhpn6pn2uhzWx8b5V4sTWD7tWoSyx3hE5pYfdbWovvZvOir/Q+HeY4pS y67RSSxa+xnMk9EfASYTKk4qXy+/G/9SYFpia2GRi2n7FdoskajUDAbquEUEiI+X8uth 9jKs4P8ssN/etZ0Zbg6zB4wnvH4vYAkdc3SXc+D/tzUynnbxPbRncD8qei5zGXs71AAW FwCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sK0hhYZBu6frIxjWsIxSztsrm/mn5iRzqwOrv8e7mKY=; b=a3B/adqowe5jXchDi3pj66bi7F0vt6YFGhkx58L8Dr+PnnDyh6B8QK9xC2B9m6LjAF vv8dOFYls0Jm7H5kbuS3YRzlqck+4iq3IP17DP6QJPDUCTHF7hyGuyPIPXR5T05Ron0j /pXoubny+9kUrEXFzvebIAPrSbX59FfsWIYtr/8RI9BaCGRLJjI4nh4h1B85KGgietv1 wh6HW9wQr94hrCdqbgeKdzVexP5uMzY0zAEwRZejk5LagY/uaxBIecZAGgeVXdbsfuWd qj2M+ZSd5Zpozoz4n1ThjFGRtgtatry2uSkerFerF2B21A8Ei3MDZjrYUp9qfp89n8+R T77w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si7806068pgr.434.2018.01.22.01.33.16; Mon, 22 Jan 2018 01:33:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752089AbeAVJZr (ORCPT + 99 others); Mon, 22 Jan 2018 04:25:47 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:44109 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003AbeAVJZo (ORCPT ); Mon, 22 Jan 2018 04:25:44 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id D64DC2072C; Mon, 22 Jan 2018 10:25:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id A406A20730; Mon, 22 Jan 2018 10:25:31 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, narmstrong@baylibre.com, thomas@vitsch.nl Subject: [PATCH v4 06/13] drm/sun4i: engine: Add a VBLANK quirk callback Date: Mon, 22 Jan 2018 10:25:20 +0100 Message-Id: <7c298d43aa1500196aa5d15d7a7c0f228c7a6f3c.1516613040.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++++ drivers/gpu/drm/sun4i/sunxi_engine.h | 13 +++++++++++++ 2 files changed, 17 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 b819d4f9f02f..54c029877531 100644 --- a/drivers/gpu/drm/sun4i/sunxi_engine.h +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h @@ -85,6 +85,19 @@ struct sunxi_engine_ops { * This function is optional. */ void (*disable_color_correction)(struct sunxi_engine *engine); + + /** + * @vblank_quirk: + * + * This callback is used to implement engine-specific + * 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