From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49EF8C433B4 for ; Tue, 4 May 2021 15:34:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1669B6115B for ; Tue, 4 May 2021 15:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231326AbhEDPfN (ORCPT ); Tue, 4 May 2021 11:35:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20942 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbhEDPfM (ORCPT ); Tue, 4 May 2021 11:35:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620142457; 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=yTR7KxNHedPcWlig0HG3YpWXMEHessQmv89zJz6Bk7k=; b=TagLtzu2ppwDdAXBo4VCni2IDBqNHw/c86B/oAVIPcu4Ja+6iMOUg0lMuwmQ/BiGgtnWLg 3kjD0m4LJ+zS6KkV33xOsOl11oVECrXD2zRATBOXUHBbpq2Ehk4C6igx42KN4DIE/Xu2pk dLnuqWpeimHnIGgsiHY4PIDSqe0vXHY= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-6ge05ahfO5WTIAOmAskmzw-1; Tue, 04 May 2021 11:34:14 -0400 X-MC-Unique: 6ge05ahfO5WTIAOmAskmzw-1 Received: by mail-ej1-f69.google.com with SMTP id qk30-20020a170906d9deb02903916754e1b6so3274086ejb.2 for ; Tue, 04 May 2021 08:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yTR7KxNHedPcWlig0HG3YpWXMEHessQmv89zJz6Bk7k=; b=JIQQZzlkjsapWSsDUBIvKU5vMC0g37R4GYiNKOLFa0qKMyM5Qp0yF3AgmU66L3Ewcm ftouJLMBMN6eZiy8+W1QWTC3VvyhFd6g/Yhwq+pVRvpw7RukWuUshz/C29m1oyxqIXT3 bxdxjTU2ZpeSGg2Nk+2QSH4pB0CbX7SdOCJmMZvh1QzOG9b4zdTQHPijTGh8Fai6oQIk /NwzErP+aiBGsfRjyMQpfvIkBl3Jj5uq9kRBBu2mr5XYErMG25LXkv6qPjyoMgPH1g4j kgtOw3UQFtyqy4++A0aJ2TXF3xhMXtcNjcm4McyOIXm1fMFUNRbQ7mrFzEXe4OwsXDQv SM5A== X-Gm-Message-State: AOAM533HdHq6OncoS1ovshrRFVJDoCbwdbC96ScoPbs5K4+U54x1hOoZ RJvKqlGktrZ7lZhzEPjNG0zf4Y9lBeJQ6HYI2tu1GpD6spix/G7EB/OIN5dksRYNNvFEwPqM26U 9PIlcBQAX8CTAHLdGt0gua3eULDvA4Loc8g== X-Received: by 2002:a17:906:5495:: with SMTP id r21mr22710116ejo.471.1620142453389; Tue, 04 May 2021 08:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/9ENOolVDsOP9e1/qJjV8sFUtPE9yGpoQtUWrlmSggZGp55BI4Pp+2sNfMIGO+z3VLrCpDQ== X-Received: by 2002:a17:906:5495:: with SMTP id r21mr22710085ejo.471.1620142453131; Tue, 04 May 2021 08:34:13 -0700 (PDT) Received: from x1.localdomain (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 f19sm14604035edu.12.2021.05.04.08.34.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 08:34:12 -0700 (PDT) Subject: Re: [PATCH 4/9] drm/connector: Add support for out-of-band hotplug notification To: Heikki Krogerus Cc: Imre Deak , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Daniel Vetter , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Greg Kroah-Hartman , Guenter Roeck , intel-gfx , dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org References: <20210428215257.500088-1-hdegoede@redhat.com> <20210428215257.500088-5-hdegoede@redhat.com> <00e380b2-0376-0ddb-9b0e-342779b7fc06@redhat.com> From: Hans de Goede Message-ID: <077edd03-c24f-01ac-18da-5b6fca8ce7c0@redhat.com> Date: Tue, 4 May 2021 17:34:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Hi, On 5/4/21 4:52 PM, Heikki Krogerus wrote: > On Mon, May 03, 2021 at 04:35:29PM +0200, Hans de Goede wrote: >> Hi, >> >> On 5/3/21 10:00 AM, Heikki Krogerus wrote: >>> Hi Hans, >>> >>> On Wed, Apr 28, 2021 at 11:52:52PM +0200, Hans de Goede wrote: >>>> +/** >>>> + * struct drm_connector_oob_hotplug_event_data: OOB hotplug event data >>>> + * >>>> + * Contains data about out-of-band hotplug events, signalled through >>>> + * drm_connector_oob_hotplug_event(). >>>> + */ >>>> +struct drm_connector_oob_hotplug_event_data { >>>> + /** >>>> + * @connected: New connected status for the connector. >>>> + */ >>>> + bool connected; >>>> + /** >>>> + * @dp_lanes: Number of available displayport lanes, 0 if unknown. >>>> + */ >>>> + int dp_lanes; >>>> + /** >>>> + * @orientation: Connector orientation. >>>> + */ >>>> + enum typec_orientation orientation; >>>> +}; >>> >>> I don't think the orientation is relevant. It will always be "normal" >>> from DP PoW after muxing, no? >> >> That is what I thought to, but during the discussion of my previous attempt >> at this one of the i915 devs mentioned that in some cases the muxes manage >> to swap the lane order when the connector upside-down and at least the >> Intel GPUs can correct for this on the GPU side, so they asked for this >> info to be included. >> >>> I'm also not sure those deatils are enough in the long run. Based on >>> what I've understood from our graphics team guys, for example knowing >>> if multi-function is preferred may be important in some cases. >> >> The current data being passed is just intended as a starting point, >> this is purely a kernel internal API so we can easily add more >> data to the struct. As I mentioned in the cover-letter the current >> oob_hotplug handler which the i915 patch adds to the i915 driver does >> not actually do anything with the data. ATM it is purely there to >> demonstrate that the ability to pass relevant data is there now >> (which was an issue with the previous attempt). I believe the current >> code is fine as a PoC of "pass event data" once GPU drivers actually >> start doing something with the data we can extend or outright replace >> it without issues. > > Ah, if there is nothing using that information yet, then just don't > pass it at all for now. As you said, it's kernel internal API, we can > change it later if needed. > >>> All of that, and more, is already available in the Configuration VDO >>> Status VDO that the we have negotiated with the DP partner. Both those >>> VDOs are part of struct typec_displayport_data. I think we should >>> simply supply that structure to the DRM code instead of picking those >>> details out of it... >> >> I'm not sure I like the idea of passing the raw VDO, but if the >> DRM folks think that would be useful we can certainly add it. > > Why are you against passing all the data that we have? What is the > benefit in picking only certain details out of an object that has a > standard format, and constructing a customised object for those > details instead? The VDO is Type-C specific and the drm_connector_oob_hotplug_event() is intended to be a generic API. There are other OOB event sources, e.g. the drivers/apci/acpi_video.c code receives hotplug events for connectors on powered-down GPUs on dual/hybrid GPU laptops. ATM the GPU drivers register an ACPI notifier to catch these; and there are no immediate plans to change this, but this does illustrate how OOB hotplug notification is not just a Type-C thing, where as the VDO and its format very much are Type-C things. Regards, Hans From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A27EDC43461 for ; Tue, 4 May 2021 15:34:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47EA1610FA for ; Tue, 4 May 2021 15:34:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47EA1610FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A00AD6EB23; Tue, 4 May 2021 15:34:19 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2C3B6EB23 for ; Tue, 4 May 2021 15:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620142458; 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=yTR7KxNHedPcWlig0HG3YpWXMEHessQmv89zJz6Bk7k=; b=czBNnY0O6HIXNAxBLx81mofmTGtde9pCpcva+jJhiFPFmEBkYTQHm+eYhVzspGg7ClNbgc WDbRzMZNgvxkbFOxdOiS42H58dzCgFxrllKLsmq1RGtvg+2JUmFohqx7mu0Hg/IsIGHdUs /ptkW+zVzothOUOtdWOCnppB/IAqSr8= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-F0QOrMYwPpOpb3lKsaHkvg-1; Tue, 04 May 2021 11:34:14 -0400 X-MC-Unique: F0QOrMYwPpOpb3lKsaHkvg-1 Received: by mail-ej1-f72.google.com with SMTP id r18-20020a1709069592b029039256602ce8so3280792ejx.1 for ; Tue, 04 May 2021 08:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yTR7KxNHedPcWlig0HG3YpWXMEHessQmv89zJz6Bk7k=; b=CQ6jOOjEzNE/NE77hE8cZ6cnCyrke3xNNktrJWLS7z9A1JG2Wo+vCG2//Rj79qVARG TBQmyRFcgYyCbDEk/fbstpv25zHk+bjM98ouF7/4g6dURwqJbSGbbQ8n9z0GS1kvqMsK 4gG4qwVPDftlnEvTZI2q3xrQMbafq3OQ1ZUtXVxcAqOBPaJlvalQOGJNLrob8cq4TsV8 MnsQCAAwUNzLthoumFqy3xJHASGnMUiQVXzRJ+9HQh358SFiLEtpvCgvuNNvw5JuWIaG dyAmaHRhrsYq9qXmlbnfRxezpOm+vVMRStjOcfTy863CzRrHFF+tIbiE1T7c8gmLJUXT YQPw== X-Gm-Message-State: AOAM5301aY64YsGD2DXTCWwHhcMJJPAPdG/bZSCqgrMPrXEJpYHKHdPU uQi44JpU424+vYJ0OYs946uHmaN++CCAiB4tDVJM93E1qlTq5aydQG4afjl4+1HEHcX+aJ+UAXj imBYST8kU9uMkZw7lfEAdz6pyrYZB X-Received: by 2002:a17:906:5495:: with SMTP id r21mr22710107ejo.471.1620142453388; Tue, 04 May 2021 08:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/9ENOolVDsOP9e1/qJjV8sFUtPE9yGpoQtUWrlmSggZGp55BI4Pp+2sNfMIGO+z3VLrCpDQ== X-Received: by 2002:a17:906:5495:: with SMTP id r21mr22710085ejo.471.1620142453131; Tue, 04 May 2021 08:34:13 -0700 (PDT) Received: from x1.localdomain (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 f19sm14604035edu.12.2021.05.04.08.34.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 08:34:12 -0700 (PDT) Subject: Re: [PATCH 4/9] drm/connector: Add support for out-of-band hotplug notification To: Heikki Krogerus References: <20210428215257.500088-1-hdegoede@redhat.com> <20210428215257.500088-5-hdegoede@redhat.com> <00e380b2-0376-0ddb-9b0e-342779b7fc06@redhat.com> From: Hans de Goede Message-ID: <077edd03-c24f-01ac-18da-5b6fca8ce7c0@redhat.com> Date: Tue, 4 May 2021 17:34:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org, Thomas Zimmermann , David Airlie , Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, Rodrigo Vivi , intel-gfx , Guenter Roeck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, On 5/4/21 4:52 PM, Heikki Krogerus wrote: > On Mon, May 03, 2021 at 04:35:29PM +0200, Hans de Goede wrote: >> Hi, >> >> On 5/3/21 10:00 AM, Heikki Krogerus wrote: >>> Hi Hans, >>> >>> On Wed, Apr 28, 2021 at 11:52:52PM +0200, Hans de Goede wrote: >>>> +/** >>>> + * struct drm_connector_oob_hotplug_event_data: OOB hotplug event data >>>> + * >>>> + * Contains data about out-of-band hotplug events, signalled through >>>> + * drm_connector_oob_hotplug_event(). >>>> + */ >>>> +struct drm_connector_oob_hotplug_event_data { >>>> + /** >>>> + * @connected: New connected status for the connector. >>>> + */ >>>> + bool connected; >>>> + /** >>>> + * @dp_lanes: Number of available displayport lanes, 0 if unknown. >>>> + */ >>>> + int dp_lanes; >>>> + /** >>>> + * @orientation: Connector orientation. >>>> + */ >>>> + enum typec_orientation orientation; >>>> +}; >>> >>> I don't think the orientation is relevant. It will always be "normal" >>> from DP PoW after muxing, no? >> >> That is what I thought to, but during the discussion of my previous attempt >> at this one of the i915 devs mentioned that in some cases the muxes manage >> to swap the lane order when the connector upside-down and at least the >> Intel GPUs can correct for this on the GPU side, so they asked for this >> info to be included. >> >>> I'm also not sure those deatils are enough in the long run. Based on >>> what I've understood from our graphics team guys, for example knowing >>> if multi-function is preferred may be important in some cases. >> >> The current data being passed is just intended as a starting point, >> this is purely a kernel internal API so we can easily add more >> data to the struct. As I mentioned in the cover-letter the current >> oob_hotplug handler which the i915 patch adds to the i915 driver does >> not actually do anything with the data. ATM it is purely there to >> demonstrate that the ability to pass relevant data is there now >> (which was an issue with the previous attempt). I believe the current >> code is fine as a PoC of "pass event data" once GPU drivers actually >> start doing something with the data we can extend or outright replace >> it without issues. > > Ah, if there is nothing using that information yet, then just don't > pass it at all for now. As you said, it's kernel internal API, we can > change it later if needed. > >>> All of that, and more, is already available in the Configuration VDO >>> Status VDO that the we have negotiated with the DP partner. Both those >>> VDOs are part of struct typec_displayport_data. I think we should >>> simply supply that structure to the DRM code instead of picking those >>> details out of it... >> >> I'm not sure I like the idea of passing the raw VDO, but if the >> DRM folks think that would be useful we can certainly add it. > > Why are you against passing all the data that we have? What is the > benefit in picking only certain details out of an object that has a > standard format, and constructing a customised object for those > details instead? The VDO is Type-C specific and the drm_connector_oob_hotplug_event() is intended to be a generic API. There are other OOB event sources, e.g. the drivers/apci/acpi_video.c code receives hotplug events for connectors on powered-down GPUs on dual/hybrid GPU laptops. ATM the GPU drivers register an ACPI notifier to catch these; and there are no immediate plans to change this, but this does illustrate how OOB hotplug notification is not just a Type-C thing, where as the VDO and its format very much are Type-C things. Regards, Hans _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A355FC433ED for ; Tue, 4 May 2021 15:34:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 457CE613D7 for ; Tue, 4 May 2021 15:34:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 457CE613D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B9D436EB1C; Tue, 4 May 2021 15:34:17 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 03BC96EB23 for ; Tue, 4 May 2021 15:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620142456; 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=yTR7KxNHedPcWlig0HG3YpWXMEHessQmv89zJz6Bk7k=; b=LoODFldtXygSkck+G2np7dyHRrScyE4iv1sbQpmG3wZ83MQAvH/C/myVdvvOH2j30vPd1g HOxed6Oc8EeNUf9qjkYs2wOlE+1lwWzgY8xwxuxLXADI0Ctq3x6LazjdLvA1qpECKca6Hi BPzUjdl0cLlzC3PIkgqAgKv0piEnSio= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-VmfcdHclMjq8BohRldso9A-1; Tue, 04 May 2021 11:34:14 -0400 X-MC-Unique: VmfcdHclMjq8BohRldso9A-1 Received: by mail-ej1-f71.google.com with SMTP id nd10-20020a170907628ab02903a324b229bfso3292237ejc.7 for ; Tue, 04 May 2021 08:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yTR7KxNHedPcWlig0HG3YpWXMEHessQmv89zJz6Bk7k=; b=lR690P3aJGqERPKXVsjFU8L5sDon7kbslt9w7n2dekdKlym8HEJQsfw8CsPus6TUKp 8HWUnGBLx0V3ckOr9yZo94UzTm4LS8nL4YEGJ9cxMN3zT+mpD6ByV5EOT3Paenhy4PZD Cj1pgaJcOwI9BoKhdI1Yg81WAdLBCzoyTPSF+OFYG3vp2GSAqepJvAbpxiHoQfq+CLS2 LdD4Lv+WfhOdGv4wj7C1ky4m2KDiw7y3j+kXnrx+A/wWufkrRy0BxJjdcIKIR5hEpwOL DRSNtsrgN9vXZuf4q4FMP2y3j2sfEFRKp9AxjVPdNG362ugLBRxh3PWdt0h+w/8a7+t4 jenw== X-Gm-Message-State: AOAM531nseepnPpY5HzjmsbIz4d03WGXriy2T1i7ibLg6MvyvFYQKrYg /6PQBJx20Pk2RML+cj5h3dSH5k1M+079sKQxi2kcUtBVIMDsfhYealKYmbrxlQyfq/6oWDD8AGt dJypkHKJ2rjPkskEPq85fFKhnTDxF X-Received: by 2002:a17:906:5495:: with SMTP id r21mr22710109ejo.471.1620142453388; Tue, 04 May 2021 08:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/9ENOolVDsOP9e1/qJjV8sFUtPE9yGpoQtUWrlmSggZGp55BI4Pp+2sNfMIGO+z3VLrCpDQ== X-Received: by 2002:a17:906:5495:: with SMTP id r21mr22710085ejo.471.1620142453131; Tue, 04 May 2021 08:34:13 -0700 (PDT) Received: from x1.localdomain (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 f19sm14604035edu.12.2021.05.04.08.34.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 08:34:12 -0700 (PDT) To: Heikki Krogerus References: <20210428215257.500088-1-hdegoede@redhat.com> <20210428215257.500088-5-hdegoede@redhat.com> <00e380b2-0376-0ddb-9b0e-342779b7fc06@redhat.com> From: Hans de Goede Message-ID: <077edd03-c24f-01ac-18da-5b6fca8ce7c0@redhat.com> Date: Tue, 4 May 2021 17:34:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH 4/9] drm/connector: Add support for out-of-band hotplug notification X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org, Thomas Zimmermann , David Airlie , Greg Kroah-Hartman , Maxime Ripard , platform-driver-x86@vger.kernel.org, intel-gfx , Guenter Roeck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi, On 5/4/21 4:52 PM, Heikki Krogerus wrote: > On Mon, May 03, 2021 at 04:35:29PM +0200, Hans de Goede wrote: >> Hi, >> >> On 5/3/21 10:00 AM, Heikki Krogerus wrote: >>> Hi Hans, >>> >>> On Wed, Apr 28, 2021 at 11:52:52PM +0200, Hans de Goede wrote: >>>> +/** >>>> + * struct drm_connector_oob_hotplug_event_data: OOB hotplug event data >>>> + * >>>> + * Contains data about out-of-band hotplug events, signalled through >>>> + * drm_connector_oob_hotplug_event(). >>>> + */ >>>> +struct drm_connector_oob_hotplug_event_data { >>>> + /** >>>> + * @connected: New connected status for the connector. >>>> + */ >>>> + bool connected; >>>> + /** >>>> + * @dp_lanes: Number of available displayport lanes, 0 if unknown. >>>> + */ >>>> + int dp_lanes; >>>> + /** >>>> + * @orientation: Connector orientation. >>>> + */ >>>> + enum typec_orientation orientation; >>>> +}; >>> >>> I don't think the orientation is relevant. It will always be "normal" >>> from DP PoW after muxing, no? >> >> That is what I thought to, but during the discussion of my previous attempt >> at this one of the i915 devs mentioned that in some cases the muxes manage >> to swap the lane order when the connector upside-down and at least the >> Intel GPUs can correct for this on the GPU side, so they asked for this >> info to be included. >> >>> I'm also not sure those deatils are enough in the long run. Based on >>> what I've understood from our graphics team guys, for example knowing >>> if multi-function is preferred may be important in some cases. >> >> The current data being passed is just intended as a starting point, >> this is purely a kernel internal API so we can easily add more >> data to the struct. As I mentioned in the cover-letter the current >> oob_hotplug handler which the i915 patch adds to the i915 driver does >> not actually do anything with the data. ATM it is purely there to >> demonstrate that the ability to pass relevant data is there now >> (which was an issue with the previous attempt). I believe the current >> code is fine as a PoC of "pass event data" once GPU drivers actually >> start doing something with the data we can extend or outright replace >> it without issues. > > Ah, if there is nothing using that information yet, then just don't > pass it at all for now. As you said, it's kernel internal API, we can > change it later if needed. > >>> All of that, and more, is already available in the Configuration VDO >>> Status VDO that the we have negotiated with the DP partner. Both those >>> VDOs are part of struct typec_displayport_data. I think we should >>> simply supply that structure to the DRM code instead of picking those >>> details out of it... >> >> I'm not sure I like the idea of passing the raw VDO, but if the >> DRM folks think that would be useful we can certainly add it. > > Why are you against passing all the data that we have? What is the > benefit in picking only certain details out of an object that has a > standard format, and constructing a customised object for those > details instead? The VDO is Type-C specific and the drm_connector_oob_hotplug_event() is intended to be a generic API. There are other OOB event sources, e.g. the drivers/apci/acpi_video.c code receives hotplug events for connectors on powered-down GPUs on dual/hybrid GPU laptops. ATM the GPU drivers register an ACPI notifier to catch these; and there are no immediate plans to change this, but this does illustrate how OOB hotplug notification is not just a Type-C thing, where as the VDO and its format very much are Type-C things. Regards, Hans _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx