Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6672222ybf; Fri, 6 Mar 2020 02:16:55 -0800 (PST) X-Google-Smtp-Source: ADFU+vuFvf2Qg0/buIr8MgoTZ9YRQMF13kPnEY3CbzbLYACbIDTcEjDUCYosiN6Zl+CCD5Z2sIhf X-Received: by 2002:a9d:69d3:: with SMTP id v19mr1863717oto.320.1583489814991; Fri, 06 Mar 2020 02:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583489814; cv=none; d=google.com; s=arc-20160816; b=BHabX7cqgZQHN1uI/Zz8xjtn6kjzUKD5eUUSyh6Ft802Lb1Hvs2URZZBGiEED4S84v wiGu4BbFD3chsvYVYdTRuDKrTUf4ccImk7ZBvidH1kF7G6KZDajPX+bTN5h7CNHatc0w E0gqFBHFggCGP1i4HS/F+jOqp72Bz6jpqfrfiB5eIhdqyStf9e08d2i3t7P1AWV+wW1G 5U6TerRFBqs7uqYI0AgOoZnqRxREjKcjj6J3V6/UerDzTR0LG1NNHv0J3E0A4Y+NT8DK ENAq4JduyGuBUcWxiiYRM2JWIVukaUm8DLXHiZztUp3kyIU1DizecIQcXRo0udAnkyIe bTwA== 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=Z8umGEQXQMLcYbD0OwVq8nDaYapJuU1/+VsooYpIhUY=; b=Kxz+Ly2suyJypMbzmFxPVNjB7e8XuE1rLUes+tecfCX2m5uiXq9SWXj2gihr/WcGsp zkYXnWdaU+ftbQCFjh7Yfw2/1oLcEJQxuPj1raoiJTDGIHy4bn/TubrfaKuTyX6I4lk1 fHwV82LA2NB1RzqibEcnB2RAHJOA/P60CL3aWmpnr+WbDsqnVFoHwN/5mbsp2m4hPNqF Yy9hN6Daj3ns+dLBVYP1v2YKmPAQwJT8afB81m9c68wot9GpSnBWIGSys1ztb400asbo 3dRVEWArX9xsL0a28ER7ZHykBqszKDWmdT7nJ2FEj5Uqc2NuDbXePNwFYRWuqViP1SWU MFQw== 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 w21si1109167otm.291.2020.03.06.02.16.43; Fri, 06 Mar 2020 02:16:54 -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 S1726378AbgCFKPR (ORCPT + 99 others); Fri, 6 Mar 2020 05:15:17 -0500 Received: from mga18.intel.com ([134.134.136.126]:50480 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbgCFKPR (ORCPT ); Fri, 6 Mar 2020 05:15:17 -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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 02:15:16 -0800 X-IronPort-AV: E=Sophos;i="5.70,521,1574150400"; d="scan'208";a="234756101" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.161]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 02:15:07 -0800 From: Jani Nikula To: Rajat Jain Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Joonas Lahtinen , Rodrigo Vivi , Ville =?utf-8?B?U3lyasOkbMOk?= , Chris Wilson , Imre Deak , =?utf-8?Q?Jo?= =?utf-8?Q?s=C3=A9?= Roberto de Souza , Linux Kernel Mailing List , dri-devel , intel-gfx@lists.freedesktop.org, Greg Kroah-Hartman , Mat King , Daniel Thompson , Jonathan Corbet , Pavel Machek , Sean Paul , Duncan Laurie , Jesse Barnes , Thierry Reding , Mark Pearson , Nitin Joshi1 , Sugumaran Lacshiminarayanan , Tomoki Maruichi , Guenter Roeck , Rajat Jain Subject: Re: [PATCH v6 3/3] drm/i915: Add support for integrated privacy screens In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200305012338.219746-1-rajatja@google.com> <20200305012338.219746-4-rajatja@google.com> <87k13znmrc.fsf@intel.com> Date: Fri, 06 Mar 2020 12:15:04 +0200 Message-ID: <87pndpoklz.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, 05 Mar 2020, Rajat Jain wrote: > OK, will do. In order to do that I may need to introduce driver level > hooks that i915 driver can populate and drm core can call (or may be > some functions to add privacy screen property that drm core exports > and i915 driver will call). The latter. Look at drm_connector_attach_*() functions in drm_connector.c. i915 (or any other driver) can create and attach the property as needed. drm_atomic_connector_{get,set}_property in drm_atomic_uapi.c need to handle the properties, but *only* to get/set the value in drm_connector_state, nothing more. How that value is actually used is up to the drivers, but the userspace interface will be the same instead of being driver specific. >> > @@ -93,15 +97,18 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector, >> > struct drm_i915_private *dev_priv = to_i915(dev); >> > struct intel_digital_connector_state *intel_conn_state = >> > to_intel_digital_connector_state(state); >> > + struct intel_connector *intel_connector = to_intel_connector(connector); >> > >> > if (property == dev_priv->force_audio_property) { >> > intel_conn_state->force_audio = val; >> > return 0; >> > - } >> > - >> > - if (property == dev_priv->broadcast_rgb_property) { >> > + } else if (property == dev_priv->broadcast_rgb_property) { >> > intel_conn_state->broadcast_rgb = val; >> > return 0; >> > + } else if (property == intel_connector->privacy_screen_property) { >> > + intel_privacy_screen_set_val(intel_connector, val); >> >> I think this part should only change the connector state. The driver >> would then do the magic at commit stage according to the property value. Also, this would be the part that's done in drm core level. > Can you please point me to some code reference as to where in code > does the "commit stage" apply the changes? Look at, say, drm_connector_attach_scaling_mode_property(). In the getter/setter code it'll just read/change state->scaling_mode. You can use the value in encoder ->enable, ->disable, and ->update_pipe hooks. Enable should enable the privacy screen if desired, disable should probably unconditionally disable the privacy screen while disabling the display, and update should just change the state according to the value. Update is called if there isn't a full modeset. (Scaling mode is a bit more indirect than that, affecting other things in the encoder ->compute_config hook, leading to similar effects.) Ville, anything I missed? BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center