From patchwork Thu Sep 9 01:37:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 12482163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0445C433F5 for ; Thu, 9 Sep 2021 01:37:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D1C861167 for ; Thu, 9 Sep 2021 01:37:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7D1C861167 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 987DC6E417; Thu, 9 Sep 2021 01:37:28 +0000 (UTC) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47A076E415 for ; Thu, 9 Sep 2021 01:37:26 +0000 (UTC) Received: by mail-pj1-x1033.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso255578pjh.5 for ; Wed, 08 Sep 2021 18:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P6h/AzjJX8XOg/F/r/wG18RWpAzgwfTHDR+lZB1mjt0=; b=DE/wHSL6/AVCA5fpYOhiKO1xu5/0n0I3P8R/W6Ur9yiWh6QMYRTFF9D+8jWIKcyau0 dhNTDMuNsRcGxYChG8A0X836tL6+j1lsWbJ/c04V3iNLQ+wgRXizSwnCw7QjSWdXKQUR 7FzL80JwH5TstwYJV01Gl0I7vD2N+GWULxr00= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P6h/AzjJX8XOg/F/r/wG18RWpAzgwfTHDR+lZB1mjt0=; b=DsAx7NZKNorkfn0tQadcveZyARrim6jdnz8xq+1Od9f4n8AdXVy1oXIPS8+Z9BGhCj G/+mnm4Y326mCPP83B3ySviHot3rVixxoUUzF2RocUHsCT4j0vjhoklU6Cm04itkOdr3 se3VPZ/2PISNSIeZDQtVDOmU7G/aT7SrJscCpajimxhKiBdXBVoNqZ7YiI02JUvs5JU9 dJVuCHE+OiJR8CrNswcAG1GSuNnxSbQyT+E3Zm4mXoWRLqLV0aQ0knHPJ4/zd1/u0N3x BKLM8iUdKA3b22p/8zbMmcx+BrH8qg2PMkQP22R9n6owuovBHa4vuZCGaiM/PMCCmr3/ uWaw== X-Gm-Message-State: AOAM531fHXvTkpB2cRQYPpwOzNHyFixd2+Jhi8b80u6CsG3BuUig5W4t /PpEFwS624ERjhfqQwu7A6sJ6gjmcnltwfrK X-Google-Smtp-Source: ABdhPJwKUx3RgHVS8F2A+LbGHMiRlMIwbS1D5DKyEIkP2c7vHU0XI2UvqUn2jir2pdbDQ8Pd1B86XA== X-Received: by 2002:a17:902:e302:b0:138:f4e3:d010 with SMTP id q2-20020a170902e30200b00138f4e3d010mr534053plc.33.1631151445717; Wed, 08 Sep 2021 18:37:25 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:b3e5:2f81:d686:bc91]) by smtp.gmail.com with ESMTPSA id h9sm142488pjg.9.2021.09.08.18.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 18:37:25 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org, virtio-dev@lists.oasis-open.org Cc: kraxel@redhat.com Subject: [PATCH v1 06/12] drm/virtio: implement context init: track {ring_idx, emit_fence_info} in virtio_gpu_fence Date: Wed, 8 Sep 2021 18:37:11 -0700 Message-Id: <20210909013717.861-7-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210909013717.861-1-gurchetansingh@chromium.org> References: <20210909013717.861-1-gurchetansingh@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Each fence should be associated with a [fence ID, fence_context, seqno]. The seqno number is just the fence id. To get the fence context, we add the ring_idx to the 3D context's base_fence_ctx. The ring_idx is between 0 and 31, inclusive. Each 3D context will have it's own base_fence_ctx. The ring_idx will be emitted to host userspace, when emit_fence_info is true. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 9996abf60e3a..401aec1a5efb 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -139,7 +139,9 @@ struct virtio_gpu_fence_driver { struct virtio_gpu_fence { struct dma_fence f; + uint32_t ring_idx; uint64_t fence_id; + bool emit_fence_info; struct virtio_gpu_fence_driver *drv; struct list_head node; };