Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38FA7C433EF for ; Tue, 7 Dec 2021 12:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232031AbhLGM3n (ORCPT ); Tue, 7 Dec 2021 07:29:43 -0500 Received: from mga06.intel.com ([134.134.136.31]:21863 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231718AbhLGM3m (ORCPT ); Tue, 7 Dec 2021 07:29:42 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10190"; a="298359149" X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="298359149" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 04:26:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="657661600" Received: from kuha.fi.intel.com ([10.237.72.166]) by fmsmga001.fm.intel.com with SMTP; 07 Dec 2021 04:26:06 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 07 Dec 2021 14:26:05 +0200 Date: Tue, 7 Dec 2021 14:26:05 +0200 From: Heikki Krogerus To: Bjorn Andersson , Hans de Goede , Imre Deak Cc: Prashant Malani , Doug Anderson , Laurent Pinchart , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-arm-msm , LKML , Abhinav Kumar , Stephen Boyd , Kuogee Hsieh , dri-devel , Vara Reddy , freedreno , Enric Balletbo i Serra , Benson Leung Subject: Re: [RFC] drm/msm/dp: Allow attaching a drm_panel Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Hans and Imre On Mon, Dec 06, 2021 at 02:31:40PM -0800, Bjorn Andersson wrote: > On Thu 07 Oct 03:17 PDT 2021, Heikki Krogerus wrote: > > On Wed, Oct 06, 2021 at 01:26:35PM -0700, Prashant Malani wrote: > > > (CC+ Heikki) > [..] > > > On Wed, Oct 6, 2021 at 8:19 AM Doug Anderson wrote: > [..] > > void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode); > > > > If your USB Type-C controller/port driver does not yet register the DP > > alt mode, the it's responsible of handling HPD separately by calling > > drm_connector_oob_hotplug_event() on its own. > > > > Finally found my way back to this topic and it doesn't look like I can > reuse the existing altmode code with the firmware interface provided by > Qualcomm, so I just hacked something up that invokes > drm_connector_oob_hotplug_event(). > > But I'm not able to make sense of what the expected usage is. Reading > altmode/displayport.c, it seems that I should only invoke > drm_connector_oob_hotplug_event() as HPD state toggles. > > I made a trial implementation of this, where my firmware interface > driver calls drm_connector_oob_hotplug_event() every time HPD state > changes and then in my oob_hotplug_event callback I flip the DP > controller between on and off. > > Unfortunately when I then connect my HDMI dongle, I get HPD state HIGH, > call the oob_hotplug_event, the DP driver powers up and concludes that > there's nothing connected to the dongle and goes to idle. I then connect > the HDMI cable to the dongle, the firmware sends me another message with > HPD irq and state HIGH, which I ignore because it's not a change in > state. > > In the end I hacked up drm_connector_oob_hotplug_event() to allow me to > pass the HPD state and this solves my problem. I can now distinguish > between connect, disconnect and attention. > > Can you please help shed some light on what I might be missing? Originally I wanted an API that we could use to pass all the details that we have in the USB Type-C drivers (that would be the configuration and status) to the GPU drivers, but Hans was against that because, if I remember correctly, the OOB hotplug event may need to be delivered to the GPU drivers in some cases even when the connector is not USB Type-C connector, and he wanted a common API. Hans, please correct me if I got it wrong. I think that the GPU drivers need to handle USB Type-C connectors separately one way or the other, but maybe the notification from the connector can continue to be generic - not USB Type-C specific. Imre proposed that the GPU drivers should be able to query the DisplayPort configuration and status from the USB Type-C drivers instead of the USB Type-C drivers just dumping the information together with the notification about some event (so connection, disconnection or attention) like I originally proposed. Imre, please correct me if I misunderstood you :-). I'm fine with anything, but we do need improvement here as you guys can see. thanks, -- heikki