Skip to contentSkip to conversation

drm/i915/hdcp: Update CP as per the kernel internal state

PATCH Superseded Anshuman Gupta 3 participants 7 messages May 15, 2020 – May 18, 2020

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915/hdcp: Update CP as per the kernel internal state

Content Protection property should be updated as per the kernel internal state. Let's say if Content protection is disabled by userspace, CP property should be set to UNDESIRED so that reauthentication will not happen until userspace request it again, but when kernel disables the HDCP due to any DDI disabling sequences like modeset/DPMS operation, kernel should set the property to DESIRED, so that when opportunity arises, kernel will start the HDCP authentication on its own.

Somewhere in the line, state machine to set content protection to DESIRED from kernel was broken and IGT coverage was missing for it. This patch fixes it.

v2:
- Fixing hdcp CP state in intel_hdcp_atomic_check(), that will require to check hdcp->value in intel_hdcp_update_pipe() in order to avoid enabling hdcp, if it was already enabled.

---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 27 +++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_hdcp.c +23 -4
index 2cbc4619b4ce..f90f48819838 100644
@@ -2083,6 +2083,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
 		(conn_state->hdcp_content_type != hdcp->content_type &&
 		 conn_state->content_protection !=
 		 DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
+	bool desired_and_not_enabled = false;
 
 	/*
 	 * During the HDCP encryption session if Type change is requested,
@@ -2105,8 +2106,15 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
 	}
 
 	if (conn_state->content_protection ==
-	    DRM_MODE_CONTENT_PROTECTION_DESIRED ||
-	    content_protection_type_changed)
+	    DRM_MODE_CONTENT_PROTECTION_DESIRED) {
+		mutex_lock(&hdcp->mutex);
+		/* Avoid enabling hdcp, if it already ENABLED */
+		desired_and_not_enabled =
+			hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED;
+		mutex_unlock(&hdcp->mutex);
+	}
+
+	if (desired_and_not_enabled || content_protection_type_changed)
 		intel_hdcp_enable(connector,
 				  crtc_state->cpu_transcoder,
 				  (u8)conn_state->hdcp_content_type);
@@ -2155,6 +2163,19 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 		return;
 	}
 
