* [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length
@ 2018-01-08 15:55 Sean Paul
2018-01-08 15:55 ` [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test Sean Paul
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Sean Paul @ 2018-01-08 15:55 UTC (permalink / raw)
To: intel-gfx; +Cc: seanpaul
Noticed while I was reading it. Makes for a good first contribution, I
guess.
Changes in v2:
- None
Changes in v3:
- None
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
CONTRIBUTING | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/CONTRIBUTING b/CONTRIBUTING
index 561c5dd8..ca2ed8a5 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -18,13 +18,13 @@ A short list of contribution guidelines:
on its first invocation.
-- intel-gpu-tools is MIT lincensed and we require contributions to follow the
+- intel-gpu-tools is MIT licensed and we require contributions to follow the
developer's certificate of origin: http://developercertificate.org/
- When submitting new testcases please follow the naming conventions documented
- in the generated documentation. Also please make full use of all the helpers and
- convenience macros provided by the igt library. The semantic patch lib/igt.cocci
- can help with the more automatic conversions.
+ in the generated documentation. Also please make full use of all the helpers
+ and convenience macros provided by the igt library. The semantic patch
+ lib/igt.cocci can help with the more automatic conversions.
- Patches need to be reviewed on the mailing list. Exceptions only apply for
testcases and tooling for drivers with just a single contributor (e.g. vc4).
--
2.16.0.rc0.223.g4a4ac83678-goog
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test
2018-01-08 15:55 [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length Sean Paul
@ 2018-01-08 15:55 ` Sean Paul
2018-02-14 15:09 ` Chris Wilson
2018-01-08 16:31 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length Patchwork
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Sean Paul @ 2018-01-08 15:55 UTC (permalink / raw)
To: intel-gfx; +Cc: seanpaul
Pretty simple test:
- initializes the output
- clears the content protection property
- verifies that it clears
- sets the content protection property to desired
- verifies that it transitions to enabled
Does this for both legacy and atomic.
Changes in v2:
- Don't check for i915 gen
- Skip test if Content Protection property is absent
Changes in v3:
- s/igt_require_f/igt_assert_f/ (Ram)
- Clear property after test runs (Ram)
- s/drm_open_driver/drm_open_driver_master/ (Ram)
- Fix spelling mistake in log message
- Pull out property set/check into helper
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
lib/igt_kms.c | 3 +-
lib/igt_kms.h | 1 +
tests/Makefile.sources | 1 +
tests/kms_content_protection.c | 133 +++++++++++++++++++++++++++++++++++++++++
tests/meson.build | 1 +
5 files changed, 138 insertions(+), 1 deletion(-)
create mode 100644 tests/kms_content_protection.c
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 125ecb19..907db694 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -190,7 +190,8 @@ const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
"scaling mode",
"CRTC_ID",
"DPMS",
- "Broadcast RGB"
+ "Broadcast RGB",
+ "Content Protection"
};
/*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 2a480bf3..93e59dc7 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -118,6 +118,7 @@ enum igt_atomic_connector_properties {
IGT_CONNECTOR_CRTC_ID,
IGT_CONNECTOR_DPMS,
IGT_CONNECTOR_BROADCAST_RGB,
+ IGT_CONNECTOR_CONTENT_PROTECTION,
IGT_NUM_CONNECTOR_PROPS
};
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 34ca71a0..e0466411 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -179,6 +179,7 @@ TESTS_progs = \
kms_chv_cursor_fail \
kms_color \
kms_concurrent \
+ kms_content_protection\
kms_crtc_background_color \
kms_cursor_crc \
kms_cursor_legacy \
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
new file mode 100644
index 00000000..3f05c36d
--- /dev/null
+++ b/tests/kms_content_protection.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright © 2017 Google, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "igt.h"
+
+IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
+
+typedef struct {
+ int drm_fd;
+ igt_display_t display;
+} data_t;
+
+static bool
+wait_for_prop_value(igt_output_t *output, uint64_t expected)
+{
+ uint64_t val;
+ int i;
+
+ for (i = 0; i < 2000; i++) {
+ val = igt_output_get_prop(output,
+ IGT_CONNECTOR_CONTENT_PROTECTION);
+ if (val == expected)
+ return true;
+ usleep(1000);
+ }
+ igt_info("prop_value mismatch %ld != %ld\n", val, expected);
+ return false;
+}
+
+static void set_prop(igt_display_t *display, igt_output_t *output,
+ enum igt_commit_style s, uint64_t set_val,
+ uint64_t expected_val)
+{
+ igt_output_set_prop_value(output, IGT_CONNECTOR_CONTENT_PROTECTION,
+ set_val);
+ igt_display_commit2(display, s);
+
+ igt_assert_f(wait_for_prop_value(output, expected_val),
+ "Content Protection did not transition to %ld\n",
+ expected_val);
+}
+
+static void
+test_pipe_output(igt_display_t *display, const enum pipe pipe,
+ igt_output_t *output, enum igt_commit_style s)
+{
+ drmModeModeInfo mode;
+ igt_plane_t *primary;
+ struct igt_fb red;
+
+ igt_assert(kmstest_get_connector_default_mode(
+ display->drm_fd, output->config.connector, &mode));
+
+ igt_output_override_mode(output, &mode);
+ igt_output_set_pipe(output, pipe);
+
+ igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
+ DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+ 1.f, 0.f, 0.f, &red);
+ primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+ igt_plane_set_fb(primary, &red);
+ igt_display_commit2(display, s);
+
+ set_prop(display, output, s, 0, 0);
+ set_prop(display, output, s, 1, 2);
+ set_prop(display, output, s, 0, 0);
+
+ igt_plane_set_fb(primary, NULL);
+ igt_output_set_pipe(output, PIPE_NONE);
+}
+
+static void
+test_content_protection(igt_display_t *display, enum igt_commit_style s)
+{
+ igt_output_t *output;
+ enum pipe pipe;
+ int valid_tests = 0;
+
+ for_each_pipe_with_valid_output(display, pipe, output) {
+ if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
+ continue;
+
+ test_pipe_output(display, pipe, output, s);
+ valid_tests++;
+ }
+ igt_require_f(valid_tests, "no support for content protection found\n");
+}
+
+igt_main
+{
+ data_t data = {};
+
+ igt_fixture {
+ igt_skip_on_simulation();
+
+ data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+
+ igt_display_init(&data.display, data.drm_fd);
+ }
+
+
+ igt_subtest("legacy")
+ test_content_protection(&data.display, COMMIT_LEGACY);
+
+ igt_subtest("atomic") {
+ igt_require(data.display.is_atomic);
+ test_content_protection(&data.display, COMMIT_ATOMIC);
+ }
+
+ igt_fixture
+ igt_display_fini(&data.display);
+}
diff --git a/tests/meson.build b/tests/meson.build
index 59ccd9a6..b12c35c0 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -157,6 +157,7 @@ test_progs = [
'kms_chv_cursor_fail',
'kms_color',
'kms_concurrent',
+ 'kms_content_protection',
'kms_crtc_background_color',
'kms_cursor_crc',
'kms_cursor_legacy',
--
2.16.0.rc0.223.g4a4ac83678-goog
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length
2018-01-08 15:55 [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length Sean Paul
2018-01-08 15:55 ` [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test Sean Paul
@ 2018-01-08 16:31 ` Patchwork
2018-01-08 20:03 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-17 10:20 ` [PATCH i-g-t v3 1/2] " Petri Latvala
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-01-08 16:31 UTC (permalink / raw)
To: Sean Paul; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length
URL : https://patchwork.freedesktop.org/series/36155/
State : success
== Summary ==
IGT patchset tested on top of latest successful build
d5e51a60e5cbb807bcacd2655bd4ffe90a686bbb scripts/trace.pl: Optimize event parsing and processing
with latest DRM-Tip kernel build CI_DRM_3607
70afdd6e5dfe drm-tip: 2018y-01m-08d-13h-41m-31s UTC integration manifest
Testlist changes:
+igt@kms_content_protection@atomic
+igt@kms_content_protection@legacy
Test kms_frontbuffer_tracking:
Subgroup basic:
incomplete -> SKIP (fi-elk-e7500) fdo#103989 +1
fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:425s
fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:429s
fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:373s
fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:495s
fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:280s
fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:489s
fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:487s
fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:475s
fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:459s
fi-elk-e7500 total:229 pass:172 dwarn:10 dfail:0 fail:0 skip:46
fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:277s
fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:513s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:392s
fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:404s
fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:415s
fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:457s
fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:414s
fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:468s
fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:504s
fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:452s
fi-kbl-r total:288 pass:260 dwarn:1 dfail:0 fail:0 skip:27 time:502s
fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:579s
fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:432s
fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:510s
fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:527s
fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:495s
fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:489s
fi-snb-2520m total:3 pass:2 dwarn:0 dfail:0 fail:0 skip:0
fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:400s
Blacklisted hosts:
fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:578s
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:474s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_755/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✗ Fi.CI.IGT: failure for series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length
2018-01-08 15:55 [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length Sean Paul
2018-01-08 15:55 ` [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test Sean Paul
2018-01-08 16:31 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length Patchwork
@ 2018-01-08 20:03 ` Patchwork
2018-01-17 10:20 ` [PATCH i-g-t v3 1/2] " Petri Latvala
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-01-08 20:03 UTC (permalink / raw)
To: Sean Paul; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length
URL : https://patchwork.freedesktop.org/series/36155/
State : failure
== Summary ==
Test gem_tiled_swapping:
Subgroup non-threaded:
incomplete -> PASS (shard-hsw) fdo#104218
Test kms_flip:
Subgroup vblank-vs-modeset-suspend:
pass -> INCOMPLETE (shard-hsw)
Subgroup modeset-vs-vblank-race-interruptible:
fail -> PASS (shard-hsw) fdo#103060
Subgroup wf_vblank-vs-dpms:
pass -> DMESG-WARN (shard-hsw) fdo#102614
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
pass -> FAIL (shard-snb) fdo#101623
fdo#104218 https://bugs.freedesktop.org/show_bug.cgi?id=104218
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
shard-hsw total:2661 pass:1505 dwarn:2 dfail:0 fail:9 skip:1144 time:8821s
shard-snb total:2715 pass:1308 dwarn:2 dfail:0 fail:12 skip:1393 time:7919s
Blacklisted hosts:
shard-apl total:2715 pass:1688 dwarn:1 dfail:0 fail:23 skip:1003 time:13485s
shard-kbl total:2686 pass:1785 dwarn:6 dfail:0 fail:27 skip:867 time:10448s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_755/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length
2018-01-08 15:55 [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length Sean Paul
` (2 preceding siblings ...)
2018-01-08 20:03 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-01-17 10:20 ` Petri Latvala
3 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2018-01-17 10:20 UTC (permalink / raw)
To: Sean Paul; +Cc: intel-gfx, seanpaul
On Mon, Jan 08, 2018 at 10:55:20AM -0500, Sean Paul wrote:
> Noticed while I was reading it. Makes for a good first contribution, I
> guess.
>
> Changes in v2:
> - None
> Changes in v3:
> - None
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
This patch is now merged, thanks.
--
Petri Latvala
> ---
> CONTRIBUTING | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/CONTRIBUTING b/CONTRIBUTING
> index 561c5dd8..ca2ed8a5 100644
> --- a/CONTRIBUTING
> +++ b/CONTRIBUTING
> @@ -18,13 +18,13 @@ A short list of contribution guidelines:
>
> on its first invocation.
>
> -- intel-gpu-tools is MIT lincensed and we require contributions to follow the
> +- intel-gpu-tools is MIT licensed and we require contributions to follow the
> developer's certificate of origin: http://developercertificate.org/
>
> - When submitting new testcases please follow the naming conventions documented
> - in the generated documentation. Also please make full use of all the helpers and
> - convenience macros provided by the igt library. The semantic patch lib/igt.cocci
> - can help with the more automatic conversions.
> + in the generated documentation. Also please make full use of all the helpers
> + and convenience macros provided by the igt library. The semantic patch
> + lib/igt.cocci can help with the more automatic conversions.
>
> - Patches need to be reviewed on the mailing list. Exceptions only apply for
> testcases and tooling for drivers with just a single contributor (e.g. vc4).
> --
> 2.16.0.rc0.223.g4a4ac83678-goog
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test
2018-01-08 15:55 ` [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test Sean Paul
@ 2018-02-14 15:09 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-02-14 15:09 UTC (permalink / raw)
To: Sean Paul, intel-gfx; +Cc: seanpaul
Quoting Sean Paul (2018-01-08 15:55:21)
> Pretty simple test:
> - initializes the output
> - clears the content protection property
> - verifies that it clears
> - sets the content protection property to desired
> - verifies that it transitions to enabled
>
> Does this for both legacy and atomic.
>
> Changes in v2:
> - Don't check for i915 gen
> - Skip test if Content Protection property is absent
> Changes in v3:
> - s/igt_require_f/igt_assert_f/ (Ram)
> - Clear property after test runs (Ram)
> - s/drm_open_driver/drm_open_driver_master/ (Ram)
> - Fix spelling mistake in log message
> - Pull out property set/check into helper
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
> lib/igt_kms.c | 3 +-
> lib/igt_kms.h | 1 +
> tests/Makefile.sources | 1 +
> tests/kms_content_protection.c | 133 +++++++++++++++++++++++++++++++++++++++++
> tests/meson.build | 1 +
> 5 files changed, 138 insertions(+), 1 deletion(-)
> create mode 100644 tests/kms_content_protection.c
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 125ecb19..907db694 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -190,7 +190,8 @@ const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
> "scaling mode",
> "CRTC_ID",
> "DPMS",
> - "Broadcast RGB"
> + "Broadcast RGB",
> + "Content Protection"
> };
>
> /*
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 2a480bf3..93e59dc7 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -118,6 +118,7 @@ enum igt_atomic_connector_properties {
> IGT_CONNECTOR_CRTC_ID,
> IGT_CONNECTOR_DPMS,
> IGT_CONNECTOR_BROADCAST_RGB,
> + IGT_CONNECTOR_CONTENT_PROTECTION,
> IGT_NUM_CONNECTOR_PROPS
> };
>
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 34ca71a0..e0466411 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -179,6 +179,7 @@ TESTS_progs = \
> kms_chv_cursor_fail \
> kms_color \
> kms_concurrent \
> + kms_content_protection\
> kms_crtc_background_color \
> kms_cursor_crc \
> kms_cursor_legacy \
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> new file mode 100644
> index 00000000..3f05c36d
> --- /dev/null
> +++ b/tests/kms_content_protection.c
> @@ -0,0 +1,133 @@
> +/*
> + * Copyright © 2017 Google, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include "igt.h"
> +
> +IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
> +
> +typedef struct {
> + int drm_fd;
> + igt_display_t display;
> +} data_t;
> +
> +static bool
> +wait_for_prop_value(igt_output_t *output, uint64_t expected)
> +{
> + uint64_t val;
> + int i;
> +
> + for (i = 0; i < 2000; i++) {
> + val = igt_output_get_prop(output,
> + IGT_CONNECTOR_CONTENT_PROTECTION);
> + if (val == expected)
> + return true;
> + usleep(1000);
> + }
if (igt_wait(igt_output_get_prop(output, IGT_CONNECTOR...), 2000, 1))
return true;
> + igt_info("prop_value mismatch %ld != %ld\n", val, expected);
> + return false;
> +}
> +
> +static void set_prop(igt_display_t *display, igt_output_t *output,
> + enum igt_commit_style s, uint64_t set_val,
> + uint64_t expected_val)
> +{
> + igt_output_set_prop_value(output, IGT_CONNECTOR_CONTENT_PROTECTION,
> + set_val);
> + igt_display_commit2(display, s);
> +
> + igt_assert_f(wait_for_prop_value(output, expected_val),
> + "Content Protection did not transition to %ld\n",
> + expected_val);
> +}
> +
> +static void
> +test_pipe_output(igt_display_t *display, const enum pipe pipe,
> + igt_output_t *output, enum igt_commit_style s)
> +{
> + drmModeModeInfo mode;
> + igt_plane_t *primary;
> + struct igt_fb red;
> +
> + igt_assert(kmstest_get_connector_default_mode(
> + display->drm_fd, output->config.connector, &mode));
> +
> + igt_output_override_mode(output, &mode);
> + igt_output_set_pipe(output, pipe);
> +
> + igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
> + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
> + 1.f, 0.f, 0.f, &red);
> + primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> + igt_plane_set_fb(primary, &red);
> + igt_display_commit2(display, s);
> +
> + set_prop(display, output, s, 0, 0);
> + set_prop(display, output, s, 1, 2);
> + set_prop(display, output, s, 0, 0);
> +
> + igt_plane_set_fb(primary, NULL);
> + igt_output_set_pipe(output, PIPE_NONE);
Can you also hook up to chamelium to do CRC checks across a CP link?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-14 15:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-08 15:55 [PATCH i-g-t v3 1/2] CONTRIBUTING: Fix spelling mistake and line length Sean Paul
2018-01-08 15:55 ` [PATCH i-g-t v3 2/2] kms_content_protection: Add Content Protection test Sean Paul
2018-02-14 15:09 ` Chris Wilson
2018-01-08 16:31 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/2] CONTRIBUTING: Fix spelling mistake and line length Patchwork
2018-01-08 20:03 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-17 10:20 ` [PATCH i-g-t v3 1/2] " Petri Latvala
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.