From patchwork Thu Nov 19 01:08:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11916303 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E81B8C5519F for ; Thu, 19 Nov 2020 01:08:16 +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 3CCE022260 for ; Thu, 19 Nov 2020 01:08:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Hy2clGNt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CCE022260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A4D289FCA; Thu, 19 Nov 2020 01:08:15 +0000 (UTC) Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7293F89FCA for ; Thu, 19 Nov 2020 01:08:13 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id 62so2648656pgg.12 for ; Wed, 18 Nov 2020 17:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pTYuHQ3iIWCra003R2Aqiup8jYhFP+fKxLhQWTWFh1U=; b=Hy2clGNtH2ZCn3+ANSf9qi0Z+PyrTBSryZdL7Vhwru62yRoc8EHzXp9pROMzfdadH4 ZCgppVT1D6Dv5wXJ4IgFBcOQzKRmmM8mSPP9mCrH+SB9ptCUS6ZWqZwAY7BPOJp45JIW +6eTxxWJV3NcTOC1Np2bbNbFGXCjQj7yQmNwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pTYuHQ3iIWCra003R2Aqiup8jYhFP+fKxLhQWTWFh1U=; b=UgpJnqRZBb2i265bV11bgfIeua03e3fsEGGIECIjLSJ3yI9INvn3APwXiw3JGAy0HU chLUExz3Ivy++WJjjErhnaFn0W98Ti+2M8BGEFCYSFMNJot3b6ptuwi0IPuu151hi8FQ K9yEPxpbd/rWrP+0B/fBmJKVzhbna5ltM/rRt8a5oKPHhuGteJqu2R/U+uWcs/DjO2Jl JKKd/R6gMqj7yFFYZ6Zxq5WtNtvCPX2wiQRbUd5EB/vhbOq7xBgSruWqf6wJXGDHy4kC X1oy1/+bXVdsnInuU4rttjpLGIrpcLCldIociKLX8m9ZNnn5jsFmsCDkBEYN7Q6NA0Jz H2Nw== X-Gm-Message-State: AOAM5301QIOWxVadRqZ3TZaaJM8VWcqpZLn67NQrmj4IhR+j40e95w+y FmGlqiHrzUAGy9/JgHJh5iJju0BjNpTulA== X-Google-Smtp-Source: ABdhPJylKuCNauCFz5izUTGz50jmK8H6K0cDsERs5PPovHhpJMCoAr3vGMx1Ke16wFDpTt25nSASzQ== X-Received: by 2002:a63:f64c:: with SMTP id u12mr11273040pgj.325.1605748092776; Wed, 18 Nov 2020 17:08:12 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:5265:f3ff:fe2d:4d58]) by smtp.gmail.com with ESMTPSA id m8sm24188574pgg.1.2020.11.18.17.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:08:12 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm/virtio: suffix create blob call with _ioctl like any ioctl Date: Wed, 18 Nov 2020 17:08:05 -0800 Message-Id: <20201119010809.528-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.26.2 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: , Cc: kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Anthoine Bourgeois For coherency, all ioctls are suffixed Signed-off-by: Anthoine Bourgeois --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 5417f365d1a3..23eb6d772e40 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -591,8 +591,9 @@ static int verify_blob(struct virtio_gpu_device *vgdev, return 0; } -static int virtio_gpu_resource_create_blob(struct drm_device *dev, - void *data, struct drm_file *file) +static int virtio_gpu_resource_create_blob_ioctl(struct drm_device *dev, + void *data, + struct drm_file *file) { int ret = 0; uint32_t handle = 0; @@ -696,6 +697,6 @@ struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS] = { DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_RESOURCE_CREATE_BLOB, - virtio_gpu_resource_create_blob, + virtio_gpu_resource_create_blob_ioctl, DRM_RENDER_ALLOW), }; From patchwork Thu Nov 19 01:08:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11916305 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 51989C63697 for ; Thu, 19 Nov 2020 01:08:21 +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 CFBFA22260 for ; Thu, 19 Nov 2020 01:08:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="S91Naq5c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFBFA22260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2720E89FD1; Thu, 19 Nov 2020 01:08:18 +0000 (UTC) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 876FA89FCA for ; Thu, 19 Nov 2020 01:08:14 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id v12so2795591pfm.13 for ; Wed, 18 Nov 2020 17:08:14 -0800 (PST) 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=aXyaxqpuXOCrWcF5Z4oG3lL2Xp82TSlm8ifpPTO/aow=; b=S91Naq5c2eriZiWSnHIiwuQ2qkFI0P0kqZIAyFYD91vrzhZJYkkGOiaxkKLHpI8L7j LXzhYLj/xKXLV+eCuuaw6Uc87rhuuIEgg5ecBx+xzpBEZhGFVoxz0liqcg+LALJB6Rli eVeX6bRFotSFTF+KkzMZMOd8iwkTkg2UYyk8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aXyaxqpuXOCrWcF5Z4oG3lL2Xp82TSlm8ifpPTO/aow=; b=gqh00RrvdfxviM+gxreHiwuRCoqlUI0IOmyh0y84YFsAwosH/yFfl5/g0FlCoVIhvH /J8TjioG5ZCXJwmw14vzBorxB7XhfC1FHCFXsGtHX3CW7jVgRmaqGEAcrmpcC+RaVpi8 h9oby3Wi1Et30eBvjJ6Id6gscALBvYLMR54vZHWcV/j9Awi4oRlb7cfEM2VEz+0RC9t4 6LnDDNyOW8UM/P4uXO+p8heL+s6r2N9LLjjbsqV6V1bv3sM5vm4vzqgs+2CsKDaQBTp4 IgJHRBB0i4kPpbv1CLho4P+Sp7sF64sfcfTU4vFkWfPEX8DC3VrTcUT4H6JSAHmQ3XzU jA9A== X-Gm-Message-State: AOAM531+iUrlPIaRt1w1Yhbb/RGPJEeG8zDFc41dGLnTaWVlwsslacXx AJqXx7wrKGnMJYe0Ee3B8MLHKpYPOC7qTw== X-Google-Smtp-Source: ABdhPJyYySS3j25q047oIkT28lbxFl+anJQyA9gKhPdHcAqXflWu+WJsPT+XSJ130LL8t9sUxwWkcA== X-Received: by 2002:a63:1514:: with SMTP id v20mr11088613pgl.203.1605748093896; Wed, 18 Nov 2020 17:08:13 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:5265:f3ff:fe2d:4d58]) by smtp.gmail.com with ESMTPSA id m8sm24188574pgg.1.2020.11.18.17.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:08:13 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/5] drm/virtio: fix a file name comment reference Date: Wed, 18 Nov 2020 17:08:06 -0800 Message-Id: <20201119010809.528-2-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201119010809.528-1-gurchetansingh@chromium.org> References: <20201119010809.528-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: , Cc: kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Anthoine Bourgeois Easier to find where declarations are implemented. Signed-off-by: Anthoine Bourgeois --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 3c0e17212c33..c94052376d18 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -257,7 +257,7 @@ struct virtio_gpu_fpriv { struct mutex context_lock; }; -/* virtio_ioctl.c */ +/* virtgpu_ioctl.c */ #define DRM_VIRTIO_NUM_IOCTLS 11 extern struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS]; void virtio_gpu_create_context(struct drm_device *dev, struct drm_file *file); From patchwork Thu Nov 19 01:08:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11916307 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 127D2C5519F for ; Thu, 19 Nov 2020 01:08:24 +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 92B6E22260 for ; Thu, 19 Nov 2020 01:08:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SepqZCev" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92B6E22260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F53489FD4; Thu, 19 Nov 2020 01:08:18 +0000 (UTC) Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id A37E289FD1 for ; Thu, 19 Nov 2020 01:08:15 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id w4so2641501pgg.13 for ; Wed, 18 Nov 2020 17:08:15 -0800 (PST) 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=RtP9Z/a6k591s0xJ+tIM9GI8+9vDDzTmaUr2O3GHnLg=; b=SepqZCevI0hJA+FCmGjNnm7F0YloFodCXmyHJz9wwdDgInabW2BmgDeIoGgkvvqyli VbV8ycMpgZHo6vKS3JQVfsXaZHEW0pdBkbelc8jbFbARpJHrCznGIOwRKK+DIgaRyvnn BxyJ5DkW8cGH9yTITdYjuieJ+GYuPm/5QU85M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RtP9Z/a6k591s0xJ+tIM9GI8+9vDDzTmaUr2O3GHnLg=; b=FxRFz5ukAM5DQUk/U7SBnQpkhFDsMDKpGSGEdpjgLHkr7liU0DDyS7C7fWMkp8SjnX GfICRroVLehZsbBGco1Sr9RYHAbdjaXmGqgMfcMiGSfMcB/BVNKxoVj4imb1p3IUXyyU PeIuqjVziMk2HLeHF+bscTqUAG70Vsi+KxkC3nm0tHBb4B6vVN5Sv1R136u6uIHC76mU b9z1rOalEJseylKTaa/AHxcHNxrTzbFL/n1cDWs2SiLNirtA8KtqvBOF3O6uEu8kAR7d 01aaNRJgoq4lNLCj1jx0sD4KxHvufT247tV2uF1Gg/tZpUsVrsWcFpptwUatfkXKLSO5 qWCA== X-Gm-Message-State: AOAM5300jLK4zYobZus5y8yV13jNeXQ40bwDMBO8Oqceuyu0zRsw9pTe 1LW9nPiqbvPicsHUo7KcKAHf4totuEbU6g== X-Google-Smtp-Source: ABdhPJz92gJXSMl5buhUTs8U5WGZeRC+wMjZ8oYQ6HLqi7lpbqlKy1jfGiPWvE+2pUJPMeWtS8plHg== X-Received: by 2002:a63:171b:: with SMTP id x27mr11099060pgl.70.1605748095127; Wed, 18 Nov 2020 17:08:15 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:5265:f3ff:fe2d:4d58]) by smtp.gmail.com with ESMTPSA id m8sm24188574pgg.1.2020.11.18.17.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:08:14 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] virtio-gpu api: Add a comment on VIRTIO_GPU_SHM_ID_HOST_VISIBLE Date: Wed, 18 Nov 2020 17:08:07 -0800 Message-Id: <20201119010809.528-3-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201119010809.528-1-gurchetansingh@chromium.org> References: <20201119010809.528-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: , Cc: kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Anthoine Bourgeois This provides a description of how the kernel driver uses the shmid to determine capabilities. Signed-off-by: Anthoine Bourgeois --- include/uapi/linux/virtio_gpu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index 0ec6b610402c..97523a95781d 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux/virtio_gpu.h @@ -115,6 +115,10 @@ enum virtio_gpu_ctrl_type { enum virtio_gpu_shm_id { VIRTIO_GPU_SHM_ID_UNDEFINED = 0, + /* + * VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB + * VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB + */ VIRTIO_GPU_SHM_ID_HOST_VISIBLE = 1 }; From patchwork Thu Nov 19 01:08:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11916311 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 74B2BC5519F for ; Thu, 19 Nov 2020 01:08:28 +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 042E522260 for ; Thu, 19 Nov 2020 01:08:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gfQyt5kb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 042E522260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E6036E4EA; Thu, 19 Nov 2020 01:08:23 +0000 (UTC) Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id C670A6E4EA for ; Thu, 19 Nov 2020 01:08:19 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id b63so2799472pfg.12 for ; Wed, 18 Nov 2020 17:08:19 -0800 (PST) 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=vFk5BmQRRvOORZDdtDt946VaDPG1yMYcu2bc7wF2+xc=; b=gfQyt5kbhhiaHuFCFVunnb4GVFvoxM0h0xtO+YFKB8QY60IUqWW1w04HqevjxO0j9o G+Gdgsnck7lZ2GzdrA7mpy3JYIuE8KQKYbI4OeKj0WvkxQ78W6K6Zo9hSvbQeDV5MSHK K8asQ4652TdbdICp9IhirSbxXkSlhdI3BhNmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vFk5BmQRRvOORZDdtDt946VaDPG1yMYcu2bc7wF2+xc=; b=NSxCoJtHgOIuSOOaEMQuy2NXDSjw3OVm50aocFDZ7TymrYxxyyuPsGVZvLEYt9QsgP so6pV+c1exw0/luh+dZiwZOKT5/rDvXGqOq8mYQcYWLRTAl8pybt55R9NxzhvrX2yyM1 bRySyr+bXRZusJMZGfkoNTe5ntIyD0esnv7j6p/IFoTGEXpREzeokekpDK9Bw8xLd0/N Mb49I8Bx4/cbXJebTQmkFOJO6P5JNf1Q/IlS0saXcfWj/Z/vM03qoJ8bJg493sHvoTDl iFghO9d1MlL3FZ+gyevU7QCVI1kSIeoUisq4x1KCS+eLt1tJ/rMPekL0khGqeVsC33Jk M81g== X-Gm-Message-State: AOAM5301qqcUYadKECdqIuVekWAg2jyU4rKFkJxBzQqq10p3crnwNA2O z6TYnwPn983Xp4tq+NOzz7z0/jK5tlz/0A== X-Google-Smtp-Source: ABdhPJxdTVQyZG2WqIb0+W8/aZ+/aDnuP5iqH2M+Xntzd4UAkHOfYtWb3Jwulgsn9b/1L4/KI+X5mA== X-Received: by 2002:a63:2ad0:: with SMTP id q199mr10962861pgq.257.1605748096218; Wed, 18 Nov 2020 17:08:16 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:5265:f3ff:fe2d:4d58]) by smtp.gmail.com with ESMTPSA id m8sm24188574pgg.1.2020.11.18.17.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:08:15 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] drm/virtio: use fence_id when processing fences Date: Wed, 18 Nov 2020 17:08:08 -0800 Message-Id: <20201119010809.528-4-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201119010809.528-1-gurchetansingh@chromium.org> References: <20201119010809.528-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: , Cc: kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently, the fence ID, which can be used to identify a virtgpu fence, is the same as the fence sequence number. Let's use the fence_id name to clearly signal this. Signed-off-by: Gurchetan Singh Reviewed-by: Anthoine Bourgeois --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- drivers/gpu/drm/virtio/virtgpu_fence.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index c94052376d18..7c7967a2eb84 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -420,7 +420,7 @@ void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev, struct virtio_gpu_ctrl_hdr *cmd_hdr, struct virtio_gpu_fence *fence); void virtio_gpu_fence_event_process(struct virtio_gpu_device *vdev, - u64 last_seq); + u64 fence_id); /* virtgpu_object.c */ void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo); diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 5b2a4146c5bd..2fe9c7ebcbd4 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -112,16 +112,16 @@ void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev, } void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev, - u64 last_seq) + u64 fence_id) { struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv; struct virtio_gpu_fence *fence, *tmp; unsigned long irq_flags; spin_lock_irqsave(&drv->lock, irq_flags); - atomic64_set(&vgdev->fence_drv.last_seq, last_seq); + atomic64_set(&vgdev->fence_drv.last_seq, fence_id); list_for_each_entry_safe(fence, tmp, &drv->fences, node) { - if (last_seq < fence->f.seqno) + if (fence_id < fence->f.seqno) continue; dma_fence_signal_locked(&fence->f); list_del(&fence->node); From patchwork Thu Nov 19 01:08:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11916309 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 809DDC5519F for ; Thu, 19 Nov 2020 01:08:26 +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 0F8B722260 for ; Thu, 19 Nov 2020 01:08:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UnrCsOjX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F8B722260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E6346E4EC; Thu, 19 Nov 2020 01:08:23 +0000 (UTC) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC5D089FD1 for ; Thu, 19 Nov 2020 01:08:17 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id bj5so1201004plb.4 for ; Wed, 18 Nov 2020 17:08:17 -0800 (PST) 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=SHx4ytUijlNq7bxaYPhHyX5eNG3Jmb5vUd+7wKMszi8=; b=UnrCsOjXt91X3uDxE2bRnn51Qylw5aPu+fChwRoCk1rpN842aYn6klPrDJBgABMitU H/T04lcgGwxLqWWo2ef72rgGDnZtYF7+qcE1NveTW1NmbsBwPrLwsx6Gx0v94NvVxXde Ov1WISNyhdPWD6KelyH4YahXrFqXUhIxmsGtM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SHx4ytUijlNq7bxaYPhHyX5eNG3Jmb5vUd+7wKMszi8=; b=a8TN0f9kyA1I6ljENOyHwdVzMdM2LCVIBwy1GdhebEvR77xKOERBIZdUqgWpv+IF1k YIR24LZWQ2b6UeE9Zg9r+3EFcNIoWn1QYh2+ZT4kBmZJGIEmTt1w4dLNLR+z27OmhqbW COhcuDihx1Q2xGh6sI7UNSkBqNpxzl0tGFQScj/+rSKbJ3mbjdfAtTsbct05wgZJMvl8 KgQVpX3OHOzZUTGTjx4MuNqdwXLivq+dHvatZvmjPblTc/68kL8qAooas5BpMV9Gn1xt OI8cEHFdLEkv25BFMCFzum81sJ5lwJt096SX7Q6DDkDebY+wbqz2LIAJ6GBKW5Qmg1Y1 Ystw== X-Gm-Message-State: AOAM533BhX/M9ja+C/zaoFSmhbT1PPZAWUD0pylQaNp4Jv2ku9GdwfSl kQg0pdXPyKyMAcShtmviqTMVWNEyUokuEA== X-Google-Smtp-Source: ABdhPJxeUOSTbMSMeNsGHJbmrgvEND8QM/55Cluu52fZKa312LE/iwk222afJ6TLweY+sKYELFljUA== X-Received: by 2002:a17:902:a702:b029:d8:c562:14dc with SMTP id w2-20020a170902a702b02900d8c56214dcmr6838091plq.40.1605748097308; Wed, 18 Nov 2020 17:08:17 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:5265:f3ff:fe2d:4d58]) by smtp.gmail.com with ESMTPSA id m8sm24188574pgg.1.2020.11.18.17.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 17:08:16 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm/virtio: rename sync_seq and last_seq Date: Wed, 18 Nov 2020 17:08:09 -0800 Message-Id: <20201119010809.528-5-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201119010809.528-1-gurchetansingh@chromium.org> References: <20201119010809.528-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: , Cc: kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To be clearer about our intentions to associate sequence numbers and fence IDs, let's rename these variables. Signed-off-by: Gurchetan Singh Reviewed-by: Anthoine Bourgeois --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- drivers/gpu/drm/virtio/virtgpu_fence.c | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c index f336a8fa6666..5fefc88d47e4 100644 --- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c +++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c @@ -67,8 +67,8 @@ virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; seq_printf(m, "fence %llu %lld\n", - (u64)atomic64_read(&vgdev->fence_drv.last_seq), - vgdev->fence_drv.sync_seq); + (u64)atomic64_read(&vgdev->fence_drv.last_fence_id), + vgdev->fence_drv.current_fence_id); return 0; } diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 7c7967a2eb84..6a232553c99b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -127,8 +127,8 @@ typedef void (*virtio_gpu_resp_cb)(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf); struct virtio_gpu_fence_driver { - atomic64_t last_seq; - uint64_t sync_seq; + atomic64_t last_fence_id; + uint64_t current_fence_id; uint64_t context; struct list_head fences; spinlock_t lock; diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 2fe9c7ebcbd4..728ca36f6327 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -48,7 +48,7 @@ static bool virtio_fence_signaled(struct dma_fence *f) /* leaked fence outside driver before completing * initialization with virtio_gpu_fence_emit */ return false; - if (atomic64_read(&fence->drv->last_seq) >= fence->f.seqno) + if (atomic64_read(&fence->drv->last_fence_id) >= fence->f.seqno) return true; return false; } @@ -62,7 +62,8 @@ static void virtio_timeline_value_str(struct dma_fence *f, char *str, int size) { struct virtio_gpu_fence *fence = to_virtio_fence(f); - snprintf(str, size, "%llu", (u64)atomic64_read(&fence->drv->last_seq)); + snprintf(str, size, "%llu", + (u64)atomic64_read(&fence->drv->last_fence_id)); } static const struct dma_fence_ops virtio_fence_ops = { @@ -100,7 +101,7 @@ void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev, unsigned long irq_flags; spin_lock_irqsave(&drv->lock, irq_flags); - fence->f.seqno = ++drv->sync_seq; + fence->f.seqno = ++drv->current_fence_id; dma_fence_get(&fence->f); list_add_tail(&fence->node, &drv->fences); spin_unlock_irqrestore(&drv->lock, irq_flags); @@ -119,7 +120,7 @@ void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev, unsigned long irq_flags; spin_lock_irqsave(&drv->lock, irq_flags); - atomic64_set(&vgdev->fence_drv.last_seq, fence_id); + atomic64_set(&vgdev->fence_drv.last_fence_id, fence_id); list_for_each_entry_safe(fence, tmp, &drv->fences, node) { if (fence_id < fence->f.seqno) continue;