Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp170332rdb; Tue, 31 Oct 2023 04:26:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/ggMxRbd86HUXKpeXel4+Su3LUrUKXlqxJJ2oyUeFEu8XkOG8Bbrydk0GdjkAVNs2lK2I X-Received: by 2002:a05:6870:12c3:b0:1e9:da6f:a161 with SMTP id 3-20020a05687012c300b001e9da6fa161mr12670700oam.3.1698751568717; Tue, 31 Oct 2023 04:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698751568; cv=none; d=google.com; s=arc-20160816; b=c64czVw7vGqYfSZdMy7SKLKbyMHif/RrriFmzHDLc3QAk0iiF7C+i174mr0ZNSxnbl Rfr6fhyzrzf7m5jmG5DICLL8GHivG+tnO4g7hwCAzzBDclD/2PXwwZ3cScjTqN3RPq4Y Erwkp34isf8ok5v9fc6tcs9X1yZmP2EYYWxQg9sOYq5qMBj7oS3AN2xJfijZX+0nNjIr 8mjOIyQGMdrp7SXD9lRn1MdSU/NM1a6AWEqNgEqoqSwJ0wea04qlPlpzrIhtlQC54VBd ns4Tl1nSEAZENi6G9kYzfJDriuyI3JSsOs1sjMQUn5o9uzLH0voFCxJcaTEQv9h3b3Dk oxYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:organization:references:in-reply-to:date :cc:to:from:subject:message-id:dkim-signature; bh=CZ7/qD/Tv5Z4oH0wiTqiipmN3iPWBat7xPpjhvQgcJA=; fh=htvIroZrbKeU2x4AOko0NW3x9xa19Yggb7QfVOG/ARs=; b=aCbkkXVbEvdmpcHtOoVZCUVcvpEFZ+GnSWAIFnIvI4LjIiTMEgIt3pB50Z2cUPP4cC opryei/wOSCyskZG9N/Ue1kIkXXYcLe6e0/SirAg3gqda7zXnP8jFRaSyPXRhBhEjNuK IZ/9N9mYYoBMenRO7IBiVmlouQiEbVO5AvlNa2m6lCHnxoCXn2RS/zyspanF0A4Ptuce geXT+Q8Xp0uWFselNXt1WeozakJDoRSBxOy4LLUlQJutHCa105GCl5RgQ3U9Wo7D+QHN dDW5C1IIMkXZRuu+3/2k6USGF51vQA+wjrWbqpNvXwZoKd+AcK0B29+MdmCg5K70/o0g OLZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WBOyWUeH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id l64-20020a639143000000b005898db9d676si885767pge.260.2023.10.31.04.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 04:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WBOyWUeH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8810F80239E1; Tue, 31 Oct 2023 04:25:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235281AbjJaLZj (ORCPT + 99 others); Tue, 31 Oct 2023 07:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjJaLZh (ORCPT ); Tue, 31 Oct 2023 07:25:37 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97EE297 for ; Tue, 31 Oct 2023 04:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698751535; x=1730287535; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=CZ7/qD/Tv5Z4oH0wiTqiipmN3iPWBat7xPpjhvQgcJA=; b=WBOyWUeHxy13G7GNWkAQ5rW0k3NW4T/dLl571hD+sog2yAiLfvNasuir enK/xmOrs7yQwkj+1+hwLlOrFlmHT1UV7Rj/zpnD99dxBjPvj8KJ5t+hx g5WWZPwOouVQlZNeGSvinmmnCOyCTxkNexsQFBldxoccgXdIWGh+dcJpF t4bGxOy8ctg1nfiv8Gj+A0MwJy5jr0cCz++dk75crYdyHtUHMi80xZKcI +DBePlriUIpzdQ4WdUyqEVazrwydEyM8vTz4xdVlHQ2QMY02gUjp3Mben sojyZSe+E7B5OmoWzVMZpIDdD6rgnB5AiRTCCZj4SbjNXrtFS09T1jKu2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="388091130" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="388091130" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 04:25:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="754110635" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="754110635" Received: from olindum-mobl1.ger.corp.intel.com (HELO [10.249.254.59]) ([10.249.254.59]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 04:25:31 -0700 Message-ID: <4a51c1cd9e2435332e033f9426bac8fae1c21c60.camel@linux.intel.com> Subject: Re: [PATCH drm-misc-next v7 4/7] drm/gpuvm: add an abstraction for a VM / BO combination From: Thomas =?ISO-8859-1?Q?Hellstr=F6m?= To: Danilo Krummrich , airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com, sarah.walker@imgtec.com, donald.robson@imgtec.com, boris.brezillon@collabora.com, christian.koenig@amd.com, faith@gfxstrand.net Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Tue, 31 Oct 2023 12:25:29 +0100 In-Reply-To: <20231023201659.25332-5-dakr@redhat.com> References: <20231023201659.25332-1-dakr@redhat.com> <20231023201659.25332-5-dakr@redhat.com> Organization: Intel Sweden AB, Registration Number: 556189-6027 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 31 Oct 2023 04:25:44 -0700 (PDT) On Mon, 2023-10-23 at 22:16 +0200, Danilo Krummrich wrote: > Add an abstraction layer between the drm_gpuva mappings of a > particular > drm_gem_object and this GEM object itself. The abstraction represents > a > combination of a drm_gem_object and drm_gpuvm. The drm_gem_object > holds > a list of drm_gpuvm_bo structures (the structure representing this > abstraction), while each drm_gpuvm_bo contains list of mappings of > this > GEM object. >=20 > This has multiple advantages: >=20 > 1) We can use the drm_gpuvm_bo structure to attach it to various > lists > =C2=A0=C2=A0 of the drm_gpuvm. This is useful for tracking external and e= victed > =C2=A0=C2=A0 objects per VM, which is introduced in subsequent patches. >=20 > 2) Finding mappings of a certain drm_gem_object mapped in a certain > =C2=A0=C2=A0 drm_gpuvm becomes much cheaper. >=20 > 3) Drivers can derive and extend the structure to easily represent > =C2=A0=C2=A0 driver specific states of a BO for a certain GPUVM. >=20 > The idea of this abstraction was taken from amdgpu, hence the credit > for > this idea goes to the developers of amdgpu. >=20 > Cc: Christian K=C3=B6nig > Signed-off-by: Danilo Krummrich > --- > =C2=A0drivers/gpu/drm/drm_gpuvm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 335 +++++++++++++++++++++-- > -- > =C2=A0drivers/gpu/drm/nouveau/nouveau_uvmm.c |=C2=A0 64 +++-- > =C2=A0include/drm/drm_gem.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 32 +-- > =C2=A0include/drm/drm_gpuvm.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 188 +++++++++++++- > =C2=A04 files changed, 533 insertions(+), 86 deletions(-) That checkpatch.pl error still remains as well. Thanks, Thomas