Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B6FCC43331 for ; Thu, 2 Apr 2020 14:38:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D03BE2073B for ; Thu, 2 Apr 2020 14:38:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D03BE2073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F82E89DB4; Thu, 2 Apr 2020 14:38:05 +0000 (UTC) X-Greylist: delayed 404 seconds by postgrey-1.36 at gabe; Thu, 02 Apr 2020 14:38:04 UTC Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by gabe.freedesktop.org (Postfix) with ESMTPS id 11BDC89CBE for ; Thu, 2 Apr 2020 14:38:04 +0000 (UTC) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 5F3DC300020AD; Thu, 2 Apr 2020 16:31:17 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 3381B448C29; Thu, 2 Apr 2020 16:31:17 +0200 (CEST) Date: Thu, 2 Apr 2020 16:31:17 +0200 From: Lukas Wunner To: Daniel Vetter Subject: Re: How to handle disconnection of eDP panels due to dynamic display mux switches Message-ID: <20200402143117.qabod72gn3p6yft3@wunner.de> References: <956fd624-e1f5-e2a0-90de-9a5f2934547d@nvidia.com> <20200402113925.2zvatduiyqld7pj2@wunner.de> <20200402154934.04917382@eldfell.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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: Daniel Dadap , dri-devel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Apr 02, 2020 at 03:13:26PM +0200, Daniel Vetter wrote: > On Thu, Apr 2, 2020 at 2:58 PM Pekka Paalanen wrote: > > On Thu, 2 Apr 2020 13:39:25 +0200 Lukas Wunner wrote: > > > Note that vga_switcheroo is currently controlled via debugfs. > > > That is a historic artefact. The kernel has since gained a > > > mux subsystem in drivers/mux/ which could be used to represent > > > the display mux in a standardized way in regular sysfs. > > > > if mux control was in sysfs, then how would userspace figure out > > which mux state refers to which DRM device and its connector? > > > > Maybe some DRM connector property referring to the mux and its state? > > > > How would a display server running as a regular user gain access to > > sysfs to control the mux? > > I think a sysfs interface for vgaswitcheroo would need some kind of > links from drm_device (and for the outpu-only mux from drm_connector > sysfs files) to the corresponding sysfs directory for the > vgaswitcheroo switch. Yes, that would be one way to do it. > But actual change of state needs to indeed be done through some other > interface, since sysfs interfaces suck for compositors. We have this > problem already with backlight, and the solution there is a special > backlight frobbing services which compositors can call through udev, > and fun stuff like that. Definitely not an uapi pattern we want to > repeat. So I think sysfs would be only for information links, and > maybe the global switch for the old optimus designs where you can only > switch the entire gpu, and need to delay the switch until all existing > clients are closed. Aka 1) stop compositor 2) write to sysfs 3) start > new compositor on new gpu. For that case compositors don't need to > ever write to sysfs themselves, so I think that's ok. Also only > relevant for rather old hw. There's an in-kernel interface in which could be invoked from, say, an ioctl(), to control or query the mux. I'm not really prepared to answer detailed questions how it should be done, my point is just that the existing building blocks (such as the mux subsystem) should be used instead of reinventing the wheel. If the mux subsystem lacks specific features needed for graphics muxes, I think adding them won't face much opposition from Peter Rosin. Thanks, Lukas _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel