[PATCH 25/34] drm: Extract struct drm_mm_scan from struct drm_mm

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Tue Dec 13 15:17:42 UTC 2016


On ma, 2016-12-12 at 11:53 +0000, Chris Wilson wrote:
> The scan state occupies a large proportion of the struct drm_mm and is
> rarely used and only contains temporary state. That makes it suitable to
> moving to its struct and onto the stack of the callers.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +void drm_mm_scan_init_with_range(struct drm_mm_scan *scan,
> +				 struct drm_mm *mm,
>  				 u64 size,
>  				 u64 alignment,
>  				 unsigned long color,
>  				 u64 start,
>  				 u64 end)

Just call drm_mm_scan_init() here and override check_range and a few
others.

Or add __drm_mm_scan_init(), but get rid of the duplicate the code.

With that changed;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the dri-devel mailing list