lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MWHPR11MB174144916507690D292D2AFAE3BA9@MWHPR11MB1741.namprd11.prod.outlook.com>
Date:   Fri, 10 Mar 2023 06:00:43 +0000
From:   "Kandpal, Suraj" <suraj.kandpal@...el.com>
To:     Mark Yacoub <markyacoub@...omium.org>,
        "quic_khsieh@...cinc.com" <quic_khsieh@...cinc.com>,
        "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "freedreno@...ts.freedesktop.org" <freedreno@...ts.freedesktop.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>
CC:     "quic_sbillaka@...cinc.com" <quic_sbillaka@...cinc.com>,
        "konrad.dybcio@...ainline.org" <konrad.dybcio@...ainline.org>,
        "bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "airlied@...il.com" <airlied@...il.com>,
        "hbh25y@...il.com" <hbh25y@...il.com>,
        "Vasut, Marek" <marex@...x.de>,
        "abhinavk@...eaurora.org" <abhinavk@...eaurora.org>,
        "javierm@...hat.com" <javierm@...hat.com>,
        "agross@...nel.org" <agross@...nel.org>,
        "quic_jesszhan@...cinc.com" <quic_jesszhan@...cinc.com>,
        "daniel@...ll.ch" <daniel@...ll.ch>,
        "Nikula, Jani" <jani.nikula@...el.com>,
        "De Marchi, Lucas" <lucas.demarchi@...el.com>,
        "quic_abhinavk@...cinc.com" <quic_abhinavk@...cinc.com>,
        "swboyd@...omium.org" <swboyd@...omium.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "christophe.jaillet@...adoo.fr" <christophe.jaillet@...adoo.fr>,
        "maxime@...no.tech" <maxime@...no.tech>,
        "Vivi, Rodrigo" <rodrigo.vivi@...el.com>,
        "johan+linaro@...nel.org" <johan+linaro@...nel.org>,
        "andersson@...nel.org" <andersson@...nel.org>,
        "dianders@...omium.org" <dianders@...omium.org>,
        "tzimmermann@...e.de" <tzimmermann@...e.de>,
        "dmitry.baryshkov@...aro.org" <dmitry.baryshkov@...aro.org>,
        "seanpaul@...omium.org" <seanpaul@...omium.org>
