From patchwork Mon Nov 7 10:03:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9414649 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 A77956022E for ; Mon, 7 Nov 2016 10:20:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F4A328CF5 for ; Mon, 7 Nov 2016 10:20:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8094928CFD; Mon, 7 Nov 2016 10:20:17 +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.2 required=2.0 tests=BAYES_00, 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 F23D128CF5 for ; Mon, 7 Nov 2016 10:20:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFBAE6E34B; Mon, 7 Nov 2016 10:20:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD0716E34B for ; Mon, 7 Nov 2016 10:20:09 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id y68so15813544pfb.1 for ; Mon, 07 Nov 2016 02:20:09 -0800 (PST) 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=zdYW3G+U/bIDq/D/6FjTBDNMRW9QcyQuDWpt0eR8bKA=; b=FF9/OEUv5c07XmS0Szcn+RTMjUZ83u4f//oyJsIzKxm6r2HNfkoB4O0WJvXUzE45sN CtLz4yh/jQhIJUYuHTH2q0PbJC0AGhqaDdZS7e0p4F17qKROSy0QJSybp8Yesb9L62t+ i5btzR5Rz3kuGeAzJ8xoaavPsxULlaEbwtf2sbiKK//ZRtRW0COj9r1LF4pxT85pqarW iVi41iX7AGjsTvY8aZNHD9g8wMoMEydMyLpPy54HyL4FdiG3mLP0ZVz3Hu9Z/y1CEdHv WSZC+XkOkjWyBVpzoC/AwM5KAdcSX6kIEgK7EbG96oUnjzKToO/dVmeWnVdxf5ecCPxe FiSA== X-Gm-Message-State: ABUngvdt+PWR2/xgyGpmNUdpC3uzhLO6QL5oHpB6+SQoX0Jq2Q5xUdujOhpniIZR+SLxMQ== X-Received: by 10.99.105.70 with SMTP id e67mr9375835pgc.99.1478513025240; Mon, 07 Nov 2016 02:03:45 -0800 (PST) Received: from jade.nodan1.kt.home.ne.jp (122-255-138-194.koalanet.ne.jp. [122.255.138.194]) by smtp.gmail.com with ESMTPSA id 188sm38992638pfd.9.2016.11.07.02.03.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 02:03:44 -0800 (PST) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/4] drm/msm: use drm_atomic_set_fence_for_plane() to set the fence Date: Mon, 7 Nov 2016 19:03:32 +0900 Message-Id: <1478513013-3221-3-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1478513013-3221-1-git-send-email-gustavo@padovan.org> References: <1478513013-3221-1-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan 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. Cc: Rob Clark Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter Acked-by: Rob Clark --- 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); } }