Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4500432ybp; Mon, 7 Oct 2019 09:20:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxA6fb6UAwSYZ1dFXdzyTU2zwB9EKCWiDqeV49Dxp8j4zWPWd68YN+dqUMRFdWQ55fSC/CY X-Received: by 2002:a17:906:d04f:: with SMTP id bo15mr24351089ejb.296.1570465228381; Mon, 07 Oct 2019 09:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570465228; cv=none; d=google.com; s=arc-20160816; b=FgSyCNhT/aNF0D1jVSyawUJDendTI0DATcOBq0Q0O4aYlyc8HsH7/lqUwIRfvVKCSY cW6hKQZkwgM0mzMbSSwWeW5O77LR7Pkm/zlfkNlUUFBVlOBssy1VAO7UAy32fOCeL3Xt qn0KPDg7NCAjzS6VLbaPH1mE21ra53RnHHmxzdNQXgeeQ/aMIbdaBsZYFSJ1ukbx6KgL Yz/USndvj1VIC8J3+1hRMUvomGE8aSML9ApLmRGOnvv4Je+lSmEKN/RPasd5oJSlyyp9 qGc47U944ZQPzd5H2ZQ6wwuQ4MXLq+a9TdVBNpMIDVUgSmZZidCZfyyFnWmJwAn1ZOW5 dzYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fuxnneegK0n5AQkn3Efg7QQxvRdE8FlI4AZRcfswJc0=; b=VQZCVxghfRMHHfLujLdIZIWfrPgc17L9nv95NTeLcgCJOq5ouxdBFTXjPfSYmBrVpu ufucc2lJ3FwDcN6Q6NKJGbbYFpRhmz0E2tfXM4+Eg+w/spSaJOShNtcVmndabdYkR+NJ 3VH/EiIWzXXNvhTP6ZJEus/2vs/b4iHSTe/00KRbZMPVJpip5c/y1aXK9qsmSSjuEOJ2 dYWAB79VIGMfecmgQlpo+O+5riqF88qSD/OxIvJuPdd28PBmkN7Tf7QZlWMocTT4GqQP KebRU1tAZgM2rSDbU7lRdYRxpJQbYtFopguvprnpUF4MBql/Voms1SEFnc1qYF5ej3Y4 UhdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gggESg/a"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si8113266ejj.37.2019.10.07.09.20.04; Mon, 07 Oct 2019 09:20:28 -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=@google.com header.s=20161025 header.b="gggESg/a"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728530AbfJGQT4 (ORCPT + 99 others); Mon, 7 Oct 2019 12:19:56 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:35555 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbfJGQT4 (ORCPT ); Mon, 7 Oct 2019 12:19:56 -0400 Received: by mail-yb1-f195.google.com with SMTP id f4so4874440ybm.2 for ; Mon, 07 Oct 2019 09:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fuxnneegK0n5AQkn3Efg7QQxvRdE8FlI4AZRcfswJc0=; b=gggESg/a8iQOk/eiOTYXQcYqkbR3kHUOK4ySOsws+CmrSgKU4qCuh6MRVhVwZrOSqH EAVlps2UTDr67pjAIsQp6XjADyOhQByETJApt/rPvGhO4mx+JUJc8a6WCAEw2o94ZVpp puHtiiLQI3X9djyBadmRMxRWZJ6Otqn7YHM4X2WzEML79wT25lncdGXCFPMnx3jfFxzI WozJkgi2KYnGBwwTGFvSlydzybZrzld2q7kJshd4T/uUKvvgx93IrP8zbRk0jpTeo6+c +klcRS1tsciAetBVSSO4cns8cCH1Ox95p+8JHTky6IFRRQ0zFbUEBN3hvRvzwDteUtTk sONQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fuxnneegK0n5AQkn3Efg7QQxvRdE8FlI4AZRcfswJc0=; b=jpklN5n5JEw8HhORMdz03txBsRKXRdRWygCMqV8EpE68b08lSWo9Wt4WPpG+a9xOVN N6Je62TRdVjo5XBv5lc6sWDBONiAAi8ILv0/CLNS1V131G7TaUztpg5E9eqwbPrac6FT 6QYic+f02vG5vkYwxGfQTYIXc7t4wJQNk3STXhP5EcgKzTaTergBszLODf50rGr4SzP9 ZYa9h7AAjd0LPvOXv842cUaMHJLQvGOgG280CuM78tdBWSMNdvmecRuJRtpQtc/PM1cU Noonpim+CycuC5Sic82/GTuF87GszLWsinXPpdWvl1oHNnOzwMWKj6zpa90tH3YZBO5X 5efQ== X-Gm-Message-State: APjAAAWXUCVNoUMXwDOG9ei1ud9k8u3v4ZOpf5owU+shNliTRy1zn4gA Zhf+5FrZskpXa1nTgcPEF+sVjjDF1JkKHuemQ94QNA== X-Received: by 2002:a25:df8d:: with SMTP id w135mr10874114ybg.453.1570465192707; Mon, 07 Oct 2019 09:19:52 -0700 (PDT) MIME-Version: 1.0 References: <87h84rbile.fsf@intel.com> <20191002102428.zaid63hp6wpd7w34@holly.lan> <8736gbbf2b.fsf@intel.com> <87h84q9pcj.fsf@intel.com> In-Reply-To: From: Mat King Date: Mon, 7 Oct 2019 10:19:40 -0600 Message-ID: Subject: Re: New sysfs interface for privacy screens To: Sean Paul Cc: Jani Nikula , Daniel Thompson , Linux Kernel Mailing List , dri-devel , rafael@kernel.org, Greg KH , Ross Zwisler , Jingoo Han , Rajat Jain , Lee Jones , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , David Airlie , Daniel Vetter , Alexander Schremmer , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 7, 2019 at 7:09 AM Sean Paul wrote: > > On Thu, Oct 3, 2019 at 3:57 PM Mat King wrote: > > > > On Thu, Oct 3, 2019 at 2:59 AM Jani Nikula wrote: > > > > > > On Wed, 02 Oct 2019, Mat King wrote: > > > > On Wed, Oct 2, 2019 at 4:46 AM Jani Nikula wrote: > > > >> > > > >> On Wed, 02 Oct 2019, Daniel Thompson wrote: > > > >> > 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 > > /snip > > > > > So my proposal would now be to add a new standard property to > > drm_connector called "privacy_screen" this property would be an enum > > which can take one of three values. > > > > PRIVACY_UNSUPPORTED - Privacy is not available for this connector > > PRIVACY_DISABLED - Privacy is available but turned off > > PRIVACY_ENABLED - Privacy is available and turned on > > Agree with Jani, use the property presence to determine if it's supported That makes sense; just to confirm can a property be added or removed after the connector is registered? > > > > > When the connector is initized the privacy screen property is set to > > PRIVACY_UNSUPPORTED and cannot be changed unless a drm_privacy_screen > > is registered to the connector. drm_privacy_screen will look something > > like > > > > struct drm_privacy_screen_ops { > > int (*get_privacy_state)(struct drm_privacy_screen *); > > int (*set_privacy_state)(struct drm_privacy_screen *, int); > > } > > > > struct drm_privacy_screen { > > /* The privacy screen device */ > > struct device *dev; > > > > /* The connector that the privacy screen is attached */ > > struct drm_connector *connector; > > > > /* Ops to get and set the privacy screen state */ > > struct drm_privacy_screen_ops *ops; > > > > /* The current state of the privacy screen */ > > int state; > > } > > > > Privacy screen device drivers will call a function to register the > > privacy screen with the connector. > > Do we actually need dedicated drivers for privacy screen? It seems > like something that is panel-specific hardware, so I'd suggest just > using the panel driver. The privacy screen is physically part of the display but the control interface, at least in all current use cases, is ACPI. Is there a way to control an ACPI device with the panel driver? > > Sean > > > > > int drm_privacy_screen_register(struct drm_privacy_screen_ops *ops, > > struct device *dev, struct drm_connector *); > > > > Calling this will set a new field on the connector "struct > > drm_privacy_screen *privacy_screen" and change the value of the > > property to ops->get_privacy_state(). When > > drm_mode_connector_set_obj_prop() is called with the > > privacy_screen_proptery if a privacy_screen is registered to the > > connector the ops->set_privacy_state() will be called with the new > > value. > > > > Setting of this property (and all drm properties) is done in user > > space using ioctrl. > > > > Registering the privacy screen with a connector may be tricky because > > the driver for the privacy screen will need to be able to identify > > which connector it belongs to and we will have to deal with connectors > > being added both before and after the privacy screen device is added > > by it's driver. > > > > How does that sound? I will work on a patch if that all sounds about right. > > > > One question I still have is there a way to not accept a value that is > > passed to drm_mode_connector_set_obj_prop()? In this case if a privacy > > screen is not registered the property must stay PRIVACY_UNSUPPORTED > > and if a privacy screen is registered then PRIVACY_UNSUPPORTED must > > never be set.