Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1451718rwb; Sun, 14 Aug 2022 04:21:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5JmQUsIKlUgKO7yCiXLMCM1BJiddKC1cQUykL82xPadYZxftDHWl8+DCK2GCgvDwB5+P8p X-Received: by 2002:a63:db17:0:b0:41b:8e02:3e80 with SMTP id e23-20020a63db17000000b0041b8e023e80mr10008450pgg.235.1660476093797; Sun, 14 Aug 2022 04:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660476093; cv=none; d=google.com; s=arc-20160816; b=CpH25j9upW7VH/pYv1nDTASw9L0hGouQWu+5Cg24/JyXC46rz6mdp/HWnp/k3qfJxx svnAfpgzQlLZMzHlCGLqqYhVT+qFmQNDcpFqcGBOqWjCpkI0PWqG9fLZip2PST9xwcKn 4tUHvrF781hWB43yNW4XBPY4mGMvCC63L0GiQY5uWGrCWPWRbSxj3jBeLN444BwmcGtN gz5GxMXu88I82ZYTTOiP0SUgeFNZ2hXSVJFqd6gORJfVGn8XECqVNi5lFbDScr5MiD+L MYpE90XN/FBTTCG0lF4F8zAzaFru7j8twoqnLtmaHAV5CkOkSb3MTZGMYqQWqD6nwu61 n0iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=22dNxJzvxp2B00me6HuMPLK8GVRm19BDIdjRa94Kq80=; b=VjBDo52De5N38Jaj6a/rTVcCA9mMHNh1iyLvBPrUF2SQLny6OfEV/fYu2dwDhHkR0k Ml+1ZRmgagOoEnzyvh98O4t8fnnyHZ84jaLhbaT/cEBZb+0s7a/VE6orcfNmV+f/poSN UvlqiDLoJoprQyiYZDPG43AhAEh8Vijhnm/pMII5o4rNWBQjhjCvUbA8qkSR2g+rgBaH 5dKZx4VtWIH7G5nOxM/Rjb/Hw4pg70ihE10ga7hGBV1RCGIdMbZ/VRuhghqSEoaXoE7b OucrfKV7cTC8h5ynDRqG/qR2FDGfFDDjNWEjb1vwsT0iiLvwt1ucl8h12JAC8zOorMoR wNDw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q19-20020a170902b11300b0016d6afdef20si6487059plr.231.2022.08.14.04.21.00; Sun, 14 Aug 2022 04:21: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbiHNKmS (ORCPT + 99 others); Sun, 14 Aug 2022 06:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiHNKmR (ORCPT ); Sun, 14 Aug 2022 06:42:17 -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 13AC312AED; Sun, 14 Aug 2022 03:42:14 -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 F206F100D9401; Sun, 14 Aug 2022 12:42:10 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id C984D325AC1; Sun, 14 Aug 2022 12:42:10 +0200 (CEST) Date: Sun, 14 Aug 2022 12:42:10 +0200 From: Lukas Wunner To: Luke Jones Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] asus-wmi: Support the hardware GPU MUX on some laptops Message-ID: <20220814104210.GA22519@wunner.de> References: <20220813092624.6228-1-luke@ljones.dev> <20220813105533.GA3258@wunner.de> <56171d4f65c02d3cba64d2f6d49e190107c12a18.camel@ljones.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56171d4f65c02d3cba64d2f6d49e190107c12a18.camel@ljones.dev> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,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 Sun, Aug 14, 2022 at 09:09:43PM +1200, Luke Jones wrote: > On Sat, 2022-08-13 at 12:55 +0200, Lukas Wunner wrote: > > On Sat, Aug 13, 2022 at 09:26:24PM +1200, Luke D. Jones wrote: > > > Support the hardware GPU MUX switch available on some models. This > > > switch can toggle the MUX between: > > > > > > - 0, Dedicated mode > > > - 1, Optimus mode > > > > > > Optimus mode is the regular iGPU + dGPU available, while dedicated > > > mode switches the system to have only the dGPU available. > > > > Could you please integrate this with the framework provided by: > > > > include/linux/vga_switcheroo.h > > drivers/gpu/vga/vga_switcheroo.c > > > > vga_switcheroo will then automatically expose a sysfs interface. > > I did investigate this first before submitting. The way asus does it is > not standard at all. On switch you must reboot, and the change isn't > reflected by the ACPI get method until reboot. It's very reflective of > how they used dgpu_disable to work around windows issues that we do in > Linux by removing the device from the device tree. > > The key thing is a reboot is required. This is not done on-the-fly. I > have a two year old GX502 which has the same method as exposed here, > and also a 2022 TUF laptop with same method. My understanding of this > pariicular method is that it isn't the same one as what Nvidia is > advertising, and ASUS is perhaps misadvertising it - the suspision is > raised by the fact that my GX502 machine predates what Nvidia is > advertising. I see, thanks for the explanation. You may want to add that background information to the commit message if/when respinning. Indeed vga_switcheroo facilitates GPU switching at runtime, not upon next reboot. Thanks, Lukas