Re: [Intel-gfx] [PATCH] drm/i915/ttm: remove the virtualized start hack

2023-02-24 Thread Andrzej Hajda

On 20.12.2022 12:27, Matthew Auld wrote:

This was mostly needed to differentiate between mappable and
non-mappable lmem, such that ttm would understand non-mappable ->
mappable moves (or vice versa), and not just turn them into noops. We
have since gained proper .intersects() and .compatible() hooks for the
resource manager, which takes care of this for us.

Signed-off-by: Matthew Auld 
Cc: Nirmoy Das 
Cc: Andrzej Hajda 


Reviewed-by: Andrzej Hajda 

Regards
Andrzej


---
  drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 7 ---
  1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c 
b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
index a72698a2dbc8..a1bc804cfa15 100644
--- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
+++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
@@ -139,13 +139,6 @@ static int i915_ttm_buddy_man_alloc(struct 
ttm_resource_manager *man,
  
  	mutex_unlock(&bman->lock);
  
-	if (place->lpfn - place->fpfn == n_pages)

-   bman_res->base.start = place->fpfn;
-   else if (lpfn <= bman->visible_size)
-   bman_res->base.start = 0;
-   else
-   bman_res->base.start = bman->visible_size;
-
*res = &bman_res->base;
return 0;
  




Re: [Intel-gfx] [PATCH] drm/i915/ttm: remove the virtualized start hack

2023-02-24 Thread Andi Shyti
Hi Matt,

On Tue, Dec 20, 2022 at 11:27:36AM +, Matthew Auld wrote:
> This was mostly needed to differentiate between mappable and
> non-mappable lmem, such that ttm would understand non-mappable ->
> mappable moves (or vice versa), and not just turn them into noops. We
> have since gained proper .intersects() and .compatible() hooks for the
> resource manager, which takes care of this for us.
> 
> Signed-off-by: Matthew Auld 
> Cc: Nirmoy Das 
> Cc: Andrzej Hajda 

Reviewed-by: Andi Shyti 

Thank you,
Andi

> ---
>  drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 7 ---
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c 
> b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
> index a72698a2dbc8..a1bc804cfa15 100644
> --- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
> +++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
> @@ -139,13 +139,6 @@ static int i915_ttm_buddy_man_alloc(struct 
> ttm_resource_manager *man,
>  
>   mutex_unlock(&bman->lock);
>  
> - if (place->lpfn - place->fpfn == n_pages)
> - bman_res->base.start = place->fpfn;
> - else if (lpfn <= bman->visible_size)
> - bman_res->base.start = 0;
> - else
> - bman_res->base.start = bman->visible_size;
> -
>   *res = &bman_res->base;
>   return 0;
>  
> -- 
> 2.38.1


[Intel-gfx] [PATCH] drm/i915/ttm: remove the virtualized start hack

2022-12-20 Thread Matthew Auld
This was mostly needed to differentiate between mappable and
non-mappable lmem, such that ttm would understand non-mappable ->
mappable moves (or vice versa), and not just turn them into noops. We
have since gained proper .intersects() and .compatible() hooks for the
resource manager, which takes care of this for us.

Signed-off-by: Matthew Auld 
Cc: Nirmoy Das 
Cc: Andrzej Hajda 
---
 drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c 
b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
index a72698a2dbc8..a1bc804cfa15 100644
--- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
+++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
@@ -139,13 +139,6 @@ static int i915_ttm_buddy_man_alloc(struct 
ttm_resource_manager *man,
 
mutex_unlock(&bman->lock);
 
-   if (place->lpfn - place->fpfn == n_pages)
-   bman_res->base.start = place->fpfn;
-   else if (lpfn <= bman->visible_size)
-   bman_res->base.start = 0;
-   else
-   bman_res->base.start = bman->visible_size;
-
*res = &bman_res->base;
return 0;
 
-- 
2.38.1