From patchwork Fri Nov 4 03:30:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 9411783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD4C760585 for ; Fri, 4 Nov 2016 03:30:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2548290D8 for ; Fri, 4 Nov 2016 03:30:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 937CC2AF54; Fri, 4 Nov 2016 03:30:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D0F9290D8 for ; Fri, 4 Nov 2016 03:30:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 789746E87C; Fri, 4 Nov 2016 03:30:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A41B6E00B for ; Fri, 4 Nov 2016 03:30:48 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 03 Nov 2016 20:30:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.31,442,1473145200"; d="scan'208"; a="1080404058" Received: from nuc-skylake.jf.intel.com ([10.54.75.23]) by fmsmga002.fm.intel.com with ESMTP; 03 Nov 2016 20:30:47 -0700 From: Dhinakaran Pandiyan To: intel-gfx@lists.freedesktop.org Date: Thu, 3 Nov 2016 20:30:14 -0700 Message-Id: <1478230214-4016-1-git-send-email-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.7.4 Cc: Dhinakaran Pandiyan Subject: [Intel-gfx] [PATCH] drm/i915/dp: Update connector status for DP MST hotplugs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Hotplugging a monitor in DP MST configuration triggers short pulses. Although the short pulse handling path ends up in the MST hotplug function, we do not perform a detect before sending the hotplug uvent. This leads to the connector status not being updated when the userspace calls DRM_IOCTL_MODE_GETCONNECTOR. So, let's call the connector function ->detect() to update the connector status before sending the uevent. Signed-off-by: Dhinakaran Pandiyan --- drivers/gpu/drm/i915/intel_dp_mst.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 3ffbd69..a28b12b 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -492,8 +492,25 @@ static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct drm_device *dev = intel_dig_port->base.base.dev; + struct intel_connector *intel_connector; + bool change = false; + enum drm_connector_status old_status; + + for_each_intel_connector(dev, intel_connector) { + struct drm_connector *connector = &(intel_connector->base); + + if (intel_connector->mst_port != intel_dp) + continue; + + old_status = connector->status; + connector->status = connector->funcs->detect(connector, false); + + if (old_status != connector->status) + changed = true; + } - drm_kms_helper_hotplug_event(dev); + if (changed) + drm_kms_helper_hotplug_event(dev); } static const struct drm_dp_mst_topology_cbs mst_cbs = {