[PATCH] drm/mm: Adjust start/end for coloring first

Daniel Vetter daniel at ffwll.ch
Mon May 19 01:14:27 PDT 2014


On Mon, May 19, 2014 at 07:52:37AM +0100, Chris Wilson wrote:
> The current user of the coloring will adjust the end points of the node
> to leave a hole between disjoint memory types. This adjustment must be
> performed first or else the derived size will conflict with the
> adjustment and trigger the BUG_ON sanity checks that the node is within
> bounds.
> 
> Fixes regression from
> commit 62347f9e0f81d50e9b0923ec8a192f60ab7a1801
> Author: Lauri Kasanen <cand at gmx.com>
> Date:   Wed Apr 2 20:03:57 2014 +0300
> 
>     drm: Add support for two-ended allocation, v3
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Do we have a bugzilla for this, or why did igt not scream about this
failure?
-Daniel

> ---
>  drivers/gpu/drm/drm_mm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
> index 04a209e2b66d..911863bed9f3 100644
> --- a/drivers/gpu/drm/drm_mm.c
> +++ b/drivers/gpu/drm/drm_mm.c
> @@ -264,12 +264,12 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node,
>  	if (adj_end > end)
>  		adj_end = end;
>  
> -	if (flags & DRM_MM_CREATE_TOP)
> -		adj_start = adj_end - size;
> -
>  	if (mm->color_adjust)
>  		mm->color_adjust(hole_node, color, &adj_start, &adj_end);
>  
> +	if (flags & DRM_MM_CREATE_TOP)
> +		adj_start = adj_end - size;
> +
>  	if (alignment) {
>  		unsigned tmp = adj_start % alignment;
>  		if (tmp) {
> -- 
> 2.0.0.rc2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list