[Intel-gfx] [PATCH] drm/i915/mocs: Program MOCS for all engines on init

Antoine, Peter peter.antoine at intel.com
Thu Mar 10 15:43:05 UTC 2016


Sorry chris, resent the patch, it was the wrong one.
I'll update the version and send again.

Peter.

-----Original Message-----
From: Chris Wilson [mailto:chris at chris-wilson.co.uk] 
Sent: Thursday, March 10, 2016 3:36 PM
To: Antoine, Peter <peter.antoine at intel.com>
Cc: intel-gfx at lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/mocs: Program MOCS for all engines on init

On Thu, Mar 10, 2016 at 03:27:00PM +0000, Peter Antoine wrote:
> Allow for the MOCS to be programmed for all engines.
> Currently we program the MOCS when the first render batch goes 
> through. This works on most platforms but fails on platforms that do 
> not run a render batch early, i.e. headless servers. The patch now 
> programs all initialised engines on init and the RCS is programmed 
> again within the initial batch. This is done for predictable 
> consistency with regards to the hardware context.
> 
> Hardware context loading sets the values of the MOCS for RCS and L3CC. 
> Programming them from within the batch makes sure that the render 
> context is valid, no matter what the previous state of the 
> saved-context was.
> 
> Signed-off-by: Peter Antoine <peter.antoine at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c   |   7 ++
>  drivers/gpu/drm/i915/intel_mocs.c | 137 ++++++++++++++++++++++++++++++++++----
>  drivers/gpu/drm/i915/intel_mocs.h |   1 +
>  3 files changed, 133 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c 
> b/drivers/gpu/drm/i915/i915_gem.c index b854af2..0bb6c60 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -32,6 +32,7 @@
>  #include "i915_vgpu.h"
>  #include "i915_trace.h"
>  #include "intel_drv.h"
> +#include "intel_mocs.h"
>  #include <linux/shmem_fs.h>
>  #include <linux/slab.h>
>  #include <linux/swap.h>
> @@ -4882,6 +4883,12 @@ i915_gem_init_hw(struct drm_device *dev)
>  			goto out;
>  	}
>  
> +	/*
> +	 * lets program the mocs values for all engines the RCS will
> +	 * send a batch on context start, but that will have to happen
> +	 */
> +	intel_program_mocs_all_engines(dev);

Not quite. See engine->init_hw()
-Chris

--
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list