Re: [PATCH 2/5] drm: Check against color expansion in drm_mm_reserve_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2016 at 02:11:15PM +0000, Chris Wilson wrote:
> Use the color_adjust callback when reserving a node to check if
> inserting a node into this hole requires any additional space, and so if
> that space then conflicts with an existing allocation.
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Both drm_mm patches merged to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_mm.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
> index f8eebbde376e..025dcd8cadcb 100644
> --- a/drivers/gpu/drm/drm_mm.c
> +++ b/drivers/gpu/drm/drm_mm.c
> @@ -306,6 +306,7 @@ int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node)
>  	u64 end = node->start + node->size;
>  	struct drm_mm_node *hole;
>  	u64 hole_start, hole_end;
> +	u64 adj_start, adj_end;
>  
>  	if (WARN_ON(node->size == 0))
>  		return -EINVAL;
> @@ -327,9 +328,13 @@ int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node)
>  	if (!hole->hole_follows)
>  		return -ENOSPC;
>  
> -	hole_start = __drm_mm_hole_node_start(hole);
> -	hole_end = __drm_mm_hole_node_end(hole);
> -	if (hole_start > node->start || hole_end < end)
> +	adj_start = hole_start = __drm_mm_hole_node_start(hole);
> +	adj_end = hole_end = __drm_mm_hole_node_end(hole);
> +
> +	if (mm->color_adjust)
> +		mm->color_adjust(hole, node->color, &adj_start, &adj_end);
> +
> +	if (adj_start > node->start || adj_end < end)
>  		return -ENOSPC;
>  
>  	node->mm = mm;
> -- 
> 2.10.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux