Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4280966ybp; Mon, 7 Oct 2019 06:12:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8RiLECQbbpe+AgxxUArGf39suavdgF+d1oz1xc5P+u/AqQ0xqqfSirF2cha6Au9q+mk8Y X-Received: by 2002:a17:906:1c05:: with SMTP id k5mr23952870ejg.286.1570453966494; Mon, 07 Oct 2019 06:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570453966; cv=none; d=google.com; s=arc-20160816; b=IrhHpv/tkYnc7FJCqdLylVDYAScbJcL1RznsoIOoEzPf25CgeQAfHOsUlhSj8X6dS9 8venf9OUpTLsEvCStGOGGYKZ4jehs2Jz/Mu9Hl2dLkDdpv4VOQhx70FUg2MEbhJ+QfDf pIHNel3C7NGDblIm/b69UuvCKlR2hyy8OrVoW5mUm4n5eJcmMyYyDmTnFmcgV1g2RT6q cYBCSfOsoURAeSaCOOqP40hrzXBsqG5cqUTOC4OBdmbZKsIOUBoDl4ZistAk1gPS6LWg e3FGodsen4v6afA9kSDLhOlVKMOSQ3ANXAqgYxilVaXQXnAutIrplztDhGw9KaBwG35g XHEA== 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=QGGpibKSgPN52F+AToEQA5qscMTvvOJsG/MluQQQWb8=; b=IK/SgvJiMxIMOHr0paqMgaKKJYg8iKrbFwwjGpchxy7JSvYPeRIsybP+ImrTSrftcc S4O2Cr0pNpeGxqO8M/WyefErL7pChPHXvr4Jy3BwKpKd4PYswLmd+Qg+lBN+Ws5iL0Zy URhhlDGIexg4dO4A77ZB/sEUZLfKPIgiZaDZ17p+MFJaQL7+VxMxk1ly2tZFBneRb77M 3XBhMK2eod0krBF/ydpNwfeyJTyy/h9GcDbC4W435nYGTQ2VsE34VzKlqBccgvFBvXgO v1HzbOA1x17RbRug2FtFtgGtj2SMwH9UzFdMvaZAjIDHesXch9Dp24oZarie8TYOMio+ 8FcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UKLLFbk7; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si8709120edz.77.2019.10.07.06.12.23; Mon, 07 Oct 2019 06:12:46 -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=@chromium.org header.s=google header.b=UKLLFbk7; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbfJGNJD (ORCPT + 99 others); Mon, 7 Oct 2019 09:09:03 -0400 Received: from mail-yw1-f49.google.com ([209.85.161.49]:43371 "EHLO mail-yw1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727580AbfJGNJD (ORCPT ); Mon, 7 Oct 2019 09:09:03 -0400 Received: by mail-yw1-f49.google.com with SMTP id q7so5068542ywe.10 for ; Mon, 07 Oct 2019 06:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QGGpibKSgPN52F+AToEQA5qscMTvvOJsG/MluQQQWb8=; b=UKLLFbk7MozKtKXnphdmdst1Gzjdzn/kP9WFcji1s6Ob0Ncn1WVsfCDCMDa0kelx2H UgWEmBVm0gVF1Ibj+h+q30kw7QRZOXHs+5UmEBaVM0iuR+HuyETd4jhXWRCglTr+ODNO YPUu2jQnH1pWJeZuZdRTFn7uKmM+ApWINK8M4= 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=QGGpibKSgPN52F+AToEQA5qscMTvvOJsG/MluQQQWb8=; b=jyavsXBknew2S71vGsWLkKg4oBScZQcinH+Fc4qO/bLDSi0SK2OW1VzG15BzXcYz1z stp4auNsUFHVfDV2ae8mUN/KSzHa1ml64d8mofa1l64508OX07pNlqAfJmZZtwTArABZ 95Y2cYgX+1BdYEowSJhUSOg02N4crUn8bnv2DMcCDx00QjfvefrtIL7uJwNx+dkJioOJ bbcd8+WI9OeV/MPCQQrbVIT8YhGWOrcrNyja6SdEsvlnJVnh6hcmgaCO8aVwCYLv1xfl ALG03j3tgd3ttJ0dzIw1U1IWf4vy7AQRgATjkJKg9ojzPLMA12BlbqaGR95BcP0XrfCV u+UQ== X-Gm-Message-State: APjAAAVt8z5SEBT2oMNc4a2RFkRlj+rgpBfqd/5ATpO0s5HSC7lCoX8W eqtdc54rIiPnG2r/aqa4tcMCEUlJafs= X-Received: by 2002:a0d:ea81:: with SMTP id t123mr19600152ywe.30.1570453741536; Mon, 07 Oct 2019 06:09:01 -0700 (PDT) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com. [209.85.219.179]) by smtp.gmail.com with ESMTPSA id d66sm3635156ywe.31.2019.10.07.06.08.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Oct 2019 06:09:00 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id 4so956530ybq.9 for ; Mon, 07 Oct 2019 06:08:59 -0700 (PDT) X-Received: by 2002:a25:6e41:: with SMTP id j62mr11442914ybc.41.1570453738921; Mon, 07 Oct 2019 06:08:58 -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: Sean Paul Date: Mon, 7 Oct 2019 09:08:18 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: New sysfs interface for privacy screens To: Mat King 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 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 > > 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. 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.