Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5829517imd; Wed, 31 Oct 2018 02:42:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5eioP2AP2KEmJYtJufSdV6uwOEDkWkp9ZEp1yCRHYdkLrJcjkR8T0aV5kRnjDNkSkQh9k61 X-Received: by 2002:a62:1896:: with SMTP id 144-v6mr2715228pfy.88.1540978967728; Wed, 31 Oct 2018 02:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540978967; cv=none; d=google.com; s=arc-20160816; b=mWr0/23S7ZIeHlKyo1zqQvf57skyD0mahT1ir+Q/UZrzIUdCq0TPqDBjVFAvOfXv8y MSFEZA0H60J8TEsr0DuRF4tVriE9KcdDMsbUGyolq/bsUWvzWEsg6t5xDQ2azdrPxnZ+ qXBHzHHJt0lcTqq/hjxIkVCIN6/jQyrQOOEK7thExnJ+Lq7ZklQnqpifh3e2VRCMtrtq sbqiMWii7JIEDN5DKo8uczUpEyPvDN06O0QnRtpyWe6vnzzV4OxrNkYniO+6Okzn1nAb cuLDvxvQvcq1cdy1qQNMEaGW1SWCg84C+RWGe2M7C/uOATslXknjdh3RkFWo9NCRjD7P 7clg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=c7M0UgePHpuUxoExjLDO7Ng++06lZMkdKHfd3ukiizY=; b=RE3C+6g4/Rp6XFr4sAk6DSKn4RFoToDVVx9DKoFb0CITDgOyP5O+yaCuXOZv1URDfu CY8f8xfb5HXDgakE9fwBtvcYjdppVpgwSIv1tS1AGOj9bmWKdhCJEkOBZGUbMu352LhT h6tJwAvPfYqtNs08oSJWdfa7LKFGTakJz77+/fw5PhgbaSeXk0eUNLiuKlYTx00sjmOg 694E7PdKpR8AoThLx1GQjfLUSEhNmClasG4o4XlvyTuab+r75j2CSkoLRs/xs9L8xpI0 BNWiQAz66rFDVsf1R/zahsLxf/+T5D6Olx6hqAaowin7lBiqmbM0JiMnsP8FJNpRQTVx c8fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tzxp6BRS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15-v6si26995854pgh.88.2018.10.31.02.42.32; Wed, 31 Oct 2018 02:42:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tzxp6BRS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728119AbeJaShg (ORCPT + 99 others); Wed, 31 Oct 2018 14:37:36 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:46249 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727436AbeJaShg (ORCPT ); Wed, 31 Oct 2018 14:37:36 -0400 Received: by mail-ua1-f68.google.com with SMTP id z8so5635978uap.13 for ; Wed, 31 Oct 2018 02:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c7M0UgePHpuUxoExjLDO7Ng++06lZMkdKHfd3ukiizY=; b=Tzxp6BRSkUosaiQK5pmbni4jsj0r1RiGF5vKU5jNPOThdEuh0arhROKKb0uRV/j5MK X5kRxAVsoFPNS5GbwrpqX0wsIwSX21fTVyG1sT4BDN3Ksq41fOXJwC2Gc8qxsLkztQuq tIQmJSFiRk3Cf8XNILJjEM6m5T+F5G+AFXH7t75SYnQaegEdUSYJfN7+yWt7WUM58t4a tGvvq45a90uFn10cXRkJ8DBVsKK10VRFu1n3uljJfBwX8iVslBfHihEMVj2KQIYts/rd zmpfvneMfAc0tbYpdKXw+NRHreYLj02BxGDFPnx6Hg4bjMZ7RUqNBmsrTh1aeg6wEW+v 5cBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c7M0UgePHpuUxoExjLDO7Ng++06lZMkdKHfd3ukiizY=; b=pys+HfC2vSE10NEPhy2Od1esdSHaAKvUDCz37tfkjA631CWkYb01xLdC0U96WjB/3C cO/10O/UFIqc5cUYfESgWqzJnRUyXj/3v4u8ofz5im9iElC/EBzPTDWvLwH2aEqSOYps crFLcB6WGW/YjzVyBZOkR4hqacDVYBZNYh+Vnp06lXVlr6pEjVLnKWHX4S65m2U8X9tN eRXnzL0vUsYeYDqHt7M1M3RxcO0eZ+1zQ955OcwUz7UjwwxwiNaH1UjDNAoSWctlIKvE ruspGLjO/EVw5KD3coiNIJ1Ry1LpI2/jVrGW2v05X2RddDtqOupI/QmbH1JVAj78hfN/ EGRw== X-Gm-Message-State: AGRZ1gLtuyc82T+dKvmFhCEUIfGdZG6BfrI+yX7rH4lhjy90KyAwrZRe yvCabyGqqQORnKGb73AO+up01pSoe9yww32XN20= X-Received: by 2002:ab0:15a1:: with SMTP id i30mr1027142uae.11.1540978813892; Wed, 31 Oct 2018 02:40:13 -0700 (PDT) MIME-Version: 1.0 References: <20181025183739.9375-1-robert.foss@collabora.com> <20181025183739.9375-4-robert.foss@collabora.com> In-Reply-To: <20181025183739.9375-4-robert.foss@collabora.com> From: Emil Velikov Date: Wed, 31 Oct 2018 09:38:56 +0000 Message-ID: Subject: Re: [PATCH 3/5] drm/virtio: add in-fences support for explicit synchronization To: Robert Foss Cc: David Airlie , Gerd Hoffmann , ML dri-devel , "open list:VIRTIO GPU DRIVER" , "Linux-Kernel@Vger. Kernel. Org" , Rob Herring , Gustavo Padovan , Emil Velikov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On Thu, 25 Oct 2018 at 19:38, Robert Foss wrote: > @@ -124,6 +127,22 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, > if ((exbuf->flags & ~VIRTGPU_EXECBUF_FLAGS)) > return -EINVAL; > > + if (exbuf->flags & VIRTGPU_EXECBUF_FENCE_FD_IN) { > + in_fence = sync_file_get_fence(in_fence_fd); > + if (!in_fence) > + return -EINVAL; > + > + /* > + * Wait if the fence is from a foreign context, or if the fence > + * array contains any fence from a foreign context. > + */ > + if (!dma_fence_match_context(in_fence, vgdev->fence_drv.context)) { > + ret = dma_fence_wait(in_fence, true); > + if (ret) > + return ret; Aren't we missing dma_fence_put() before the return here? With that Reviewed-by: Emil Velikov -Emil