Skip to contentSkip to conversation

drm/i915/hdcp: restore hdcp state same as previous

PATCH In review Anshuman Gupta 3 participants 3 messages Jan 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915/hdcp: restore hdcp state same as previous

When port is disabled due to modeset or DPMS off actually it disables the HDCP encryption keeping its state to CP_ENABLED this doesn't enable HDCP again while port gets enable again. HDCP state should set accordingly when port is disabled.

v2: Incorporated the necessary locking and making sure
when user explicitly set HDCP to UNDESRIED it should make HDCP to desired while disabling DDI. (Ram)

---
 drivers/gpu/drm/i915/display/intel_display_types.h |  1 +
 drivers/gpu/drm/i915/display/intel_hdcp.c          | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
index 630a94892b7b..f2552a52f26a 100644
@@ -344,6 +344,7 @@ struct intel_hdcp {
 	u64 value;
 	struct delayed_work check_work;
 	struct work_struct prop_work;
+	bool is_hdcp_undesired;
 
 	/* HDCP1.4 Encryption status */
 	bool hdcp_encrypted;
drivers/gpu/drm/i915/display/intel_hdcp.c +11 -1
index 0fdbd39f6641..507056aab33b 100644
@@ -2002,11 +2002,17 @@ int intel_hdcp_disable(struct intel_connector *connector)
 	mutex_lock(&hdcp->mutex);
 
 	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
-		hdcp->value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
 		if (hdcp->hdcp2_encrypted)
 			ret = _intel_hdcp2_disable(connector);
 		else if (hdcp->hdcp_encrypted)
 			ret = _intel_hdcp_disable(connector);
+
+		if (hdcp->is_hdcp_undesired) {
+			hdcp->value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
+		} else {
+			hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+			schedule_work(&hdcp->prop_work);
+		}
 	}
 
 	mutex_unlock(&hdcp->mutex);
