From: Jesse Barnes Subject: Re: [PATCH] drm/i915: push crtc->fb update into pipe_set_base Date: Wed, 5 Sep 2012 10:55:26 -0700 Message-ID: <20120905105526.5a55552f@jbarnes-desktop> References: <1345403595-9678-45-git-send-email-daniel.vetter@ffwll.ch> <1346787202-2643-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy7-pub.bluehost.com (oproxy7-pub.bluehost.com [67.222.55.9]) by gabe.freedesktop.org (Postfix) with SMTP id 4281DA0305 for ; Wed, 5 Sep 2012 10:55:28 -0700 (PDT) In-Reply-To: <1346787202-2643-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Tue, 4 Sep 2012 21:33:22 +0200 Daniel Vetter wrote: > Passing in the old fb, having overwritten the current fb, leads to > some neatly convoluted code. It's much simpler if we defer the > crtc->fb update to the place that updates the hw, in pipe_set_base. > This way we also don't need to restore anything in case something > fails - we only update crtc->fb once things have succeeded. > > The real reason for this change is that now we keep the old fb > assigned to crtc->fb, which allows us to finally move the crtc disable > case into the common low-level set_mode function in the next patch. > > Also don't clobber crtc->x and crtc->y, we neatly pass these down the > callchain already. Unfortunately we can't do the same with crtc->mode, > because that one is being used in the mode_set callbacks. > > v2: Don't restore the drm_crtc object any more on failed modesets, > since we've lose an fb reference otherwise. Also (and this is the > reason this has been found), this totally confused the modeset state > tracking, since it clobbers crtc->enabled. Issue reported by Paulo > Zanoni. Ok obviously missed the leak. Reviewed-by: Jesse Barnes -- Jesse Barnes, Intel Open Source Technology Center