From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 06/13] drm/i915: Retrieve the current mode upon KMS takeover Date: Tue, 26 Mar 2013 16:59:55 -0700 Message-ID: <20130326165955.2cba0db3@jbarnes-desktop> References: <1361309508-4901-1-git-send-email-jbarnes@virtuousgeek.org> <1361309508-4901-7-git-send-email-jbarnes@virtuousgeek.org> <1363782985.13528.25.camel@intelbox> <20130326162448.0b345bc5@jbarnes-desktop> <20130326235247.GD9021@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy6-pub.bluehost.com (oproxy6-pub.bluehost.com [67.222.54.6]) by gabe.freedesktop.org (Postfix) with SMTP id 1ECFEE6025 for ; Tue, 26 Mar 2013 16:59:40 -0700 (PDT) In-Reply-To: <20130326235247.GD9021@phenom.ffwll.local> 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-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, 27 Mar 2013 00:52:47 +0100 Daniel Vetter wrote: > On Tue, Mar 26, 2013 at 04:24:48PM -0700, Jesse Barnes wrote: > > On Wed, 20 Mar 2013 14:36:25 +0200 > > Imre Deak wrote: > > > > > > + pipe = -1; > > > > > > > > if (encoder->get_hw_state(encoder, &pipe)) { > > > > - encoder->base.crtc = > > > > - dev_priv->pipe_to_crtc_mapping[pipe]; > > > > - } else { > > > > + crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); > > > > > > get_hw_state() can return true and still leave pipe at -1, causing an > > > invalid access here. > > > > Fixed, thanks. > > That shouldn't actually be possible - if encoder->get_hw_state returns > true but doesn't set the pipe, that's a bug in the callback. So maybe yell > with a WARN? I'll just check all the callbacks; I thought I remembered one case where it seemed to make sense, but yeah a WARN at least would be nice if not. -- Jesse Barnes, Intel Open Source Technology Center