[Intel-gfx] [PATCH] drm/i915/bdw: Populate lrc with aliasing ppgtt if required

Damien Lespiau damien.lespiau at intel.com
Mon Aug 18 18:49:29 CEST 2014


On Mon, Aug 18, 2014 at 03:54:02PM +0100, Thomas Daniel wrote:
> A previous commit broke aliasing PPGTT for lrc, resulting in a kernel oops
> on boot. Add a check so that is full PPGTT is not in use the context is
> populated with the aliasing PPGTT.
> 
> Issue: VIZ-4278
> Signed-off-by: Thomas Daniel <thomas.daniel at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index c096b9b..79a6b91 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1452,12 +1452,19 @@ static int
>  populate_lr_context(struct intel_context *ctx, struct drm_i915_gem_object *ctx_obj,
>  		    struct intel_engine_cs *ring, struct intel_ringbuffer *ringbuf)
>  {
> +	struct drm_device *dev = ring->dev;
> +	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct drm_i915_gem_object *ring_obj = ringbuf->obj;
>  	struct i915_hw_ppgtt *ppgtt = ctx->ppgtt;

It's a bit weird to leave ppgtt initialized here when you're going to
always override it below.

>  	struct page *page;
>  	uint32_t *reg_state;
>  	int ret;
>  
> +	if (USES_FULL_PPGTT(dev))
> +		ppgtt = ctx->ppgtt;
> +	else
> +		ppgtt = dev_priv->mm.aliasing_ppgtt;
> +

The patch drom daniel you mention removes the usage of USES_FULL_PPGTT()
to directly test ctx->ppgtt. You may want to reproduce that here ie.

	ppgtt = ctx->ppgtt;
	if (!ppgtt)
		ppgtt = dev_priv->mm.aliasing_ppgtt;

doesn't really matter either way I guess, but can we at least not set
then always override ppgtt?

Thanks,

-- 
Damien



More information about the Intel-gfx mailing list