Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1971171pxt; Sun, 8 Aug 2021 07:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrQPZaWIJZmP7ulYYaQLgyzCnK98KXYIqCfO31ygjoGmsTK5yJzm4McZK2Lbc2VIzEZ67M X-Received: by 2002:a5d:96da:: with SMTP id r26mr99933iol.47.1628432625195; Sun, 08 Aug 2021 07:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628432625; cv=none; d=google.com; s=arc-20160816; b=c9QdHEb2tTqnVTjP4dLbXGWA5RuFG/XNOe38VTLMiAeryXk3wAmg8leY0Uo1s6r7P+ 60t0PNOzbpE5OOnS9Y+cJZ4RDPzxml1aS9YbUQJfJ+75KUrvU3ZvJSO0Xs1U6eC62sSR ZEaKOGZu3rEEUSakHBxvf75AUpYn3CaQxG92Gtm5Hm3LPSDy6R1Dnnt4fyPbiRuFjmTF 7zwSwZR1PXyhmRH2yRBjomxQ7IKy0zHN9T1HKf6IpYBZugDJpZ86k3vt3eR3aLbMmGqq rgXRlcCj+aODmBUB4WsCsRWpmgBpwpUe/lCQVEqXohLm1xSkHtx4RGfvjwX3focxFn1n a6Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8CRTU87r90oIzPTTUvQTiFxc59c6e8oxlYWoTSZXYdc=; b=l070KO0+qmTE1Ek7PEJRQPzFIxq7BLO/NyEQHocEBwL21mBiM5MiPiuPIvhQeinlTz rlc0aM2dzTbtLgCkn6pfWp/6GBoqwWOBWduJPbL1JIvWfjmq1bHSTMZAIXLJ7GOOi4B5 aEr1Faj74869tyBm94DHCOVau4H9H61Ye1WiYkVbGrU6s+CSxgey5jXYWJqJSfCtA+Mj eUNkH67XhPlyPprOvkUcc13PlK3bC0HNbGVUzLccO/npVPF5+sY8Mb5cfbg3IFzcf4aS mZu1Q+aM2IUtfP0018JThQ8iNoG5o8Mo4dXEIDfc0yxzPJifRE2jnyyYHXQaz4PBOsl4 JbjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si14927368ilj.118.2021.08.08.07.23.14; Sun, 08 Aug 2021 07:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231685AbhHHNq3 (ORCPT + 99 others); Sun, 8 Aug 2021 09:46:29 -0400 Received: from aposti.net ([89.234.176.197]:55820 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231673AbhHHNq3 (ORCPT ); Sun, 8 Aug 2021 09:46:29 -0400 From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: "H . Nikolaus Schaller" , Paul Boddie , list@opendingux.net, Sam Ravnborg , linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 3/8] drm/ingenic: Use standard drm_atomic_helper_commit_tail Date: Sun, 8 Aug 2021 15:45:21 +0200 Message-Id: <20210808134526.119198-4-paul@crapouillou.net> In-Reply-To: <20210808134526.119198-1-paul@crapouillou.net> References: <20210808134526.119198-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By making the CRTC's .vblank_enable() function return an error when it is known that the hardware won't deliver a VBLANK, we can drop the ingenic_drm_atomic_helper_commit_tail() function and use the standard drm_atomic_helper_commit_tail() function instead. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 28 ++++------------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index bc71ba44ccf4..3ed7c27a8dde 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -706,29 +706,6 @@ static int ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder, } } -static void ingenic_drm_atomic_helper_commit_tail(struct drm_atomic_state *old_state) -{ - /* - * Just your regular drm_atomic_helper_commit_tail(), but only calls - * drm_atomic_helper_wait_for_vblanks() if priv->no_vblank. - */ - struct drm_device *dev = old_state->dev; - struct ingenic_drm *priv = drm_device_get_priv(dev); - - drm_atomic_helper_commit_modeset_disables(dev, old_state); - - drm_atomic_helper_commit_planes(dev, old_state, 0); - - drm_atomic_helper_commit_modeset_enables(dev, old_state); - - drm_atomic_helper_commit_hw_done(old_state); - - if (!priv->no_vblank) - drm_atomic_helper_wait_for_vblanks(dev, old_state); - - drm_atomic_helper_cleanup_planes(dev, old_state); -} - static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg) { struct ingenic_drm *priv = drm_device_get_priv(arg); @@ -749,6 +726,9 @@ static int ingenic_drm_enable_vblank(struct drm_crtc *crtc) { struct ingenic_drm *priv = drm_crtc_get_priv(crtc); + if (priv->no_vblank) + return -EWOULDBLOCK; + regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, JZ_LCD_CTRL_EOF_IRQ, JZ_LCD_CTRL_EOF_IRQ); @@ -856,7 +836,7 @@ static const struct drm_mode_config_funcs ingenic_drm_mode_config_funcs = { }; static struct drm_mode_config_helper_funcs ingenic_drm_mode_config_helpers = { - .atomic_commit_tail = ingenic_drm_atomic_helper_commit_tail, + .atomic_commit_tail = drm_atomic_helper_commit_tail, }; static void ingenic_drm_unbind_all(void *d) -- 2.30.2