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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893DAC00140 for ; Thu, 18 Aug 2022 11:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244168AbiHRLxo (ORCPT ); Thu, 18 Aug 2022 07:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233816AbiHRLxm (ORCPT ); Thu, 18 Aug 2022 07:53:42 -0400 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f23e:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907346D55D for ; Thu, 18 Aug 2022 04:53:40 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 328EF103B1EE1; Thu, 18 Aug 2022 13:53:38 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0E5F2D554; Thu, 18 Aug 2022 13:53:38 +0200 (CEST) Date: Thu, 18 Aug 2022 13:53:38 +0200 From: Lukas Wunner To: Jani Nikula Cc: Kai-Heng Feng , joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, Heikki Krogerus , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Hans de Goede , Zenghui Yu Subject: Re: [PATCH] drm/i915: Switch TGL-H DP-IN to dGFX when it's supported Message-ID: <20220818115338.GA26586@wunner.de> References: <20220816025217.618181-1-kai.heng.feng@canonical.com> <87leror4sl.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87leror4sl.fsf@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2022 at 11:06:18AM +0300, Jani Nikula wrote: > On Tue, 16 Aug 2022, Kai-Heng Feng wrote: > > On mobile workstations like HP ZBook Fury G8, iGFX's DP-IN can switch to > > dGFX so external monitors are routed to dGFX, and more monitors can be > > supported as result. > > > > To switch the DP-IN to dGFX, the driver needs to invoke _DSM function 20 > > on intel_dsm_guid2. This method is described in Intel document 632107. > > Is this the policy decision that we want to unconditionally make, > though? In general, we handle switching of outputs between GPUs in vga_switcheroo.c upon a request from user space via sysfs (well, debugfs currently). It's up to users to decide which policy suits their needs best. That said, we never grew support to allow different switching policies for the built-in panel and external outputs. Laptops supporting this are rare. Older MacBook Pros introduced between 2008 and 2010 are among them: They have separate muxes for the panel and external DP port. Our policy is documented in a code comment in drivers/platform/x86/apple-gmux.c: * The external DP port is only fully switchable on the first two unibody * MacBook Pro generations, MBP5 2008/09 and MBP6 2010. This is done by an * `NXP CBTL06141`_ which is controlled by gmux. [...] * Our switching policy for the external port is that on those generations * which are able to switch it fully, the port is switched together with the * panel when IGD / DIS commands are issued to vga_switcheroo. It is thus * possible to drive e.g. a beamer on battery power with the integrated GPU. * The user may manually switch to the discrete GPU if more performance is * needed. * * On all newer generations, the external port can only be driven by the * discrete GPU. If a display is plugged in while the panel is switched to * the integrated GPU, *both* GPUs will be in use for maximum performance. * To decrease power consumption, the user may manually switch to the * discrete GPU, thereby suspending the integrated GPU. In other words, on these older MacBook Pros, we switch the panel and external DP port in unison, thus always allowing one of the two GPUs to runtime suspend and save power. Thanks, Lukas 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 99ED6C00140 for ; Thu, 18 Aug 2022 12:09:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66A6814A764; Thu, 18 Aug 2022 12:06:46 +0000 (UTC) X-Greylist: delayed 719 seconds by postgrey-1.36 at gabe; Thu, 18 Aug 2022 12:05:45 UTC Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D17014A137; Thu, 18 Aug 2022 12:05:39 +0000 (UTC) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 328EF103B1EE1; Thu, 18 Aug 2022 13:53:38 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0E5F2D554; Thu, 18 Aug 2022 13:53:38 +0200 (CEST) Date: Thu, 18 Aug 2022 13:53:38 +0200 From: Lukas Wunner To: Jani Nikula Subject: Re: [PATCH] drm/i915: Switch TGL-H DP-IN to dGFX when it's supported Message-ID: <20220818115338.GA26586@wunner.de> References: <20220816025217.618181-1-kai.heng.feng@canonical.com> <87leror4sl.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87leror4sl.fsf@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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: tvrtko.ursulin@linux.intel.com, Heikki Krogerus , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Hans de Goede , Kai-Heng Feng , rodrigo.vivi@intel.com, Zenghui Yu Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Aug 16, 2022 at 11:06:18AM +0300, Jani Nikula wrote: > On Tue, 16 Aug 2022, Kai-Heng Feng wrote: > > On mobile workstations like HP ZBook Fury G8, iGFX's DP-IN can switch to > > dGFX so external monitors are routed to dGFX, and more monitors can be > > supported as result. > > > > To switch the DP-IN to dGFX, the driver needs to invoke _DSM function 20 > > on intel_dsm_guid2. This method is described in Intel document 632107. > > Is this the policy decision that we want to unconditionally make, > though? In general, we handle switching of outputs between GPUs in vga_switcheroo.c upon a request from user space via sysfs (well, debugfs currently). It's up to users to decide which policy suits their needs best. That said, we never grew support to allow different switching policies for the built-in panel and external outputs. Laptops supporting this are rare. Older MacBook Pros introduced between 2008 and 2010 are among them: They have separate muxes for the panel and external DP port. Our policy is documented in a code comment in drivers/platform/x86/apple-gmux.c: * The external DP port is only fully switchable on the first two unibody * MacBook Pro generations, MBP5 2008/09 and MBP6 2010. This is done by an * `NXP CBTL06141`_ which is controlled by gmux. [...] * Our switching policy for the external port is that on those generations * which are able to switch it fully, the port is switched together with the * panel when IGD / DIS commands are issued to vga_switcheroo. It is thus * possible to drive e.g. a beamer on battery power with the integrated GPU. * The user may manually switch to the discrete GPU if more performance is * needed. * * On all newer generations, the external port can only be driven by the * discrete GPU. If a display is plugged in while the panel is switched to * the integrated GPU, *both* GPUs will be in use for maximum performance. * To decrease power consumption, the user may manually switch to the * discrete GPU, thereby suspending the integrated GPU. In other words, on these older MacBook Pros, we switch the panel and external DP port in unison, thus always allowing one of the two GPUs to runtime suspend and save power. Thanks, Lukas 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 935E2C32772 for ; Thu, 18 Aug 2022 12:09:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC47A14A30E; Thu, 18 Aug 2022 12:06:10 +0000 (UTC) X-Greylist: delayed 719 seconds by postgrey-1.36 at gabe; Thu, 18 Aug 2022 12:05:45 UTC Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D17014A137; Thu, 18 Aug 2022 12:05:39 +0000 (UTC) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 328EF103B1EE1; Thu, 18 Aug 2022 13:53:38 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0E5F2D554; Thu, 18 Aug 2022 13:53:38 +0200 (CEST) Date: Thu, 18 Aug 2022 13:53:38 +0200 From: Lukas Wunner To: Jani Nikula Message-ID: <20220818115338.GA26586@wunner.de> References: <20220816025217.618181-1-kai.heng.feng@canonical.com> <87leror4sl.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87leror4sl.fsf@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH] drm/i915: Switch TGL-H DP-IN to dGFX when it's supported 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: Heikki Krogerus , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kai-Heng Feng , rodrigo.vivi@intel.com, Zenghui Yu Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Aug 16, 2022 at 11:06:18AM +0300, Jani Nikula wrote: > On Tue, 16 Aug 2022, Kai-Heng Feng wrote: > > On mobile workstations like HP ZBook Fury G8, iGFX's DP-IN can switch to > > dGFX so external monitors are routed to dGFX, and more monitors can be > > supported as result. > > > > To switch the DP-IN to dGFX, the driver needs to invoke _DSM function 20 > > on intel_dsm_guid2. This method is described in Intel document 632107. > > Is this the policy decision that we want to unconditionally make, > though? In general, we handle switching of outputs between GPUs in vga_switcheroo.c upon a request from user space via sysfs (well, debugfs currently). It's up to users to decide which policy suits their needs best. That said, we never grew support to allow different switching policies for the built-in panel and external outputs. Laptops supporting this are rare. Older MacBook Pros introduced between 2008 and 2010 are among them: They have separate muxes for the panel and external DP port. Our policy is documented in a code comment in drivers/platform/x86/apple-gmux.c: * The external DP port is only fully switchable on the first two unibody * MacBook Pro generations, MBP5 2008/09 and MBP6 2010. This is done by an * `NXP CBTL06141`_ which is controlled by gmux. [...] * Our switching policy for the external port is that on those generations * which are able to switch it fully, the port is switched together with the * panel when IGD / DIS commands are issued to vga_switcheroo. It is thus * possible to drive e.g. a beamer on battery power with the integrated GPU. * The user may manually switch to the discrete GPU if more performance is * needed. * * On all newer generations, the external port can only be driven by the * discrete GPU. If a display is plugged in while the panel is switched to * the integrated GPU, *both* GPUs will be in use for maximum performance. * To decrease power consumption, the user may manually switch to the * discrete GPU, thereby suspending the integrated GPU. In other words, on these older MacBook Pros, we switch the panel and external DP port in unison, thus always allowing one of the two GPUs to runtime suspend and save power. Thanks, Lukas