Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp711718ybn; Wed, 2 Oct 2019 05:07:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaUueY/rADwLLRV1AwAky6gAo7GL158GngSstBaDY9xYvbrMNVNH4t7ZH1wPQtYZx6YUEo X-Received: by 2002:a17:906:b84c:: with SMTP id ga12mr2744506ejb.0.1570018038227; Wed, 02 Oct 2019 05:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570018038; cv=none; d=google.com; s=arc-20160816; b=EhAInLGviGj4kpt+K6r2jVKJHRQaCxHoxEqoCqs7Nn2huC7TcQPd3e02Ra4Y0dMBhT o9wQ3xH9W9fjtAWA2gWY5EOQ60KYUY/Hyu7TkOzNmxm44/mmCDxM+GTcKbUjmofkeXtW BU9lL6OtPF2DwZWLnC3lSzQ+wWJmYlBOQ6ofIIGIEMPLYHVvwf04Be1UteHmCX/9X4tE 4wG0uMec3fmtY31AuOaBArzu8wU5J0RHFdj/K7Rgs6C8FD4yqOUJxaOFd4PtD/CSrend Oa7OQzAIXYbZCWlqTPfPmPd2DDL6bP6zlnuB3iMZggY62WuHCXMyW78OUkFmSqh8ncmH WElw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=O+hcgVLMwxs2OkjmvbvoX9zdHxPsFqiVek5U1Sq91Og=; b=l6vlLmtQotre6d23rudcXaHUPc6H1z+hkGO6+mp+znrilsa3sq01hmVksJugIdnZVH 3B7CQo1LNdrvdf/BGfaTKKW7oy32VeTMeubazMRR56ppgih9SYBw7o3EhhaNGw8nREsE 82OpAsE7/tT6TGG3KhTinM2Q91AKvt2kpqmKsCTSJZJMIG7dNw45aNmDlXC7k3lxzCTm UAgeB8LfEplM+n2Zcj5SdU2iaAPciJhx/9RDOJ3nWTtZBOn3uMHjm9CHoh9jF8A6656W V/kvqx+RF2GSrZG9qU9dnsXMEr2k+R5YNRvF9WiRRXNgnPaBlP4mcnUSKBlGACQ2Uktg LWcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WYNiWUnr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz19si10568559ejb.93.2019.10.02.05.06.35; Wed, 02 Oct 2019 05:07:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WYNiWUnr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727796AbfJBKYd (ORCPT + 99 others); Wed, 2 Oct 2019 06:24:33 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35391 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfJBKYd (ORCPT ); Wed, 2 Oct 2019 06:24:33 -0400 Received: by mail-wr1-f66.google.com with SMTP id v8so19027439wrt.2 for ; Wed, 02 Oct 2019 03:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O+hcgVLMwxs2OkjmvbvoX9zdHxPsFqiVek5U1Sq91Og=; b=WYNiWUnrV3gtv/lZGZljpHNjOVvPMo/JfitKNRVoIB3e5+h6TMaXrdudYBeDJeACEh Gf6wtVTgc5Rr7LI47jxMg8NGGY4k/W+FstCSBorFGU1NQvGf83wuho34gwbRrnIFukDO X1tmnGQWh0oSFYUlYzGH8FhXB3517L921pERboLpQoXOPh3SGk3RskVJ2zS17nK9tcZu aeiQuI7c+k3lqFqyrwE9XyC+lWqUHquIbxwLPi0FR8aKgIyL+sNM8xi9GiHpjlGdBMnA 78XOETjsuQ3p/Hm8EqynB8le6VQTmsccJhusHW4j/424yzkFYo7VYuYzAU/VzCJxzDn8 SQqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=O+hcgVLMwxs2OkjmvbvoX9zdHxPsFqiVek5U1Sq91Og=; b=Pc3rNbLrtVdkW49XqThkGQ7iHLYV3IIlsctlJPN2gDMvNOS17eEQ4Z3cVCXzTRw9lQ ErH9dS7xxul1LMt9w7L/ujjLXyezl4nuIpm+bHpUhdzLtkHAmXw3dndujXazKthvetEB c5gUNWcV+hQRYG8KrrCap4unSMQoWpO84MiF/aMOYqaZZK7V/QZR02TxZgyhB4QvOZeM DZpufVRcfot+k8SBoTMGyXUankhbI7RVFqarALsPFw/1ZcyuTCpchow84lkZCKNOYJpA 0kLSzLbiV3JrOuxy5bBZy+5cGziSIUEEf0lF6+rgSWVLuJ453MBbWF9NMvJJ9AWNkj3F gmFg== X-Gm-Message-State: APjAAAUtRafRnQsNaElM91btJU98ObUzLVpSRxoVdg8rYpda+es7Sum4 Fv0ZCywj2leqOANfGnDocHe03Q== X-Received: by 2002:adf:f20e:: with SMTP id p14mr1973496wro.212.1570011871281; Wed, 02 Oct 2019 03:24:31 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id t4sm20164065wrm.13.2019.10.02.03.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 03:24:30 -0700 (PDT) Date: Wed, 2 Oct 2019 11:24:28 +0100 From: Daniel Thompson To: Jani Nikula Cc: Mat King , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rafael@kernel.org, gregkh@linuxfoundation.org, Ross Zwisler , Jingoo Han , Rajat Jain , Lee Jones , Ville =?utf-8?B?U3lyasOkbMOk?= Subject: Re: New sysfs interface for privacy screens Message-ID: <20191002102428.zaid63hp6wpd7w34@holly.lan> References: <87h84rbile.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h84rbile.fsf@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 12:30:05PM +0300, Jani Nikula wrote: > On Tue, 01 Oct 2019, Mat King wrote: > > Resending in plain text mode > > > > I have been looking into adding Linux support for electronic privacy > > screens which is a feature on some new laptops which is built into the > > display and allows users to turn it on instead of needing to use a > > physical privacy filter. In discussions with my colleagues the idea of > > using either /sys/class/backlight or /sys/class/leds but this new > > feature does not seem to quite fit into either of those classes. > > > > I am proposing adding a class called "privacy_screen" to interface > > with these devices. The initial API would be simple just a single > > property called "privacy_state" which when set to 1 would mean that > > privacy is enabled and 0 when privacy is disabled. > > > > Current known use cases will use ACPI _DSM in order to interface with > > the privacy screens, but this class would allow device driver authors > > to use other interfaces as well. > > > > Example: > > > > # get privacy screen state > > cat /sys/class/privacy_screen/cros_privacy/privacy_state # 1: privacy > > enabled 0: privacy disabled > > > > # set privacy enabled > > echo 1 > /sys/class/privacy_screen/cros_privacy/privacy_state > > > > Does this approach seem to be reasonable? > > What part of the userspace would be managing the privacy screen? Should > there be a connection between the display and the privacy screen that > covers the display? How would the userspace make that connection if it's > a sysfs interface? > > I don't know how the privacy screen operates, but if it draws any power, > you'll want to disable it when you switch off the display it covers. > > If the privacy screen control was part of the graphics subsystem (say, a > DRM connector property, which feels somewhat natural), I think it would > make it easier for userspace to have policies such as enabling the > privacy screen automatically depending on the content you're viewing, > but only if the content is on the display that has a privacy screen. Connectors versus sysfs came up on a backlight thread recently. Daniel Vetter wrote an excellent summary on why it has been (and still is) difficult to migrate backlight controls towards the DRM connector interface: https://lkml.org/lkml/2019/8/20/752 Many of the backlight legacy problems do not apply to privacy screens but I do suggest reading this post and some of the neighbouring parts of the thread. In particular the ACPI driver versus real driver issues Daniel mentioned could occur again. Hopefully not though, I mean how wrong can a 1-bit control go? (actually no... don't answer that). It would definitely be a shame to build up an unnecessary sysfs legacy for privacy screens so definitely worth seeing if this can use DRM connector properties. Daniel.