[Intel-gfx] [PATCH] drm/i915: Quietly reject attempts to create non-pagealigned stolen objects

Chris Wilson chris at chris-wilson.co.uk
Wed Jan 21 14:22:54 PST 2015


On Wed, Jan 21, 2015 at 07:13:04PM +0100, Daniel Vetter wrote:
> Something like the below would imo be the proper bandaid. Untested since I
> don't have an affected system. Then we can still (later on, if bored)
> recover the offsets properly if ever needed.

> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 86831aec5c0d..733c99d5b671 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2370,13 +2370,17 @@ intel_alloc_plane_obj(struct intel_crtc *crtc,
>  	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_gem_object *obj = NULL;
>  	struct drm_mode_fb_cmd2 mode_cmd = { 0 };
> -	u32 base = plane_config->base;
> +	u32 base_aligned = round_down(plane_config->base, PAGE_SIZE);
> +	u32 size_aligned = round_up(plane_config->base + plane_config->size,
> +				    PAGE_SIZE);

You forgot size_aligned -= base_aligned;
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list