Patch "drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff" has been added to the 4.9-stable tree
From: <gregkh@linuxfoundation.org>
Date: 2017-01-09 09:33:26
This is a note to let you know that I've just added the patch titled
drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-i915-fix-oopses-in-the-overlay-code-due-to-i915_gem_active-stuff.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let [off-list ref] know about it.
From b72eb5ffa6d8601d9ba72619d75fb5b27723743a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <redacted>
Date: Wed, 7 Dec 2016 17:56:47 +0000
Subject: drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Ville Syrjälä <redacted>
commit b72eb5ffa6d8601d9ba72619d75fb5b27723743a upstream.
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 <redacted>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Fixes: 0d9bdd886f29 ("drm/i915: Convert intel_overlay to request tracking")
Signed-off-by: Ville Syrjälä <redacted>
Signed-off-by: Chris Wilson <redacted>
Link: http://patchwork.freedesktop.org/patch/msgid/20161207175647.10018-1-chris@chris-wilson.co.uk
(cherry picked from commit ecd9caa0522db5a6b03ac8858c42067ef9d8323b)
Signed-off-by: Jani Nikula <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/i915_gem_request.h | 19 +++++++++++++++++++
drivers/gpu/drm/i915/intel_overlay.c | 3 ++-
2 files changed, 21 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h@@ -344,6 +344,25 @@ i915_gem_active_set(struct i915_gem_acti 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) { --- 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 { 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); }
Patches currently in stable-queue which might be from ville.syrjala@linux.intel.com are queue-4.9/drm-i915-fix-oopses-in-the-overlay-code-due-to-i915_gem_active-stuff.patch queue-4.9/drm-i915-initialize-overlay-last_flip-properly.patch queue-4.9/drm-i915-force-vdd-off-on-the-new-power-seqeuencer-before-starting-to-use-it.patch queue-4.9/drm-i915-fix-oops-in-overlay-due-to-frontbuffer-tracking.patch