[Intel-gfx] [PATCH 1/2] drm/i915: make CRTC enable/disable asynchronous v2

Chris Wilson chris at chris-wilson.co.uk
Fri May 30 20:56:22 CEST 2014


On Fri, May 30, 2014 at 11:05:21AM -0700, Jesse Barnes wrote:
> +static void intel_queue_crtc_enable(struct drm_crtc *crtc)
> +{
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	struct intel_crtc_work *work;
> +
> +	WARN(!mutex_is_locked(&dev->mode_config.mutex),
> +	     "need mode_config mutex\n");
> +
> +	work = kmalloc(sizeof(*work), GFP_KERNEL);
> +	if (!work) {
> +		dev_priv->display._crtc_disable(&intel_crtc->base);
> +		return;
> +	}
> +
> +	work->enable = true;
> +	work->intel_crtc = intel_crtc;
> +	INIT_LIST_HEAD(&work->head);
(redundant, list_add doesn't care)

> +
> +	list_add_tail(&dev_priv->crtc_work_queue, &work->head);
> +	schedule_work(&dev_priv->crtc_work);
> +}

If we tracked one queued item per crtc, we could avoid the allocation
and allow for elision of pending operations.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list