Subject: RE: [Intel-gfx] [PATCH v6 02/10] drm/hdcp: Avoid changing crtc state
 in hdcp atomic check



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@...ts.freedesktop.org> On Behalf Of Mark
> Yacoub
> Sent: Thursday, January 19, 2023 1:00 AM
> To: quic_khsieh@...cinc.com; linux-arm-msm@...r.kernel.org; dri-
> devel@...ts.freedesktop.org; freedreno@...ts.freedesktop.org;
> devicetree@...r.kernel.org; linux-kernel@...r.kernel.org; intel-
> gfx@...ts.freedesktop.org
> Cc: quic_sbillaka@...cinc.com; konrad.dybcio@...ainline.org;
> bjorn.andersson@...aro.org; krzysztof.kozlowski+dt@...aro.org;
> airlied@...il.com; hbh25y@...il.com; Vasut, Marek <marex@...x.de>;
> abhinavk@...eaurora.org; javierm@...hat.com; agross@...nel.org;
> quic_jesszhan@...cinc.com; daniel@...ll.ch; Nikula, Jani
> <jani.nikula@...el.com>; De Marchi, Lucas <lucas.demarchi@...el.com>;
> quic_abhinavk@...cinc.com; swboyd@...omium.org; robh+dt@...nel.org;
> christophe.jaillet@...adoo.fr; maxime@...no.tech; Vivi, Rodrigo
> <rodrigo.vivi@...el.com>; johan+linaro@...nel.org;
> markyacoub@...omium.org; andersson@...nel.org;
> dianders@...omium.org; tzimmermann@...e.de;
> dmitry.baryshkov@...aro.org; seanpaul@...omium.org
> Subject: [Intel-gfx] [PATCH v6 02/10] drm/hdcp: Avoid changing crtc state in
> hdcp atomic check
> 
> From: Sean Paul <seanpaul@...omium.org>
> 
> Instead of forcing a modeset in the hdcp atomic check, simply return true if
> the content protection value is changing and let the driver decide whether a
> modeset is required or not.
> 
> Acked-by: Jani Nikula <jani.nikula@...el.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@...el.com>
> Signed-off-by: Sean Paul <seanpaul@...omium.org>
> Signed-off-by: Mark Yacoub <markyacoub@...omium.org>
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20210913175747.47456-3-
> sean@...rly.run #v1
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20210915203834.1439-3-
> sean@...rly.run #v2
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20211001151145.55916-3-
> sean@...rly.run #v3
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20211105030434.2828845-
> 3-sean@...rly.run #v4
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20220411204741.1074308-
> 3-sean@...rly.run #v5
> 
> Changes in v2:
> -None
> Changes in v3:
> -None
> Changes in v4:
> -None
> Changes in v5:
> -None
> Changes in V6:
> -Rebase: modifications in drm_hdcp_helper.c instead of drm_hdcp.c
> 
> ---
>  drivers/gpu/drm/display/drm_hdcp_helper.c   | 33 +++++++++++++++------
>  drivers/gpu/drm/i915/display/intel_atomic.c |  6 ++--
>  include/drm/display/drm_hdcp_helper.h       |  2 +-
>  3 files changed, 27 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_hdcp_helper.c
> b/drivers/gpu/drm/display/drm_hdcp_helper.c
> index 7d910523b05f..a3896b0904b5 100644
> --- a/drivers/gpu/drm/display/drm_hdcp_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdcp_helper.c
> @@ -428,11 +428,14 @@
> EXPORT_SYMBOL(drm_hdcp_update_content_protection);
>   * @connector: drm_connector on which content protection state needs an
> update
>   *
>   * This function can be used by display drivers to perform an atomic check
> on the
> - * hdcp state elements. If hdcp state has changed, this function will set
> - * mode_changed on the crtc driving the connector so it can update its
> hardware
> - * to match the hdcp state.
> + * hdcp state elements. If hdcp state has changed in a manner which
> + requires the
> + * driver to enable or disable content protection, this function will
> + return
> + * true.
> + *
> + * Returns:
> + * true if the driver must enable/disable hdcp, false otherwise
>   */
> -void drm_hdcp_atomic_check(struct drm_connector *connector,
> +bool drm_hdcp_atomic_check(struct drm_connector *connector,
>  			   struct drm_atomic_state *state)
>  {
>  	struct drm_connector_state *new_conn_state, *old_conn_state;
> @@ -450,10 +453,12 @@ void drm_hdcp_atomic_check(struct
> drm_connector *connector,
>  		 * If the connector is being disabled with CP enabled, mark it
>  		 * desired so it's re-enabled when the connector is brought
> back
>  		 */
> -		if (old_hdcp ==
> DRM_MODE_CONTENT_PROTECTION_ENABLED)
> +		if (old_hdcp ==
> DRM_MODE_CONTENT_PROTECTION_ENABLED) {
>  			new_conn_state->content_protection =
> 
> 	DRM_MODE_CONTENT_PROTECTION_DESIRED;
> -		return;
> +			return true;
> +		}
> +		return false;
>  	}
> 
>  	new_crtc_state =
> @@ -465,9 +470,19 @@ void drm_hdcp_atomic_check(struct
> drm_connector *connector,
>  	*/
>  	if (drm_atomic_crtc_needs_modeset(new_crtc_state) &&
>  	    (old_hdcp == DRM_MODE_CONTENT_PROTECTION_ENABLED &&
> -	     new_hdcp != DRM_MODE_CONTENT_PROTECTION_UNDESIRED))
> +	     new_hdcp != DRM_MODE_CONTENT_PROTECTION_UNDESIRED))
> {
>  		new_conn_state->content_protection =
>  			DRM_MODE_CONTENT_PROTECTION_DESIRED;
> +		return true;
> +	}
> +
> +	/*
> +	 * Coming back from disable or changing CRTC with DESIRED state
> requires
> +	 * that the driver try CP enable.
> +	 */

Hi ,
We can have a clearer comment which says something like "Coming back from
UNDESIRED state, CRTC change or re-enablement requires the driver to try CP enable"

Regards,
Suraj Kandpal
> +	if (new_hdcp == DRM_MODE_CONTENT_PROTECTION_DESIRED &&
> +	    new_conn_state->crtc != old_conn_state->crtc)
> +		return true;
> 
>  	/*
>  	 * Nothing to do if content type is unchanged and one of:
> @@ -482,9 +497,9 @@ void drm_hdcp_atomic_check(struct drm_connector
> *connector,
>  	     new_hdcp == DRM_MODE_CONTENT_PROTECTION_DESIRED)) {
>  		if (old_conn_state->hdcp_content_type ==
>  		    new_conn_state->hdcp_content_type)
> -			return;
> +			return false;
>  	}
> 
> -	new_crtc_state->mode_changed = true;
> +	return true;
>  }
>  EXPORT_SYMBOL(drm_hdcp_atomic_check);
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c
> b/drivers/gpu/drm/i915/display/intel_atomic.c
> index 8a473199c4bf..a2067cbae2d5 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> @@ -123,8 +123,6 @@ int intel_digital_connector_atomic_check(struct
> drm_connector *conn,
>  		to_intel_digital_connector_state(old_state);
>  	struct drm_crtc_state *crtc_state;
> 
> -	drm_hdcp_atomic_check(conn, state);
> -
>  	if (!new_state->crtc)
>  		return 0;
> 
> @@ -140,8 +138,8 @@ int intel_digital_connector_atomic_check(struct
> drm_connector *conn,
>  	    new_conn_state->base.picture_aspect_ratio != old_conn_state-
> >base.picture_aspect_ratio ||
>  	    new_conn_state->base.content_type != old_conn_state-
> >base.content_type ||
>  	    new_conn_state->base.scaling_mode != old_conn_state-
> >base.scaling_mode ||
> -	    new_conn_state->base.privacy_screen_sw_state !=
> old_conn_state->base.privacy_screen_sw_state ||
> -	    !drm_connector_atomic_hdr_metadata_equal(old_state,
> new_state))
> +	    !drm_connector_atomic_hdr_metadata_equal(old_state,
> new_state) ||
> +	    drm_hdcp_atomic_check(conn, state))
>  		crtc_state->mode_changed = true;
> 
>  	return 0;
> diff --git a/include/drm/display/drm_hdcp_helper.h
> b/include/drm/display/drm_hdcp_helper.h
> index dd02b2e72a50..cb2cc5002f65 100644
> --- a/include/drm/display/drm_hdcp_helper.h
> +++ b/include/drm/display/drm_hdcp_helper.h
> @@ -19,7 +19,7 @@ int drm_hdcp_check_ksvs_revoked(struct drm_device
> *dev, u8 *ksvs, u32 ksv_count)  int
> drm_connector_attach_content_protection_property(struct drm_connector
> *connector,
>  						     bool hdcp_content_type);
>  void drm_hdcp_update_content_protection(struct drm_connector
> *connector, u64 val); -void drm_hdcp_atomic_check(struct drm_connector
> *connector,
> +bool drm_hdcp_atomic_check(struct drm_connector *connector,
>  			   struct drm_atomic_state *state);
> 
>  #endif
> --
> 2.39.0.246.g2a6d74b583-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