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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 CC6E4C433B4 for ; Tue, 4 May 2021 12:53:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8516611AE for ; Tue, 4 May 2021 12:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbhEDMyj (ORCPT ); Tue, 4 May 2021 08:54:39 -0400 Received: from mga12.intel.com ([192.55.52.136]:49125 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230346AbhEDMyj (ORCPT ); Tue, 4 May 2021 08:54:39 -0400 IronPort-SDR: 0BQbwveTeMZx5csEArOUwo+zXzw3S41Z8r711xumrMl0ls3TFGl5GvnR78pWlSvIpPFZvMM1Ww OD5ElDsEX26A== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="177511993" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="177511993" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:53:42 -0700 IronPort-SDR: fvSVcDAH5DChXuddF2Etdns2q6zsCelkGeI2GKbJcmhMRZ6EM5GgqaG3qgRufd6/pPEb7L4x3M LA22KC8Y9dug== X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="433268052" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:53:38 -0700 Date: Tue, 4 May 2021 15:53:35 +0300 From: Imre Deak To: Heikki Krogerus Cc: Hans de Goede , 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 Subject: Re: [PATCH 4/9] drm/connector: Add support for out-of-band hotplug notification Message-ID: <20210504125335.GA30246@ideak-desk.fi.intel.com> References: <20210428215257.500088-1-hdegoede@redhat.com> <20210428215257.500088-5-hdegoede@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org On Mon, May 03, 2021 at 11:00:20AM +0300, 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? > > 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. Combo PHY ports - which is what this patchset is adding the notification for - can only reverse the lane assignment. TypeC PHY ports (on ICL+) have a more C-type aware mux in the SoC (FIA) as well, so in theory we could have a system based on such platforms with an external mux only switching between the USB, DP, USB+DP (MFD) modes, but leaving the plug orientation specific muxing up to the FIA. The graphics driver is not involved in programming the FIA though, it's done by a firmware component, so I don't think this configuration needs to get passed. Yes, the driver needs to know if the PD controller configured the sink in the MFD mode (DP+USB) or in the DP-only mode. For that the number of lanes assigned to DP is enough. > +Imre. > > 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... > > > /** > > * struct drm_tv_connector_state - TV connector related states > > * @subconnector: selected subconnector > > @@ -1110,6 +1132,15 @@ struct drm_connector_funcs { > > */ > > void (*atomic_print_state)(struct drm_printer *p, > > const struct drm_connector_state *state); > > + > > + /** > > + * @oob_hotplug_event: > > + * > > + * This will get called when a hotplug-event for a drm-connector > > + * has been received from a source outside the display driver / device. > > + */ > > + void (*oob_hotplug_event)(struct drm_connector *connector, > > + struct drm_connector_oob_hotplug_event_data *data); > > So I would not try to generalise this like that. This callback should > be USB Type-C DP altmode specific: > > void (*oob_hotplug_event)(struct drm_connector *connector, > struct typec_displayport_data *data); > > Or like this if the orientation can really be reversed after muxing: > > void (*oob_hotplug_event)(struct drm_connector *connector, > struct typec_altmode *altmode, > struct typec_displayport_data *data); > > You can now check the orientation separately with > typec_altmode_get_orientation() if necessary. > > > thanks, > > -- > heikki 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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 9A6B1C43461 for ; Tue, 4 May 2021 12:53:46 +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 6005361040 for ; Tue, 4 May 2021 12:53:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6005361040 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.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 A63D76EAD2; Tue, 4 May 2021 12:53:44 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D0B36E214; Tue, 4 May 2021 12:53:43 +0000 (UTC) IronPort-SDR: dRLt5zsiCrzGUaXaBj2ccy5pb3cDKUaackp5UAC4bC0WOMEfy7sYyq8rQfTApNajuihC0VUvct cjYJHUNSuLhg== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="194833005" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="194833005" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:53:42 -0700 IronPort-SDR: fvSVcDAH5DChXuddF2Etdns2q6zsCelkGeI2GKbJcmhMRZ6EM5GgqaG3qgRufd6/pPEb7L4x3M LA22KC8Y9dug== X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="433268052" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:53:38 -0700 Date: Tue, 4 May 2021 15:53:35 +0300 From: Imre Deak To: Heikki Krogerus Subject: Re: [PATCH 4/9] drm/connector: Add support for out-of-band hotplug notification Message-ID: <20210504125335.GA30246@ideak-desk.fi.intel.com> References: <20210428215257.500088-1-hdegoede@redhat.com> <20210428215257.500088-5-hdegoede@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 , intel-gfx , platform-driver-x86@vger.kernel.org, Hans de Goede , Rodrigo Vivi , Guenter Roeck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, May 03, 2021 at 11:00:20AM +0300, 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? > > 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. Combo PHY ports - which is what this patchset is adding the notification for - can only reverse the lane assignment. TypeC PHY ports (on ICL+) have a more C-type aware mux in the SoC (FIA) as well, so in theory we could have a system based on such platforms with an external mux only switching between the USB, DP, USB+DP (MFD) modes, but leaving the plug orientation specific muxing up to the FIA. The graphics driver is not involved in programming the FIA though, it's done by a firmware component, so I don't think this configuration needs to get passed. Yes, the driver needs to know if the PD controller configured the sink in the MFD mode (DP+USB) or in the DP-only mode. For that the number of lanes assigned to DP is enough. > +Imre. > > 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... > > > /** > > * struct drm_tv_connector_state - TV connector related states > > * @subconnector: selected subconnector > > @@ -1110,6 +1132,15 @@ struct drm_connector_funcs { > > */ > > void (*atomic_print_state)(struct drm_printer *p, > > const struct drm_connector_state *state); > > + > > + /** > > + * @oob_hotplug_event: > > + * > > + * This will get called when a hotplug-event for a drm-connector > > + * has been received from a source outside the display driver / device. > > + */ > > + void (*oob_hotplug_event)(struct drm_connector *connector, > > + struct drm_connector_oob_hotplug_event_data *data); > > So I would not try to generalise this like that. This callback should > be USB Type-C DP altmode specific: > > void (*oob_hotplug_event)(struct drm_connector *connector, > struct typec_displayport_data *data); > > Or like this if the orientation can really be reversed after muxing: > > void (*oob_hotplug_event)(struct drm_connector *connector, > struct typec_altmode *altmode, > struct typec_displayport_data *data); > > You can now check the orientation separately with > typec_altmode_get_orientation() if necessary. > > > thanks, > > -- > heikki _______________________________________________ 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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 BAA2CC433ED for ; Tue, 4 May 2021 12:53:44 +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 435B8611AE for ; Tue, 4 May 2021 12:53:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 435B8611AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.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 B2D566E214; Tue, 4 May 2021 12:53:43 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D0B36E214; Tue, 4 May 2021 12:53:43 +0000 (UTC) IronPort-SDR: dRLt5zsiCrzGUaXaBj2ccy5pb3cDKUaackp5UAC4bC0WOMEfy7sYyq8rQfTApNajuihC0VUvct cjYJHUNSuLhg== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="194833005" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="194833005" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:53:42 -0700 IronPort-SDR: fvSVcDAH5DChXuddF2Etdns2q6zsCelkGeI2GKbJcmhMRZ6EM5GgqaG3qgRufd6/pPEb7L4x3M LA22KC8Y9dug== X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="433268052" Received: from ideak-desk.fi.intel.com ([10.237.68.141]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 05:53:38 -0700 Date: Tue, 4 May 2021 15:53:35 +0300 From: Imre Deak To: Heikki Krogerus Message-ID: <20210504125335.GA30246@ideak-desk.fi.intel.com> References: <20210428215257.500088-1-hdegoede@redhat.com> <20210428215257.500088-5-hdegoede@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 , intel-gfx , Maxime Ripard , platform-driver-x86@vger.kernel.org, Guenter Roeck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, May 03, 2021 at 11:00:20AM +0300, 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? > > 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. Combo PHY ports - which is what this patchset is adding the notification for - can only reverse the lane assignment. TypeC PHY ports (on ICL+) have a more C-type aware mux in the SoC (FIA) as well, so in theory we could have a system based on such platforms with an external mux only switching between the USB, DP, USB+DP (MFD) modes, but leaving the plug orientation specific muxing up to the FIA. The graphics driver is not involved in programming the FIA though, it's done by a firmware component, so I don't think this configuration needs to get passed. Yes, the driver needs to know if the PD controller configured the sink in the MFD mode (DP+USB) or in the DP-only mode. For that the number of lanes assigned to DP is enough. > +Imre. > > 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... > > > /** > > * struct drm_tv_connector_state - TV connector related states > > * @subconnector: selected subconnector > > @@ -1110,6 +1132,15 @@ struct drm_connector_funcs { > > */ > > void (*atomic_print_state)(struct drm_printer *p, > > const struct drm_connector_state *state); > > + > > + /** > > + * @oob_hotplug_event: > > + * > > + * This will get called when a hotplug-event for a drm-connector > > + * has been received from a source outside the display driver / device. > > + */ > > + void (*oob_hotplug_event)(struct drm_connector *connector, > > + struct drm_connector_oob_hotplug_event_data *data); > > So I would not try to generalise this like that. This callback should > be USB Type-C DP altmode specific: > > void (*oob_hotplug_event)(struct drm_connector *connector, > struct typec_displayport_data *data); > > Or like this if the orientation can really be reversed after muxing: > > void (*oob_hotplug_event)(struct drm_connector *connector, > struct typec_altmode *altmode, > struct typec_displayport_data *data); > > You can now check the orientation separately with > typec_altmode_get_orientation() if necessary. > > > thanks, > > -- > heikki _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx