From patchwork Sat Oct 22 07:23:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096027wrr; Sat, 22 Oct 2022 01:04:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mtqOzO4d9/gRZ7Z26sPJPMZlRzSBvfdEDiNQJqVtssQiRbSD3D1vQU/NRcSbfkISQnpa2 X-Received: by 2002:a63:211d:0:b0:44e:f294:8440 with SMTP id h29-20020a63211d000000b0044ef2948440mr19311608pgh.103.1666425846678; Sat, 22 Oct 2022 01:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425846; cv=none; d=google.com; s=arc-20160816; b=tVZ4WPQzGYVMSU+mPCcyo/uLr7eUtOXdkjhOhlcHAljJIn0hhlseaa072rGg2tBhCv 3xMMb50BDic1L9CaVPigHBG5CeNkopNqDAb0F+z84po7/4fcnzRB2AbxYsk2eimImytm /js9yoHeKVq/03RoX2suloc+4LruAJy502n5upwntBq8nroEWTXMxHXVU4DxBNe4LrFv 3Wy8KxOZw9H4ck74jUpQskqHID1EFkEmpwKLQtJ/qHzIvIhRp/XFLJX2cyWbkNsbr78+ VbvudiabVJvyZKfclhs5QnD8VdOFW/8twQOssYeveP17HrgchC587BpytLNtLhpidhoD ZUiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jjgKJHG4vB4Rm3ZerTgQFCggJRja6GbNL/KGS0rRpyU=; b=hpMeje1BlxVVT1jx25WyZm8Xf9gHr1M+DmcG7xC7SL874UmVAR2TPxUfkz+8IKXHxU cfYoKDXJEPCUxK3qZ9Xm3oava09gXb2fCxPXIH9zI9QGWQR1uvdweTwbK7+mrvdLkBK7 FTAV7R1w/e07nwqknp+6XLKlkwDyxfb/6y6FAFIfht/RzHT2tRLRF3QiuPTSpH7+zcRJ B+epdBYHagP20EaAQLPCcCqfCmxq7sFbustT5Ss9ZZSQefbFMkzvRpPrCG17+M/yPo2/ ag1Cp2zeva33O4Nrl/aoxTL1y+Q4tiodTXydtqPIy3f5bCrmlQgbDZ93cc868bhisIUS S+Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aMEgqGMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a170902ec8c00b00177ee2efd41si18840952plg.265.2022.10.22.01.03.53; Sat, 22 Oct 2022 01:04:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aMEgqGMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbiJVIDc (ORCPT + 99 others); Sat, 22 Oct 2022 04:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232457AbiJVHzC (ORCPT ); Sat, 22 Oct 2022 03:55:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 358F14A13E; Sat, 22 Oct 2022 00:48:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ED4A3B82DFC; Sat, 22 Oct 2022 07:47:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BF26C433C1; Sat, 22 Oct 2022 07:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424873; bh=a9QnuAj57d0g4YM0AcqhAV4WtYyzOmeBc0b2HC4WlRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aMEgqGMZUHqaDjRfuljiItxlvLV1c5A4bWwtvQiQRVtp02nQgeZO7YSOz3FzTIAST KbAbdbJMSbHmwUk0CkSIeXyNeL7ElJIEFmx7pOFg22PwGMSDFqUFTC8S8egThCTYpM McCw2nRMtGsfNG90hdX5xJOAp2f9D0XyvijYpuoA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Gerd Hoffmann , Sasha Levin Subject: [PATCH 5.19 309/717] drm/virtio: Fix same-context optimization Date: Sat, 22 Oct 2022 09:23:08 +0200 Message-Id: <20221022072507.258233889@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374148483779316?= X-GMAIL-MSGID: =?utf-8?q?1747374148483779316?= From: Rob Clark [ Upstream commit 3007dc2af6e86ac00b4daf7414142637fdf50bfa ] When VIRTGPU_EXECBUF_RING_IDX is used, we should be considering the timeline that the EB if running on rather than the global driver fence context. Fixes: 85c83ea915ed ("drm/virtio: implement context init: allocate an array of fence contexts") Signed-off-by: Rob Clark Link: http://patchwork.freedesktop.org/patch/msgid/20220812224001.2806463-1-robdclark@gmail.com Signed-off-by: Gerd Hoffmann Signed-off-by: Sasha Levin --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 9b2702116f93..3b1701607aae 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -168,7 +168,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, * array contains any fence from a foreign context. */ ret = 0; - if (!dma_fence_match_context(in_fence, vgdev->fence_drv.context)) + if (!dma_fence_match_context(in_fence, fence_ctx + ring_idx)) ret = dma_fence_wait(in_fence, true); dma_fence_put(in_fence);