[Intel-gfx] [PATCH 02/11] drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 7 17:44:15 UTC 2016


On Wed, Dec 07, 2016 at 07:28:04PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at 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 setting the ->retire hook using init_request_active()
> so that it'll do the NULL->i915_gem_retire_noop conversion for us.
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Fixes: 0d9bdd886f29 ("drm/i915: Convert intel_overlay to request tracking")
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_overlay.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index 1cc963814224..786389dd5175 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -216,7 +216,7 @@ 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;
> +	init_request_active(&overlay->last_flip, retire);

Hmm, init, not reinit. The alternative is to use i915_gem_retire_noop
instead of NULL. (And sorry, it did used to allow NULL.)

overlay->last_flip.retire = retire ?= i915_gem_retire_noop;

Or i915_gem_active_set_retire_fn(&overlay->last_flip, retire);
That's seems like it should make everyone a bit happier.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list