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 B0825C433FE for ; Tue, 7 Dec 2021 16:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239668AbhLGRAR (ORCPT ); Tue, 7 Dec 2021 12:00:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26505 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239664AbhLGRAQ (ORCPT ); Tue, 7 Dec 2021 12:00:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638896205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NbZlHXLrH/KJuXxiNiEqP7XsRIdskxdthUk853zOUiw=; b=e2weVA2U8M6qw9Vu/T6kuO1zVvXuMsxrKAYe3w/2cUw0g8/LsLBppDUYk8Y1wLmyG1AHLG t+am2wGssaFsHu1RljqnqRYLr6UOo4RYZjZHkjWdJgEZs1gG012GJcsxj6VZtGaYRmCfW2 Yl9gbdMT3AU+dAfRVHXEVsLWPKE1eXU= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-6Cndx51hOR-w-y7ynnClXA-1; Tue, 07 Dec 2021 11:56:43 -0500 X-MC-Unique: 6Cndx51hOR-w-y7ynnClXA-1 Received: by mail-ed1-f72.google.com with SMTP id w18-20020a056402071200b003e61cbafdb4so12023975edx.4 for ; Tue, 07 Dec 2021 08:56:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=NbZlHXLrH/KJuXxiNiEqP7XsRIdskxdthUk853zOUiw=; b=dn7dgoEyBLDDUANlLXrnMIZHcAoMaV5rgrmz61K+u/6o9k/25H5BfaNPuXfE1H7+TI 2lk+dRLfti6gk6ZmZ9re8IIL9BE50OI2X9jy6+/E2LN/RVtk2ceCTzOt/Hk+5ovbeQhh 22M3YtuDwAk7PWGivUeDN/vbARyN4oporXGjFNdcu1S+ikVBI1vh6X/JxcoUoWK1kwl6 QAtn6dsSv9/PWiXrDwi8QJxePdYmezPMh+Xwd4Nde1R3spOZlvStmtA2AikuctAxV68N RI2jA3CwaIDo0VXmu/Fvhp5ZJf/LPAFATHpu3bQoHjxCAOtTX/M+dJQ2RdGVduFeClXX 2A6Q== X-Gm-Message-State: AOAM5334TEn7U1KvN3hYEzxa5W4QvoJb2xjtyL1Da7rRphxuf4gdCxFT yqIMVK9gsxfetPwNHY5pC+feHkcZqlzd3sEQ7roNLdEoY9u0SFmhUEsrA9JpiB8zoPZCu2sq9as 4KuZBrodz9WUTyXpWaPWFEMfi X-Received: by 2002:a05:6402:1e90:: with SMTP id f16mr10814705edf.91.1638896202411; Tue, 07 Dec 2021 08:56:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWY5F2d+fnUAIHK7DKXb2eeQuC/2KAs3zfqQ8Bz4jxzk/E6I9ha/jg6dxz+Cfm3QS2MOTNmg== X-Received: by 2002:a05:6402:1e90:: with SMTP id f16mr10814679edf.91.1638896202262; Tue, 07 Dec 2021 08:56:42 -0800 (PST) Received: from ?IPV6:2001:1c00:c1e:bf00:1054:9d19:e0f0:8214? (2001-1c00-0c1e-bf00-1054-9d19-e0f0-8214.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1054:9d19:e0f0:8214]) by smtp.gmail.com with ESMTPSA id w18sm197483edx.55.2021.12.07.08.56.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Dec 2021 08:56:41 -0800 (PST) Message-ID: <1932c73c-e372-788b-fcbd-13cad52d96da@redhat.com> Date: Tue, 7 Dec 2021 17:56:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [RFC] drm/msm/dp: Allow attaching a drm_panel Content-Language: en-US To: Heikki Krogerus , Bjorn Andersson , 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 References: From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Hans i