From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Don't clobber crtc->fb when queue_flip fails
Date: Fri, 22 Feb 2013 15:46:00 +0200 [thread overview]
Message-ID: <87sj4ofomf.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1361535444-14625-1-git-send-email-ville.syrjala@linux.intel.com>
ville.syrjala@linux.intel.com writes:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Point crtc->fb the the new framebuffer only after we know that the flip
> was succesfully queued.
>
> While at it, move the intel_fb and obj assignments a bit close to where
> they're used.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> It looks like Mika hit this rather easily in his ARB_robustness work.
> Waiting for him to confirm whether this really fixes the pin_count
> underflow bug he's seeing.
Tested-by: Mika Kuoppala <mika.kuoppala@intel.com>
> drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 0ff10b3..e7684f1 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7311,9 +7311,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
> intel_crtc->unpin_work = work;
> spin_unlock_irqrestore(&dev->event_lock, flags);
>
> - intel_fb = to_intel_framebuffer(fb);
> - obj = intel_fb->obj;
> -
> if (atomic_read(&intel_crtc->unpin_work_count) >= 2)
> flush_workqueue(dev_priv->wq);
>
> @@ -7321,12 +7318,13 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
> if (ret)
> goto cleanup;
>
> + intel_fb = to_intel_framebuffer(fb);
> + obj = intel_fb->obj;
> +
> /* Reference the objects for the scheduled work. */
> drm_gem_object_reference(&work->old_fb_obj->base);
> drm_gem_object_reference(&obj->base);
>
> - crtc->fb = fb;
> -
> work->pending_flip_obj = obj;
>
> work->enable_stall_check = true;
> @@ -7338,6 +7336,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
> if (ret)
> goto cleanup_pending;
>
> + crtc->fb = fb;
> +
> intel_disable_fbc(dev);
> intel_mark_fb_busy(obj);
> mutex_unlock(&dev->struct_mutex);
> --
> 1.7.12.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2013-02-22 13:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-22 12:17 [PATCH] drm/i915: Don't clobber crtc->fb when queue_flip fails ville.syrjala
2013-02-22 13:31 ` [Intel-gfx] " Chris Wilson
2013-02-22 14:36 ` Ville Syrjälä
2013-02-22 14:41 ` Chris Wilson
2013-03-03 18:48 ` Daniel Vetter
2013-02-22 13:46 ` Mika Kuoppala [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sj4ofomf.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.