From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 982EBC3F2D2 for ; Tue, 3 Mar 2020 03:05:14 +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 680AA21739 for ; Tue, 3 Mar 2020 03:05:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="E29SyMtm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 680AA21739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B4436E968; Tue, 3 Mar 2020 03:05:14 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 360FA6E968 for ; Tue, 3 Mar 2020 03:05:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LrC5HRT9pQDH1CJtxwluRLYiDnMPHnE/WiXEbHg5Zb1QMnODklWuZkDPhC/mOCeDPyE2PsSi9y5to5gmRiRsbM6SjIn5mnCiNoiZigfgYTPqNAyChiTZN4dHrm7ozqMetNZjOi8TW/dbPysVj1rEM+RyIrmEUCQC1FSs5p4THWTj65ODncPsBzA4nbSlVuicHxeXiM9nbGVT+R/PsrzJE6s70LLcs83q8D9ycVetI1k1ENVnipiYdtQmtpk3uFkpCvoSted2Z2PTWyjv0QeT1bvarNnqVdhrpq723fzPTcwXAvoMBLPOyuwXvalDyZJbKjVFwgNGaMzUcIPGbv/Qjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/BpiKWb1mjOHltw/Y54jM6bpNiwOnozv9NTdn7oriGo=; b=FnqTzX3fGO9wv4RCQe7P9XPlhWfwpTcyxG0cUNePNJGc1TeLwIVvZTXuTfCr6Mhb1ddzInLn28Nt5CkGwfw3qfbJ3iSUQG/YflL9jsjTLsX2UyvJhl2OU/u2MWqBvBZc2tvHcoLW1Thblb8LxtxXumQ+gNoiIgc0XuaQCHsUMdZBTBO7pofasgimyKy8TOR/W3XFxUWpp08kC/LVHgxlZcXIimPn41z2JSoAoALghHEPmnManC64kPgVYlS2xN0tN8rI0SKbEdLiNAae6+QYpEGfC8Py3Mjn+Dnc/3Zp88f8snDvtDwNq7KPzG3u0b864LISwj9/nmyEEKqGT9mcVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/BpiKWb1mjOHltw/Y54jM6bpNiwOnozv9NTdn7oriGo=; b=E29SyMtm4vi2UHxvvJVYVIOkJp24hntK4eu8ko7bnGapMBUr5P03vvHgayBWxQNOP6uSnYxkS7bWofDUH7U41cqDy1Kdx1EeEX3bZz8yDPfTprM86Cpgu4Es3SdpLt0SmqaatEBKSeCluat41QFsA8bF8dWxBgIJ31OY1noUDs8= Received: from MN2PR12MB3376.namprd12.prod.outlook.com (2603:10b6:208:c2::20) by MN2PR12MB4549.namprd12.prod.outlook.com (2603:10b6:208:268::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Tue, 3 Mar 2020 03:05:08 +0000 Received: from MN2PR12MB3376.namprd12.prod.outlook.com ([fe80::61bc:e52b:bdcf:4f9b]) by MN2PR12MB3376.namprd12.prod.outlook.com ([fe80::61bc:e52b:bdcf:4f9b%4]) with mapi id 15.20.2772.019; Tue, 3 Mar 2020 03:05:08 +0000 From: "He, Jacob" To: "amd-gfx@lists.freedesktop.org" Subject: RE: [PATCH] drm/amdgpu: Update SPM_VMID with the job's vmid when application reserves the vmid Thread-Topic: [PATCH] drm/amdgpu: Update SPM_VMID with the job's vmid when application reserves the vmid Thread-Index: AQHV8FRyok5cRxATf0SYBiJ9i8QZh6g2MFGq Date: Tue, 3 Mar 2020 03:05:08 +0000 Message-ID: References: <20200302053529.5736-1-jacob.he@amd.com> In-Reply-To: <20200302053529.5736-1-jacob.he@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Enabled=True; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SetDate=2020-03-03T03:04:43.4736649Z; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=0; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jacob.He@amd.com; x-originating-ip: [180.167.199.185] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c9cff641-7dfc-4397-ae74-08d7bf1fae4f x-ms-traffictypediagnostic: MN2PR12MB4549: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 03319F6FEF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(346002)(366004)(39860400002)(376002)(199004)(189003)(26005)(9686003)(81166006)(81156014)(186003)(478600001)(52536014)(5660300002)(316002)(71200400001)(55016002)(8676002)(64756008)(2906002)(6916009)(66446008)(53546011)(76116006)(91956017)(66476007)(6506007)(8936002)(66946007)(66556008)(86362001)(15650500001)(7696005)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB4549; H:MN2PR12MB3376.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YvqPTd62fCZcr8wSH1DgM/XSaFOFiYDM5YQKg8PikqmsQORPGYWK+0L7FKsz0AmmAWmnR2EAFgvM/J879Dyz6UORA+WAy/BWJ2Haf0FpjI513IK3pLOaVNNbPFJl5YIe0n5oKbtNwFLAxnchqz3u7VPE6ZjmEyNiW+8mftNgf745jJ6A4WJnKCUyjPlvB0fmrJXDP1U+e/WXlXiS08zyN9tDAikhr5COu6Nvfw5UIzUYtF7d0PC3VKO6ZPUjA/4rO2q9J+2/KGQMc6kZDskL2kGuVL+53FN5fUjWhP9RKNq+MX5N5nyU+4Dy4LKk/2tgdJ2qLayerC3wRbEWgW5rwFiy++pMn4lYDE7zXkpVtqMX1c3Z5SY+qp5ZM7iLXgyjsP9Kct6Ods7bOKDgO+G+UD72fvLvgcnmi9cV27lOXVTL/AKAjEhOPoW2M8b+TrGJ x-ms-exchange-antispam-messagedata: zZDLEsmu6DX+cINU1vW0X6lk7zHPekdt/CvNJ5mccgDIFBMKCYFUMg9g2ldprWAK3UsbwW4PfVCuwW0jwyH15+fbuxocJdTF8pRISMurbpMoAb9MCBsGzuTPe8QsLcKrcqLUh5kGwjYywLpvrs8pSA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9cff641-7dfc-4397-ae74-08d7bf1fae4f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2020 03:05:08.5173 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nu6VOWfa/7Rq3ojvVbpsA12vdHzSV3HSlfLTU+txEjXIZcqhWZ8TEkmqrVQtx5l2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4549 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1527433101==" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --===============1527433101== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN2PR12MB33763713725FCEDF5E4B82C19BE40MN2PR12MB3376namp_" --_000_MN2PR12MB33763713725FCEDF5E4B82C19BE40MN2PR12MB3376namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - Internal Distribution Only] Could anyone help to review the patch? Thanks Jacob ________________________________ From: He, Jacob Sent: Monday, March 2, 2020 1:35:29 PM To: amd-gfx@lists.freedesktop.org Cc: He, Jacob Subject: [PATCH] drm/amdgpu: Update SPM_VMID with the job's vmid when appli= cation reserves the vmid SPM access the video memory according to SPM_VMID. It should be updated with the job's vmid right before the job is scheduled. SPM_VMID is a global resource Change-Id: Id3881908960398f87e7c95026a54ff83ff826700 Signed-off-by: Jacob He --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/a= mdgpu/amdgpu_vm.c index c00696f3017e..c761d3a0b6e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1080,8 +1080,12 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct= amdgpu_job *job, struct dma_fence *fence =3D NULL; bool pasid_mapping_needed =3D false; unsigned patch_offset =3D 0; + bool update_spm_vmid_needed =3D (job->vm && (job->vm->reserved_vmid= [vmhub] !=3D NULL)); int r; + if (update_spm_vmid_needed && adev->gfx.rlc.funcs->update_spm_vmid) + adev->gfx.rlc.funcs->update_spm_vmid(adev, job->vmid); + if (amdgpu_vmid_had_gpu_reset(adev, id)) { gds_switch_needed =3D true; vm_flush_needed =3D true; -- 2.17.1 --_000_MN2PR12MB33763713725FCEDF5E4B82C19BE40MN2PR12MB3376namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - Internal Distribution Only]


