From patchwork Wed Feb 28 19:18:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10249401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F2B0C60211 for ; Wed, 28 Feb 2018 19:19:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC4E128DD0 for ; Wed, 28 Feb 2018 19:19:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFB0C28DD4; Wed, 28 Feb 2018 19:19:21 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 8202228DB1 for ; Wed, 28 Feb 2018 19:19:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD7576EB40; Wed, 28 Feb 2018 19:19:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D28D6EB35 for ; Wed, 28 Feb 2018 19:19:12 +0000 (UTC) Received: by mail-yw0-x242.google.com with SMTP id u84so1196914ywg.9 for ; Wed, 28 Feb 2018 11:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QnIdCTx180IdiXBxN6f9IBz3mdZcBz9wwQo9W7NsbuQ=; b=L2WE0hBwADrKQxJJ8rZKOBpqCMGljY4XGHuxCuGYl8/01doztn15JhnDrbG20S/RwK FuwE0yNn/EwUXdghqTE/+2eHkmukkHPkeqIZKFkw/kwTioNGlwP1hAhYnudI0k3NQIMv gxkO4HQmKXNfK6cpfTX+lhIs2+EsLg6CR04Ls= 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:in-reply-to :references; bh=QnIdCTx180IdiXBxN6f9IBz3mdZcBz9wwQo9W7NsbuQ=; b=SeesMmF0emoH4UREXnmVkqJ1fhQ25W57EkEkQiS2t18IELdEHiu2UBON6n56MFC9vQ yVz5rSKR3HRHa21g3OVv4B7XJj0amCnKwQ1KrNMHzz8E31xsz/igMSQoOE3my+Ley504 DXUYg5HARrrbas2JpCwaPTwqi4C6NLPP2QUsBgfIzfdBX0A+l+10qG6n3quN5Oa2WN1S sq5JdUVTN76Q1gA/xe0D6KY0q/aowh7KMPLvww+nUIu4KWymmj4smLuIX5DEgVDwNtsg 85Id4QcDYN8f7lmycDmrr/fDyaIG5Uzngieju9xEb9R14z0Y5PNKV2cPqt662DF5yBc9 HOug== X-Gm-Message-State: APf1xPA3FdtXt+zjADuTgR6jIMN2QBj8bHDF4ccnopq65UKjDQG5NJzu bDab1cPnsPkNxlHZ6lPclGAWDQ== X-Google-Smtp-Source: AH8x227D1Tab2C5IpUQ+OPOyoeXUezcQls0YbyFInCnGpKHQSpLPJWxcMxRMsuhQMtcql83k5LnFYQ== X-Received: by 10.129.85.4 with SMTP id j4mr12424678ywb.301.1519845551710; Wed, 28 Feb 2018 11:19:11 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id u62sm884594ywa.19.2018.02.28.11.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 11:19:11 -0800 (PST) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [DPU PATCH 04/11] drm/msm: Move implicit sync fence handling to prepare_fb Date: Wed, 28 Feb 2018 14:18:59 -0500 Message-Id: <20180228191906.185417-5-seanpaul@chromium.org> X-Mailer: git-send-email 2.16.2.395.g2e18187dfd-goog In-Reply-To: <20180228191906.185417-1-seanpaul@chromium.org> References: <20180228191906.185417-1-seanpaul@chromium.org> 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: hoegsberg@chromium.org, abhinavk@codeaurora.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is another piece that can be moved out of atomic to facilitate using the atomic helpers. Change-Id: I6dc3c4e5df508942bbc378c73a44e46e511b8469 Signed-off-by: Sean Paul Reviewed-by: Jeykumar Sankaran --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 8 ++++++++ drivers/gpu/drm/msm/msm_atomic.c | 13 ------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 834dcc0bfefd..29e72b39fd72 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -2720,6 +2720,8 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane, struct dpu_plane_rot_state *new_rstate; struct dpu_hw_fmt_layout layout; struct msm_gem_address_space *aspace; + struct msm_gem_object *msm_obj; + struct dma_fence *fence; int ret; if (!new_state->fb) @@ -2761,6 +2763,12 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane, return ret; } + /* To support implicit sync, set a fence on the plane if appropriate */ + msm_obj = to_msm_bo(msm_framebuffer_bo(fb, 0)); + fence = reservation_object_get_excl_rcu(msm_obj->resv); + if (fence) + drm_atomic_set_fence_for_plane(new_state, fence); + return 0; } diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index eb2ccda5da0f..3a18bd3dc215 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -282,19 +282,6 @@ int msm_atomic_commit(struct drm_device *dev, for_each_new_crtc_in_state(state, crtc, crtc_state, i) c->crtc_mask |= drm_crtc_mask(crtc); - /* - * Figure out what fence to wait for: - */ - for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { - if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { - struct drm_gem_object *obj = msm_framebuffer_bo(new_plane_state->fb, 0); - struct msm_gem_object *msm_obj = to_msm_bo(obj); - struct dma_fence *fence = reservation_object_get_excl_rcu(msm_obj->resv); - - drm_atomic_set_fence_for_plane(new_plane_state, fence); - } - } - /* * Wait for pending updates on any of the same crtc's and then * mark our set of crtc's as busy: