[Intel-gfx] [PATCH 2/9] drm/i915: Convert renderctx to a regular context

Chris Wilson chris at chris-wilson.co.uk
Mon Jul 15 12:24:18 CEST 2013


On Sun, Jul 14, 2013 at 09:22:46AM -0700, Ben Widawsky wrote:
> @@ -3650,10 +3650,14 @@ static int ironlake_setup_rc6(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
> -	if (dev_priv->ips.renderctx == NULL)
> -		dev_priv->ips.renderctx = intel_alloc_context_page(dev);
> -	if (!dev_priv->ips.renderctx)
> +	if (dev_priv->ips.renderctx.obj == NULL)
> +		dev_priv->ips.renderctx.obj = intel_alloc_context_page(dev);
> +	if (!dev_priv->ips.renderctx.obj)
>  		return -ENOMEM;
> +	else {
> +		dev_priv->ips.renderctx.id = DEFAULT_CONTEXT_ID;
> +		dev_priv->ips.renderctx.ring = &dev_priv->ring[RCS];
> +	}

Make this a bit more consistent style wise. You are mixing here !obj and
obj == NULL, along with a superfluous else{}.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list