From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/fb-helper: delay hotplug handling when partially bound Date: Wed, 18 Jul 2012 17:52:52 +0200 Message-ID: <20120718155252.GF5348@phenom.ffwll.local> References: <1339750882-23398-1-git-send-email-daniel.vetter@ffwll.ch> <1339752751_24743@CP5-2952> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id CA79CA0DC1 for ; Wed, 18 Jul 2012 08:52:47 -0700 (PDT) Received: by bkcji2 with SMTP id ji2so1516543bkc.36 for ; Wed, 18 Jul 2012 08:52:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1339752751_24743@CP5-2952> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Chris Wilson , Dave Airlie Cc: Daniel Vetter , DRI Development List-Id: dri-devel@lists.freedesktop.org On Fri, Jun 15, 2012 at 10:32:20AM +0100, Chris Wilson wrote: > On Fri, 15 Jun 2012 11:01:22 +0200, Daniel Vetter wrote: > > Ok, this requires quite a dance to actually hit: > > 1) We plug in a 2nd screen, enable it in both X and (by vt-switching) > > in the fbcon. > > 2) We disable that screen again in with xrandr. > > 3) We vt-switch again, so that fbcon displays on the 2nd screen, but X > > on the first screen. This obviously needs a driver that doesn't switch > > off unused functions when regaining the VT. > > 3) When X controls the vt, we unplug that screen. > > > > Now drm_fb_helper_hotplug_event we noticed that that some crtcs are > > bound, but because we still have the fbcon on the 2nd screeen we also > > have bound set. Which means the fbcon wrongly assumes it's in control > > of everything an happily disables the output on the 2nd screen, but > > enables its fb on the first screen. > > > > Work around this issue by counting how many crtcs are bound and how > > many are bound to fbcon and assuming that when fbcon isn't bound to > > all of them, it better not touch the output configuration. > > > > Conceptually this is the same as only restoring the fbcon output > > configuration on the driver's ->lastclose, when we're sure that no one > > else is using kms. So this should be consistent with existing kms > > drivers. > > > > Chris has created a separate patch for the intel ddx, but I think we > > should fix this issue here regardless - the fbcon messing with the > > output config while it's not fully in control simply isn't a too > > polite behaviour. > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50772 > > Tested-by: Maxim A. Nikulin > > Signed-Off-by: Daniel Vetter > Reviewed-by: Chris Wilson Hi Dave, This one here fixes a bug where fbcon clobbers outputs even though a real drm client is still displaying things. Please include for 3.6. Cheers, Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48