Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3438291rwb; Tue, 16 Aug 2022 03:06:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5BzjTQ5+1LJZMrd8ZFboHOmh6OSz9gs9TUTQudiBcb9EsAQbppaBHnyXJcgs8G1AIE4E56 X-Received: by 2002:a17:903:2448:b0:171:4853:e580 with SMTP id l8-20020a170903244800b001714853e580mr21192666pls.145.1660644382884; Tue, 16 Aug 2022 03:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660644382; cv=none; d=google.com; s=arc-20160816; b=kRIbi/HH6Zq6cVpv48RQvDQ69ZRVkt44dGnP5nkpfWVLKdJXahcZNF0xOr+uV3hXuv cJZzjRabR4igSOxxs3ISMDMhUxdlKGmW9VqxKI21Y5kYUAJsqRXO397EqAVBlHa1ZZJ4 DqBerSWeGsAZvURu1hRgNX3axyOHwPQbkjt2MUiaYDSQebGPxoSxj6oOfFOUIOaSQCKD s3T/G4FqnrC/SAgK5fd1vI7xHtbt5FsepphyQUWIeBiaqhHwG4GrGTOsMQDoGxTeGRfx Kd+36WQZ6WpNUx0B+IkXQLF8wjg748y5lTucdyWixEzFBSwUPg2Hc8r1Yxj3hv2QDNa1 NKjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=jntjTMc4GoCPkwhnMdKhmhNvxLaNJX1yA+t8yaIn7xs=; b=TCQclxDkzEGc2F+/HLlNOtroAdDAYS3YjnQVtaqe0jUeZcmTlLMErjKV7+lZUJKSsJ r70/0QTqInveECi2UwgL2W9W2r/QAUFyVfq00Mfu1JWXH3upHAQ/xV8V+1uDD4qUGliE wth8AIxTDwHUyD/w6HHZ4jIKlqfUOJ1r7WgeJuCb+fWj3r+fku+Br9J/W3/ca+nfGAbm 9ID27vZa6r52j/PmJDs3wU3JjJ+NunCAb/A/MSyXyXN0mFVt7BHa1DeHXgR7K4XHvlip cDCTEe5HCsK3syKPlIz3cUHiyrlgl+LbvwyDnpD/ai4n9uhyVKySjL7hUzAEFLDOy9Nu CQAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SEhpqqv0; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a63e207000000b0042195f309a1si1098308pgh.846.2022.08.16.03.06.11; Tue, 16 Aug 2022 03:06:22 -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=@intel.com header.s=Intel header.b=SEhpqqv0; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233753AbiHPJj2 (ORCPT + 99 others); Tue, 16 Aug 2022 05:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233654AbiHPJjW (ORCPT ); Tue, 16 Aug 2022 05:39:22 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345AF13F201 for ; Tue, 16 Aug 2022 01:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660637198; x=1692173198; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=w+c/e2AkjNu1SyDCQR+vXt15ugvR4JTciB+nrN0p4kI=; b=SEhpqqv0LUPEjtGaaNg2n+KQ90iPxDm6q0hdKgZFwOTFBDN8gABOSM0H Hl3pk5KLjEIIl2QSIINJNugcQzbX3llsXrMNVQjAtoh1mNpV6piz7lCs+ q1rKpjGjNsrj4ss2FRGj0ZYJp51XpUuzy3xU/yBCN6e2bb3H24hqMuPMk aPw9bdVnJTC/laOemVz8wnE5u9+vNgJD5FNn858Ail+UvaaoFqy0Ybrjb S1jWHoJT3/5QZqpcsOQ2ISIc/t/QtoWJrRl0MB0Es5Z0XK3jTWyFE8mxi w0SpsZYt+/cj7ZmA/bcoLpLD/cvlbeCNCEOepEbSsmGMEQ0VDCIPJyiWC w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="292153650" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="292153650" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 01:06:24 -0700 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="667006509" Received: from kinzelba-mobl.ger.corp.intel.com (HELO localhost) ([10.252.39.194]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 01:06:20 -0700 From: Jani Nikula To: Kai-Heng Feng , joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com Cc: Kai-Heng Feng , David Airlie , Daniel Vetter , Ville =?utf-8?B?U3ly?= =?utf-8?B?asOkbMOk?= , Zenghui Yu , Lyude Paul , Hans de Goede , Heikki Krogerus , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915: Switch TGL-H DP-IN to dGFX when it's supported In-Reply-To: <20220816025217.618181-1-kai.heng.feng@canonical.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220816025217.618181-1-kai.heng.feng@canonical.com> Date: Tue, 16 Aug 2022 11:06:18 +0300 Message-ID: <87leror4sl.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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, 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? 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