diff mbox series

[1/2] drm/i915/gem: Do not look for the exact address in node

Message ID 20240807100521.478266-2-andi.shyti@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Allow partial memory mapping for cpu memory | expand

Commit Message

Andi Shyti Aug. 7, 2024, 10:05 a.m. UTC
In preparation for the upcoming partial memory mapping feature,
we want to make sure that when looking for a node we consider
also the offset and not just the starting address of the virtual
memory node.

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Nirmoy Das Aug. 8, 2024, 4:11 p.m. UTC | #1
On 8/7/2024 12:05 PM, Andi Shyti wrote:
> In preparation for the upcoming partial memory mapping feature,
> we want to make sure that when looking for a node we consider
> also the offset and not just the starting address of the virtual
> memory node.
>
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_mman.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index cac6d4184506..d3ee8ef7ea2f 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -1071,9 +1071,9 @@ int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>   
>   	rcu_read_lock();
>   	drm_vma_offset_lock_lookup(dev->vma_offset_manager);
> -	node = drm_vma_offset_exact_lookup_locked(dev->vma_offset_manager,
> -						  vma->vm_pgoff,
> -						  vma_pages(vma));
> +	node = drm_vma_offset_lookup_locked(dev->vma_offset_manager,
> +					    vma->vm_pgoff,
> +					    vma_pages(vma));
>   	if (node && drm_vma_node_is_allowed(node, priv)) {
>   		/*
>   		 * Skip 0-refcnted objects as it is in the process of being
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index cac6d4184506..d3ee8ef7ea2f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -1071,9 +1071,9 @@  int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma)
 
 	rcu_read_lock();
 	drm_vma_offset_lock_lookup(dev->vma_offset_manager);
-	node = drm_vma_offset_exact_lookup_locked(dev->vma_offset_manager,
-						  vma->vm_pgoff,
-						  vma_pages(vma));
+	node = drm_vma_offset_lookup_locked(dev->vma_offset_manager,
+					    vma->vm_pgoff,
+					    vma_pages(vma));
 	if (node && drm_vma_node_is_allowed(node, priv)) {
 		/*
 		 * Skip 0-refcnted objects as it is in the process of being