Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754636AbbLPId4 (ORCPT ); Wed, 16 Dec 2015 03:33:56 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38683 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632AbbLPIdx (ORCPT ); Wed, 16 Dec 2015 03:33:53 -0500 Date: Wed, 16 Dec 2015 09:33:50 +0100 From: Daniel Vetter To: Lyude Cc: David Airlie , "open list:DRM DRIVERS" , open list , Daniel Vetter , Rui Matos , Julien Wajsberg , kuddel.mail@gmx.de, Lennart Poettering , Rob Clark , Benjamin Tissoires Subject: Re: [PATCH v2] drm/i915: Send a hotplug event on resume instead of an IRQ event Message-ID: <20151216083350.GD30437@phenom.ffwll.local> Mail-Followup-To: Lyude , David Airlie , "open list:DRM DRIVERS" , open list , Rui Matos , Julien Wajsberg , kuddel.mail@gmx.de, Lennart Poettering , Rob Clark , Benjamin Tissoires References: <1450211658.8084.11.camel@redhat.com> <1450218356-24028-1-git-send-email-cpaul@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450218356-24028-1-git-send-email-cpaul@redhat.com> X-Operating-System: Linux phenom 4.2.0-1-amd64 User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3643 Lines: 84 On Tue, Dec 15, 2015 at 05:25:56PM -0500, Lyude wrote: > We currently call drm_helper_hpd_irq_event() to handle reprobing > displays on resume, however drm_helper_hpd_irq_event() only checks the > status of hpd. HPD doesn't update if the displays connected changed > before resuming the system, and as such causes us not to detect any > connection changes after resume. > > This originally wasn't the case since drm would reset all of the > connectors to unknown during resume and cause a reprobe (since the > connector statuses would change), however this behavior changed in > 5677d67ae394 ('drm: Stop resetting connector state to unknown'). > > Signed-off-by: Lyude > --- > I did some research into why setting the connector state to unknown was > causing a reprobe and discovered that the fact that this reprobing ever > worked at all was just a coincidence (i915's IRQ handler gets called by the > irq event, notices the state of all the connectors changed since they were > set to unknown, causes a reprobe). This seems to fix everything (including > monitor detection in normal VTs), and I can't figure out any real use now > for us to set everything to unknown so I'm going to go the route of just > sending the hotplug event instead. > > drivers/gpu/drm/i915/i915_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index 760e0ce..27a6c1b 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -792,7 +792,7 @@ static int i915_drm_resume(struct drm_device *dev) > * */ > intel_hpd_init(dev_priv); > /* Config may have changed between suspend and resume */ > - drm_helper_hpd_irq_event(dev); > + drm_kms_helper_hotplug_event(dev); So there's a bunch of things broken in this area, but just from your description it's unclear what exactly. Problems I'm aware of: - hpd_irq_event() only reprobes connectors for which hpd is enabled, which are not all of them. We broke this in commit 816da85a0990c2b52cfffa77637d1c770d6790e9 Author: Daniel Vetter Date: Tue Oct 23 18:23:33 2012 +0000 drm: handle HPD and polled connectors separately which is positively ages ago. Also note that any other driver not using vt switching also suffers from this (atm radeon, nouveau, rockchip, amdgpu). otoh at least from a quick those drivers also don't really bother with reprobing on resume really. - DP MST reprobing is busted in i915 since commit e7d6f7d708290da1b7c92f533444b042c79412e0 Author: Dave Airlie Date: Mon Dec 8 13:23:37 2014 +1000 drm/i915: resume MST after reading back hw state There's some bug reports iirc from Takashi and Ted Tso about this. Your patch won't help for DP MST since we never reprobe MST state from userspace, it only ever happens through interrupt handling. Well mostly, if you completely unplug something then we detect that and throw all the MST stuff over board, but if you e.g. just change a connection in your dock or go from one dock to another we won't detect this. Which one of the above is it? And to what extend do you care about this working everywhere? Sorry that I'm opening a can of worms here. Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/