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: 10693365 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 6021B14DE for ; Thu, 22 Nov 2018 01:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F7AF2C7D5 for ; Thu, 22 Nov 2018 01:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3042B2C7DD; Thu, 22 Nov 2018 01:45:20 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9E3E2C7D5 for ; Thu, 22 Nov 2018 01:45:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 968906E186; Thu, 22 Nov 2018 01:45:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 473566E186 for ; Thu, 22 Nov 2018 01:45:16 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id a14so7994082plm.12 for ; Wed, 21 Nov 2018 17:45:16 -0800 (PST) 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=s3ft5F0uJrINx95w4CPzB1+4JLPneliCtcrUyeHH/PM71ByzIVTXP22sPZokA+3Stz jxT6hrOUfASPxMryO2+hJHoNmef3oQ9lPIp/3B9qc5+Bk+olwcLcL7phFp0KOYSGVsR4 Cp/f5CiIkPh0ANo/dErMrNwRIwGFE8H6Nko30syZ585koPvWR3h7mkoyVbWHMf2v/wsT iPnuQ0M7ClsteIUlt7k4Nm3XXD2gpH/I+y2ywh0N8AcpGH3nqT1f3YMhJn6NHRNJ1G0w Iw6ImvbupDgFmwRTAinTBqPaHczSxgyj2xOd/1tzFfOZJicNbyYj2rOd6aK1hVxOzfCc 7e8g== X-Gm-Message-State: AA+aEWbVIJJpl0LhkY9wP0yx7E7+BIYrUV6mRRYNW7d1jRGAm32Ej2Jl 1tN1gvB4gJ2N5mj0D+5ADF/qoPBr+3w= 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick , Qiang Yu , Icenowy Zheng MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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,