Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3583003rwb; Tue, 16 Aug 2022 05:44:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR6JRwX6LIbsk4ZT2+X9dgwkpXNV9b6asoCRyvGI92GoezQEKNcWR0IfrmF9N1gJ1WPer7oI X-Received: by 2002:a17:907:6088:b0:733:1435:fb07 with SMTP id ht8-20020a170907608800b007331435fb07mr13507739ejc.306.1660653895316; Tue, 16 Aug 2022 05:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660653895; cv=none; d=google.com; s=arc-20160816; b=IA8ybNpebdqlfp+cqQZqYNdllPehPfNRFxVlVCkvfyatid+ayC1T7IgmEOgh0A3kPH 842bSJZ8udxcPOflf4cC3EsQRVD+8ODqiNh2CGG87QwfM1kwLyIIKr8PQT4fDnO9EnUx yhXXmBKrkyFUZzaKqQpRwwSOaX/fkUqQSScTLBjmjAR88XdCW3atRWYtQKRfTcY/McoX 7NmByfqZ0fWZOGPmaLLhTQBmUuBu+3Kz0X1wrLpTUMGW520PNpyaVM5xLWVvH5mv7aeI szJl+Gx9odNDTS/TfdDeFRAZ/YTN+uTeyiYAd/y4KmutRpe4Ihpw9gRRJxkOg0PkETZT Drmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aSmJyx7D+51w1LpJgRV3eRqde7lEGdt1JKguqJZK45s=; b=lPknbiaE2jj1gdP1VArqoDu7xyImT3gjW+rtKUY7uoWq+eoQ+r/efc4aeOs9dBMyUP hGeAUjIrXf8ZxCRTqSnQ/ZHxL3RZs3jr4jojdo5eIHde7G+wud8s2QDC7LHvnzT9lJXc ACRQutJdNZVXPIN7VtFzHBPd2KY1uhvt6rVwYoUej3UPiXaTew+tHHXc45/k9i8KzaXg 9smJNS+9FydsquCxUKjsKFCk5OfV641b2gmo2ASI6sgxn30viz0fa4p3jzIRqaHvQ3H4 QE2lULeEW+HXO1sYWmY3L/FZ+1ReHbdGVZeRxtC19OxgCZ7utMa0+AaVeAvRJJk+MzEW 4HdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=dHalwpEu; 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=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp26-20020a1709073e1a00b0072ab4b5ffe5si11728611ejc.987.2022.08.16.05.44.29; Tue, 16 Aug 2022 05:44:55 -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=@canonical.com header.s=20210705 header.b=dHalwpEu; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235194AbiHPLyB (ORCPT + 99 others); Tue, 16 Aug 2022 07:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiHPLxm (ORCPT ); Tue, 16 Aug 2022 07:53:42 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDA30CAC4F for ; Tue, 16 Aug 2022 04:29:27 -0700 (PDT) Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 057293F043 for ; Tue, 16 Aug 2022 11:29:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1660649366; bh=aSmJyx7D+51w1LpJgRV3eRqde7lEGdt1JKguqJZK45s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dHalwpEu3omyda1I5IGxIu/SF2e/Rlkw5HSK9Qm5loTF3VIaXu/+ZEWopawrWFG4i 58uPhncVGMD0b5ys9xrgG0sAM10fyjRyR+wgj4kKaqbT12LL3f+O4AMgRkEnwXOthR RD2TTc9wtvPjouJQqiQ5jHgMZ7jf4WFyVBKmlXFXeMp9mvQoArSVFDXBxHnYuLrBo+ n8CrNiOv3Vo+swhyVQXGGK7/A+sfAp48JisyhgIw5xyKGU2CF4OCeMhSXFfPjn8uvN Qa3P2MIvFSQqtsMlY5HTLTOA9WM3bfof69WodCPx9/Uv7IvSdcvHU/saXF8Q2EbWNd PV3n+P9ojGGBw== Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-112b79a5407so2472821fac.16 for ; Tue, 16 Aug 2022 04:29:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=aSmJyx7D+51w1LpJgRV3eRqde7lEGdt1JKguqJZK45s=; b=yqL6UF9n6Co0yL4v6mcnnIH5HT44A/lHyq7DZyUuD0ZSvu9ROugMUC8EOLwWldxfzO aeiykUlUfnPFeeONFkg3zdXD841OpSeV1MyUyeYExeXIwPbZiRFRvDI4tetcjY72fSIL T/0HIZGDTMNBADXnHAuxhOl+toEvEOWhf5BwsEpa/Y7fZT1qi+OEdtKlkBxfIX/2gVKv BQ0s1Cz+savYBdYxLGEUvRFi05U33CocjqrRtfvm0Fgxksi/GVk1UUrYp44VRfuK0oam LL4XV4rk4k1emOA8qINZFzxlvLQVEXcJkQHDS+2Y/I/U8vThpcjQLdYZ9mPuzjiypatt J3sQ== X-Gm-Message-State: ACgBeo01HffloOtmsSJsJ4CCPEmeMVH4iadDN6Oppd+7RyHQgRoXqtLt DvwJH4Ru9dikH4Yko9wDBGpl/HwpSwOWHdegUoi0rJXwdwF5fyPqe5Rv/U+FIoz4bOetJiGZyhv mWVnOdyylb1OOtGASl95sIpogSQ3yoaRqiKA7boW1z3Ol3SCrSX9k3q8fbg== X-Received: by 2002:a9d:f05:0:b0:637:1068:1081 with SMTP id 5-20020a9d0f05000000b0063710681081mr7028763ott.224.1660649364937; Tue, 16 Aug 2022 04:29:24 -0700 (PDT) X-Received: by 2002:a9d:f05:0:b0:637:1068:1081 with SMTP id 5-20020a9d0f05000000b0063710681081mr7028758ott.224.1660649364645; Tue, 16 Aug 2022 04:29:24 -0700 (PDT) MIME-Version: 1.0 References: <20220816025217.618181-1-kai.heng.feng@canonical.com> <87leror4sl.fsf@intel.com> In-Reply-To: <87leror4sl.fsf@intel.com> From: Kai-Heng Feng Date: Tue, 16 Aug 2022 19:29:11 +0800 Message-ID: Subject: Re: [PATCH] drm/i915: Switch TGL-H DP-IN to dGFX when it's supported To: Jani Nikula Cc: joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, David Airlie , Daniel Vetter , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Zenghui Yu , Lyude Paul , Hans de Goede , Heikki Krogerus , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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, 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 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 > > 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