@@ -2044,6 +2050,7 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 {
 	u64 old_cp = old_state->content_protection;
 	u64 new_cp = new_state->content_protection;
+	struct intel_connector *intel_conn = to_intel_connector(connector);
 	struct drm_crtc_state *crtc_state;
 
 	if (!new_state->crtc) {
@@ -2069,6 +2076,9 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 			return;
 	}
 
+	if (new_cp == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+		intel_conn->hdcp.is_hdcp_undesired  =  true;
+
 	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
 						   new_state->crtc);
 	crtc_state->mode_changed = true;
Signature · 6 lines
2.24.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 2 lines · Anshuman Gupta

When port is disabled due to modeset or DPMS off actually it disables the HDCP encryption keeping its state to

s/state/"content protection property as"

Quoted 3 lines

CP_ENABLED.
this doesn't enable HDCP again while port
gets enable again.

Since the content protection is left at ENABLED state by mistake at next DDI enable flow HDCP auth is not attempted.

Quoted 1 line

HDCP state should set accordingly

content protection property state should be updated as per port authentication state.

Quoted 5 lines

when port is disabled.

v2: Incorporated the necessary locking and making sure
when user explicitly set HDCP to UNDESRIED it should make HDCP to desired while disabling DDI. (Ram)

Need to rephrase this too.

Quoted 13 lines
---
 drivers/gpu/drm/i915/display/intel_display_types.h |  1 +
 drivers/gpu/drm/i915/display/intel_hdcp.c          | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display_types.h +0 -0
index 630a94892b7b..f2552a52f26a 100644

drivers/gpu/drm/i915/display/intel_display_types.h struct intel_hdcp { · line 347

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
@@ -344,6 +344,7 @@ struct intel_hdcp {
 	u64 value;
 	struct delayed_work check_work;
 	struct work_struct prop_work;
+	bool is_hdcp_undesired;

small comment on why this is needed now would be good.

/* Indicates whether HDCP is UNDESIERD by userspace */

Quoted 35 lines
drivers/gpu/drm/i915/display/intel_display_types.h +0 -0
 	/* HDCP1.4 Encryption status */
 	bool hdcp_encrypted;
drivers/gpu/drm/i915/display/intel_hdcp.c +8 -1
index 0fdbd39f6641..507056aab33b 100644
@@ -2002,11 +2002,17 @@ int intel_hdcp_disable(struct intel_connector *connector)
 	mutex_lock(&hdcp->mutex);
 
 	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
-		hdcp->value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
 		if (hdcp->hdcp2_encrypted)
 			ret = _intel_hdcp2_disable(connector);
 		else if (hdcp->hdcp_encrypted)
 			ret = _intel_hdcp_disable(connector);
+
+		if (hdcp->is_hdcp_undesired) {
+			hdcp->value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
+		} else {
+			hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+			schedule_work(&hdcp->prop_work);
+		}
 	}
 
 	mutex_unlock(&hdcp->mutex);
@@ -2044,6 +2050,7 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 {
 	u64 old_cp = old_state->content_protection;
 	u64 new_cp = new_state->content_protection;
+	struct intel_connector *intel_conn = to_intel_connector(connector);
 	struct drm_crtc_state *crtc_state;
 
 	if (!new_state->crtc) {

drivers/gpu/drm/i915/display/intel_hdcp.c void intel_hdcp_atomic_check(struct drm_connector *connector, · line 2080

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_hdcp.c +2 -0
@@ -2069,6 +2076,9 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 			return;
 	}
 
+	if (new_cp == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+		intel_conn->hdcp.is_hdcp_undesired  =  true;

This flag will be always left at true. reset it to false as soon as used at intel_hdcp_disable()

-Ram

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_hdcp.c +1 -0
+
 	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
 						   new_state->crtc);
 	crtc_state->mode_changed = true;
Signature · 1 line
2.24.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/hdcp: restore hdcp state same as previous

In reply to Anshuman Gupta
== Series Details ==

== Series Details ==

Series: drm/i915/hdcp: restore hdcp state same as previous
URL : https://patchwork.freedesktop.org/series/71820/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7714 -> Patchwork_16039
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/index.html

Known issues
------------

Here are the changes found in Patchwork_16039 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_blt:
- fi-bsw-nick: [PASS][1] -> [DMESG-FAIL][2] ([i915#723])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-bsw-nick/igt@i915_selftest@live_blt.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-bsw-nick/igt@i915_selftest@live_blt.html

* igt@i915_selftest@live_gem_contexts:
- fi-byt-j1900: [PASS][3] -> [DMESG-FAIL][4] ([i915#722])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-byt-j1900/igt@i915_selftest@live_gem_contexts.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-byt-j1900/igt@i915_selftest@live_gem_contexts.html

* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: [PASS][5] -> [FAIL][6] ([fdo#109635] / [i915#262])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-kbl-7500u/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live_blt:
- fi-hsw-4770r: [DMESG-FAIL][7] ([i915#725]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-hsw-4770r/igt@i915_selftest@live_blt.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-hsw-4770r/igt@i915_selftest@live_blt.html
- fi-hsw-4770: [DMESG-FAIL][9] ([i915#725]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-hsw-4770/igt@i915_selftest@live_blt.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-hsw-4770/igt@i915_selftest@live_blt.html

* igt@i915_selftest@live_gem_contexts:
- fi-skl-lmem: [INCOMPLETE][11] ([i915#424]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-skl-lmem/igt@i915_selftest@live_gem_contexts.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-skl-lmem/igt@i915_selftest@live_gem_contexts.html
- fi-cfl-8700k: [DMESG-FAIL][13] ([i915#623]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html
- fi-byt-n2820: [DMESG-FAIL][15] ([i915#722]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7714/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html

[fdo#109635]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
[i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
[i915#424]: https://gitlab.freedesktop.org/drm/intel/issues/424
[i915#623]: https://gitlab.freedesktop.org/drm/intel/issues/623
[i915#722]: https://gitlab.freedesktop.org/drm/intel/issues/722
[i915#723]: https://gitlab.freedesktop.org/drm/intel/issues/723
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725

Participating hosts (46 -> 40)
------------------------------

Additional (5): fi-bsw-n3050 fi-skl-6770hq fi-gdg-551 fi-bsw-kefka fi-skl-6600u
Missing (11): fi-ehl-1 fi-hsw-4200u fi-byt-squawks fi-kbl-guc fi-ctg-p8600 fi-byt-clapper fi-whl-u fi-blb-e6850 fi-tgl-y fi-snb-2600 fi-kbl-r

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_7714 -> Patchwork_16039

CI-20190529: 20190529
CI_DRM_7714: b633f28f2de80cdb861d6c1c3b4df6fd2d53239f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5358: c6fc013f414b806175dc4143c58ab445e5235ea5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_16039: 5cc5af7c0775df42001c466e0291458728160bbb @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

5cc5af7c0775 drm/i915/hdcp: restore hdcp state same as previous

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16039/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx