From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm: kms_helper: don't lose hotplug event Date: Thu, 25 Oct 2012 10:07:46 +0100 Message-ID: <6c3329$6th7mi@orsmga002.jf.intel.com> References: <1351106213-3809-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 mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id AB583A01F5 for ; Thu, 25 Oct 2012 02:08:34 -0700 (PDT) In-Reply-To: <1351106213-3809-1-git-send-email-daniel.vetter@ffwll.ch> 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: DRI Development Cc: Daniel Vetter List-Id: dri-devel@lists.freedesktop.org On Wed, 24 Oct 2012 21:16:53 +0200, Daniel Vetter wrote: > There's a race window (small for hpd, 10s large for polled outputs) > where userspace could sneak in with an unrelated connnector probe > ioctl call and eat the hotplug event (since neither the hpd nor the > poll code see a state change). > > To avoid this, check whether the connector state changes in all other > ->detect calls (in the current helper code that's only probe_single) > and if that's the case, fire off a hotplug event. Note that we can't > directly call the hotplug event handler, since that expects that no > locks are held (due to reentrancy with the fb code to update the kms > console). > > Also, this requires that drivers using the probe_single helper > function set up the poll work. All current drivers do that already, > and with the reworked hpd handling there'll be no downside to > unconditionally setting up the poll work any more. > > Signed-off-by: Daniel Vetter Aye, we do want the hotplug notification for the desktop to respond to if the user happens to steal it by haplessly querying the system with xrandr. lgtm, Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre