From patchwork Wed Oct 19 08:27:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4787 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp215957wrs; Wed, 19 Oct 2022 02:17:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7T2QuuN2ACf+zSzrKME80y+IPg9RLge/E30kkwdwTaeNZbhcevQg0SWUAv/dtswVqA8n2t X-Received: by 2002:a17:907:868c:b0:78d:f741:7fa7 with SMTP id qa12-20020a170907868c00b0078df7417fa7mr5892692ejc.648.1666171029481; Wed, 19 Oct 2022 02:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666171029; cv=none; d=google.com; s=arc-20160816; b=goXRzTVBG+vB+WjIM7wMQMiMkLu+0zDRiXoeIYdtu+/ewbq78Lo2xJ+hwlsF0x22HF 1UeM9KErisovkzaXuaPcghxYrWrTjD6dlGH1iUXxe8VdhHiT1hXsFeK8eD+vsw8WSk+d 6l55ObK6BEHM4U4L2zMt+E89N0Q0jLgpF1x5fY120gSkKCc9IPeOROrVFdbRyuTGzCT9 JCa4TLUTublmX34AJq8W7XUqzHDAVWGw5JnBO57m95z1uYRUGo7jp8G1p0jpK0be/IOe h3SUvUPlRxfqFzbGYbrkj1FDM1O4IwqaSo+QMQ2MscgP+FbTC6G0jijGwJdRTqy7I1fK xAdQ== 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=ugulrRUODgOhRoRwV6LJdk62PA//oWBVNaPxtg87Z8+GCp32CH9bFmK+5/gyoXZsH5 coFw2QQ/W7Yo7keoTLLDdOFa5+jcVgGoziCTAagRUj3dW9xIggDm9RMqUOnG2CuD4pfV sdrGf5Sv/1pZseQkM0MgnLFQF43AH0IldyxdsTU/TKn/ogey+2WRG0GCjEkwXZXIC+B2 MVF4foqgpnCLk+MJsN+GIzaxL0uw0vYHWjZylFUwEwNPB02xBjZEagvYexhxjeZa88T9 6FbHOFE5M65+iUVZQPGBZ4Cy4nUItO6xIV6ZKzbo0Wz4nm4mn0blOBI7VQcIzV220JEk zDEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lunRCWzL; 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 f10-20020a0564021e8a00b0045d29efdb5esi14519846edf.381.2022.10.19.02.16.44; Wed, 19 Oct 2022 02:17:09 -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=lunRCWzL; 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 S233085AbiJSJQD (ORCPT + 99 others); Wed, 19 Oct 2022 05:16:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232707AbiJSJNC (ORCPT ); Wed, 19 Oct 2022 05:13:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 503A4CA8A5; Wed, 19 Oct 2022 02:03:19 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7D3AE617F1; Wed, 19 Oct 2022 08:54:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95FC2C433C1; Wed, 19 Oct 2022 08:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169676; bh=a9QnuAj57d0g4YM0AcqhAV4WtYyzOmeBc0b2HC4WlRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lunRCWzLYVB2vT0runN1HkG0XOkFa7cLhfkdN3VT7ZkNrNjPEecNhuWMEcdjXcHwt eweu3aPiYJBrrJ3lbnaubLu+iGth2Z3WN+gchiOfLpfsz1R377lj1HUhd45h4BzXBt xK3eeaJzHDluXM2v1DJtd/WPllGdmZIKTzxWjXFc= 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 6.0 366/862] drm/virtio: Fix same-context optimization Date: Wed, 19 Oct 2022 10:27:33 +0200 Message-Id: <20221019083306.183088706@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747106953388418080?= X-GMAIL-MSGID: =?utf-8?q?1747106953388418080?= 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);