Could anyone help to review the patch?

 

Thanks

Jacob

 


From: He, Jacob <Jacob.H= e@amd.com>
Sent: Monday, March 2, 2020 1:35:29 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org&= gt;
Cc: He, Jacob <Jacob.He@amd.com>
Subject: [PATCH] drm/amdgpu: Update SPM_VMID with the job's vmid whe= n application reserves the vmid
 
SPM access the video memory according to SPM_VMID.= It should be updated
with the job's vmid right before the job is scheduled. SPM_VMID is a
global resource

Change-Id: Id3881908960398f87e7c95026a54ff83ff826700
Signed-off-by: Jacob He <jacob.he@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/a= mdgpu/amdgpu_vm.c
index c00696f3017e..c761d3a0b6e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1080,8 +1080,12 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, st= ruct amdgpu_job *job,
         struct dma_fence *fence = =3D NULL;
         bool pasid_mapping_needed = =3D false;
         unsigned patch_offset =3D = 0;
+       bool update_spm_vmid_needed =3D (= job->vm && (job->vm->reserved_vmid[vmhub] !=3D NULL));
         int r;
 
+       if (update_spm_vmid_needed &&= amp; adev->gfx.rlc.funcs->update_spm_vmid)
+           &nbs= p;   adev->gfx.rlc.funcs->update_spm_vmid(adev, job->vmi= d);
+
         if (amdgpu_vmid_had_gpu_re= set(adev, id)) {
            &nb= sp;    gds_switch_needed =3D true;
            &nb= sp;    vm_flush_needed =3D true;
--
2.17.1

--_000_MN2PR12MB33763713725FCEDF5E4B82C19BE40MN2PR12MB3376namp_-- --===============1527433101== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx --===============1527433101==--