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 ADBCEC433FE for ; Tue, 7 Dec 2021 17:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239995AbhLGRcC (ORCPT ); Tue, 7 Dec 2021 12:32:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbhLGRcA (ORCPT ); Tue, 7 Dec 2021 12:32:00 -0500 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F5FC061574 for ; Tue, 7 Dec 2021 09:28:30 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id n17-20020a9d64d1000000b00579cf677301so18957455otl.8 for ; Tue, 07 Dec 2021 09:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cAiQf0ONQNJNMdL3+jUJU+JidwXWLCQpiHOB2RtvqCE=; b=KvCQ6dF4flLsJTf0KvEcK4GIjyYXs2v/mFJobl/fJywV5MqL8F7fLCBbUfWg2ncDhf S1Ccq6b0r+ZOEKE1yuHcuS/5Qo2/gqzus+eCTa6mJxR+vrO1OW3nIPw28SMDC8AuRjgQ u/Jg8q6DyV9KSj+O72quvvZISTrOLDjAYjKvukolgNttyjAxFpeWY/I0j9PDeJZQf570 p/rHUMcb3YQGCpy5FuwWyzL4IscZWFuQDiTFibOB6jybLLsn+t1wisDq/kz8c+4Ztjx8 DQutOJMLfCusc7SzJ0f84zDVU2CowjDO1kppUEilla3cfdCELyuWPbVCvZEqlfZ9lVNv 3TIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cAiQf0ONQNJNMdL3+jUJU+JidwXWLCQpiHOB2RtvqCE=; b=k7Qq/AORKW0ZlRFxlCA9yuHEbmlSleQQBGZoGJ5XRt0BQSF02L+qwavAIX2Xyl+f1i yvYnmLmh6bDz/jaklfg61hO8JJYzcYqqGBG+TKRAmC6QvCYHpsAbgJKBYf8Tkwpwt6Az nF57SLl+oQhawCd4bCEYYP/qgtc+0naMykXJAhCct/4e6Kih+hv3BUEo1pTT3DMDFOQk kwmlP3dSnRj3S0GHHFj+IokW3X5JpuKM1A7uyLk/pxLIm0m8FmTW10/mE7TkRBbrHecw 1ZwNnvyrZ6SE9WI1DY2eIBOOQTdizSUAWSIp9C7KQb9cm1f/S5pbRQeQt+n+4Tb9Fhi5 OfDA== X-Gm-Message-State: AOAM530qSOyHlQGSx1xQjB1vZZkujHr5RaafAp2KXRAEY9yC1DwIfGkC m+fquFDAeC47eCMHMQhBD7qhMw== X-Google-Smtp-Source: ABdhPJxpv2sQTpaNTYyMr91f6tCuspeaXuCJcm8jiGxkp55PT3GbiwK0ScBsEtJNNeNKjyQ+l1mvBA== X-Received: by 2002:a05:6830:453:: with SMTP id d19mr36870191otc.72.1638898109698; Tue, 07 Dec 2021 09:28:29 -0800 (PST) Received: from ripper (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id q10sm60905oiw.17.2021.12.07.09.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 09:28:28 -0800 (PST) Date: Tue, 7 Dec 2021 09:29:54 -0800 From: Bjorn Andersson To: Hans de Goede Cc: Heikki Krogerus , Imre Deak , 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: <1932c73c-e372-788b-fcbd-13cad52d96da@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1932c73c-e372-788b-fcbd-13cad52d96da@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 07 Dec 08:56 PST 2021, Hans de Goede wrote: > Hi all, > > On 12/7/21 13:26, Heikki Krogerus wrote: > > +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? > > The plan always was to pass some extra information, like the number > of available DP lanes (which can make training faster) along as > parameter to the drm_connector_oob_hotplug_event(). > > The merged version ended up not doing this because there were no > consumers, but passing additional info like HPD state definitely > is ok. > Thanks, that clarifies things. I think it makes sense to pass #lanes, as that would rule out the possibility of attempting to run 4 lanes per dpcd information over a 2-lane mux configuration as well. I will write up some patches. Regards, Bjorn