From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff
Date: Wed, 7 Dec 2016 20:11:33 +0200 [thread overview]
Message-ID: <20161207181133.GV31595@intel.com> (raw)
In-Reply-To: <20161207175647.10018-1-chris@chris-wilson.co.uk>
On Wed, Dec 07, 2016 at 05:56:47PM +0000, Chris Wilson wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The i915_gem_active stuff doesn't like a NULL ->retire hook, but
> the overlay code can set it to NULL. That obviously ends up oopsing.
> Fix it by introducing a new helper to assign the retirement callback
> that will switch out the NULL function pointer with
> i915_gem_retire_noop.
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Fixes: 0d9bdd886f29 ("drm/i915: Convert intel_overlay to request tracking")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
lgtm, feel free to put yourself as the author is you want.
BTW I don't think we ever call the init_foo() thing on last_flip.
Should be do that in overlay_init() or some such place?
> ---
> drivers/gpu/drm/i915/i915_gem_request.h | 19 +++++++++++++++++++
> drivers/gpu/drm/i915/intel_overlay.c | 3 ++-
> 2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
> index 2fc6b8b3f580..b0d50aa81acb 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.h
> +++ b/drivers/gpu/drm/i915/i915_gem_request.h
> @@ -440,6 +440,25 @@ i915_gem_active_set(struct i915_gem_active *active,
> rcu_assign_pointer(active->request, request);
> }
>
> +/**
> + * i915_gem_active_set_retire_fn - updates the retirement callback
> + * @active - the active tracker
> + * @fn - the routine called when the request is retired
> + * @mutex - struct_mutex used to guard retirements
> + *
> + * i915_gem_active_set_retire_fn() updates the function pointer that
> + * is called when the final request associated with the @active tracker
> + * is retired.
> + */
> +static inline void
> +i915_gem_active_set_retire_fn(struct i915_gem_active *active,
> + i915_gem_retire_fn fn,
> + struct mutex *mutex)
> +{
> + lockdep_assert_held(mutex);
> + active->retire = fn ?: i915_gem_retire_noop;
> +}
> +
> static inline struct drm_i915_gem_request *
> __i915_gem_active_peek(const struct i915_gem_active *active)
> {
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index 354f8cec96bb..29509f3055c8 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -216,7 +216,8 @@ static void intel_overlay_submit_request(struct intel_overlay *overlay,
> {
> GEM_BUG_ON(i915_gem_active_peek(&overlay->last_flip,
> &overlay->i915->drm.struct_mutex));
> - overlay->last_flip.retire = retire;
> + i915_gem_active_set_retire_fn(&overlay->last_flip, retire,
> + &overlay->i915->drm.struct_mutex);
> i915_gem_active_set(&overlay->last_flip, req);
> i915_add_request(req);
> }
> --
> 2.11.0
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-12-07 18:11 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 17:28 [PATCH 00/11] drm/i915: Overlay fixes ville.syrjala
2016-12-07 17:28 ` [PATCH 01/11] drm/i915: Fix oops in overlay due to frontbuffer trakcing ville.syrjala
2016-12-07 17:48 ` Chris Wilson
2016-12-07 17:28 ` [PATCH 02/11] drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff ville.syrjala
2016-12-07 17:44 ` Chris Wilson
2016-12-07 17:49 ` Ville Syrjälä
2016-12-07 17:56 ` [PATCH] " Chris Wilson
2016-12-07 18:11 ` Ville Syrjälä [this message]
2016-12-07 18:22 ` Chris Wilson
2016-12-21 14:45 ` [PATCH] drm/i915: Initialize overlay->last_flip properly ville.syrjala
2016-12-07 17:28 ` [PATCH 03/11] drm/i915: Restore dev_priv->mm.interruptible for overlay ville.syrjala
2016-12-07 17:41 ` Chris Wilson
2016-12-07 17:51 ` Ville Syrjälä
2016-12-07 18:25 ` Chris Wilson
2016-12-07 18:45 ` [PATCH] drm/i915: Asynchronously wait for the overlay to finish Chris Wilson
2016-12-07 18:49 ` [PATCH 03/11] drm/i915: Restore dev_priv->mm.interruptible for overlay Ville Syrjälä
2016-12-07 17:28 ` [PATCH 04/11] drm/i915: Fix the overlay frontbuffer tracking ville.syrjala
2016-12-08 9:46 ` Chris Wilson
2016-12-07 17:28 ` [PATCH 05/11] drm/i915: Use pipe_src_w in overlay code ville.syrjala
2016-12-08 8:35 ` Chris Wilson
2016-12-08 16:11 ` Ville Syrjälä
2016-12-07 17:28 ` [PATCH 06/11] drm/i915: Kill intel_panel_fitter_pipe() ville.syrjala
2016-12-08 8:31 ` Chris Wilson
2016-12-07 17:28 ` [PATCH 07/11] drm/i915: Simplify SWIDTHSW calculation ville.syrjala
2016-12-08 8:40 ` Chris Wilson
2016-12-07 17:28 ` [PATCH 08/11] drm/i915: Reorganize overlay filter coeffs into a nicer form ville.syrjala
2016-12-08 8:45 ` Chris Wilson
2016-12-08 16:17 ` Ville Syrjälä
2016-12-08 16:26 ` Chris Wilson
2016-12-22 19:55 ` Ville Syrjälä
2016-12-07 17:28 ` [PATCH 09/11] drm/i915: Use primary plane->state for overlay ckey setup ville.syrjala
2016-12-08 8:50 ` Chris Wilson
2016-12-07 17:28 ` [PATCH 10/11] drm/i915: Disable L2 cache clock gating on 830 when using the overlay ville.syrjala
2016-12-08 9:39 ` Chris Wilson
2016-12-07 17:28 ` [PATCH 11/11] drm/i915: Kill the 830 MI_OVERLAY_OFF workaround ville.syrjala
2016-12-08 0:02 ` kbuild test robot
2016-12-08 14:27 ` kbuild test robot
2016-12-22 19:52 ` [PATCH v2 " ville.syrjala
2016-12-22 21:40 ` Chris Wilson
2016-12-23 14:46 ` Ville Syrjälä
2016-12-07 20:22 ` ✓ Fi.CI.BAT: success for drm/i915: Overlay fixes (rev3) Patchwork
2016-12-21 15:45 ` ✓ Fi.CI.BAT: success for drm/i915: Overlay fixes (rev4) Patchwork
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=20161207181133.GV31595@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox