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 B2BC2C433FE for ; Mon, 3 Oct 2022 06:14:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BDDE10E166; Mon, 3 Oct 2022 06:13:24 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F27210E166; Mon, 3 Oct 2022 06:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664777597; x=1696313597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pl5/N/aT3L6DHwNQAeOb5dai7E4ho6QQwedqWGFvQoY=; b=EmbDdfAUryxr1GdFpkRmq6v4TKCpMqHb5xVLngK9aoh68sQ8Hy5sMnDZ W4Wt/nBbzNgMkPvhJrA6YHjzlIsen8aAv2JFw9Rl3kEsuw/wxSFTM2Uam 9JRd3LMre4kL6IGKmwcl/KaUHcfA31AbZHEktWCuXKUuhE9bX9DNPi8/J cPwrC3FztQ/V2B4fPgf8ZX35nXF90Bad9t9XsbtqKrgO1F9K5GbZzNq19 2+LusfbZglZPArujG7l5lWM9jpQjLuWAfFx99LqLmQszxjMl/O7fl8D+/ bEP7yi+mhSSOMtEo27a2glFypFzuI3Kw925Wp+lJXxIp/sbpIR2RogybI Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="300159057" X-IronPort-AV: E=Sophos;i="5.93,364,1654585200"; d="scan'208";a="300159057" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2022 23:13:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="574516790" X-IronPort-AV: E=Sophos;i="5.93,364,1654585200"; d="scan'208";a="574516790" Received: from nvishwa1-desk.sc.intel.com ([172.25.29.76]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Oct 2022 23:13:16 -0700 From: Niranjana Vishwanathapura To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 01/17] drm/i915/vm_bind: Expose vm lookup function Date: Sun, 2 Oct 2022 23:12:29 -0700 Message-Id: <20221003061245.12716-2-niranjana.vishwanathapura@intel.com> X-Mailer: git-send-email 2.21.0.rc0.32.g243a4c7e27 In-Reply-To: <20221003061245.12716-1-niranjana.vishwanathapura@intel.com> References: <20221003061245.12716-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. Acked-by: Matthew Auld 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 DBD73C433FE for ; Mon, 3 Oct 2022 06:14:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D51B910E212; Mon, 3 Oct 2022 06:13:25 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F27210E166; Mon, 3 Oct 2022 06:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664777597; x=1696313597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pl5/N/aT3L6DHwNQAeOb5dai7E4ho6QQwedqWGFvQoY=; b=EmbDdfAUryxr1GdFpkRmq6v4TKCpMqHb5xVLngK9aoh68sQ8Hy5sMnDZ W4Wt/nBbzNgMkPvhJrA6YHjzlIsen8aAv2JFw9Rl3kEsuw/wxSFTM2Uam 9JRd3LMre4kL6IGKmwcl/KaUHcfA31AbZHEktWCuXKUuhE9bX9DNPi8/J cPwrC3FztQ/V2B4fPgf8ZX35nXF90Bad9t9XsbtqKrgO1F9K5GbZzNq19 2+LusfbZglZPArujG7l5lWM9jpQjLuWAfFx99LqLmQszxjMl/O7fl8D+/ bEP7yi+mhSSOMtEo27a2glFypFzuI3Kw925Wp+lJXxIp/sbpIR2RogybI Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="300159057" X-IronPort-AV: E=Sophos;i="5.93,364,1654585200"; d="scan'208";a="300159057" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2022 23:13:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="574516790" X-IronPort-AV: E=Sophos;i="5.93,364,1654585200"; d="scan'208";a="574516790" Received: from nvishwa1-desk.sc.intel.com ([172.25.29.76]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Oct 2022 23:13:16 -0700 From: Niranjana Vishwanathapura To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Sun, 2 Oct 2022 23:12:29 -0700 Message-Id: <20221003061245.12716-2-niranjana.vishwanathapura@intel.com> X-Mailer: git-send-email 2.21.0.rc0.32.g243a4c7e27 In-Reply-To: <20221003061245.12716-1-niranjana.vishwanathapura@intel.com> References: <20221003061245.12716-1-niranjana.vishwanathapura@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-gfx] [PATCH v2 01/17] 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. Acked-by: Matthew Auld 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