[Intel-gfx] [PATCH] drm/i915: Wrap -EIO send-vblank event for failed pageflip in spinlock

Chris Wilson chris at chris-wilson.co.uk
Sun Sep 7 19:21:16 CEST 2014


On Sun, Sep 07, 2014 at 04:51:12PM +0100, Chris Wilson wrote:
> drm_send_vblank_event() demands that we hold the event spinlock whilst
> calling it, so do so.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e2c7e3941465..4642a0e6f20c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9981,8 +9981,11 @@ free_work:
>  	if (ret == -EIO) {
>  		intel_crtc_wait_for_pending_flips(crtc);
>  		ret = intel_pipe_set_base(crtc, crtc->x, crtc->y, fb);
> -		if (ret == 0 && event)
> +		if (ret == 0 && event) {
> +			spin_lock_irqsave(&dev->event_lock, flags);
>  			drm_send_vblank_event(dev, pipe, event);
> +			spin_lock_irqsave(&dev->event_lock, flags);

That's what you get for sending a trivial patch before even testing it.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list