From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 06/13] drm/i915: Retrieve the current mode upon KMS takeover Date: Wed, 27 Mar 2013 00:52:47 +0100 Message-ID: <20130326235247.GD9021@phenom.ffwll.local> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 12528E621E for ; Tue, 26 Mar 2013 16:49:57 -0700 (PDT) Received: by mail-ee0-f41.google.com with SMTP id c1so1635751eek.14 for ; Tue, 26 Mar 2013 16:49:57 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130326162448.0b345bc5@jbarnes-desktop> 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: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch