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 C8F85C32771 for ; Wed, 28 Sep 2022 06:20:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FDF710E26A; Wed, 28 Sep 2022 06:19:50 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id D660510E26A; Wed, 28 Sep 2022 06:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664345987; x=1695881987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0K7R1R6A5Yc+8cjeLUlC9cPXDVrQDjIIN1++e5QVvJk=; b=h7m8i53+AuztOKG8jZPEM0wr8ej0BdKWniFBhE4VvWTG19X0SXDAs5Fc ofNwFookZoLmPQBLEJPzJc+RGbohYj8444K2L6uawNiIE4O4uesJPWA5F DGRTgqntoaXbI1NlHZCZc0NTfLJ/9To45Iw9A+PLVYTy6eyfmLDKyL/LE PINzzTZ7bwryzobPEnG34uMqnnTpRsbEkcZ3oTZuFSw5allBBUaKRX162 jn47raKedpYPwg5oLbX8jl7U8LJTqG6M6x1atRNkJUw6rwkl4IA2uRA4y AbdorUqEsnZ1E/TvK1PTuY652bqJBUhMtA6YCa+SEceFStq+bk++FTVJi Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="301494318" X-IronPort-AV: E=Sophos;i="5.93,351,1654585200"; d="scan'208";a="301494318" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 23:19:46 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="866849176" X-IronPort-AV: E=Sophos;i="5.93,351,1654585200"; d="scan'208";a="866849176" Received: from nvishwa1-desk.sc.intel.com ([172.25.29.76]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 27 Sep 2022 23:19:46 -0700 From: Niranjana Vishwanathapura To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 01/16] drm/i915/vm_bind: Expose vm lookup function Date: Tue, 27 Sep 2022 23:19:03 -0700 Message-Id: <20220928061918.6340-2-niranjana.vishwanathapura@intel.com> X-Mailer: git-send-email 2.21.0.rc0.32.g243a4c7e27 In-Reply-To: <20220928061918.6340-1-niranjana.vishwanathapura@intel.com> References: <20220928061918.6340-1-niranjana.vishwanathapura@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: matthew.brost@intel.com, paulo.r.zanoni@intel.com, tvrtko.ursulin@intel.com, jani.nikula@intel.com, lionel.g.landwerlin@intel.com, thomas.hellstrom@intel.com, matthew.auld@intel.com, jason@jlekstrand.net, andi.shyti@linux.intel.com, daniel.vetter@intel.com, christian.koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Make i915_gem_vm_lookup() function non-static as it will be used by the vm_bind feature. Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 11 ++++++++++- drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index 0bcde53c50c6..f4e648ec01ed 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -346,7 +346,16 @@ static int proto_context_register(struct drm_i915_file_private *fpriv, return ret; } -static struct i915_address_space * +/** + * i915_gem_vm_lookup() - looks up for the VM reference given the vm id + * @file_priv: the private data associated with the user's file + * @id: the VM id + * + * Finds the VM reference associated to a specific id. + * + * Returns the VM pointer on success, NULL in case of failure. + */ +struct i915_address_space * i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id) { struct i915_address_space *vm; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.h b/drivers/gpu/drm/i915/gem/i915_gem_context.h index e5b0f66ea1fe..899fa8f1e0fe 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.h @@ -139,6 +139,9 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data, int i915_gem_context_reset_stats_ioctl(struct drm_device *dev, void *data, struct drm_file *file); +struct i915_address_space * +i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id); + struct i915_gem_context * i915_gem_context_lookup(struct drm_i915_file_private *file_priv, u32 id); -- 2.21.0.rc0.32.g243a4c7e27 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 8DBC7C32771 for ; Wed, 28 Sep 2022 06:21:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 586DA10E288; Wed, 28 Sep 2022 06:20:06 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id D660510E26A; Wed, 28 Sep 2022 06:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664345987; x=1695881987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0K7R1R6A5Yc+8cjeLUlC9cPXDVrQDjIIN1++e5QVvJk=; b=h7m8i53+AuztOKG8jZPEM0wr8ej0BdKWniFBhE4VvWTG19X0SXDAs5Fc ofNwFookZoLmPQBLEJPzJc+RGbohYj8444K2L6uawNiIE4O4uesJPWA5F DGRTgqntoaXbI1NlHZCZc0NTfLJ/9To45Iw9A+PLVYTy6eyfmLDKyL/LE PINzzTZ7bwryzobPEnG34uMqnnTpRsbEkcZ3oTZuFSw5allBBUaKRX162 jn47raKedpYPwg5oLbX8jl7U8LJTqG6M6x1atRNkJUw6rwkl4IA2uRA4y AbdorUqEsnZ1E/TvK1PTuY652bqJBUhMtA6YCa+SEceFStq+bk++FTVJi Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="301494318" X-IronPort-AV: E=Sophos;i="5.93,351,1654585200"; d="scan'208";a="301494318" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 23:19:46 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="866849176" X-IronPort-AV: E=Sophos;i="5.93,351,1654585200"; d="scan'208";a="866849176" Received: from nvishwa1-desk.sc.intel.com ([172.25.29.76]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 27 Sep 2022 23:19:46 -0700 From: Niranjana Vishwanathapura To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Tue, 27 Sep 2022 23:19:03 -0700 Message-Id: <20220928061918.6340-2-niranjana.vishwanathapura@intel.com> X-Mailer: git-send-email 2.21.0.rc0.32.g243a4c7e27 In-Reply-To: <20220928061918.6340-1-niranjana.vishwanathapura@intel.com> References: <20220928061918.6340-1-niranjana.vishwanathapura@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-gfx] [PATCH 01/16] drm/i915/vm_bind: Expose vm lookup function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulo.r.zanoni@intel.com, jani.nikula@intel.com, thomas.hellstrom@intel.com, matthew.auld@intel.com, daniel.vetter@intel.com, christian.koenig@amd.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Make i915_gem_vm_lookup() function non-static as it will be used by the vm_bind feature. Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 11 ++++++++++- drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index 0bcde53c50c6..f4e648ec01ed 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -346,7 +346,16 @@ static int proto_context_register(struct drm_i915_file_private *fpriv, return ret; } -static struct i915_address_space * +/** + * i915_gem_vm_lookup() - looks up for the VM reference given the vm id + * @file_priv: the private data associated with the user's file + * @id: the VM id + * + * Finds the VM reference associated to a specific id. + * + * Returns the VM pointer on success, NULL in case of failure. + */ +struct i915_address_space * i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id) { struct i915_address_space *vm; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.h b/drivers/gpu/drm/i915/gem/i915_gem_context.h index e5b0f66ea1fe..899fa8f1e0fe 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.h @@ -139,6 +139,9 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data, int i915_gem_context_reset_stats_ioctl(struct drm_device *dev, void *data, struct drm_file *file); +struct i915_address_space * +i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id); + struct i915_gem_context * i915_gem_context_lookup(struct drm_i915_file_private *file_priv, u32 id); -- 2.21.0.rc0.32.g243a4c7e27