+	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
+						   new_state->crtc);
+	/*
+	 * Fix the HDCP uapi content protection state in case of modeset.
+	 * FIXME: As per HDCP content protection property uapi doc, an uevent()
+	 * need to be sent if there is transition from ENABLED->DESIRED.
+	 */
+	if (drm_atomic_crtc_needs_modeset(crtc_state) &&
+	    (old_cp == DRM_MODE_CONTENT_PROTECTION_ENABLED &&
+	    new_cp != DRM_MODE_CONTENT_PROTECTION_UNDESIRED))
+		new_state->content_protection =
+			DRM_MODE_CONTENT_PROTECTION_DESIRED;
+
 	/*
 	 * Nothing to do if the state didn't change, or HDCP was activated since
 	 * the last commit. And also no change in hdcp content type.
@@ -2167,8 +2188,6 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 			return;
 	}
 
-	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
-						   new_state->crtc);
 	crtc_state->mode_changed = true;
 }
 
Signature · 6 lines
2.26.0

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

Quoting Anshuman Gupta (2020-05-15 07:10:29)

Quoted 3 lines

Somewhere in the line, state machine to set content protection to DESIRED from kernel was broken and IGT coverage was missing for it. This patch fixes it.

It's strange that you mention IGT, since what tests being run by CI never pass and have not been fixed for several months. As well as the sporadic HDCP failures affecting unrelated tests, which have not appeared to have received any attention either.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 7 lines · Chris Wilson

Quoting Anshuman Gupta (2020-05-15 07:10:29)

Quoted 3 lines

Somewhere in the line, state machine to set content protection to DESIRED from kernel was broken and IGT coverage was missing for it. This patch fixes it.

It's strange that you mention IGT, since what tests being run by CI never pass and have not been fixed for several months. As well as the

Actually IGT fix for the coverge was worked upon after discovering this issue.
https://patchwork.freedesktop.org/patch/349542/?series=72264&rev=1
above patch requires to merge after kernel patch.

Quoted 2 lines

sporadic HDCP failures affecting unrelated tests, which have not appeared to have received any attention either.

This bug was not failing any igt subtest, as igt test coverage was missing, content protection igt test were passing.
Thanks,
Anshuman.

Quoted 1 line

-Chris

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

#3 lore raw

Quoting Anshuman Gupta (2020-05-15 08:10:06)

Quoted 8 lines · Chris Wilson
Quoted 7 lines

Quoting Anshuman Gupta (2020-05-15 07:10:29)

Quoted 3 lines

Somewhere in the line, state machine to set content protection to DESIRED from kernel was broken and IGT coverage was missing for it. This patch fixes it.

It's strange that you mention IGT, since what tests being run by CI never pass and have not been fixed for several months. As well as the

Quoted 7 lines

Actually IGT fix for the coverge was worked upon after discovering this issue.
https://patchwork.freedesktop.org/patch/349542/?series=72264&rev=1
above patch requires to merge after kernel patch.

Quoted 2 lines

sporadic HDCP failures affecting unrelated tests, which have not appeared to have received any attention either.

This bug was not failing any igt subtest, as igt test coverage was missing, content protection igt test were passing.

I'm referring to the existing failures in kms_content_protection -- it is a failure across the board in CI. Not to mention the sporadic OOPSes caused by CP.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/hdcp: Update CP as per the kernel internal state (rev4)

In reply to Anshuman Gupta
== Series Details ==

== Series Details ==

Series: drm/i915/hdcp: Update CP as per the kernel internal state (rev4)
URL : https://patchwork.freedesktop.org/series/72251/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8489 -> Patchwork_17671
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_17671:

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@i915_selftest@live@execlists:
- {fi-tgl-dsi}: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/fi-tgl-dsi/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/fi-tgl-dsi/igt@i915_selftest@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@execlists:
- fi-cfl-guc: [PASS][3] -> [INCOMPLETE][4] ([i915#1874])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/fi-cfl-guc/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/fi-cfl-guc/igt@i915_selftest@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@execlists:
- fi-skl-lmem: [INCOMPLETE][5] ([i915#656]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/fi-skl-lmem/igt@i915_selftest@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/fi-skl-lmem/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@i915_pm_rpm@module-reload:
- fi-kbl-x1275: [FAIL][7] ([i915#62]) -> [SKIP][8] ([fdo#109271])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/fi-kbl-x1275/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/fi-kbl-x1275/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1874]: https://gitlab.freedesktop.org/drm/intel/issues/1874
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656

Participating hosts (52 -> 44)
------------------------------

Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u fi-byt-clapper fi-bdw-samus

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

* Linux: CI_DRM_8489 -> Patchwork_17671

CI-20190529: 20190529
CI_DRM_8489: 4a38678eb36587a5fdcccbf0e9e888bf30e8bb3e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5655: 2cc4c1edc3065590f9917930b6d049a90c4a38fd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17671: 004791888c5f9a9fb0e43cdf29e3640f826a4b96 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

004791888c5f drm/i915/hdcp: Update CP as per the kernel internal state

== Logs ==

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

#5 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/hdcp: Update CP as per the kernel internal state (rev4)

In reply to Anshuman Gupta
== Series Details ==

== Series Details ==

Series: drm/i915/hdcp: Update CP as per the kernel internal state (rev4)
URL : https://patchwork.freedesktop.org/series/72251/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8489_full -> Patchwork_17671_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_rpm@system-suspend:
- shard-skl: [PASS][1] -> [INCOMPLETE][2] ([i915#151] / [i915#69])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl4/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl5/igt@[email protected]

* igt@i915_suspend@sysfs-reader:
- shard-apl: [PASS][3] -> [DMESG-WARN][4] ([i915#180]) +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-apl7/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-apl1/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-a-64x64-left-edge:
- shard-apl: [PASS][5] -> [FAIL][6] ([i915#70] / [i915#95])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-apl3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-apl7/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][7] -> [DMESG-WARN][8] ([i915#180] / [i915#93] / [i915#95])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-kbl2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-kbl4/igt@[email protected]

* igt@kms_hdr@bpc-switch-suspend:
- shard-kbl: [PASS][9] -> [DMESG-WARN][10] ([i915#180]) +3 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-kbl1/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-kbl1/igt@[email protected]
- shard-skl: [PASS][11] -> [FAIL][12] ([i915#1188]) +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl6/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl6/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence:
- shard-skl: [PASS][13] -> [FAIL][14] ([i915#53]) +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl6/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl6/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [PASS][15] -> [FAIL][16] ([fdo#108145] / [i915#265])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl6/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl6/igt@[email protected]

* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [PASS][17] -> [SKIP][18] ([fdo#109441]) +3 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-iclb3/igt@kms_psr@psr2_primary_mmap_cpu.html

#### Possible fixes ####

* igt@kms_cursor_crc@pipe-b-cursor-64x64-random:
- shard-snb: [SKIP][19] ([fdo#109271]) -> [PASS][20] +1 similar issue
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-snb1/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-snb2/igt@[email protected]

* igt@kms_cursor_legacy@all-pipes-torture-bo:
- shard-snb: [DMESG-WARN][21] ([i915#128]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-snb5/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-snb2/igt@[email protected]

* {igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2}:
- shard-glk: [FAIL][23] ([i915#79]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-glk2/igt@kms_flip@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-glk6/igt@kms_flip@[email protected]

* {igt@kms_flip@flip-vs-suspend-interruptible@a-dp1}:
- shard-kbl: [DMESG-WARN][25] ([i915#180]) -> [PASS][26] +8 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-kbl2/igt@kms_flip@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-kbl6/igt@kms_flip@[email protected]

* {igt@kms_flip@flip-vs-suspend@c-dp1}:
- shard-apl: [DMESG-WARN][27] ([i915#180]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-apl1/igt@kms_flip@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-apl8/igt@kms_flip@[email protected]

* {igt@kms_flip@plain-flip-fb-recreate-interruptible@b-edp1}:
- shard-skl: [FAIL][29] ([i915#1883]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl1/igt@kms_flip@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl5/igt@kms_flip@[email protected]

* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [FAIL][31] ([i915#1188]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl7/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl4/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-skl: [INCOMPLETE][33] ([i915#648] / [i915#69]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl10/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl7/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
- shard-skl: [INCOMPLETE][35] ([i915#69]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-skl3/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-skl7/igt@[email protected]

* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [SKIP][37] ([fdo#109642] / [fdo#111068]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-iclb8/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-iclb2/igt@[email protected]

* igt@kms_psr@psr2_primary_render:
- shard-iclb: [SKIP][39] ([fdo#109441]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-iclb4/igt@kms_psr@psr2_primary_render.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-iclb2/igt@kms_psr@psr2_primary_render.html

* {igt@perf@blocking-parameterized}:
- shard-iclb: [FAIL][41] ([i915#1542]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-iclb1/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-iclb1/igt@[email protected]

#### Warnings ####

* igt@i915_pm_dc@dc6-psr:
- shard-tglb: [SKIP][43] ([i915#468]) -> [FAIL][44] ([i915#454])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-tglb2/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-tglb8/igt@[email protected]

* igt@i915_pm_rpm@cursor-dpms:
- shard-snb: [SKIP][45] ([fdo#109271]) -> [INCOMPLETE][46] ([i915#82])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-snb6/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-snb1/igt@[email protected]

* igt@kms_content_protection@atomic:
- shard-kbl: [TIMEOUT][47] ([i915#1319]) -> [FAIL][48] ([fdo#110321] / [fdo#110336] / [i915#93] / [i915#95])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-kbl1/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-kbl2/igt@[email protected]

* igt@kms_content_protection@legacy:
- shard-apl: [TIMEOUT][49] ([i915#1319]) -> [FAIL][50] ([fdo#110321] / [fdo#110336])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-apl3/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-apl7/igt@[email protected]

* igt@kms_content_protection@lic:
- shard-apl: [FAIL][51] ([fdo#110321]) -> [TIMEOUT][52] ([i915#1319])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8489/shard-apl1/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17671/shard-apl8/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#128]: https://gitlab.freedesktop.org/drm/intel/issues/128
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#151]: https://gitlab.freedesktop.org/drm/intel/issues/151
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1883]: https://gitlab.freedesktop.org/drm/intel/issues/1883
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#468]: https://gitlab.freedesktop.org/drm/intel/issues/468
[i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
[i915#648]: https://gitlab.freedesktop.org/drm/intel/issues/648
[i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
[i915#70]: https://gitlab.freedesktop.org/drm/intel/issues/70
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (11 -> 11)
------------------------------

No changes in participating hosts

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

* Linux: CI_DRM_8489 -> Patchwork_17671

CI-20190529: 20190529
CI_DRM_8489: 4a38678eb36587a5fdcccbf0e9e888bf30e8bb3e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5655: 2cc4c1edc3065590f9917930b6d049a90c4a38fd @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17671: 004791888c5f9a9fb0e43cdf29e3640f826a4b96 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#6 lore raw
In reply to Anshuman Gupta
Quoted 18 lines · Anshuman Gupta

Content Protection property should be updated as per the kernel internal state. Let's say if Content protection is disabled by userspace, CP property should be set to UNDESIRED so that reauthentication will not happen until userspace request it again, but when kernel disables the HDCP due to any DDI disabling sequences like modeset/DPMS operation, kernel should set the property to DESIRED, so that when opportunity arises, kernel will start the HDCP authentication on its own.

Somewhere in the line, state machine to set content protection to DESIRED from kernel was broken and IGT coverage was missing for it. This patch fixes it.

v2:
- Fixing hdcp CP state in intel_hdcp_atomic_check(), that will require to check hdcp->value in intel_hdcp_update_pipe() in order to avoid enabling hdcp, if it was already enabled.

Quoted 6 lines

Ram, Daniel, Jani,
Above patch fixes HDCP uapi broken state.
Could you please provide your inputs , is it ok to merges this patch in current form. Thanks,
Anshuman Gupta.

Quoted 66 lines
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 27 +++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_hdcp.c +23 -4
index 2cbc4619b4ce..f90f48819838 100644
@@ -2083,6 +2083,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
 		(conn_state->hdcp_content_type != hdcp->content_type &&
 		 conn_state->content_protection !=
 		 DRM_MODE_CONTENT_PROTECTION_UNDESIRED);
+	bool desired_and_not_enabled = false;
 
 	/*
 	 * During the HDCP encryption session if Type change is requested,
@@ -2105,8 +2106,15 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
 	}
 
 	if (conn_state->content_protection ==
-	    DRM_MODE_CONTENT_PROTECTION_DESIRED ||
-	    content_protection_type_changed)
+	    DRM_MODE_CONTENT_PROTECTION_DESIRED) {
+		mutex_lock(&hdcp->mutex);
+		/* Avoid enabling hdcp, if it already ENABLED */
+		desired_and_not_enabled =
+			hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED;
+		mutex_unlock(&hdcp->mutex);
+	}
+
+	if (desired_and_not_enabled || content_protection_type_changed)
 		intel_hdcp_enable(connector,
 				  crtc_state->cpu_transcoder,
 				  (u8)conn_state->hdcp_content_type);
@@ -2155,6 +2163,19 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 		return;
 	}
 
+	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
+						   new_state->crtc);
+	/*
+	 * Fix the HDCP uapi content protection state in case of modeset.
+	 * FIXME: As per HDCP content protection property uapi doc, an uevent()
+	 * need to be sent if there is transition from ENABLED->DESIRED.
+	 */
+	if (drm_atomic_crtc_needs_modeset(crtc_state) &&
+	    (old_cp == DRM_MODE_CONTENT_PROTECTION_ENABLED &&
+	    new_cp != DRM_MODE_CONTENT_PROTECTION_UNDESIRED))
+		new_state->content_protection =
+			DRM_MODE_CONTENT_PROTECTION_DESIRED;
+
 	/*
 	 * Nothing to do if the state didn't change, or HDCP was activated since
 	 * the last commit. And also no change in hdcp content type.
@@ -2167,8 +2188,6 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
 			return;
 	}
 
-	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
-						   new_state->crtc);
 	crtc_state->mode_changed = true;
 }
 
Signature · 1 line
2.26.0

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