Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3972470rwb; Tue, 16 Aug 2022 11:59:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4dA+8nU9cH0aVnFPhZwKDyfMs/Ep3w+8WK90hbE76a9x421c5vx4qdbrvNQFyTUGQN7lfO X-Received: by 2002:a17:907:1c1c:b0:730:9473:7a0e with SMTP id nc28-20020a1709071c1c00b0073094737a0emr14195520ejc.492.1660676373961; Tue, 16 Aug 2022 11:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660676373; cv=none; d=google.com; s=arc-20160816; b=vB8XP5DdB8uPyIGl+z6VouPeb+UxM/xP1mWYb5WmM0RX83s2l4u+1yn5Gi3mS2/KPD 0/ro5PyM0WHeRkXic1q4BE48fxKpChbQBg6tUkYrNFWB+f/51p2D0sqwJmX8uI6vM5Tc P3Y1hMJsWOFmOSoWQb9xfPt92x+fAyTC63a4H/r5nepTDpVwlQ+tzyUG106NKI0U3P9B Yi5BrMrU7ni8PU81DvDNNhyg7mMehtzhscDPWYFs+0UbaL3SEs/Jt9cCZ8S25BtqXM3x LQAKz9A9FATCHoTYO5rqmVabDT6zuCz8UIkqWiHLXyA7SH1agu2wqWb3lgYvIT670n/m P8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=vZ54moplpvPdL/wHH71E1xm/y/yfzS3drqv2XjiZKiI=; b=kInpTAWXH1NqSYeGunRMlT2F3eRdjwif66aGSUM8HYyZiEj/y8IsuCfiCzXncKGu8D D8iRLCA5T0AkOuXSFdHvv2WgNvPUMChe1VprC5gy0iVuBl9UkaMnOfpMxiqVm37xBiU9 QIFXuKJNWA01GbLYmjwiuiEzA/eb1XXOCS6VPZbYHXqpLkn1GmQe9LD+jztrVE8FpqNr kv9pjN7ui0C6d6Y14TLManTAgeVfZCdICHGHHkYq407jhVAzPe/DZ+o1IkPjd9fIyfRo T5WKvBS01A5cPhTtY86UNwLLyBoODU5QuVrcsrHnjbWCSCazuCxWSPkHhryAu+HtlZPz U/Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I7PgTU+i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a1709061f0700b0072f3533752bsi9621724ejj.161.2022.08.16.11.59.08; Tue, 16 Aug 2022 11:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I7PgTU+i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237123AbiHPSgO (ORCPT + 99 others); Tue, 16 Aug 2022 14:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236791AbiHPSgN (ORCPT ); Tue, 16 Aug 2022 14:36:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6846D7AC07 for ; Tue, 16 Aug 2022 11:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660674970; 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=vZ54moplpvPdL/wHH71E1xm/y/yfzS3drqv2XjiZKiI=; b=I7PgTU+iPPvz1jfckS7oOgBKTp+U//kvOo2u7YgYs8wFtLbfQHrBOS/LaqgXLalZeUJF+O c9U4fLCxhcuuMrWyj6ujswYVhy1LAI374uCpog6UkoJmxnhv9GXmvG4BFWLUqKG2K4J0iR nFBpesTwKnCzim6dH9EipffBMygY21A= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-258-g8hYIl7HM4m0zdstDHdlIA-1; Tue, 16 Aug 2022 14:36:09 -0400 X-MC-Unique: g8hYIl7HM4m0zdstDHdlIA-1 Received: by mail-qt1-f200.google.com with SMTP id z6-20020ac875c6000000b0034454b14c91so6755497qtq.15 for ; Tue, 16 Aug 2022 11:36:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc; bh=vZ54moplpvPdL/wHH71E1xm/y/yfzS3drqv2XjiZKiI=; b=GqwsTsjWukikWg94NpJZthjtp/QPXTl7Rr8bcX5aauYDoleb4wUicoqUVavYod+uHU jzwCZudpyf5cpzWtYNcpgGXpyvJ6vRrKDLfkfuwfr0eorJN6OMinZdy0feiKxdwG7TaM XlvP3/YyMOMUho/NEpeG8rpdPEnivACZwl+WLecdootzJaYLYnJsQt3QeDZoMXgjLgQ9 rFoJmGAXDxrGzr5h1gVicyuE7lGXJsk3r9X3zhg0s0o61deVhma1wqXcyy3Agy2NjBzu ICuolAL1FPMEM7KVX/vkW/tHx8G8+0jiSGNc1v+uw/PveTTV3CDXKfa5geyPsyNnty+A RoaQ== X-Gm-Message-State: ACgBeo2Qeb2KHH1tPRhYR8DXXzCAGQTfwdy8HkSVeySz2G8LnBF0IkAI GnqPg2rDbCHzYGLKvMG+Uv+Vdk61qXJhxKJR/A9J+ze2habWMS2iuMUcVaQ3wUd+YvqitWzqx06 ijIJ0tKwm5aWGcI8VvuvoOk1z X-Received: by 2002:a05:620a:1a16:b0:6b8:7789:8ca4 with SMTP id bk22-20020a05620a1a1600b006b877898ca4mr15412806qkb.292.1660674968884; Tue, 16 Aug 2022 11:36:08 -0700 (PDT) X-Received: by 2002:a05:620a:1a16:b0:6b8:7789:8ca4 with SMTP id bk22-20020a05620a1a1600b006b877898ca4mr15412789qkb.292.1660674968609; Tue, 16 Aug 2022 11:36:08 -0700 (PDT) Received: from [192.168.8.138] (pool-100-0-245-4.bstnma.fios.verizon.net. [100.0.245.4]) by smtp.gmail.com with ESMTPSA id bb12-20020a05622a1b0c00b0031ef67386a5sm10612124qtb.68.2022.08.16.11.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 11:36:06 -0700 (PDT) Message-ID: Subject: Re: [PATCH] drm/i915: Switch TGL-H DP-IN to dGFX when it's supported From: Lyude Paul To: Kai-Heng Feng , Jani Nikula Cc: joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, David Airlie , Daniel Vetter , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , Zenghui Yu , Hans de Goede , Heikki Krogerus , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Tue, 16 Aug 2022 14:36:03 -0400 In-Reply-To: References: <20220816025217.618181-1-kai.heng.feng@canonical.com> <87leror4sl.fsf@intel.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-08-16 at 14:24 -0400, Lyude Paul wrote: > On Tue, 2022-08-16 at 19:29 +0800, Kai-Heng Feng wrote: > > On Tue, Aug 16, 2022 at 4:06 PM 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 documentation released anywhere? We've been wondering about these > interfaces for quite a long time, and it would be good to know if there's docs > for this we haven't really been seeing. > > > > > > > Is this the policy decision that we want to unconditionally make, > > > though? > > > > I believes so, so more external monitors can be supported at the same time. > > > > Kai-Heng > > Is this for systems with dual Intel GPUs? I ask because if this affects > Intel/Nvidia hybrid systems then this is a huge no from me. Nouveau is able to > support these systems, but at a limited capacity. This would imply that we are > making external displays work for users of the nvidia proprietary driver, at > the expense making external display support for mainline kernel users > substantially worse for people who are using the mainline kernel. Which isn't > a choice we should be making, because nvidia's OOT driver is not a mainline > kernel driver. Doing some quick research, unless the models mentioned in the commit message are unreleased some of them are definitely Intel/Nvidia hybrids. So I'm going to say: NAK-by: Lyude Paul If you'd like to resubmit this for systems with amdgpus and Intel only, that's perfectly fine with me if the Intel folks are ok with it. But please hold off on this for Nvidia systems, at least until we've got GSP reworks functional in nouveau. If nvidia's interested in making this work for their driver, they're welcome to do the work there. For reference: the main limitations you would hit as a result of this patch would be lagginess on the external displays as a result of us not being able to reclock the GPU, which means PCIe bandwidth will be pretty limited. > > If this is just for Intel/Intel systems though that's probably fine, and it > might also be fine for AMD systems. > > > > > > > > > BR, > > > Jani. > > > > > > > > > > > Signed-off-by: Kai-Heng Feng > > > > --- > > > > drivers/gpu/drm/i915/display/intel_acpi.c | 18 +++++++++++++++++- > > > > 1 file changed, 17 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_acpi.c b/drivers/gpu/drm/i915/display/intel_acpi.c > > > > index e78430001f077..3bd5930e2769b 100644 > > > > --- a/drivers/gpu/drm/i915/display/intel_acpi.c > > > > +++ b/drivers/gpu/drm/i915/display/intel_acpi.c > > > > @@ -20,6 +20,7 @@ static const guid_t intel_dsm_guid = > > > > 0xa8, 0x54, 0x0f, 0x13, 0x17, 0xb0, 0x1c, 0x2c); > > > > > > > > #define INTEL_DSM_FN_GET_BIOS_DATA_FUNCS_SUPPORTED 0 /* No args */ > > > > +#define INTEL_DSM_FN_DP_IN_SWITCH_TO_DGFX 20 /* No args */ > > > > > > > > static const guid_t intel_dsm_guid2 = > > > > GUID_INIT(0x3e5b41c6, 0xeb1d, 0x4260, > > > > @@ -187,6 +188,7 @@ void intel_dsm_get_bios_data_funcs_supported(struct drm_i915_private *i915) > > > > struct pci_dev *pdev = to_pci_dev(i915->drm.dev); > > > > acpi_handle dhandle; > > > > union acpi_object *obj; > > > > + int supported = 0; > > > > > > > > dhandle = ACPI_HANDLE(&pdev->dev); > > > > if (!dhandle) > > > > @@ -194,8 +196,22 @@ void intel_dsm_get_bios_data_funcs_supported(struct drm_i915_private *i915) > > > > > > > > obj = acpi_evaluate_dsm(dhandle, &intel_dsm_guid2, INTEL_DSM_REVISION_ID, > > > > INTEL_DSM_FN_GET_BIOS_DATA_FUNCS_SUPPORTED, NULL); > > > > - if (obj) > > > > + if (obj) { > > > > + if (obj->type == ACPI_TYPE_INTEGER) > > > > + supported = obj->integer.value; > > > > + > > > > ACPI_FREE(obj); > > > > + } > > > > + > > > > + /* Tiger Lake H DP-IN Boot Time Switching from iGfx to dGfx */ > > > > + if (supported & BIT(20)) { > > > > + obj = acpi_evaluate_dsm(dhandle, &intel_dsm_guid2, > > > > + INTEL_DSM_REVISION_ID, > > > > + INTEL_DSM_FN_DP_IN_SWITCH_TO_DGFX, > > > > + NULL); > > > > + if (obj) > > > > + ACPI_FREE(obj); > > > > + } > > > > } > > > > > > > > /* > > > > > > -- > > > Jani Nikula, Intel Open Source Graphics Center > > > -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat