From patchwork Mon Jan 22 09:25:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 125355 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1053973ljf; Mon, 22 Jan 2018 01:26:21 -0800 (PST) X-Google-Smtp-Source: AH8x226WRBKqrYbcoc/dnBrPk1nqLfTsLitoTeu9LBxAFu1wB2r8Z8jXb8schMLAS9rw86J2yBKH X-Received: by 10.99.65.199 with SMTP id o190mr3430476pga.238.1516613180877; Mon, 22 Jan 2018 01:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516613180; cv=none; d=google.com; s=arc-20160816; b=XzCuLcyB5L08Y4DGNjxzgUb1ehTMz+KzOKDN57cldA7quRty4Jw+nbMhrBzf8RfgrX 2qxTmKN+JZeP7LKMYWgS3WbTYfGy1ligq79FDzsSw/1ULnvHdNvlDAK7EIAjal1tzVxd v6xGYJyvrSBYSXXMGUKXts1Q3/eTDnuXuy2BQsA0do4rMWG79kU6EvEakB8/KNVIm38W m8ZgmAmIh0Rc1biwNalfgakFbz1VoCfWB/XEtosixT93qUORD+2ingULRMyz7QMtJkjP 31CEbm/kvEVaJSnJKMUveHDwZvanY8u+k0uaTGRnF7TOf9qM9Xg2PLbnWONcIU0yG37Z l5FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=93wVv08wTZJT2vYZVRD1BeAsyyyD3HWl0sPxin0Y7k4=; b=xY1dw9bjjzwkKLdz6vENU55lfuHGLmE5HgHz+g/QLkAlHruFd5eh0+FK5QcXp5zkhs uG/rOApgYxpebOt1WxSE/sy1jxMGWB6JoQL2MKuYiL8vY/PCuI2H01nQiQb1d3MJZIq3 +/JB3OlTKuIi+30cdV15oCnXqsLa9CWATKluFZealvdLByxa7jUyXFm3HiJUHIYhgSaB 5U6S2XoR4YTj+Z1+3GrHDxgpPUi01Ro3hBQSgDYhXqcuHxs7yUY2ZMJnuxMRMcBYz57R uiLZu6omhbjCaAKp1kc/Idn4SKAovnEOpj4AnGRwd1lhWvLpcBqZQ6uHgabKSWS3LKiN WkBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id a89si15278503pfj.107.2018.01.22.01.26.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 01:26:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1ED06E16B; Mon, 22 Jan 2018 09:25:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id DE76B6E0C6 for ; Mon, 22 Jan 2018 09:25:40 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 47A9D206A4; Mon, 22 Jan 2018 10:25:40 +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 19257206F0; Mon, 22 Jan 2018 10:25:30 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 02/13] drm/sun4i: backend: Document the engine operations Date: Mon, 22 Jan 2018 10:25:16 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: linux-arm-kernel@lists.infradead.org, thomas@vitsch.nl, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, narmstrong@baylibre.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Our operations were missing some documentation to explain what was expected from them. Let's make that clearer. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sunxi_engine.h | 46 +++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h index 4cb70ae65c79..b374e074c7c3 100644 --- a/drivers/gpu/drm/sun4i/sunxi_engine.h +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h @@ -15,12 +15,58 @@ struct drm_device; struct sunxi_engine; +/** + * struct sunxi_engine_ops - helper operations for sunXi engines + * + * These hooks are used by the common part of the DRM driver to + * implement the proper behaviour. + */ struct sunxi_engine_ops { + /** + * @commit: + * + * This callback will trigger the hardware switch to commit + * the new configuration that has been setup during the next + * vblank period. + * + * This function is optional. + */ void (*commit)(struct sunxi_engine *engine); + + /** + * @layers_init: + * + * This callback is used to allocate, initialize and register + * the layers supported by that engine. + * + * This function is mandatory. + * + * RETURNS: + * + * The array of struct drm_plane backing the layers, or an + * error pointer on failure. + */ struct drm_plane **(*layers_init)(struct drm_device *drm, struct sunxi_engine *engine); + /** + * @apply_color_correction: + * + * This callback will enable the color correction in the + * engine. This is useful only for the composite output. + * + * This function is optional. + */ void (*apply_color_correction)(struct sunxi_engine *engine); + + /** + * @disable_color_correction: + * + * This callback will stop the color correction in the + * engine. This is useful only for the composite output. + * + * This function is optional. + */ void (*disable_color_correction)(struct sunxi_engine *engine); };