From patchwork Mon Nov 7 10:03:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9414585 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 ECB9460512 for ; Mon, 7 Nov 2016 10:03:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCBAB28B11 for ; Mon, 7 Nov 2016 10:03:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0D0128C99; Mon, 7 Nov 2016 10:03:46 +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 E6B6A28B11 for ; Mon, 7 Nov 2016 10:03:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1DD7E6E34C; Mon, 7 Nov 2016 10:03:45 +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 1B0B66E348 for ; Mon, 7 Nov 2016 10:03:44 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id y68so15776875pfb.1 for ; Mon, 07 Nov 2016 02:03:44 -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=/mVVpq5SMzH0iiL5nwPCs1zkHMX813DXuT+/q3774r0=; b=DyMYZnv+wCeBj+XdwDVz8JH8aqakCVVU8Jojxki0P3/maxYfMtuuW/ohHVWgEvSvuk ok1Km5BaiuwQGxe1o8FtXdwu8yI8R/XVza72TOfb++0pR2iz0Rc8uPRMo2buz/Xmcm+8 aMRobNxt2D4jNGKFLL5MvprjnLfB5PmeyH3OEqS0bxqP3IH0dZF+/zw62vks5iBLOG2C l4+1jEM/I36j0zxbFm13wRo22levd6ORAUxzD1l430WrEPzR4aNm7NdKzT5+Z6xY6nlv QK25VQWtnD5dfLtg+g/coi4WqJvPxHQzm15TaGkq7tXgiLDj60UeB4U2QPNRdiMv37QE kokA== X-Gm-Message-State: ABUngveekpmM2IWr5Eirf1yLU0JM2ddqTCscqKL1166GCtmil9ADk526gWZ0lvjtBCtVsQ== X-Received: by 10.99.142.201 with SMTP id k192mr9473046pge.174.1478513023519; Mon, 07 Nov 2016 02:03:43 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 02:03:43 -0800 (PST) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/4] drm/imx: use drm_atomic_set_fence_for_plane() to set the fence Date: Mon, 7 Nov 2016 19:03:31 +0900 Message-Id: <1478513013-3221-2-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: Philipp Zabel Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter Acked-by: Philipp Zabel --- drivers/gpu/drm/imx/imx-drm-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 98df09c..07fe955 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -158,6 +158,7 @@ static int imx_drm_atomic_commit(struct drm_device *dev, struct drm_plane_state *plane_state; struct drm_plane *plane; struct dma_buf *dma_buf; + struct dma_fence *fence; int i; /* @@ -170,8 +171,9 @@ static int imx_drm_atomic_commit(struct drm_device *dev, 0)->base.dma_buf; if (!dma_buf) continue; - plane_state->fence = - reservation_object_get_excl_rcu(dma_buf->resv); + fence = reservation_object_get_excl_rcu(dma_buf->resv); + + drm_atomic_set_fence_for_plane(plane_state, fence); } }