From patchwork Thu Oct 27 19:37:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9400281 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 6B66860231 for ; Thu, 27 Oct 2016 19:37:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CAF32A38D for ; Thu, 27 Oct 2016 19:37:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 410A02A399; Thu, 27 Oct 2016 19:37:43 +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.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 DCA652A38D for ; Thu, 27 Oct 2016 19:37:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46A986EACD; Thu, 27 Oct 2016 19:37:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-f194.google.com (mail-yb0-f194.google.com [209.85.213.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 95DE66EACE for ; Thu, 27 Oct 2016 19:37:41 +0000 (UTC) Received: by mail-yb0-f194.google.com with SMTP id 205so978198ybz.0 for ; Thu, 27 Oct 2016 12:37:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7FiG22opsTFIX/SOnxv8BONl43TIFsxSNWIZBxXxy9I=; b=iz92bJPIvjyQ2JNmMGZZEfIw024jL0vBR/nZYiN4RPAXPvigEP3pu2hJX/SQEP80pA cMtQoZoIS7bNQjhbhZBt5rSed3VnjvAxsV82/aVaNeGQcNryFrm/QAr+R3phKRm5DKFy rmtHlDHWMmvtXEyseQsNfCv2qpKnjCNrPmIjF4gD/ioNzAwRgLrjWQotZg3d4ltTvlkk KZQeYm9TPaN1kk0226AEOBK70rflHYKeVR+R5Eom83Q8bJ/bl0kxt+ymRWUGPT55avwB UBlW8PrJ3Icxpx9cFFLjEiN4o4P321cxP5spsAeyCSRKJWrgim8KKRoI9V4ay84WJ4b6 a5tA== X-Gm-Message-State: ABUngve7alpZ90X1e0fEBA9CitfB9fHrkOw8yFhSt1lAuwCewYYsfXDBNkFhqno7njbjyg== X-Received: by 10.37.105.67 with SMTP id e64mr8577042ybc.102.1477597060771; Thu, 27 Oct 2016 12:37:40 -0700 (PDT) Received: from jade.localdomain ([187.64.228.41]) by smtp.gmail.com with ESMTPSA id b207sm3129787ywa.4.2016.10.27.12.37.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Oct 2016 12:37:40 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH v6 3/6] drm/msm: use drm_atomic_set_fence_for_plane() to set the fence Date: Thu, 27 Oct 2016 17:37:08 -0200 Message-Id: <1477597031-5139-4-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1477597031-5139-1-git-send-email-gustavo@padovan.org> References: <1477597031-5139-1-git-send-email-gustavo@padovan.org> Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.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" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan drm_atomic_set_fence_for_plane() is smart and won't overwrite plane_state->fence if the user already set an explicit fence there. Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter --- drivers/gpu/drm/msm/msm_atomic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index db193f8..4e21e1d 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -217,8 +217,9 @@ int msm_atomic_commit(struct drm_device *dev, if ((plane->state->fb != plane_state->fb) && plane_state->fb) { struct drm_gem_object *obj = msm_framebuffer_bo(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); - plane_state->fence = reservation_object_get_excl_rcu(msm_obj->resv); + drm_atomic_set_fence_for_plane(plane_state, fence); } }