From patchwork Thu Nov 22 01:44:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Yu X-Patchwork-Id: 10693367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68CFA14DE for ; Thu, 22 Nov 2018 01:45:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CEFC2C7DD for ; Thu, 22 Nov 2018 01:45:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40B752C7E0; Thu, 22 Nov 2018 01:45:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E15A52C7DD for ; Thu, 22 Nov 2018 01:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=RzAYtZoMgXV4cT3pHDarQlZkbrLFIe9BjKPLgDfVWqk=; b=rhi OXZQiQOHD9/GufeTkgmGMdbR4goVmsADkVl5Wd8ZdBvHFEhC5lwI+SeIj/6/rUsf4Zibry3iZQr1D A+fx+EsxQu7ee1UdDn1cpMM4Ohj0dIWoNHQARDNTGiZcQkJ61HWn03/0Vz1WC0jgA7yj1k5ctsnfo Xh3cRTMYlbnMhxCCQaSd9VupDMXtojY7zO8mBm2O8cl9SpRaCCkRb3LTEqQ6TZL0ZSL9hCNESUNBU LKhpBZgR9IqYm4jVPw0T01LBcE7BtTvMyM8kBPP9/uZQ6i0DnK0VDDhObcs1Hck26lK9h7F8WlbEp JAuS4jrh9JAs9z03lB61ustWtlgaFaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPe3e-0002Sx-JC; Thu, 22 Nov 2018 01:45:30 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPe3b-0002S4-Ol for linux-arm-kernel@lists.infradead.org; Thu, 22 Nov 2018 01:45:29 +0000 Received: by mail-pl1-x641.google.com with SMTP id f12-v6so8014416plo.1 for ; Wed, 21 Nov 2018 17:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kvkrNknnnYyDCwzgoDOzZl41ciugn9Tt2keFs4A91m0=; b=QY9W/u1pcWReosHAIJ0Mlet99ZY0UtHlAVvl80t1NMMfhHOPTx1hQZvZei6awez8ag b+prL3CZUGSmVb1swiDRD0P9CqVG7vTRuYHiqmztckcfjuMNQAmBonoiDUYW5JZQXVWH xN0SENdRoC2Fg+DauO37xY+OKZNnUSZ/jxdrTQBQ0arhxRRb0+4uWKdV3uPodfsY9qbN lRpg3CQUwJmeezLty+0VwEDImvScy44L5D3O4JGfpfk/1atju4Li2HFwN2yGKerA+kZ1 ipLTWFgeyP+amgUYUdaBO4cavrej/fBzQg1l5XYD+mZ3vlkFx6LJRX6mQZteb4NbAWX/ i98Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kvkrNknnnYyDCwzgoDOzZl41ciugn9Tt2keFs4A91m0=; b=rIyZavsH3PULRLX5PmzVNh+VtVYuYeUx8uUrktV0W0g8BPABsXKPMAtlH3xLlyohHe dC3Oi5TvDrHV7d8VVfQH/yWhfRC/CPHOWaXhERIGE8r4/+tzNvxdKm5P0ALXh3Qvml6A rFD1dkqRi0st2eWnPjETpRlVIR4mbJhCPCb9F6T/y/3Ath9Vb8dP6HNj0vEXaP6VCbJo Xh6zQQdQTFuTs0UR+UbY38sMiwoi6EIj7lwboiSvj9fsQYVlOVtZjvZJdWIlEkX5Ypnu CfI740irmkPQx/pCipMQi92EAY9ELnsv4TmdgkcBJ8+u3lcuK0h6udHObrubJdn+R7pE utSw== X-Gm-Message-State: AA+aEWYsSCjjkXaZcL7o9n9jqbS/dBemESE21w7zXbRPxZYBE1fx+fkc T0mIEhM+/WtGdsj5Dn3lmDg= X-Google-Smtp-Source: AFSGD/VeWcDf7UYdqUvvBe0DAaAA3Ga+nNwoL2B9xy3whbF8gxhzgnRDgD6EKiBvSaJRSeFvZP0jzQ== X-Received: by 2002:a17:902:20b:: with SMTP id 11mr6303624plc.57.1542851115675; Wed, 21 Nov 2018 17:45:15 -0800 (PST) Received: from yuq-Aspire-4738G.www.tendawifi.com ([150.109.119.235]) by smtp.gmail.com with ESMTPSA id i193sm58541500pgc.22.2018.11.21.17.45.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 17:45:15 -0800 (PST) From: Qiang Yu To: dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Maxime Ripard , David Airlie , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/sun4i: wait on implicit fence before display Date: Thu, 22 Nov 2018 09:44:17 +0800 Message-Id: <20181122014417.23285-1-yuq825@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181121_174527_807129_04920656 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick , Qiang Yu , Icenowy Zheng MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Render like lima will attach a fence to the framebuffer dma_buf, display like sun4i should wait it finish before show the framebuffer. Otherwise tearing will be observed. Signed-off-by: Qiang Yu --- drivers/gpu/drm/sun4i/sun4i_layer.c | 2 ++ drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 2 ++ drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c index 750ad24de1d7..d68e663df9a0 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.c +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c @@ -12,6 +12,7 @@ #include #include +#include #include #include "sun4i_backend.h" @@ -114,6 +115,7 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane, } static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = { + .prepare_fb = drm_gem_fb_prepare_fb, .atomic_disable = sun4i_backend_layer_atomic_disable, .atomic_update = sun4i_backend_layer_atomic_update, }; diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 28c15c6ef1ef..7bc2ca2bd0c3 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -287,6 +288,7 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, } static struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { + .prepare_fb = drm_gem_fb_prepare_fb, .atomic_check = sun8i_ui_layer_atomic_check, .atomic_disable = sun8i_ui_layer_atomic_disable, .atomic_update = sun8i_ui_layer_atomic_update, diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index f4fe97813f94..815895795afd 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -315,6 +316,7 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, } static struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { + .prepare_fb = drm_gem_fb_prepare_fb, .atomic_check = sun8i_vi_layer_atomic_check, .atomic_disable = sun8i_vi_layer_atomic_disable, .atomic_update = sun8i_vi_layer_atomic_update,