Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2398362ybi; Mon, 17 Jun 2019 04:14:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz49eLfvlY694IUBGvV7hhGmZST4PzsTmXkFyJ2tJU9xAoxe+yM7MVGxJ3HO+7/+vOYd7I2 X-Received: by 2002:a17:902:830b:: with SMTP id bd11mr55504545plb.202.1560770079377; Mon, 17 Jun 2019 04:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560770079; cv=none; d=google.com; s=arc-20160816; b=fGFbUTWiBsZ4F2Tlz9adizfbhVWXcil1/Myl3fGuHv46usy2fbYe35DtSOH1KHoVC7 InmS9cSYvowezLriLkKc5q3Ut+RxbxGQqDfFvG9zuh3sc9eMmLYG6thDU5TVaWjHijKr EHwy2Yvzf4M48biytNEek0AMnlJ36ZzE889G3wzzl06gN87ums0e2F4JL9WNFCsRBmfY 4osQpl3Lvyt/erhkg5h2UQHl0G4b9Jpe7g2W5aPDv7XPR3ci6YjDBs3eLoO/9KFNad63 uiWtkrCjwcM9ld9NLPxHkPIyzaIXwLcO8phJcz8HA4TEXLv/oN8QG0a3mHzUkpRNB8Ry tX4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=osBk9Xnt7t7nQ6/6VaWbIxb7xuHFax3MpunDlUPPSfk=; b=dzJzys8mr8j9rQTsdJzVTPLodXud3VSqLAlVLdIXxiUR95rr9n8sPG9OklVHBccI6Y uZMQ84WS9IU3saj6Z8uKq8AumCFCzVj6dE9VeLutHdjWZiIq2FGDldOTgGixOqTNcIXM I2I1Duq4NjpHhvW1xWp/dOz6iAmpXPlwjyo+cNeJZDuC8RiIE3HhvC2czCeXwz7v4HIY utx+dASNMTItVvsCS7e/N8p5luC8IhP7uD80Z/II3OON1XglBuQBTxDOvBlqQQPiyJeH MXtYOYhocEAUzLzrySOf+wcNWUQrAYOlDR8ldMlBCU/Kmf//jRoHkpHk9wXoDqMXWQKM WB2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4si10186452plb.402.2019.06.17.04.14.24; Mon, 17 Jun 2019 04:14:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728083AbfFQLON (ORCPT + 99 others); Mon, 17 Jun 2019 07:14:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45246 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbfFQLOK (ORCPT ); Mon, 17 Jun 2019 07:14:10 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A69155D5E6; Mon, 17 Jun 2019 11:14:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1388A5944A; Mon, 17 Jun 2019 11:14:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2D73C16E2D; Mon, 17 Jun 2019 13:14:07 +0200 (CEST) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org (open list:VIRTIO GPU DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/4] drm/virtio: simplify cursor updates Date: Mon, 17 Jun 2019 13:14:05 +0200 Message-Id: <20190617111406.14765-4-kraxel@redhat.com> In-Reply-To: <20190617111406.14765-1-kraxel@redhat.com> References: <20190617111406.14765-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Jun 2019 11:14:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to do the reservation dance, we can just wait on the fence directly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 024c2aa0c929..4b805bf466d3 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -184,7 +184,6 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, struct virtio_gpu_framebuffer *vgfb; struct virtio_gpu_object *bo = NULL; uint32_t handle; - int ret = 0; if (plane->state->crtc) output = drm_crtc_to_virtio_gpu_output(plane->state->crtc); @@ -208,15 +207,9 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, cpu_to_le32(plane->state->crtc_w), cpu_to_le32(plane->state->crtc_h), 0, 0, vgfb->fence); - ret = virtio_gpu_object_reserve(bo, false); - if (!ret) { - reservation_object_add_excl_fence(bo->tbo.resv, - &vgfb->fence->f); - dma_fence_put(&vgfb->fence->f); - vgfb->fence = NULL; - virtio_gpu_object_unreserve(bo); - virtio_gpu_object_wait(bo, false); - } + dma_fence_wait(&vgfb->fence->f, true); + dma_fence_put(&vgfb->fence->f); + vgfb->fence = NULL; } if (plane->state->fb != old_state->fb) { -- 2.18.1