Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1845628ybv; Fri, 21 Feb 2020 04:29:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzHr46zmbA9ba/zlAToz02aLUP4sURHi0/TE8KgiXr4UIbtAQrqhUeb1WBdcjglIiYk6aMD X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr29242728otp.346.1582288185334; Fri, 21 Feb 2020 04:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582288185; cv=none; d=google.com; s=arc-20160816; b=dO7ipLuTSouRCMdx3+uv1nrhRCcHllLUQr0Bx13M8SxJZJESzXYk7+A4dl5JhIlY2N efzOPiDJ495WiOpjaUhkzeFR9gkJaOAi3Pdpq4qPPqebohw8Yx4QvOy2RK++Y2tq+J3x M079TpgoMQaHexJuISDePQIk7TfQ0SG95vGTb5RObnRHTyiJ1Bny9kOF5v0DOnGTjYXH Toz8hvB9PSt7+IY17sHqKHVcBD+yE++l9OfZ91a32jzootsPRJCXGzqAYBnianPOkcyS Y1a4n3nx/CQBmK/95Df0qgAW/AvS6BlVG8iW2BriiN4SX9LHKYc9hmCy6n+vrqeMfPpY aPJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=ExQnG48YMLIzGnihjYVcVh66FnvV2vlaVnUal96FxVI=; b=D7rWSkxOG++EzqzQJ3topLJpn+d6Jx33RoCIZ5EsobXKBIdaag0Xb0bjTojsEBA9OD gj05XalPPhswTtJazTuWiUbs2+qgbovGu1z35DvHOmITxbumVv5Osla0G+uIcFdW5qvp UAbqJ2t7UyJCe1imo25bdS6IMHbTE4jaJhOoG2VQddJqC573oqNxsYYNxG/GHGKz5ztU VrqVBwf+s9vpoAEx9cOyb5IGITCuWpjEIY72+n3FTTb4LeUq0p5J9PlgMMk+Pl+M0O/C jDJKexW0fnaGKHq1s1ESaPy8CZsHzhO8pRRsS26a0Zg0q4mRvOlyHbUHLS9rj/2O88cU 3V0Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si1388386ote.72.2020.02.21.04.29.32; Fri, 21 Feb 2020 04:29:45 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727683AbgBUM2H (ORCPT + 99 others); Fri, 21 Feb 2020 07:28:07 -0500 Received: from mga03.intel.com ([134.134.136.65]:3690 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbgBUM2H (ORCPT ); Fri, 21 Feb 2020 07:28:07 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2020 04:28:06 -0800 X-IronPort-AV: E=Sophos;i="5.70,468,1574150400"; d="scan'208";a="229837267" Received: from jmiler-mobl.ger.corp.intel.com (HELO localhost) ([10.249.38.187]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2020 04:28:01 -0800 From: Jani Nikula To: Rajat Jain , Mark Pearson Cc: Andy Shevchenko , Nitin Joshi , Mat King , Daniel Thompson , Jingoo Han , Henrique de Moraes Holschuh , Darren Hart , Andy Shevchenko , Thinkpad-acpi devel ML , Platform Driver , Nitin Joshi1 , Benjamin Berg , Linux Kernel Mailing List , dri-devel , Greg Kroah-Hartman , Pekka Paalanen Subject: Re: [External] Re: [PATCH] thinkpad_acpi: Add sysfs entry for lcdshadow feature In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200220074637.7578-1-njoshi1@lenovo.com> Date: Fri, 21 Feb 2020 14:28:06 +0200 Message-ID: <87tv3kxgyx.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Feb 2020, Rajat Jain wrote: > Hi Mark, > > > On Thu, Feb 20, 2020 at 11:03 AM Mark Pearson wrote: >> >> Hi Rajat, >> >> > -----Original Message----- >> > From: Rajat Jain >> > Sent: Thursday, February 20, 2020 1:39 PM >> > > >> > > For this particular issue what is the best way to contribute and get >> > > involved? We'd like to make it so ePrivacy can be used more easily from >> > > Linux. I agree a more generic way of controlling it would be good. >> > > I looked at the proposed patch from Rajat >> > > (https://lkml.org/lkml/2019/10/22/967) - it seems like a good solution to me. >> > > We can help with testing that on our platforms if that would be useful. >> > >> > Thanks you, just so that you know, the latest patchset is at: >> > https://lkml.org/lkml/2019/12/20/794 >> > >> > It would be great to get some additional testing if possible. I can >> > send a sample ACPI (for our platform) in case it helps. >> > >> Sounds good - we'll definitely try this out and see how it goes. I >> suspect we'll have some questions once we try it out and get more >> familiar. >> >> > > >> > > I need to understand how we connect that implementation with the ACPI >> > > controls we have (as I believe what we have are thinkpad specific and not to >> > > a drm spec; we need to confirm that). We also have the ACPI events that >> > > notify if ePrivacy was changed by the hotkeys and that seems like something >> > > that should be done in thinkpad_acpi.c and not the drm code. >> > > >> > > Not sure if the two need to be connected somehow (or if handling the >> > > event is actually not important and polling is acceptable)? >> > >> > So there was some brief discussion about this on my patches - but >> > atleast on the platforms I have seen, there was no way to change the >> > privacy screen out of software / kernel control. Essentially, if there >> > are hotkeys, they would send an input event to the kernel, who'd send >> > them to userspace, who'd use the DRM method to toggle the privacy >> > screen. Thus the current version of the patch only supports >> > controlling the privacy screen via set() method. The get() method just >> > returns the cached value.I hope that works for you. >> > >> OK - on the thinkpads we have function+D as a 'hotkey' to control the >> feature...and my understanding is that bypasses everything and goes >> straight to the firmware. In general I think it's preferrable if the hotkey sends the key event to userspace that then makes the policy decision of what, if anything, to do with it. Everything is much easier if the policy is in userspace control. For example, you could define content based policies for enabling privacy screen, something that is definitely not possible with firmware. I emphatize with the desire to just bypass everything at the hardware/firmware level, because that is totally in your control (as an OEM), and requires no interaction with the operating system initially. Exposing the read-only state of the privacy screen is helpful, but prevents the OS from building more advanced features on top, failing to reach the full potential of the nice hardware feature. That said, we obviously do need to take such hardware/firmware implementations into account as well. >> The changes Nitin had been working on in thinkpad_acpi.c was to make >> this more Linux and friendly - provide a sysfs hook for user space to >> connect to with the aim of allowing it to be configured from user >> space and have on screen display when it was triggered etc. IMO one of the problems with using sysfs for this is that it's not connected with the graphics subsystem. The userspace has to go out of its way to make the connection between the privacy screen and the display. It shouldn't have to. It's a property of the display, not some unrelated device (although, technically, I presume in hardware it might be ;). We've made the mistake with backlight before, and we still somewhat struggle with it. Please let's not repeat that. >> I'm personally not sure yet how this ties up with the DRM method - >> more digging required. I'm intrigued to see if it works on our >> systems (sadly I don't have anything with that feature available on >> my desk right now...I need to get my hands on one) > > Just FYI, Here is the brief discussion we had about an interrupt > mechanism to support a (hardware based) "kill switch" for the privacy > screen. > https://lkml.org/lkml/2019/10/25/992 I agree with Pekka's mail [1] in that thread. BR, Jani. [1] https://lkml.org/lkml/2019/10/28/94 -- Jani Nikula, Intel Open Source Graphics Center