From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbbCLI1e (ORCPT ); Thu, 12 Mar 2015 04:27:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:48391 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbbCLI13 (ORCPT ); Thu, 12 Mar 2015 04:27:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,387,1422950400"; d="scan'208";a="690952482" From: Jani Nikula To: Xi Ruoyao , daniel.vetter@intel.com, airlied@linux.ie Cc: intel-gfx@lists.freedesktop.org, dri-level@lists.freedesktop.org, linux-kernel@vger.kernel.org, Xi Ruoyao , "Roper\, Matthew D" Subject: Re: [PATCH v2] drm/i915: Fix BUG in i915_gem.c when switch to console In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: User-Agent: Notmuch/0.19+72~gd7c02cb (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 12 Mar 2015 10:28:56 +0200 Message-ID: <87pp8er54n.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Mar 2015, Xi Ruoyao wrote: > In intel_crtc_page_flip, intel_display.c, the code changed the framebuffer > assigned to plane crtc->primary by > > crtc->primary->fb = fb; > > However, it forgot to change crtc->primary->state->fb. However, when we > switch to console, some kernel code will read crtc->primary->state->fb > to get the framebuffer assigned to crtc->primaty. Then a framebuffer > object can be unpinned twice and a kernel BUG will be produced in i915_gem.c. > > So, update crtc->primary->state->fb in intel_display.c using > drm_atomic_set_fb_for_plane to fix the BUG. > > Signed-off-by: Xi Ruoyao > Fixed: Bug 93711 Is this a problem with drm-intel-nightly? In particular see commit afd65eb4cc0578a9c07d621acdb8a570e2782bf7 Author: Matt Roper Date: Tue Feb 3 13:10:04 2015 -0800 drm/i915: Ensure plane->state->fb stays in sync with plane->fb Matt, do you think this fixes the described issue? Can we backport to drm-intel-fixes (and v4.0)? BR, Jani. > --- > Sorry, the previous patch is mangled by email client, so I am re-sending it. > > drivers/gpu/drm/i915/intel_display.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index e730789..97083fd 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -37,6 +37,7 @@ > #include > #include "i915_drv.h" > #include "i915_trace.h" > +#include > #include > #include > #include > @@ -9816,6 +9817,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, > drm_gem_object_reference(&obj->base); > > crtc->primary->fb = fb; > + drm_atomic_set_fb_for_plane(crtc->primary->state, fb); > > work->pending_flip_obj = obj; > > -- > 1.9.1 > -- Jani Nikula, Intel Open Source Technology Center