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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1AB32CD6E77 for ; Wed, 11 Oct 2023 14:45:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0CED10E8FB; Wed, 11 Oct 2023 14:45:21 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48DFA10E8EE for ; Wed, 11 Oct 2023 14:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697035516; x=1728571516; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=h7cylyG4KhyTEO5sv/sCJx2mrX0gsGOwUrFbxqRDE10=; b=jv4y9A7d8UYKqACdeq+EGSMNALmPFYxo4tJAgmhri3Am9o8F58Es0PD9 AZjAHv51ITmgfgLw/FG+Xg19xDxjgHhDBkFoGFOJ5rj/n8tEgYx24pLNE /obucWxLVALMCtMSDhk+kZIEqLfYdTtZhdxX7Qd9/zcxps/T1VXO7Rv+W yMSMAvf8iD3N4+eEapcKAYMHGWiZsWkJuh1V5zFO5bwYv4l7A5++KCmlb F2o790g3cF1/32UoeQ55a1YF+mfdgon7C0uEUS35Jx0vQR4IaMcHZSc0i UoLiaUXws5MQyAeO3QsgqaZVnLzzM8dg2T2p9v0GBy+/Z0hnM/dwjJHeZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="448882483" X-IronPort-AV: E=Sophos;i="6.03,216,1694761200"; d="scan'208";a="448882483" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 07:45:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="927587899" X-IronPort-AV: E=Sophos;i="6.03,216,1694761200"; d="scan'208";a="927587899" Received: from clanggaa-mobl.ger.corp.intel.com (HELO fedora..) ([10.249.254.169]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 07:45:15 -0700 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Date: Wed, 11 Oct 2023 16:44:52 +0200 Message-ID: <20231011144500.17924-3-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231011144500.17924-1-thomas.hellstrom@linux.intel.com> References: <20231011144500.17924-1-thomas.hellstrom@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [CI 03/11] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" From: Danilo Krummrich Introduce flags for struct drm_gpuvm, this required by subsequent commits. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 4 +++- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 2 +- include/drm/drm_gpuvm.h | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 936377082a01..588b0e948444 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -703,6 +703,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc); * @gpuvm: pointer to the &drm_gpuvm to initialize * @r_obj: the root &drm_gem_object providing the GPUVM's common &dma_resv * @name: the name of the GPU VA space + * @flags: the &drm_gpuvm_flags for this GPUVM * @start_offset: the start offset of the GPU VA space * @range: the size of the GPU VA space * @reserve_offset: the start of the kernel reserved GPU VA area @@ -716,7 +717,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc); */ void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj, - const char *name, + const char *name, enum drm_gpuvm_flags flags, u64 start_offset, u64 range, u64 reserve_offset, u64 reserve_range, const struct drm_gpuvm_ops *ops) @@ -729,6 +730,7 @@ drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj, gpuvm->mm_range = range; gpuvm->name = name ? name : "unknown"; + gpuvm->flags = flags; gpuvm->ops = ops; gpuvm->r_obj = r_obj; diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c index 4dea847ef989..93ad2ba7ec8b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -1843,7 +1843,7 @@ nouveau_uvmm_init(struct nouveau_uvmm *uvmm, struct nouveau_cli *cli, uvmm->kernel_managed_addr = kernel_managed_addr; uvmm->kernel_managed_size = kernel_managed_size; - drm_gpuvm_init(&uvmm->base, r_obj, cli->name, + drm_gpuvm_init(&uvmm->base, r_obj, cli->name, 0, NOUVEAU_VA_SPACE_START, NOUVEAU_VA_SPACE_END, kernel_managed_addr, kernel_managed_size, diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h index 5aa738967c18..627c368aed6a 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -183,6 +183,16 @@ static inline bool drm_gpuva_invalidated(struct drm_gpuva *va) return va->flags & DRM_GPUVA_INVALIDATED; } +/** + * enum drm_gpuvm_flags - flags for struct drm_gpuvm + */ +enum drm_gpuvm_flags { + /** + * @DRM_GPUVM_USERBITS: user defined bits + */ + DRM_GPUVM_USERBITS = (1 << 0), +}; + /** * struct drm_gpuvm - DRM GPU VA Manager * @@ -201,6 +211,11 @@ struct drm_gpuvm { */ const char *name; + /** + * @flags: the &drm_gpuvm_flags of this GPUVM + */ + enum drm_gpuvm_flags flags; + /** * @mm_start: start of the VA space */ @@ -246,7 +261,7 @@ struct drm_gpuvm { }; void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj, - const char *name, + const char *name, enum drm_gpuvm_flags flags, u64 start_offset, u64 range, u64 reserve_offset, u64 reserve_range, const struct drm_gpuvm_ops *ops); -- 2.41.0