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

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

 



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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux